added commander actions for logfile and image downlink
This commit is contained in:
parent
2566050b3b
commit
279fa42f31
@ -96,6 +96,16 @@ def create_cmd_definition_tree() -> CmdTreeNode:
|
|||||||
CmdTreeNode("custom_params", "Custom Camera Parameters as specified from file")
|
CmdTreeNode("custom_params", "Custom Camera Parameters as specified from file")
|
||||||
)
|
)
|
||||||
action_node.add_child(cam_node)
|
action_node.add_child(cam_node)
|
||||||
|
|
||||||
|
controller_node = CmdTreeNode("controller", "Main OBSW Controller")
|
||||||
|
controller_node.add_child(
|
||||||
|
CmdTreeNode("downlink_logs", "Downlink Logs via toGround folder")
|
||||||
|
)
|
||||||
|
controller_node.add_child(
|
||||||
|
CmdTreeNode("downlink_last_img", "Downlink last image via toGroundLP folder")
|
||||||
|
)
|
||||||
|
action_node.add_child(controller_node)
|
||||||
|
|
||||||
root_node.add_child(action_node)
|
root_node.add_child(action_node)
|
||||||
|
|
||||||
return root_node
|
return root_node
|
||||||
@ -157,7 +167,18 @@ def pack_pus_telecommands(q: DefaultPusQueueHelper, cmd_path: str):
|
|||||||
service=8, subservice=128, apid=EXPERIMENT_APID, app_data=data
|
service=8, subservice=128, apid=EXPERIMENT_APID, app_data=data
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if cmd_path_list[1] == "controller":
|
||||||
|
assert len(cmd_path_list) >= 3
|
||||||
|
data = bytearray()
|
||||||
|
if cmd_path_list[2] == "downlink_logs":
|
||||||
|
data.extend(make_action_cmd_header(UniqueId.Controller, 2))
|
||||||
|
if cmd_path_list[2] == "downlink_last_img":
|
||||||
|
data.extend(make_action_cmd_header(UniqueId.Controller, 3))
|
||||||
|
return q.add_pus_tc(
|
||||||
|
PusTelecommand(
|
||||||
|
service=8, subservice=128, apid=EXPERIMENT_APID, app_data=data
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def handle_set_mode_cmd(
|
def handle_set_mode_cmd(
|
||||||
q: DefaultPusQueueHelper, target_str: str, mode_str: str, apid: int, unique_id: int
|
q: DefaultPusQueueHelper, target_str: str, mode_str: str, apid: int, unique_id: int
|
||||||
|
@ -295,7 +295,7 @@ pub mod tasks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_low_priority_ground_dir() {
|
pub fn create_low_priority_ground_dir() {
|
||||||
log::debug!("Creating low priority to ground directory");
|
log::info!("Creating low priority to ground directory");
|
||||||
if !Path::new(TO_GROUND_LP_FOLDER_EXPERIMENT).exists()
|
if !Path::new(TO_GROUND_LP_FOLDER_EXPERIMENT).exists()
|
||||||
&& std::fs::create_dir_all(TO_GROUND_LP_FOLDER_EXPERIMENT).is_err()
|
&& std::fs::create_dir_all(TO_GROUND_LP_FOLDER_EXPERIMENT).is_err()
|
||||||
{
|
{
|
||||||
|
@ -106,6 +106,7 @@ impl ExperimentController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ActionId::DownlinkLogfile => {
|
ActionId::DownlinkLogfile => {
|
||||||
|
log::info!("Copying logfile into downlink folder");
|
||||||
if let Some(logfile_path) = LOGFILE_PATH.get() {
|
if let Some(logfile_path) = LOGFILE_PATH.get() {
|
||||||
if let Ok(logfile_path) = <PathBuf as Clone>::clone(logfile_path)
|
if let Ok(logfile_path) = <PathBuf as Clone>::clone(logfile_path)
|
||||||
.into_os_string()
|
.into_os_string()
|
||||||
@ -124,6 +125,7 @@ impl ExperimentController {
|
|||||||
|
|
||||||
// downlink images, default will be the last image, otherwise specified counting down (2 = second to last image, etc.)
|
// downlink images, default will be the last image, otherwise specified counting down (2 = second to last image, etc.)
|
||||||
ActionId::DownlinkImages => {
|
ActionId::DownlinkImages => {
|
||||||
|
log::info!("Copying images into low priority downlink folder");
|
||||||
if let Ok(image_path) = match action_req.variant {
|
if let Ok(image_path) = match action_req.variant {
|
||||||
ActionRequestVariant::VecData(data) => {
|
ActionRequestVariant::VecData(data) => {
|
||||||
let index = data[0];
|
let index = data[0];
|
||||||
|
@ -291,7 +291,7 @@ impl IMS100BatchHandler {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
let output = self.take_picture(param)?;
|
let output = self.take_picture(param)?;
|
||||||
debug!("Sending action reply!");
|
info!("Sending action reply!");
|
||||||
send_data_reply(self.id, output.stdout, &self.stamp_helper, &self.tm_tx)?;
|
send_data_reply(self.id, output.stdout, &self.stamp_helper, &self.tm_tx)?;
|
||||||
self.action_reply_tx
|
self.action_reply_tx
|
||||||
.send(GenericMessage::new(
|
.send(GenericMessage::new(
|
||||||
|
Loading…
Reference in New Issue
Block a user