added HK and mode service

This commit is contained in:
2024-04-23 16:49:06 +02:00
parent 511214f903
commit e3ad841d04
6 changed files with 1010 additions and 50 deletions

View File

@ -3,22 +3,19 @@ use crate::pus::HandlingStatus;
use derive_new::new;
use satrs::spacepackets::time::{cds, TimeWriter};
use super::{action::ActionServiceWrapper, scheduler::SchedulingService, TargetedPusService};
// use super::{
// action::ActionServiceWrapper, event::EventServiceWrapper, hk::HkServiceWrapper,
// scheduler::SchedulingServiceWrapper, test::TestCustomServiceWrapper, HandlingStatus,
// TargetedPusService,
// };
use super::{
action::ActionServiceWrapper, hk::HkServiceWrapper, mode::ModeServiceWrapper,
scheduler::SchedulingService, TargetedPusService,
};
#[derive(new)]
pub struct PusStack {
test_srv: TestCustomServiceWrapper,
// hk_srv_wrapper: HkServiceWrapper<TmSender, TcInMemConverter>,
hk_srv_wrapper: HkServiceWrapper,
// event_srv: EventServiceWrapper<TmSender, TcInMemConverter>,
action_srv_wrapper: ActionServiceWrapper,
schedule_srv: SchedulingService,
// mode_srv: ModeServiceWrapper<TmSender, TcInMemConverter>,
mode_srv: ModeServiceWrapper,
}
impl PusStack {
@ -62,19 +59,21 @@ impl PusStack {
.poll_and_handle_next_reply(&time_stamp),
),
);
// is_srv_finished(
// self.hk_srv_wrapper.poll_and_handle_next_tc(&time_stamp),
// Some(self.hk_srv_wrapper.poll_and_handle_next_reply(&time_stamp)),
// );
// is_srv_finished(
// self.mode_srv.poll_and_handle_next_tc(&time_stamp),
// Some(self.mode_srv.poll_and_handle_next_reply(&time_stamp)),
// );
is_srv_finished(
3,
self.hk_srv_wrapper.poll_and_handle_next_tc(&time_stamp),
Some(self.hk_srv_wrapper.poll_and_handle_next_reply(&time_stamp)),
);
is_srv_finished(
200,
self.mode_srv.poll_and_handle_next_tc(&time_stamp),
Some(self.mode_srv.poll_and_handle_next_reply(&time_stamp)),
);
if nothing_to_do {
// Timeout checking is only done once.
self.action_srv_wrapper.check_for_request_timeouts();
// self.hk_srv_wrapper.check_for_request_timeouts();
// self.mode_srv.check_for_request_timeouts();
self.hk_srv_wrapper.check_for_request_timeouts();
self.mode_srv.check_for_request_timeouts();
break;
}
}