Skip to main content

sunspec/models/
model702.rs

1//! DER Capacity
2/// Type alias for [`DerCapacity`].
3pub type Model702 = DerCapacity;
4/// DER Capacity
5///
6/// DER capacity model.
7#[derive(Debug)]
8#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
9pub struct DerCapacity {
10    /// Active Power Max Rating
11    ///
12    /// Maximum active power rating at unity power factor in watts.
13    ///
14    /// Comments: Nameplate Ratings - Specifies capacity ratings
15    pub w_max_rtg: Option<u16>,
16    /// Active Power (Over-Excited) Rating
17    ///
18    /// Active power rating at specified over-excited power factor in watts.
19    pub w_ovr_ext_rtg: Option<u16>,
20    /// Specified Over-Excited PF
21    ///
22    /// Specified over-excited power factor.
23    pub w_ovr_ext_rtg_pf: Option<u16>,
24    /// Active Power (Under-Excited) Rating
25    ///
26    /// Active power rating at specified under-excited power factor in watts.
27    pub w_und_ext_rtg: Option<u16>,
28    /// Specified Under-Excited PF
29    ///
30    /// Specified under-excited power factor.
31    pub w_und_ext_rtg_pf: Option<u16>,
32    /// Apparent Power Max Rating
33    ///
34    /// Maximum apparent power rating in voltamperes.
35    pub va_max_rtg: Option<u16>,
36    /// Reactive Power Injected Rating
37    ///
38    /// Maximum injected reactive power rating in vars.
39    pub var_max_inj_rtg: Option<u16>,
40    /// Reactive Power Absorbed Rating
41    ///
42    /// Maximum absorbed reactive power rating in vars.
43    pub var_max_abs_rtg: Option<u16>,
44    /// Charge Rate Max Rating
45    ///
46    /// Maximum active power charge rate in watts.
47    pub w_cha_rte_max_rtg: Option<u16>,
48    /// Discharge Rate Max Rating
49    ///
50    /// Maximum active power discharge rate in watts.
51    pub w_dis_cha_rte_max_rtg: Option<u16>,
52    /// Charge Rate Max VA Rating
53    ///
54    /// Maximum apparent power charge rate in voltamperes.
55    pub va_cha_rte_max_rtg: Option<u16>,
56    /// Discharge Rate Max VA Rating
57    ///
58    /// Maximum apparent power discharge rate in voltamperes.
59    pub va_dis_cha_rte_max_rtg: Option<u16>,
60    /// AC Voltage Nominal Rating
61    ///
62    /// AC voltage nominal rating.
63    ///
64    /// Detail: Voltages are LN for single phase DER (e.g. 120 V nominal), LL for split phase DER (e.g. 240 V nominal), and LL for three phase DER (e.g., 480 V nominal).
65    pub v_nom_rtg: Option<u16>,
66    /// AC Voltage Max Rating
67    ///
68    /// AC voltage maximum rating.
69    ///
70    /// Detail: Voltages are LN for single phase DER (e.g. 120 V nominal), LL for split phase DER (e.g. 240 V nominal), and LL for three phase DER (e.g., 480 V nominal).
71    pub v_max_rtg: Option<u16>,
72    /// AC Voltage Min Rating
73    ///
74    /// AC voltage minimum rating.
75    ///
76    /// Detail: Voltages are LN for single phase DER (e.g. 120 V nominal), LL for split phase DER (e.g. 240 V nominal), and LL for three phase DER (e.g., 480 V nominal).
77    pub v_min_rtg: Option<u16>,
78    /// AC Current Max Rating
79    ///
80    /// AC current maximum rating in amps.
81    pub a_max_rtg: Option<u16>,
82    /// PF Over-Excited Rating (Unused)
83    ///
84    /// Unused. Please use WOvrExtRtgPF.
85    ///
86    /// Detail: This point is duplicative of WOvrExtRtgPF.
87    pub pf_ovr_ext_rtg: Option<u16>,
88    /// PF Under-Excited Rating (Unused)
89    ///
90    /// Unused. Please use WUndExtRtgPF.
91    ///
92    /// Detail: This point is duplicative of WUndExtRtgPF.
93    pub pf_und_ext_rtg: Option<u16>,
94    /// Reactive Susceptance
95    ///
96    /// Reactive susceptance that remains connected to the Area EPS in the cease to energize and trip state.
97    pub react_suscept_rtg: Option<u16>,
98    /// Normal Operating Category
99    ///
100    /// Normal operating performance category as specified in IEEE 1547-2018.
101    pub nor_op_cat_rtg: Option<NorOpCatRtg>,
102    /// Abnormal Operating Category
103    ///
104    /// Abnormal operating performance category as specified in IEEE 1547-2018.
105    pub abn_op_cat_rtg: Option<AbnOpCatRtg>,
106    /// Supported Control Modes
107    ///
108    /// Supported control mode functions.
109    pub ctrl_modes: Option<CtrlModes>,
110    /// Intentional Island Categories
111    ///
112    /// Intentional island categories.
113    pub int_island_cat_rtg: Option<IntIslandCatRtg>,
114    /// Active Power Max Setting
115    ///
116    /// Maximum active power setting used to adjust maximum active power setting.
117    ///
118    /// Comments: Settings - Used to adjust nameplate ratings
119    pub w_max: Option<u16>,
120    /// Active Power (Over-Excited) Setting
121    ///
122    /// Active power setting at specified over-excited power factor in watts.
123    pub w_max_ovr_ext: Option<u16>,
124    /// Specified Over-Excited PF
125    ///
126    /// Specified over-excited power factor.
127    pub w_ovr_ext_pf: Option<u16>,
128    /// Active Power (Under-Excited) Setting
129    ///
130    /// Active power setting at specified under-excited power factor in watts.
131    pub w_max_und_ext: Option<u16>,
132    /// Specified Under-Excited PF
133    ///
134    /// Specified under-excited power factor.
135    pub w_und_ext_pf: Option<u16>,
136    /// Apparent Power Max Setting
137    ///
138    /// Maximum apparent power setting used to adjust maximum apparent power rating.
139    pub va_max: Option<u16>,
140    /// Reactive Power Injected Setting
141    ///
142    /// Maximum injected reactive power setting used to adjust maximum injected reactive power rating.
143    pub var_max_inj: Option<u16>,
144    /// Reactive Power Absorbed Setting
145    ///
146    /// Maximum absorbed reactive power setting used to adjust maximum absorbed reactive power rating.
147    pub var_max_abs: Option<u16>,
148    /// Charge Rate Max Setting
149    ///
150    /// Maximum active power charge rate setting used to adjust maximum active power charge rate rating.
151    pub w_cha_rte_max: Option<u16>,
152    /// Discharge Rate Max Setting
153    ///
154    /// Maximum active power discharge rate setting used to adjust maximum active power discharge rate rating.
155    pub w_dis_cha_rte_max: Option<u16>,
156    /// Charge Rate Max VA Setting
157    ///
158    /// Maximum apparent power charge rate setting used to adjust maximum apparent power charge rate rating.
159    pub va_cha_rte_max: Option<u16>,
160    /// Discharge Rate Max VA Setting
161    ///
162    /// Maximum apparent power discharge rate setting used to adjust maximum apparent power discharge rate rating.
163    pub va_dis_cha_rte_max: Option<u16>,
164    /// Nominal AC Voltage Setting
165    ///
166    /// Nominal AC voltage setting.
167    ///
168    /// Detail: Voltages are LN for single phase DER (e.g. 120 V nominal), LL for split phase DER (e.g. 240 V nominal), and LL for three phase DER (e.g., 480 V nominal).
169    pub v_nom: Option<u16>,
170    /// AC Voltage Max Setting
171    ///
172    /// AC voltage maximum setting used to adjust AC voltage maximum rating.
173    ///
174    /// Detail: Voltages are LN for single phase DER (e.g. 120 V nominal), LL for split phase DER (e.g. 240 V nominal), and LL for three phase DER (e.g., 480 V nominal).
175    pub v_max: Option<u16>,
176    /// AC Voltage Min Setting
177    ///
178    /// AC voltage minimum setting used to adjust AC voltage minimum rating.
179    ///
180    /// Detail: Voltages are LN for single phase DER (e.g. 120 V nominal), LL for split phase DER (e.g. 240 V nominal), and LL for three phase DER (e.g., 480 V nominal).
181    pub v_min: Option<u16>,
182    /// AC Current Max Setting
183    ///
184    /// Maximum AC current setting used to adjust maximum AC current rating.
185    pub a_max: Option<u16>,
186    /// PF Over-Excited Setting (Unused)
187    ///
188    /// Unused. Please use WOvrExtPF.
189    ///
190    /// Detail: This point is duplicative of WOvrExtPF.
191    pub pf_ovr_ext: Option<u16>,
192    /// PF Under-Excited Setting (Unused)
193    ///
194    /// Unused. Please use WUndExtPF.
195    ///
196    /// Detail: This point is duplicative of WUndExtPF.
197    pub pf_und_ext: Option<u16>,
198    /// Intentional Island Categories
199    ///
200    /// Intentional island categories.
201    pub int_island_cat: Option<IntIslandCat>,
202    /// Active Power Scale Factor
203    ///
204    /// Active power scale factor.
205    ///
206    /// Comments: Scale Factors
207    pub w_sf: Option<i16>,
208    /// Power Factor Scale Factor
209    ///
210    /// Power factor scale factor.
211    pub pf_sf: Option<i16>,
212    /// Apparent Power Scale Factor
213    ///
214    /// Apparent power scale factor.
215    pub va_sf: Option<i16>,
216    /// Reactive Power Scale Factor
217    ///
218    /// Reactive power scale factor.
219    pub var_sf: Option<i16>,
220    /// Voltage Scale Factor
221    ///
222    /// Voltage scale factor.
223    pub v_sf: Option<i16>,
224    /// Current Scale Factor
225    ///
226    /// Current scale factor.
227    pub a_sf: Option<i16>,
228    /// Susceptance Scale Factor
229    ///
230    /// Susceptance scale factor.
231    pub s_sf: Option<i16>,
232}
233#[allow(missing_docs)]
234impl DerCapacity {
235    pub const W_MAX_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(0, 1, false);
236    pub const W_OVR_EXT_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(1, 1, false);
237    pub const W_OVR_EXT_RTG_PF: crate::Point<Self, Option<u16>> = crate::Point::new(2, 1, false);
238    pub const W_UND_EXT_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(3, 1, false);
239    pub const W_UND_EXT_RTG_PF: crate::Point<Self, Option<u16>> = crate::Point::new(4, 1, false);
240    pub const VA_MAX_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(5, 1, false);
241    pub const VAR_MAX_INJ_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(6, 1, false);
242    pub const VAR_MAX_ABS_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(7, 1, false);
243    pub const W_CHA_RTE_MAX_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(8, 1, false);
244    pub const W_DIS_CHA_RTE_MAX_RTG: crate::Point<Self, Option<u16>> =
245        crate::Point::new(9, 1, false);
246    pub const VA_CHA_RTE_MAX_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(10, 1, false);
247    pub const VA_DIS_CHA_RTE_MAX_RTG: crate::Point<Self, Option<u16>> =
248        crate::Point::new(11, 1, false);
249    pub const V_NOM_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(12, 1, false);
250    pub const V_MAX_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(13, 1, false);
251    pub const V_MIN_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(14, 1, false);
252    pub const A_MAX_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(15, 1, false);
253    pub const PF_OVR_EXT_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(16, 1, false);
254    pub const PF_UND_EXT_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(17, 1, false);
255    pub const REACT_SUSCEPT_RTG: crate::Point<Self, Option<u16>> = crate::Point::new(18, 1, false);
256    pub const NOR_OP_CAT_RTG: crate::Point<Self, Option<NorOpCatRtg>> =
257        crate::Point::new(19, 1, false);
258    pub const ABN_OP_CAT_RTG: crate::Point<Self, Option<AbnOpCatRtg>> =
259        crate::Point::new(20, 1, false);
260    pub const CTRL_MODES: crate::Point<Self, Option<CtrlModes>> = crate::Point::new(21, 2, false);
261    pub const INT_ISLAND_CAT_RTG: crate::Point<Self, Option<IntIslandCatRtg>> =
262        crate::Point::new(23, 1, false);
263    pub const W_MAX: crate::Point<Self, Option<u16>> = crate::Point::new(24, 1, true);
264    pub const W_MAX_OVR_EXT: crate::Point<Self, Option<u16>> = crate::Point::new(25, 1, true);
265    pub const W_OVR_EXT_PF: crate::Point<Self, Option<u16>> = crate::Point::new(26, 1, true);
266    pub const W_MAX_UND_EXT: crate::Point<Self, Option<u16>> = crate::Point::new(27, 1, true);
267    pub const W_UND_EXT_PF: crate::Point<Self, Option<u16>> = crate::Point::new(28, 1, true);
268    pub const VA_MAX: crate::Point<Self, Option<u16>> = crate::Point::new(29, 1, true);
269    pub const VAR_MAX_INJ: crate::Point<Self, Option<u16>> = crate::Point::new(30, 1, true);
270    pub const VAR_MAX_ABS: crate::Point<Self, Option<u16>> = crate::Point::new(31, 1, true);
271    pub const W_CHA_RTE_MAX: crate::Point<Self, Option<u16>> = crate::Point::new(32, 1, true);
272    pub const W_DIS_CHA_RTE_MAX: crate::Point<Self, Option<u16>> = crate::Point::new(33, 1, true);
273    pub const VA_CHA_RTE_MAX: crate::Point<Self, Option<u16>> = crate::Point::new(34, 1, true);
274    pub const VA_DIS_CHA_RTE_MAX: crate::Point<Self, Option<u16>> = crate::Point::new(35, 1, true);
275    pub const V_NOM: crate::Point<Self, Option<u16>> = crate::Point::new(36, 1, true);
276    pub const V_MAX: crate::Point<Self, Option<u16>> = crate::Point::new(37, 1, true);
277    pub const V_MIN: crate::Point<Self, Option<u16>> = crate::Point::new(38, 1, true);
278    pub const A_MAX: crate::Point<Self, Option<u16>> = crate::Point::new(39, 1, true);
279    pub const PF_OVR_EXT: crate::Point<Self, Option<u16>> = crate::Point::new(40, 1, true);
280    pub const PF_UND_EXT: crate::Point<Self, Option<u16>> = crate::Point::new(41, 1, true);
281    pub const INT_ISLAND_CAT: crate::Point<Self, Option<IntIslandCat>> =
282        crate::Point::new(42, 1, true);
283    pub const W_SF: crate::Point<Self, Option<i16>> = crate::Point::new(43, 1, false);
284    pub const PF_SF: crate::Point<Self, Option<i16>> = crate::Point::new(44, 1, false);
285    pub const VA_SF: crate::Point<Self, Option<i16>> = crate::Point::new(45, 1, false);
286    pub const VAR_SF: crate::Point<Self, Option<i16>> = crate::Point::new(46, 1, false);
287    pub const V_SF: crate::Point<Self, Option<i16>> = crate::Point::new(47, 1, false);
288    pub const A_SF: crate::Point<Self, Option<i16>> = crate::Point::new(48, 1, false);
289    pub const S_SF: crate::Point<Self, Option<i16>> = crate::Point::new(49, 1, false);
290}
291impl crate::Group for DerCapacity {
292    const LEN: u16 = 50;
293}
294impl DerCapacity {
295    fn parse_group(data: &[u16]) -> Result<(&[u16], Self), crate::DecodeError> {
296        let nested_data = data
297            .get(usize::from(<Self as crate::Group>::LEN)..)
298            .unwrap_or(&[]);
299        Ok((
300            nested_data,
301            Self {
302                w_max_rtg: Self::W_MAX_RTG.from_data(data)?,
303                w_ovr_ext_rtg: Self::W_OVR_EXT_RTG.from_data(data)?,
304                w_ovr_ext_rtg_pf: Self::W_OVR_EXT_RTG_PF.from_data(data)?,
305                w_und_ext_rtg: Self::W_UND_EXT_RTG.from_data(data)?,
306                w_und_ext_rtg_pf: Self::W_UND_EXT_RTG_PF.from_data(data)?,
307                va_max_rtg: Self::VA_MAX_RTG.from_data(data)?,
308                var_max_inj_rtg: Self::VAR_MAX_INJ_RTG.from_data(data)?,
309                var_max_abs_rtg: Self::VAR_MAX_ABS_RTG.from_data(data)?,
310                w_cha_rte_max_rtg: Self::W_CHA_RTE_MAX_RTG.from_data(data)?,
311                w_dis_cha_rte_max_rtg: Self::W_DIS_CHA_RTE_MAX_RTG.from_data(data)?,
312                va_cha_rte_max_rtg: Self::VA_CHA_RTE_MAX_RTG.from_data(data)?,
313                va_dis_cha_rte_max_rtg: Self::VA_DIS_CHA_RTE_MAX_RTG.from_data(data)?,
314                v_nom_rtg: Self::V_NOM_RTG.from_data(data)?,
315                v_max_rtg: Self::V_MAX_RTG.from_data(data)?,
316                v_min_rtg: Self::V_MIN_RTG.from_data(data)?,
317                a_max_rtg: Self::A_MAX_RTG.from_data(data)?,
318                pf_ovr_ext_rtg: Self::PF_OVR_EXT_RTG.from_data(data)?,
319                pf_und_ext_rtg: Self::PF_UND_EXT_RTG.from_data(data)?,
320                react_suscept_rtg: Self::REACT_SUSCEPT_RTG.from_data(data)?,
321                nor_op_cat_rtg: Self::NOR_OP_CAT_RTG.from_data(data)?,
322                abn_op_cat_rtg: Self::ABN_OP_CAT_RTG.from_data(data)?,
323                ctrl_modes: Self::CTRL_MODES.from_data(data)?,
324                int_island_cat_rtg: Self::INT_ISLAND_CAT_RTG.from_data(data)?,
325                w_max: Self::W_MAX.from_data(data)?,
326                w_max_ovr_ext: Self::W_MAX_OVR_EXT.from_data(data)?,
327                w_ovr_ext_pf: Self::W_OVR_EXT_PF.from_data(data)?,
328                w_max_und_ext: Self::W_MAX_UND_EXT.from_data(data)?,
329                w_und_ext_pf: Self::W_UND_EXT_PF.from_data(data)?,
330                va_max: Self::VA_MAX.from_data(data)?,
331                var_max_inj: Self::VAR_MAX_INJ.from_data(data)?,
332                var_max_abs: Self::VAR_MAX_ABS.from_data(data)?,
333                w_cha_rte_max: Self::W_CHA_RTE_MAX.from_data(data)?,
334                w_dis_cha_rte_max: Self::W_DIS_CHA_RTE_MAX.from_data(data)?,
335                va_cha_rte_max: Self::VA_CHA_RTE_MAX.from_data(data)?,
336                va_dis_cha_rte_max: Self::VA_DIS_CHA_RTE_MAX.from_data(data)?,
337                v_nom: Self::V_NOM.from_data(data)?,
338                v_max: Self::V_MAX.from_data(data)?,
339                v_min: Self::V_MIN.from_data(data)?,
340                a_max: Self::A_MAX.from_data(data)?,
341                pf_ovr_ext: Self::PF_OVR_EXT.from_data(data)?,
342                pf_und_ext: Self::PF_UND_EXT.from_data(data)?,
343                int_island_cat: Self::INT_ISLAND_CAT.from_data(data)?,
344                w_sf: Self::W_SF.from_data(data)?,
345                pf_sf: Self::PF_SF.from_data(data)?,
346                va_sf: Self::VA_SF.from_data(data)?,
347                var_sf: Self::VAR_SF.from_data(data)?,
348                v_sf: Self::V_SF.from_data(data)?,
349                a_sf: Self::A_SF.from_data(data)?,
350                s_sf: Self::S_SF.from_data(data)?,
351            },
352        ))
353    }
354}
355/// Normal Operating Category
356///
357/// Normal operating performance category as specified in IEEE 1547-2018.
358#[derive(Copy, Clone, Debug, Eq, PartialEq)]
359#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
360pub enum NorOpCatRtg {
361    /// Category A
362    CatA,
363    /// Category B
364    CatB,
365    /// Raw enum value not defined by the SunSpec model.
366    Invalid(u16),
367}
368impl crate::EnumValue for NorOpCatRtg {
369    type Repr = u16;
370    const INVALID: Self::Repr = 65535;
371    fn from_repr(value: Self::Repr) -> Self {
372        match value {
373            0 => Self::CatA,
374            1 => Self::CatB,
375            value => Self::Invalid(value),
376        }
377    }
378    fn to_repr(self) -> Self::Repr {
379        match self {
380            Self::CatA => 0,
381            Self::CatB => 1,
382            Self::Invalid(value) => value,
383        }
384    }
385}
386impl crate::FixedSize for NorOpCatRtg {
387    const SIZE: u16 = 1u16;
388    const INVALID: Self = Self::Invalid(65535);
389    fn is_invalid(&self) -> bool {
390        matches!(self, Self::Invalid(_))
391    }
392}
393/// Abnormal Operating Category
394///
395/// Abnormal operating performance category as specified in IEEE 1547-2018.
396#[derive(Copy, Clone, Debug, Eq, PartialEq)]
397#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
398pub enum AbnOpCatRtg {
399    /// Category I
400    Cat1,
401    /// Category II
402    Cat2,
403    /// Category III
404    Cat3,
405    /// Raw enum value not defined by the SunSpec model.
406    Invalid(u16),
407}
408impl crate::EnumValue for AbnOpCatRtg {
409    type Repr = u16;
410    const INVALID: Self::Repr = 65535;
411    fn from_repr(value: Self::Repr) -> Self {
412        match value {
413            0 => Self::Cat1,
414            1 => Self::Cat2,
415            2 => Self::Cat3,
416            value => Self::Invalid(value),
417        }
418    }
419    fn to_repr(self) -> Self::Repr {
420        match self {
421            Self::Cat1 => 0,
422            Self::Cat2 => 1,
423            Self::Cat3 => 2,
424            Self::Invalid(value) => value,
425        }
426    }
427}
428impl crate::FixedSize for AbnOpCatRtg {
429    const SIZE: u16 = 1u16;
430    const INVALID: Self = Self::Invalid(65535);
431    fn is_invalid(&self) -> bool {
432        matches!(self, Self::Invalid(_))
433    }
434}
435bitflags::bitflags! {
436    #[doc = " Supported Control Modes"] #[doc = " "] #[doc =
437    " Supported control mode functions."] #[derive(Copy, Clone, Debug, Eq, PartialEq)]
438    #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] pub
439    struct CtrlModes : u32 { #[doc = " Limit Maximum Active Power"] const MaxW = 1; #[doc
440    = " Fixed Active Power"] const FixedW = 2; #[doc = " Fixed Reactive Power"] const
441    FixedVar = 4; #[doc = " Fixed Power Factor"] const FixedPf = 8; #[doc =
442    " Volt-Var Function"] const VoltVar = 16; #[doc = " Freq-Watt Function"] const
443    FreqWatt = 32; #[doc = " Dynamic Reactive Current Function"] const DynReactCurr = 64;
444    #[doc = " Low-Voltage Trip"] const LvTrip = 128; #[doc = " High-Voltage Trip"] const
445    HvTrip = 256; #[doc = " Watt-Var Function"] const WattVar = 512; #[doc =
446    " Volt-Watt Function"] const VoltWatt = 1024; #[doc = " Scheduling"] const Scheduled
447    = 2048; #[doc = " Low-Frequency Trip"] const LfTrip = 4096; #[doc =
448    " High-Frequency Trip"] const HfTrip = 8192; }
449}
450impl crate::Value for CtrlModes {
451    fn decode(data: &[u16]) -> Result<Self, crate::DecodeError> {
452        let value = u32::decode(data)?;
453        Ok(Self::from_bits_retain(value))
454    }
455    fn encode(self) -> Box<[u16]> {
456        self.bits().encode()
457    }
458}
459impl crate::FixedSize for CtrlModes {
460    const SIZE: u16 = 2u16;
461    const INVALID: Self = Self::from_bits_retain(4294967295u32);
462    fn is_invalid(&self) -> bool {
463        self.bits() == 4294967295u32
464    }
465}
466bitflags::bitflags! {
467    #[doc = " Intentional Island Categories"] #[doc = " "] #[doc =
468    " Intentional island categories."] #[derive(Copy, Clone, Debug, Eq, PartialEq)]
469    #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] pub
470    struct IntIslandCatRtg : u16 { #[doc = " Uncategorized"] const Uncategorized = 1;
471    #[doc = " Intentional Island-Capable"] const IntIslCapable = 2; #[doc =
472    " Black Start-Capable"] const BlackStartCapable = 4; #[doc = " Isochronous-Capable"]
473    const IsochCapable = 8; }
474}
475impl crate::Value for IntIslandCatRtg {
476    fn decode(data: &[u16]) -> Result<Self, crate::DecodeError> {
477        let value = u16::decode(data)?;
478        Ok(Self::from_bits_retain(value))
479    }
480    fn encode(self) -> Box<[u16]> {
481        self.bits().encode()
482    }
483}
484impl crate::FixedSize for IntIslandCatRtg {
485    const SIZE: u16 = 1u16;
486    const INVALID: Self = Self::from_bits_retain(65535u16);
487    fn is_invalid(&self) -> bool {
488        self.bits() == 65535u16
489    }
490}
491bitflags::bitflags! {
492    #[doc = " Intentional Island Categories"] #[doc = " "] #[doc =
493    " Intentional island categories."] #[derive(Copy, Clone, Debug, Eq, PartialEq)]
494    #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] pub
495    struct IntIslandCat : u16 { #[doc = " Uncategorized"] const Uncategorized = 1; #[doc
496    = " Intentional Island-Capable"] const IntIslCapable = 2; #[doc =
497    " Black Start-Capable"] const BlackStartCapable = 4; #[doc = " Isochronous-Capable"]
498    const IsochCapable = 8; }
499}
500impl crate::Value for IntIslandCat {
501    fn decode(data: &[u16]) -> Result<Self, crate::DecodeError> {
502        let value = u16::decode(data)?;
503        Ok(Self::from_bits_retain(value))
504    }
505    fn encode(self) -> Box<[u16]> {
506        self.bits().encode()
507    }
508}
509impl crate::FixedSize for IntIslandCat {
510    const SIZE: u16 = 1u16;
511    const INVALID: Self = Self::from_bits_retain(65535u16);
512    fn is_invalid(&self) -> bool {
513        self.bits() == 65535u16
514    }
515}
516impl crate::Model for DerCapacity {
517    const ID: u16 = 702;
518    fn addr(models: &crate::Models) -> crate::ModelAddr<Self> {
519        models.m702
520    }
521    fn parse(data: &[u16]) -> Result<Self, crate::ParseError<Self>> {
522        let (_, model) = Self::parse_group(data)?;
523        Ok(model)
524    }
525}