dis_rs/v7/
model.rs

1use crate::enumerations::{
2    ActiveInterrogationIndicator, CoupledExtensionIndicator, DetonationTypeIndicator,
3    FireTypeIndicator, IffSimulationMode, IntercomAttachedIndicator, LvcIndicator,
4    RadioAttachedIndicator, TransferredEntityIndicator,
5};
6#[cfg(feature = "serde")]
7use serde::{Deserialize, Serialize};
8
9/// 5.2.7 PDU status record
10///
11/// 6.2.67 PDU Status record
12#[derive(Copy, Clone, Debug, PartialEq)]
13#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14pub struct PduStatus {
15    pub transferred_entity_indicator: Option<TransferredEntityIndicator>,
16    pub lvc_indicator: Option<LvcIndicator>,
17    pub coupled_extension_indicator: Option<CoupledExtensionIndicator>,
18    pub fire_type_indicator: Option<FireTypeIndicator>,
19    pub detonation_type_indicator: Option<DetonationTypeIndicator>,
20    pub radio_attached_indicator: Option<RadioAttachedIndicator>,
21    pub intercom_attached_indicator: Option<IntercomAttachedIndicator>,
22    pub iff_simulation_mode: Option<IffSimulationMode>,
23    pub active_interrogation_indicator: Option<ActiveInterrogationIndicator>,
24}
25
26#[allow(clippy::derivable_impls)]
27impl Default for PduStatus {
28    fn default() -> Self {
29        PduStatus {
30            transferred_entity_indicator: None,
31            lvc_indicator: None,
32            coupled_extension_indicator: None,
33            fire_type_indicator: None,
34            detonation_type_indicator: None,
35            radio_attached_indicator: None,
36            intercom_attached_indicator: None,
37            iff_simulation_mode: None,
38            active_interrogation_indicator: None,
39        }
40    }
41}
42
43impl PduStatus {
44    #[must_use]
45    pub fn with_transferred_entity_indicator(mut self, tei: TransferredEntityIndicator) -> Self {
46        self.transferred_entity_indicator = Some(tei);
47        self
48    }
49
50    #[must_use]
51    pub fn with_lvc_indicator(mut self, lvc: LvcIndicator) -> Self {
52        self.lvc_indicator = Some(lvc);
53        self
54    }
55
56    #[must_use]
57    pub fn with_coupled_extension_indicator(mut self, cei: CoupledExtensionIndicator) -> Self {
58        self.coupled_extension_indicator = Some(cei);
59        self
60    }
61
62    #[must_use]
63    pub fn with_fire_type_indicator(mut self, fti: FireTypeIndicator) -> Self {
64        self.fire_type_indicator = Some(fti);
65        self
66    }
67
68    #[must_use]
69    pub fn with_detonation_type_indicator(mut self, dti: DetonationTypeIndicator) -> Self {
70        self.detonation_type_indicator = Some(dti);
71        self
72    }
73
74    #[must_use]
75    pub fn with_radio_attached_indicator(mut self, rai: RadioAttachedIndicator) -> Self {
76        self.radio_attached_indicator = Some(rai);
77        self
78    }
79
80    #[must_use]
81    pub fn with_intercom_attached_indicator(mut self, iai: IntercomAttachedIndicator) -> Self {
82        self.intercom_attached_indicator = Some(iai);
83        self
84    }
85
86    #[must_use]
87    pub fn with_iff_simulation_mode(mut self, ism: IffSimulationMode) -> Self {
88        self.iff_simulation_mode = Some(ism);
89        self
90    }
91
92    #[must_use]
93    pub fn with_active_interrogation_indicator(
94        mut self,
95        aii: ActiveInterrogationIndicator,
96    ) -> Self {
97        self.active_interrogation_indicator = Some(aii);
98        self
99    }
100}