pub struct Monitor {
terminate_proc: Arc<AtomicBool>,
proc_thread: Option<JoinHandle<()>>,
new_data: Arc<AtomicBool>,
monitor_samples: Arc<Mutex<[MinMaxMonitorSamples; 6]>>,
monitor_samples_copy: [MinMaxMonitorSamples; 6],
}
Expand description
The actual frontend API for the MonitorProcessor. We start an extra thread for handling monitored signals from the MonitorBackend, because we can’t guarantee that the UI thread is actually started or working. Also because we want to be independent of whether a UI is started at all.
Just call Monitor::get_minmax_monitor_samples and you will always get the most current data.
Fields
terminate_proc: Arc<AtomicBool>
proc_thread: Option<JoinHandle<()>>
new_data: Arc<AtomicBool>
monitor_samples: Arc<Mutex<[MinMaxMonitorSamples; 6]>>
monitor_samples_copy: [MinMaxMonitorSamples; 6]
Implementations
sourceimpl Monitor
impl Monitor
pub fn new(
rb_mon_con: Consumer<MonitorBufPtr>,
rb_recycle_prod: Producer<MonitorBufPtr>
) -> Self
pub fn get_minmax_monitor_samples(&mut self, idx: usize) -> &MinMaxMonitorSamples
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Monitor
impl Send for Monitor
impl Sync for Monitor
impl Unpin for Monitor
impl !UnwindSafe for Monitor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more