initial integration with telem viz
This commit is contained in:
@@ -10,12 +10,12 @@ use crate::state_vector::StateVector;
|
||||
use anyhow::Result;
|
||||
use embedded_hal::pwm::SetDutyCycle;
|
||||
use log::info;
|
||||
use nautilus_common::add_ctrlc_handler;
|
||||
use nautilus_common::telemetry::{SwitchBank, TelemetryMessage};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::thread::sleep;
|
||||
use std::time::Duration;
|
||||
use nautilus_common::add_ctrlc_handler_arc;
|
||||
|
||||
mod hardware;
|
||||
|
||||
@@ -35,7 +35,7 @@ pub fn run() -> Result<()> {
|
||||
);
|
||||
|
||||
let running = Arc::new(AtomicBool::new(true));
|
||||
add_ctrlc_handler(running.clone())?;
|
||||
add_ctrlc_handler_arc(running.clone())?;
|
||||
|
||||
let state_vector = StateVector::new();
|
||||
|
||||
@@ -92,7 +92,7 @@ pub fn run() -> Result<()> {
|
||||
});
|
||||
});
|
||||
},
|
||||
1,
|
||||
10,
|
||||
)?;
|
||||
|
||||
info!("Starting Main Loop");
|
||||
@@ -119,7 +119,6 @@ pub fn run() -> Result<()> {
|
||||
|
||||
mod comms;
|
||||
mod data;
|
||||
mod on_drop;
|
||||
mod rcs;
|
||||
mod scheduler;
|
||||
mod state_vector;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
use log::trace;
|
||||
use std::any::type_name;
|
||||
|
||||
pub struct OnDrop<F: FnMut()> {
|
||||
func: F,
|
||||
}
|
||||
|
||||
pub fn on_drop<F: FnMut()>(func: F) -> OnDrop<F> {
|
||||
trace!("on_drop<F={}>()", type_name::<F>());
|
||||
OnDrop { func }
|
||||
}
|
||||
|
||||
impl<F: FnMut()> Drop for OnDrop<F> {
|
||||
fn drop(&mut self) {
|
||||
trace!("OnDrop<F={}>::drop()", type_name::<F>());
|
||||
(self.func)();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::on_drop::on_drop;
|
||||
use anyhow::Result;
|
||||
use log::trace;
|
||||
use nautilus_common::on_drop::on_drop;
|
||||
use std::any::type_name;
|
||||
use std::fmt::Debug;
|
||||
use std::ops::Deref;
|
||||
|
||||
Reference in New Issue
Block a user