radar-g/src/components/monitor/messages.rs

56 lines
1.9 KiB
Rust

use std::{collections::HashMap, fmt::Debug};
use crate::{
components::app::ElementKey,
pipeline::element::ElementID,
widgets::{render::Layer, widget::Widget},
};
pub enum MonitorInputMsg {
RefreshRender,
AddWidget(Box<dyn Widget>),
RemoveWidget,
AddMetaItem(HashMap<String, String>),
ClearMetaItems,
UpdateMetaItem(HashMap<String, String>),
RefreshTiles,
RefreshLayerList,
SetRenderRange(f64, f64, f64, f64),
ChangeZoom(f64),
None,
}
impl Debug for MonitorInputMsg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
MonitorInputMsg::RefreshRender => write!(f, "MonitorInputMsg::RefreshRender"),
MonitorInputMsg::RefreshTiles => write!(f, "MonitorInputMsg::RefreshTiles"),
MonitorInputMsg::ChangeZoom(_) => write!(f, "MonitorInputMsg::ChangeZoom"),
MonitorInputMsg::SetRenderRange(_, _, _, _) => {
write!(f, "MonitorInputMsg::SetRenderRange")
}
MonitorInputMsg::RefreshLayerList => write!(f, "MonitorInputMsg::RefreshLayerList"),
MonitorInputMsg::None => write!(f, "MonitorInputMsg::None"),
MonitorInputMsg::AddWidget(_) => write!(f, "MonitorInputMsg::AddWidget"),
MonitorInputMsg::RemoveWidget => write!(f, "MonitorInputMsg::RemoveWidget"),
MonitorInputMsg::AddMetaItem(_) => write!(f, "MonitorInputMsg::RemoveWidget"),
MonitorInputMsg::ClearMetaItems => write!(f, "MonitorInputMsg::ClearMetaItems"),
MonitorInputMsg::UpdateMetaItem(_) => write!(f, "MonitorInputMsg::UpdateMetaItem"),
}
}
}
#[derive(Debug)]
pub enum MonitorOutputMsg {
LayerAdded(usize),
LayerRemoved(usize),
LayerUpdated(usize),
LayerSwitchToTime(usize),
LayerRenderFinished,
}
#[derive(Debug)]
pub enum RenderInputMsg {
Monitor(MonitorInputMsg),
}