take image metadata generation

This commit is contained in:
2024-05-02 11:15:06 +02:00
parent 62cc933f88
commit c4fffdfe2d
6 changed files with 222 additions and 95 deletions

@ -1,20 +1,21 @@
use std::{
env::temp_dir,
net::{IpAddr, SocketAddr},
path::PathBuf,
sync::{atomic::AtomicBool, mpsc, Arc},
thread,
time::Duration,
};
use log::info;
#[cfg(not(feature = "host"))]
use ops_sat_rs::config::HOME_PATH;
use ops_sat_rs::config::{
cfg_file::create_app_config,
components::{CONTROLLER_ID, TCP_SERVER, TCP_SPP_CLIENT, UDP_SERVER},
pool::create_sched_tc_pool,
set_up_ground_dir, set_up_low_prio_ground_dir,
set_up_ground_dir, set_up_home_path, set_up_low_prio_ground_dir,
tasks::{FREQ_MS_CAMERA_HANDLING, FREQ_MS_CTRL, FREQ_MS_PUS_STACK, STOP_CHECK_FREQUENCY},
HOME_PATH, STOP_FILE_NAME, VALID_PACKET_ID_LIST, VERSION,
STOP_FILE_NAME, VALID_PACKET_ID_LIST, VERSION,
};
use ops_sat_rs::config::{components::CAMERA_HANDLER, tasks::FREQ_MS_EVENT_HANDLING};
use ops_sat_rs::config::{tasks::FREQ_MS_UDP_TMTC, OBSW_SERVER_ADDR, SERVER_PORT};
@ -58,10 +59,18 @@ fn main() {
let version_str = VERSION.unwrap_or("?");
println!("OPS-SAT Rust Experiment OBSW v{}", version_str);
setup_logger().expect("setting up logging with fern failed");
set_up_low_prio_ground_dir();
set_up_ground_dir();
let app_cfg = create_app_config();
set_up_home_path();
#[cfg(feature = "host")]
let base_dir = std::env::current_dir()
.expect("getting current dir failed")
.to_path_buf();
#[cfg(not(feature = "host"))]
let base_dir = HOME_PATH.get().unwrap();
set_up_low_prio_ground_dir(base_dir.clone());
set_up_ground_dir(base_dir.clone());
let app_cfg = create_app_config(base_dir.clone());
info!("App Configuration: {:?}", app_cfg);
let stop_signal = Arc::new(AtomicBool::new(false));
@ -194,8 +203,7 @@ fn main() {
stop_signal.clone(),
);
let mut home_path_stop_file = PathBuf::new();
home_path_stop_file.push(HOME_PATH.as_path());
let mut home_path_stop_file = base_dir.clone();
home_path_stop_file.push(STOP_FILE_NAME);
let mut tmp_path_stop_file = temp_dir();
tmp_path_stop_file.push(STOP_FILE_NAME);
@ -217,7 +225,7 @@ fn main() {
.expect("creating TCP SPP client failed");
let timestamp_helper = TimeStampHelper::default();
let mut camera_handler: Ims100BatchHandler = Ims100BatchHandler::new(
let mut camera_handler: Ims100BatchHandler = Ims100BatchHandler::new_with_default_img_executor(
CAMERA_HANDLER,
camera_composite_rx,
tm_funnel_tx.clone(),