sat-rs/satrs/src/mode_tree.rs

38 lines
940 B
Rust
Raw Normal View History

2024-02-21 15:37:08 +01:00
use alloc::vec::Vec;
use hashbrown::HashMap;
use crate::{
2024-02-28 16:15:03 +01:00
mode::{Mode, ModeAndSubmode, Submode},
2024-02-21 15:37:08 +01:00
ChannelId,
};
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum TableEntryType {
/// Target table containing information of the expected children modes for given mode.
Target,
/// Sequence table which contains information about how to reach a target table, including
/// the order of the sequences.
Sequence,
}
pub struct ModeTableEntry {
/// Name of respective table entry.
pub name: &'static str,
/// Target channel ID.
pub channel_id: ChannelId,
pub mode_submode: ModeAndSubmode,
pub allowed_submode_mask: Option<Submode>,
pub check_success: bool,
}
pub struct ModeTableMapValue {
/// Name for a given mode table entry.
pub name: &'static str,
pub entries: Vec<ModeTableEntry>,
}
pub type ModeTable = HashMap<Mode, ModeTableMapValue>;
#[cfg(test)]
2024-02-23 13:59:15 +01:00
mod tests {}