start integrating new susbystem commanding helper
This commit is contained in:
@@ -7,7 +7,12 @@ use models::{
|
||||
ComponentId,
|
||||
acs::subsystem::{Mode, response},
|
||||
};
|
||||
use satrs::spacepackets::CcsdsPacketIdAndPsc;
|
||||
use satrs::{
|
||||
mode::ModeRaw,
|
||||
mode_tree::{ModeStoreProvider, ModeStoreVec, SequenceModeTables, TargetModeTables},
|
||||
spacepackets::CcsdsPacketIdAndPsc,
|
||||
subsystem::SubsystemCommandingHelper,
|
||||
};
|
||||
use satrs_example::{ModeHelper, TmtcQueues};
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -114,6 +119,7 @@ pub struct Subsystem {
|
||||
mode_request_senders: ModeRequestSenders,
|
||||
mode_report_receivers: ModeReportReceivers,
|
||||
tmtc_queues: TmtcQueues,
|
||||
subsystem_helper: SubsystemCommandingHelper,
|
||||
}
|
||||
|
||||
impl Subsystem {
|
||||
@@ -124,6 +130,24 @@ impl Subsystem {
|
||||
mode_report_receivers: ModeReportReceivers,
|
||||
tmtc_queues: TmtcQueues,
|
||||
) -> Self {
|
||||
let mut mode_store_vec = ModeStoreVec::default();
|
||||
mode_store_vec.add_component(
|
||||
ComponentId::AcsMgmAssembly as satrs::ComponentId,
|
||||
models::acs::mgm_assembly::Mode::NoModeKeeping.into(),
|
||||
);
|
||||
mode_store_vec.add_component(
|
||||
ComponentId::AcsController as satrs::ComponentId,
|
||||
models::acs::ctrl::Mode::Passive.into(),
|
||||
);
|
||||
mode_store_vec.add_component(
|
||||
ComponentId::AcsMgt as satrs::ComponentId,
|
||||
models::acs::mgt::Mode::Off.into(),
|
||||
);
|
||||
|
||||
let mut target_tables = TargetModeTables::default();
|
||||
|
||||
let mut sequence_tables = SequenceModeTables::default();
|
||||
|
||||
Self {
|
||||
mode_helper: ModeHelper::new(
|
||||
models::acs::subsystem::Mode::Off,
|
||||
@@ -134,6 +158,11 @@ impl Subsystem {
|
||||
mode_report_receivers,
|
||||
tmtc_queues,
|
||||
transition_step: 0,
|
||||
subsystem_helper: SubsystemCommandingHelper::new(
|
||||
mode_store_vec,
|
||||
target_tables,
|
||||
sequence_tables,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user