removed pus tm handler generic for camera handler

This commit is contained in:
lkoester 2024-04-17 10:38:40 +02:00
parent 2d3a4cd90c
commit f960f24415
2 changed files with 13 additions and 12 deletions

View File

@ -24,14 +24,15 @@
/// v Y
///
/// see also https://opssat1.esoc.esa.int/dmsf/files/6/view
use crate::requests::CompositeRequest;
use derive_new::new;
use log::debug;
use ops_sat_rs::TimeStampHelper;
use satrs::action::{ActionRequest, ActionRequestVariant};
use satrs::hk::HkRequest;
use satrs::pus::EcssTmSender;
use satrs::request::{GenericMessage, MessageMetadata, UniqueApidTargetId};
use satrs::tmtc::PacketAsVec;
use serde::{Deserialize, Serialize};
use std::io::Error;
use std::process::Command;
@ -137,20 +138,18 @@ impl CameraPictureParameters {
#[allow(dead_code)]
#[derive(new)]
pub struct IMS100BatchHandler<TmSender: EcssTmSender> {
pub struct IMS100BatchHandler {
id: UniqueApidTargetId,
// mode_interface: MpscModeLeafInterface,
composite_request_receiver: mpsc::Receiver<GenericMessage<CompositeRequest>>,
// hk_reply_sender: mpsc::Sender<GenericMessage<HkReply>>,
tm_sender: TmSender,
tm_sender: mpsc::Sender<PacketAsVec>,
stamp_helper: TimeStampHelper,
}
#[allow(non_snake_case)]
#[allow(dead_code)]
impl<TmSender: EcssTmSender>
IMS100BatchHandler<TmSender>
{
impl IMS100BatchHandler {
pub fn periodic_operation(&mut self) {
self.stamp_helper.update_from_now();
// Handle requests.
@ -174,7 +173,11 @@ impl<TmSender: EcssTmSender>
}
}
pub fn handle_hk_request(&mut self, _requestor_info: &MessageMetadata, _hk_request: &HkRequest) {
pub fn handle_hk_request(
&mut self,
_requestor_info: &MessageMetadata,
_hk_request: &HkRequest,
) {
// TODO add hk to opssat
}
@ -202,12 +205,10 @@ impl<TmSender: EcssTmSender>
));
}
ActionRequestVariant::VecData(data) => {
let param: serde_json::Result<CameraPictureParameters>=
let param: serde_json::Result<CameraPictureParameters> =
serde_json::from_slice(data.as_slice());
match param {
Ok(param) => {
param
}
Ok(param) => param,
Err(_) => {
return Err(Error::other("Unable to deserialize parameters"));
}

View File

@ -33,4 +33,4 @@ impl SpacePacketValidator for SimpleSpValidator {
}
SpValidity::Skip
}
}
}