Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
frequency_plot_multivariate.rs

1/// A plot that performs an analysis on an multiple signals and returns
2/// data mapped to the frequency domain.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct FrequencyPlotMultivariate {
18    #[builder(default, into)]
19    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
20    title: Option<String>,
21    #[builder(
22        default,
23        list(
24            item(type = super::super::super::channelvariables::api::ChannelVariableName)
25        )
26    )]
27    #[serde(rename = "variableNames", skip_serializing_if = "Vec::is_empty", default)]
28    variable_names: Vec<super::super::super::channelvariables::api::ChannelVariableName>,
29    #[builder(default, list(item(type = super::AxisId)))]
30    #[serde(rename = "axesIds", skip_serializing_if = "Vec::is_empty", default)]
31    axes_ids: Vec<super::AxisId>,
32    #[builder(default, into)]
33    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none", default)]
34    enabled: Option<bool>,
35    #[serde(rename = "color")]
36    color: super::super::super::api::HexColor,
37    #[builder(custom(type = super::LineStyle, convert = Box::new))]
38    #[serde(rename = "lineStyle")]
39    line_style: Box<super::LineStyle>,
40}
41impl FrequencyPlotMultivariate {
42    /// Constructs a new instance of the type.
43    #[inline]
44    pub fn new(
45        color: super::super::super::api::HexColor,
46        line_style: super::LineStyle,
47    ) -> Self {
48        Self::builder().color(color).line_style(line_style).build()
49    }
50    #[inline]
51    pub fn title(&self) -> Option<&str> {
52        self.title.as_ref().map(|o| &**o)
53    }
54    #[inline]
55    pub fn variable_names(
56        &self,
57    ) -> &[super::super::super::channelvariables::api::ChannelVariableName] {
58        &*self.variable_names
59    }
60    #[inline]
61    pub fn axes_ids(&self) -> &[super::AxisId] {
62        &*self.axes_ids
63    }
64    #[inline]
65    pub fn enabled(&self) -> Option<bool> {
66        self.enabled.as_ref().map(|o| *o)
67    }
68    #[inline]
69    pub fn color(&self) -> &super::super::super::api::HexColor {
70        &self.color
71    }
72    #[inline]
73    pub fn line_style(&self) -> &super::LineStyle {
74        &*self.line_style
75    }
76}