autd3_link_visualizer/backend/
null.rs

1use crate::Backend;
2
3pub struct NullBackend {}
4
5#[derive(Clone, Copy, Default, PartialEq, Eq, Debug)]
6pub struct NullPlotConfig {}
7
8impl Backend for NullBackend {
9    type PlotConfig = NullPlotConfig;
10
11    fn new() -> Self {
12        Self {}
13    }
14
15    fn initialize(&mut self) -> Result<(), crate::error::VisualizerError> {
16        Ok(())
17    }
18
19    fn plot_1d(
20        _observe_points: Vec<f32>,
21        _acoustic_pressures: Vec<autd3_driver::defined::Complex>,
22        _resolution: f32,
23        _x_label: &str,
24        _config: Self::PlotConfig,
25    ) -> Result<(), crate::error::VisualizerError> {
26        Err(crate::error::VisualizerError::NotSupported)
27    }
28
29    fn plot_2d(
30        _observe_x: Vec<f32>,
31        _observe_y: Vec<f32>,
32        _acoustic_pressures: Vec<autd3_driver::defined::Complex>,
33        _resolution: f32,
34        _x_label: &str,
35        _y_label: &str,
36        _config: Self::PlotConfig,
37    ) -> Result<(), crate::error::VisualizerError> {
38        Err(crate::error::VisualizerError::NotSupported)
39    }
40
41    fn plot_modulation(
42        _modulation: Vec<f32>,
43        _config: Self::PlotConfig,
44    ) -> Result<(), crate::error::VisualizerError> {
45        Err(crate::error::VisualizerError::NotSupported)
46    }
47
48    fn plot_phase(
49        _config: Self::PlotConfig,
50        _geometry: &autd3_driver::geometry::Geometry,
51        _phases: Vec<f32>,
52    ) -> Result<(), crate::error::VisualizerError> {
53        Err(crate::error::VisualizerError::NotSupported)
54    }
55}