#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ChannelId {
TempLpcOutlet,
TempHpcOutlet,
TempLptOutlet,
PressureHpcOutlet,
FanSpeed,
CoreSpeed,
StaticPressureHpc,
FuelFlowRatio,
CorrectedFanSpeed,
CorrectedCoreSpeed,
BypassRatio,
BleedEnthalpy,
HptCoolantBleed,
LptCoolantBleed,
}
impl ChannelId {
#[must_use]
pub const fn cmapss_sensor_index(self) -> usize {
match self {
Self::TempLpcOutlet => 1, Self::TempHpcOutlet => 2, Self::TempLptOutlet => 3, Self::PressureHpcOutlet => 6, Self::FanSpeed => 7, Self::CoreSpeed => 8, Self::StaticPressureHpc => 10, Self::FuelFlowRatio => 11, Self::CorrectedFanSpeed => 12, Self::CorrectedCoreSpeed => 13, Self::BypassRatio => 14, Self::BleedEnthalpy => 16, Self::HptCoolantBleed => 19, Self::LptCoolantBleed => 20, }
}
#[must_use]
pub const fn label(self) -> &'static str {
match self {
Self::TempLpcOutlet => "T24 (LPC outlet temp)",
Self::TempHpcOutlet => "T30 (HPC outlet temp)",
Self::TempLptOutlet => "T50 (LPT outlet temp / EGT proxy)",
Self::PressureHpcOutlet => "P30 (HPC outlet pressure)",
Self::FanSpeed => "Nf (fan speed)",
Self::CoreSpeed => "Nc (core speed)",
Self::StaticPressureHpc => "Ps30 (HPC static pressure)",
Self::FuelFlowRatio => "phi (fuel flow / Ps30)",
Self::CorrectedFanSpeed => "NRf (corrected fan speed)",
Self::CorrectedCoreSpeed => "NRc (corrected core speed)",
Self::BypassRatio => "BPR (bypass ratio)",
Self::BleedEnthalpy => "Bleed enthalpy",
Self::HptCoolantBleed => "HPT coolant bleed",
Self::LptCoolantBleed => "LPT coolant bleed",
}
}
}
pub const INFORMATIVE_CHANNELS_FD001: &[ChannelId] = &[
ChannelId::TempLpcOutlet,
ChannelId::TempHpcOutlet,
ChannelId::TempLptOutlet,
ChannelId::PressureHpcOutlet,
ChannelId::FanSpeed,
ChannelId::CoreSpeed,
ChannelId::StaticPressureHpc,
ChannelId::FuelFlowRatio,
ChannelId::CorrectedFanSpeed,
ChannelId::CorrectedCoreSpeed,
ChannelId::BypassRatio,
ChannelId::BleedEnthalpy,
ChannelId::HptCoolantBleed,
ChannelId::LptCoolantBleed,
];
#[derive(Debug, Clone, Copy)]
pub struct SensorReading {
pub unit: u16,
pub cycle: u32,
pub op_setting_1: f64,
pub op_setting_2: f64,
pub op_setting_3: f64,
pub sensors: [f64; 21],
}