#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum PiezoToggle {
#[default]
NoChange = 0,
On = 1,
Off = 2,
}
impl From<PiezoToggle> for u32 {
fn from(val: PiezoToggle) -> Self {
val as u32
}
}
impl From<PiezoToggle> for u16 {
fn from(val: PiezoToggle) -> Self {
val as u16
}
}
#[derive(Debug, Clone, Copy, Default)]
pub struct TiltCorrection {
pub tilt_x_deg: f32,
pub tilt_y_deg: f32,
}
#[derive(Debug, Clone, Copy, Default)]
pub struct PiezoRange {
pub range_x_m: f32,
pub range_y_m: f32,
pub range_z_m: f32,
}
#[derive(Debug, Clone, Copy, Default)]
pub struct PiezoSensitivity {
pub sens_x_m_per_v: f32,
pub sens_y_m_per_v: f32,
pub sens_z_m_per_v: f32,
}
#[derive(Debug, Clone, Copy, Default)]
pub struct DriftCompConfig {
pub enabled: PiezoToggle,
pub vx_m_s: f32,
pub vy_m_s: f32,
pub vz_m_s: f32,
pub saturation_limit: f32,
}
#[derive(Debug, Clone, Copy, Default)]
pub struct DriftCompStatus {
pub enabled: bool,
pub vx_m_s: f32,
pub vy_m_s: f32,
pub vz_m_s: f32,
pub x_saturated: bool,
pub y_saturated: bool,
pub z_saturated: bool,
pub saturation_limit: f32,
}
#[derive(Debug, Clone, Copy, Default)]
pub struct HVAInfo {
pub gain_aux: f32,
pub gain_x: f32,
pub gain_y: f32,
pub gain_z: f32,
pub xy_enabled: bool,
pub z_enabled: bool,
pub aux_enabled: bool,
}
#[derive(Debug, Clone, Copy, Default)]
pub struct HVAStatusLED {
pub overheated: bool,
pub hv_supply: bool,
pub high_temperature: bool,
pub output_connector: bool,
}
#[derive(Debug, Clone, Copy)]
pub struct XYZLimits {
pub enabled: bool,
pub x_low_v: f32,
pub x_high_v: f32,
pub y_low_v: f32,
pub y_high_v: f32,
pub z_low_v: f32,
pub z_high_v: f32,
}
impl Default for XYZLimits {
fn default() -> Self {
Self {
enabled: false,
x_low_v: -10.0,
x_high_v: 10.0,
y_low_v: -10.0,
y_high_v: 10.0,
z_low_v: -10.0,
z_high_v: 10.0,
}
}
}
#[derive(Debug, Clone, Default)]
pub struct HysteresisAxisPoints {
pub x_points: Vec<f32>,
pub y_points: Vec<f32>,
}
#[derive(Debug, Clone, Default)]
pub struct HysteresisValues {
pub fast_axis: HysteresisAxisPoints,
pub slow_axis: HysteresisAxisPoints,
}