#![allow(unused, clippy::match_single_binding)]
use std::fmt;
#[derive(Clone, Copy, PartialEq)]
pub struct Event(pub u8);
impl Event {
pub const TIMER: Event = Event(0);
pub const WORKOUT: Event = Event(3);
pub const WORKOUT_STEP: Event = Event(4);
pub const POWER_DOWN: Event = Event(5);
pub const POWER_UP: Event = Event(6);
pub const OFF_COURSE: Event = Event(7);
pub const SESSION: Event = Event(8);
pub const LAP: Event = Event(9);
pub const COURSE_POINT: Event = Event(10);
pub const BATTERY: Event = Event(11);
pub const VIRTUAL_PARTNER_PACE: Event = Event(12);
pub const HR_HIGH_ALERT: Event = Event(13);
pub const HR_LOW_ALERT: Event = Event(14);
pub const SPEED_HIGH_ALERT: Event = Event(15);
pub const SPEED_LOW_ALERT: Event = Event(16);
pub const CAD_HIGH_ALERT: Event = Event(17);
pub const CAD_LOW_ALERT: Event = Event(18);
pub const POWER_HIGH_ALERT: Event = Event(19);
pub const POWER_LOW_ALERT: Event = Event(20);
pub const RECOVERY_HR: Event = Event(21);
pub const BATTERY_LOW: Event = Event(22);
pub const TIME_DURATION_ALERT: Event = Event(23);
pub const DISTANCE_DURATION_ALERT: Event = Event(24);
pub const CALORIE_DURATION_ALERT: Event = Event(25);
pub const ACTIVITY: Event = Event(26);
pub const FITNESS_EQUIPMENT: Event = Event(27);
pub const LENGTH: Event = Event(28);
pub const USER_MARKER: Event = Event(32);
pub const SPORT_POINT: Event = Event(33);
pub const CALIBRATION: Event = Event(36);
pub const FRONT_GEAR_CHANGE: Event = Event(42);
pub const REAR_GEAR_CHANGE: Event = Event(43);
pub const RIDER_POSITION_CHANGE: Event = Event(44);
pub const ELEV_HIGH_ALERT: Event = Event(45);
pub const ELEV_LOW_ALERT: Event = Event(46);
pub const COMM_TIMEOUT: Event = Event(47);
pub const AUTO_ACTIVITY_DETECT: Event = Event(54);
pub const DIVE_ALERT: Event = Event(56);
pub const DIVE_GAS_SWITCHED: Event = Event(57);
pub const TANK_PRESSURE_RESERVE: Event = Event(71);
pub const TANK_PRESSURE_CRITICAL: Event = Event(72);
pub const TANK_LOST: Event = Event(73);
pub const RADAR_THREAT_ALERT: Event = Event(75);
pub const TANK_BATTERY_LOW: Event = Event(76);
pub const TANK_POD_CONNECTED: Event = Event(81);
pub const TANK_POD_DISCONNECTED: Event = Event(82);
}
impl Default for Event {
fn default() -> Self {
Self(u8::MAX)
}
}
impl fmt::Display for Event {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.0 {
0 => write!(f, "timer"),
3 => write!(f, "workout"),
4 => write!(f, "workout_step"),
5 => write!(f, "power_down"),
6 => write!(f, "power_up"),
7 => write!(f, "off_course"),
8 => write!(f, "session"),
9 => write!(f, "lap"),
10 => write!(f, "course_point"),
11 => write!(f, "battery"),
12 => write!(f, "virtual_partner_pace"),
13 => write!(f, "hr_high_alert"),
14 => write!(f, "hr_low_alert"),
15 => write!(f, "speed_high_alert"),
16 => write!(f, "speed_low_alert"),
17 => write!(f, "cad_high_alert"),
18 => write!(f, "cad_low_alert"),
19 => write!(f, "power_high_alert"),
20 => write!(f, "power_low_alert"),
21 => write!(f, "recovery_hr"),
22 => write!(f, "battery_low"),
23 => write!(f, "time_duration_alert"),
24 => write!(f, "distance_duration_alert"),
25 => write!(f, "calorie_duration_alert"),
26 => write!(f, "activity"),
27 => write!(f, "fitness_equipment"),
28 => write!(f, "length"),
32 => write!(f, "user_marker"),
33 => write!(f, "sport_point"),
36 => write!(f, "calibration"),
42 => write!(f, "front_gear_change"),
43 => write!(f, "rear_gear_change"),
44 => write!(f, "rider_position_change"),
45 => write!(f, "elev_high_alert"),
46 => write!(f, "elev_low_alert"),
47 => write!(f, "comm_timeout"),
54 => write!(f, "auto_activity_detect"),
56 => write!(f, "dive_alert"),
57 => write!(f, "dive_gas_switched"),
71 => write!(f, "tank_pressure_reserve"),
72 => write!(f, "tank_pressure_critical"),
73 => write!(f, "tank_lost"),
75 => write!(f, "radar_threat_alert"),
76 => write!(f, "tank_battery_low"),
81 => write!(f, "tank_pod_connected"),
82 => write!(f, "tank_pod_disconnected"),
_ => write!(f, "Event({})", self.0),
}
}
}
impl fmt::Debug for Event {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.0 {
0 => write!(f, "Event::TIMER(0)"),
3 => write!(f, "Event::WORKOUT(3)"),
4 => write!(f, "Event::WORKOUT_STEP(4)"),
5 => write!(f, "Event::POWER_DOWN(5)"),
6 => write!(f, "Event::POWER_UP(6)"),
7 => write!(f, "Event::OFF_COURSE(7)"),
8 => write!(f, "Event::SESSION(8)"),
9 => write!(f, "Event::LAP(9)"),
10 => write!(f, "Event::COURSE_POINT(10)"),
11 => write!(f, "Event::BATTERY(11)"),
12 => write!(f, "Event::VIRTUAL_PARTNER_PACE(12)"),
13 => write!(f, "Event::HR_HIGH_ALERT(13)"),
14 => write!(f, "Event::HR_LOW_ALERT(14)"),
15 => write!(f, "Event::SPEED_HIGH_ALERT(15)"),
16 => write!(f, "Event::SPEED_LOW_ALERT(16)"),
17 => write!(f, "Event::CAD_HIGH_ALERT(17)"),
18 => write!(f, "Event::CAD_LOW_ALERT(18)"),
19 => write!(f, "Event::POWER_HIGH_ALERT(19)"),
20 => write!(f, "Event::POWER_LOW_ALERT(20)"),
21 => write!(f, "Event::RECOVERY_HR(21)"),
22 => write!(f, "Event::BATTERY_LOW(22)"),
23 => write!(f, "Event::TIME_DURATION_ALERT(23)"),
24 => write!(f, "Event::DISTANCE_DURATION_ALERT(24)"),
25 => write!(f, "Event::CALORIE_DURATION_ALERT(25)"),
26 => write!(f, "Event::ACTIVITY(26)"),
27 => write!(f, "Event::FITNESS_EQUIPMENT(27)"),
28 => write!(f, "Event::LENGTH(28)"),
32 => write!(f, "Event::USER_MARKER(32)"),
33 => write!(f, "Event::SPORT_POINT(33)"),
36 => write!(f, "Event::CALIBRATION(36)"),
42 => write!(f, "Event::FRONT_GEAR_CHANGE(42)"),
43 => write!(f, "Event::REAR_GEAR_CHANGE(43)"),
44 => write!(f, "Event::RIDER_POSITION_CHANGE(44)"),
45 => write!(f, "Event::ELEV_HIGH_ALERT(45)"),
46 => write!(f, "Event::ELEV_LOW_ALERT(46)"),
47 => write!(f, "Event::COMM_TIMEOUT(47)"),
54 => write!(f, "Event::AUTO_ACTIVITY_DETECT(54)"),
56 => write!(f, "Event::DIVE_ALERT(56)"),
57 => write!(f, "Event::DIVE_GAS_SWITCHED(57)"),
71 => write!(f, "Event::TANK_PRESSURE_RESERVE(71)"),
72 => write!(f, "Event::TANK_PRESSURE_CRITICAL(72)"),
73 => write!(f, "Event::TANK_LOST(73)"),
75 => write!(f, "Event::RADAR_THREAT_ALERT(75)"),
76 => write!(f, "Event::TANK_BATTERY_LOW(76)"),
81 => write!(f, "Event::TANK_POD_CONNECTED(81)"),
82 => write!(f, "Event::TANK_POD_DISCONNECTED(82)"),
_ => write!(f, "Event({})", self.0),
}
}
}