Skip to main content

cimstructs/
GovHydroWEH.rs

1/// WoodwardTM electric hydro governor. [Footnote: Woodward electric hydro governors are an example of suitable products available commercially. This information is given for the convenience of users of this document and does not constitute an endorsement by IEC of these products.]
2#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)]
3pub struct GovHydroWEH {
4    #[serde(flatten)]
5    pub base: super::TurbineGovernorDynamics,
6    /// Speed deadband (db).
7    #[serde(skip_serializing_if = "Option::is_none")]
8    pub db: Option<f64>,
9    /// Value to allow the integral controller to advance beyond the gate limits (Dicn).
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub dicn: Option<f64>,
12    /// Value to allow the pilot valve controller to advance beyond the gate limits (Dpv).
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub dpv: Option<f64>,
15    /// Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU).
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub dturb: Option<f64>,
18    /// Feedback signal selection (Sw). true = PID output (if R-Perm-Gate = droop and R-Perm-Pe = 0) false = electrical power (if R-Perm-Gate = 0 and R-Perm-Pe = droop) or false = gate position (if R-Perm-Gate = droop and R-Perm-Pe = 0). Typical value = false.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub feedback_signal: Option<bool>,
21    /// Flowgate 1 (Fl1). Flow value for gate position point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub fl1: Option<f64>,
24    /// Flowgate 2 (Fl2). Flow value for gate position point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub fl2: Option<f64>,
27    /// Flowgate 3 (Fl3). Flow value for gate position point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub fl3: Option<f64>,
30    /// Flowgate 4 (Fl4). Flow value for gate position point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub fl4: Option<f64>,
33    /// Flowgate 5 (Fl5). Flow value for gate position point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub fl5: Option<f64>,
36    /// Flow P1 (Fp1). Turbine flow value for point 1 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub fp1: Option<f64>,
39    /// Flow P10 (Fp10). Turbine flow value for point 10 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub fp10: Option<f64>,
42    /// Flow P2 (Fp2). Turbine flow value for point 2 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub fp2: Option<f64>,
45    /// Flow P3 (Fp3). Turbine flow value for point 3 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub fp3: Option<f64>,
48    /// Flow P4 (Fp4). Turbine flow value for point 4 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
49    #[serde(skip_serializing_if = "Option::is_none")]
50    pub fp4: Option<f64>,
51    /// Flow P5 (Fp5). Turbine flow value for point 5 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub fp5: Option<f64>,
54    /// Flow P6 (Fp6). Turbine flow value for point 6 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub fp6: Option<f64>,
57    /// Flow P7 (Fp7). Turbine flow value for point 7 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub fp7: Option<f64>,
60    /// Flow P8 (Fp8). Turbine flow value for point 8 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub fp8: Option<f64>,
63    /// Flow P9 (Fp9). Turbine flow value for point 9 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub fp9: Option<f64>,
66    /// Maximum gate position (Gmax) (> GovHydroWEH.gmin).
67    #[serde(skip_serializing_if = "Option::is_none")]
68    pub gmax: Option<f64>,
69    /// Minimum gate position (Gmin) (< GovHydroWEH.gmax).
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub gmin: Option<f64>,
72    /// Maximum gate closing rate (Gtmxcl).
73    #[serde(skip_serializing_if = "Option::is_none")]
74    pub gtmxcl: Option<f64>,
75    /// Maximum gate opening rate (Gtmxop).
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub gtmxop: Option<f64>,
78    /// Gate 1 (Gv1). Gate Position value for point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
79    #[serde(skip_serializing_if = "Option::is_none")]
80    pub gv1: Option<f64>,
81    /// Gate 2 (Gv2). Gate Position value for point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub gv2: Option<f64>,
84    /// Gate 3 (Gv3). Gate Position value for point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
85    #[serde(skip_serializing_if = "Option::is_none")]
86    pub gv3: Option<f64>,
87    /// Gate 4 (Gv4). Gate Position value for point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub gv4: Option<f64>,
90    /// Gate 5 (Gv5). Gate Position value for point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow.
91    #[serde(skip_serializing_if = "Option::is_none")]
92    pub gv5: Option<f64>,
93    /// Derivative controller derivative gain (Kd).
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub kd: Option<f64>,
96    /// Derivative controller Integral gain (Ki).
97    #[serde(skip_serializing_if = "Option::is_none")]
98    pub ki: Option<f64>,
99    /// Derivative control gain (Kp).
100    #[serde(skip_serializing_if = "Option::is_none")]
101    pub kp: Option<f64>,
102    /// Base for power values (MWbase) (> 0). Unit = MW.
103    #[serde(skip_serializing_if = "Option::is_none")]
104    pub mwbase: Option<f64>,
105    /// Pmss flow P1 (Pmss1). Mechanical power output for turbine flow point 1 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub pmss1: Option<f64>,
108    /// Pmss flow P10 (Pmss10). Mechanical power output for turbine flow point 10 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub pmss10: Option<f64>,
111    /// Pmss flow P2 (Pmss2). Mechanical power output for turbine flow point 2 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
112    #[serde(skip_serializing_if = "Option::is_none")]
113    pub pmss2: Option<f64>,
114    /// Pmss flow P3 (Pmss3). Mechanical power output for turbine flow point 3 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
115    #[serde(skip_serializing_if = "Option::is_none")]
116    pub pmss3: Option<f64>,
117    /// Pmss flow P4 (Pmss4). Mechanical power output for turbine flow point 4 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
118    #[serde(skip_serializing_if = "Option::is_none")]
119    pub pmss4: Option<f64>,
120    /// Pmss flow P5 (Pmss5). Mechanical power output for turbine flow point 5 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
121    #[serde(skip_serializing_if = "Option::is_none")]
122    pub pmss5: Option<f64>,
123    /// Pmss flow P6 (Pmss6). Mechanical power output for turbine flow point 6 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
124    #[serde(skip_serializing_if = "Option::is_none")]
125    pub pmss6: Option<f64>,
126    /// Pmss flow P7 (Pmss7). Mechanical power output for turbine flow point 7 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
127    #[serde(skip_serializing_if = "Option::is_none")]
128    pub pmss7: Option<f64>,
129    /// Pmss flow P8 (Pmss8). Mechanical power output for turbine flow point 8 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
130    #[serde(skip_serializing_if = "Option::is_none")]
131    pub pmss8: Option<f64>,
132    /// Pmss flow P9 (Pmss9). Mechanical power output for turbine flow point 9 for lookup table representing PU mechanical power on machine MVA rating as a function of turbine flow.
133    #[serde(skip_serializing_if = "Option::is_none")]
134    pub pmss9: Option<f64>,
135    /// Permanent droop for governor output feedback (R-Perm-Gate).
136    #[serde(skip_serializing_if = "Option::is_none")]
137    pub rpg: Option<f64>,
138    /// Permanent droop for electrical power feedback (R-Perm-Pe).
139    #[serde(skip_serializing_if = "Option::is_none")]
140    pub rpp: Option<f64>,
141    /// Derivative controller time constant (Td) (>= 0). Limits the derivative characteristic beyond a breakdown frequency to avoid amplification of high-frequency noise.
142    #[serde(skip_serializing_if = "Option::is_none")]
143    pub td: Option<f64>,
144    /// Distributive valve time lag time constant (Tdv) (>= 0).
145    #[serde(skip_serializing_if = "Option::is_none")]
146    pub tdv: Option<f64>,
147    /// Value to allow the distribution valve controller to advance beyond the gate movement rate limit (Tg) (>= 0).
148    #[serde(skip_serializing_if = "Option::is_none")]
149    pub tg: Option<f64>,
150    /// Pilot valve time lag time constant (Tp) (>= 0).
151    #[serde(skip_serializing_if = "Option::is_none")]
152    pub tp: Option<f64>,
153    /// Electrical power droop time constant (Tpe) (>= 0).
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub tpe: Option<f64>,
156    /// Water inertia time constant (Tw) (> 0).
157    #[serde(skip_serializing_if = "Option::is_none")]
158    pub tw: Option<f64>,
159}
160impl crate::base::CimElement for GovHydroWEH {
161    fn mrid(&self) -> &str { &self.base.base.base.id }
162    fn type_name(&self) -> &'static str { "GovHydroWEH" }
163    fn as_any(&self) -> &dyn std::any::Any { self }
164    fn to_json_value(&self) -> serde_json::Value {
165        serde_json::to_value(self).unwrap_or(serde_json::Value::Null)
166    }
167    fn to_block(&self) -> crate::base::RdfBlock {
168        let mut block = self.base.to_block();
169        block.type_name = "GovHydroWEH".to_string();
170        if let Some(v) = self.db {
171            block.fields.insert("GovHydroWEH.db".into(), crate::base::FieldValue::Text(v.to_string()));
172        }
173        if let Some(v) = self.dicn {
174            block.fields.insert("GovHydroWEH.dicn".into(), crate::base::FieldValue::Text(v.to_string()));
175        }
176        if let Some(v) = self.dpv {
177            block.fields.insert("GovHydroWEH.dpv".into(), crate::base::FieldValue::Text(v.to_string()));
178        }
179        if let Some(v) = self.dturb {
180            block.fields.insert("GovHydroWEH.dturb".into(), crate::base::FieldValue::Text(v.to_string()));
181        }
182        if let Some(v) = self.feedback_signal {
183            block.fields.insert("GovHydroWEH.feedbackSignal".into(), crate::base::FieldValue::Text(v.to_string()));
184        }
185        if let Some(v) = self.fl1 {
186            block.fields.insert("GovHydroWEH.fl1".into(), crate::base::FieldValue::Text(v.to_string()));
187        }
188        if let Some(v) = self.fl2 {
189            block.fields.insert("GovHydroWEH.fl2".into(), crate::base::FieldValue::Text(v.to_string()));
190        }
191        if let Some(v) = self.fl3 {
192            block.fields.insert("GovHydroWEH.fl3".into(), crate::base::FieldValue::Text(v.to_string()));
193        }
194        if let Some(v) = self.fl4 {
195            block.fields.insert("GovHydroWEH.fl4".into(), crate::base::FieldValue::Text(v.to_string()));
196        }
197        if let Some(v) = self.fl5 {
198            block.fields.insert("GovHydroWEH.fl5".into(), crate::base::FieldValue::Text(v.to_string()));
199        }
200        if let Some(v) = self.fp1 {
201            block.fields.insert("GovHydroWEH.fp1".into(), crate::base::FieldValue::Text(v.to_string()));
202        }
203        if let Some(v) = self.fp10 {
204            block.fields.insert("GovHydroWEH.fp10".into(), crate::base::FieldValue::Text(v.to_string()));
205        }
206        if let Some(v) = self.fp2 {
207            block.fields.insert("GovHydroWEH.fp2".into(), crate::base::FieldValue::Text(v.to_string()));
208        }
209        if let Some(v) = self.fp3 {
210            block.fields.insert("GovHydroWEH.fp3".into(), crate::base::FieldValue::Text(v.to_string()));
211        }
212        if let Some(v) = self.fp4 {
213            block.fields.insert("GovHydroWEH.fp4".into(), crate::base::FieldValue::Text(v.to_string()));
214        }
215        if let Some(v) = self.fp5 {
216            block.fields.insert("GovHydroWEH.fp5".into(), crate::base::FieldValue::Text(v.to_string()));
217        }
218        if let Some(v) = self.fp6 {
219            block.fields.insert("GovHydroWEH.fp6".into(), crate::base::FieldValue::Text(v.to_string()));
220        }
221        if let Some(v) = self.fp7 {
222            block.fields.insert("GovHydroWEH.fp7".into(), crate::base::FieldValue::Text(v.to_string()));
223        }
224        if let Some(v) = self.fp8 {
225            block.fields.insert("GovHydroWEH.fp8".into(), crate::base::FieldValue::Text(v.to_string()));
226        }
227        if let Some(v) = self.fp9 {
228            block.fields.insert("GovHydroWEH.fp9".into(), crate::base::FieldValue::Text(v.to_string()));
229        }
230        if let Some(v) = self.gmax {
231            block.fields.insert("GovHydroWEH.gmax".into(), crate::base::FieldValue::Text(v.to_string()));
232        }
233        if let Some(v) = self.gmin {
234            block.fields.insert("GovHydroWEH.gmin".into(), crate::base::FieldValue::Text(v.to_string()));
235        }
236        if let Some(v) = self.gtmxcl {
237            block.fields.insert("GovHydroWEH.gtmxcl".into(), crate::base::FieldValue::Text(v.to_string()));
238        }
239        if let Some(v) = self.gtmxop {
240            block.fields.insert("GovHydroWEH.gtmxop".into(), crate::base::FieldValue::Text(v.to_string()));
241        }
242        if let Some(v) = self.gv1 {
243            block.fields.insert("GovHydroWEH.gv1".into(), crate::base::FieldValue::Text(v.to_string()));
244        }
245        if let Some(v) = self.gv2 {
246            block.fields.insert("GovHydroWEH.gv2".into(), crate::base::FieldValue::Text(v.to_string()));
247        }
248        if let Some(v) = self.gv3 {
249            block.fields.insert("GovHydroWEH.gv3".into(), crate::base::FieldValue::Text(v.to_string()));
250        }
251        if let Some(v) = self.gv4 {
252            block.fields.insert("GovHydroWEH.gv4".into(), crate::base::FieldValue::Text(v.to_string()));
253        }
254        if let Some(v) = self.gv5 {
255            block.fields.insert("GovHydroWEH.gv5".into(), crate::base::FieldValue::Text(v.to_string()));
256        }
257        if let Some(v) = self.kd {
258            block.fields.insert("GovHydroWEH.kd".into(), crate::base::FieldValue::Text(v.to_string()));
259        }
260        if let Some(v) = self.ki {
261            block.fields.insert("GovHydroWEH.ki".into(), crate::base::FieldValue::Text(v.to_string()));
262        }
263        if let Some(v) = self.kp {
264            block.fields.insert("GovHydroWEH.kp".into(), crate::base::FieldValue::Text(v.to_string()));
265        }
266        if let Some(v) = self.mwbase {
267            block.fields.insert("GovHydroWEH.mwbase".into(), crate::base::FieldValue::Text(v.to_string()));
268        }
269        if let Some(v) = self.pmss1 {
270            block.fields.insert("GovHydroWEH.pmss1".into(), crate::base::FieldValue::Text(v.to_string()));
271        }
272        if let Some(v) = self.pmss10 {
273            block.fields.insert("GovHydroWEH.pmss10".into(), crate::base::FieldValue::Text(v.to_string()));
274        }
275        if let Some(v) = self.pmss2 {
276            block.fields.insert("GovHydroWEH.pmss2".into(), crate::base::FieldValue::Text(v.to_string()));
277        }
278        if let Some(v) = self.pmss3 {
279            block.fields.insert("GovHydroWEH.pmss3".into(), crate::base::FieldValue::Text(v.to_string()));
280        }
281        if let Some(v) = self.pmss4 {
282            block.fields.insert("GovHydroWEH.pmss4".into(), crate::base::FieldValue::Text(v.to_string()));
283        }
284        if let Some(v) = self.pmss5 {
285            block.fields.insert("GovHydroWEH.pmss5".into(), crate::base::FieldValue::Text(v.to_string()));
286        }
287        if let Some(v) = self.pmss6 {
288            block.fields.insert("GovHydroWEH.pmss6".into(), crate::base::FieldValue::Text(v.to_string()));
289        }
290        if let Some(v) = self.pmss7 {
291            block.fields.insert("GovHydroWEH.pmss7".into(), crate::base::FieldValue::Text(v.to_string()));
292        }
293        if let Some(v) = self.pmss8 {
294            block.fields.insert("GovHydroWEH.pmss8".into(), crate::base::FieldValue::Text(v.to_string()));
295        }
296        if let Some(v) = self.pmss9 {
297            block.fields.insert("GovHydroWEH.pmss9".into(), crate::base::FieldValue::Text(v.to_string()));
298        }
299        if let Some(v) = self.rpg {
300            block.fields.insert("GovHydroWEH.rpg".into(), crate::base::FieldValue::Text(v.to_string()));
301        }
302        if let Some(v) = self.rpp {
303            block.fields.insert("GovHydroWEH.rpp".into(), crate::base::FieldValue::Text(v.to_string()));
304        }
305        if let Some(v) = self.td {
306            block.fields.insert("GovHydroWEH.td".into(), crate::base::FieldValue::Text(v.to_string()));
307        }
308        if let Some(v) = self.tdv {
309            block.fields.insert("GovHydroWEH.tdv".into(), crate::base::FieldValue::Text(v.to_string()));
310        }
311        if let Some(v) = self.tg {
312            block.fields.insert("GovHydroWEH.tg".into(), crate::base::FieldValue::Text(v.to_string()));
313        }
314        if let Some(v) = self.tp {
315            block.fields.insert("GovHydroWEH.tp".into(), crate::base::FieldValue::Text(v.to_string()));
316        }
317        if let Some(v) = self.tpe {
318            block.fields.insert("GovHydroWEH.tpe".into(), crate::base::FieldValue::Text(v.to_string()));
319        }
320        if let Some(v) = self.tw {
321            block.fields.insert("GovHydroWEH.tw".into(), crate::base::FieldValue::Text(v.to_string()));
322        }
323        block
324    }
325}
326
327impl GovHydroWEH {
328    pub fn from_block(b: &crate::base::RdfBlock) -> Self {
329        let mut obj = Self::default();
330        obj.base.base.base.id.clone_from(&b.mrid);
331        for (key, val) in &b.fields {
332            match key.as_str() {
333                "GovHydroWEH.db" => {
334                    match val {
335                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.db = Some(v); } }
336                        crate::base::FieldValue::TextList(svs) => {
337                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.db = Some(v); } }
338                        }
339                        _ => {}
340                    }
341                }
342                "GovHydroWEH.dicn" => {
343                    match val {
344                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.dicn = Some(v); } }
345                        crate::base::FieldValue::TextList(svs) => {
346                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.dicn = Some(v); } }
347                        }
348                        _ => {}
349                    }
350                }
351                "GovHydroWEH.dpv" => {
352                    match val {
353                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.dpv = Some(v); } }
354                        crate::base::FieldValue::TextList(svs) => {
355                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.dpv = Some(v); } }
356                        }
357                        _ => {}
358                    }
359                }
360                "GovHydroWEH.dturb" => {
361                    match val {
362                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.dturb = Some(v); } }
363                        crate::base::FieldValue::TextList(svs) => {
364                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.dturb = Some(v); } }
365                        }
366                        _ => {}
367                    }
368                }
369                "GovHydroWEH.feedbackSignal" => {
370                    match val {
371                        crate::base::FieldValue::Text(sv) => { obj.feedback_signal = Some(sv.trim() == "true"); }
372                        crate::base::FieldValue::TextList(svs) => {
373                            if let Some(sv) = svs.last() { obj.feedback_signal = Some(sv.trim() == "true"); }
374                        }
375                        _ => {}
376                    }
377                }
378                "GovHydroWEH.fl1" => {
379                    match val {
380                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fl1 = Some(v); } }
381                        crate::base::FieldValue::TextList(svs) => {
382                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fl1 = Some(v); } }
383                        }
384                        _ => {}
385                    }
386                }
387                "GovHydroWEH.fl2" => {
388                    match val {
389                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fl2 = Some(v); } }
390                        crate::base::FieldValue::TextList(svs) => {
391                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fl2 = Some(v); } }
392                        }
393                        _ => {}
394                    }
395                }
396                "GovHydroWEH.fl3" => {
397                    match val {
398                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fl3 = Some(v); } }
399                        crate::base::FieldValue::TextList(svs) => {
400                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fl3 = Some(v); } }
401                        }
402                        _ => {}
403                    }
404                }
405                "GovHydroWEH.fl4" => {
406                    match val {
407                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fl4 = Some(v); } }
408                        crate::base::FieldValue::TextList(svs) => {
409                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fl4 = Some(v); } }
410                        }
411                        _ => {}
412                    }
413                }
414                "GovHydroWEH.fl5" => {
415                    match val {
416                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fl5 = Some(v); } }
417                        crate::base::FieldValue::TextList(svs) => {
418                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fl5 = Some(v); } }
419                        }
420                        _ => {}
421                    }
422                }
423                "GovHydroWEH.fp1" => {
424                    match val {
425                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp1 = Some(v); } }
426                        crate::base::FieldValue::TextList(svs) => {
427                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp1 = Some(v); } }
428                        }
429                        _ => {}
430                    }
431                }
432                "GovHydroWEH.fp10" => {
433                    match val {
434                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp10 = Some(v); } }
435                        crate::base::FieldValue::TextList(svs) => {
436                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp10 = Some(v); } }
437                        }
438                        _ => {}
439                    }
440                }
441                "GovHydroWEH.fp2" => {
442                    match val {
443                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp2 = Some(v); } }
444                        crate::base::FieldValue::TextList(svs) => {
445                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp2 = Some(v); } }
446                        }
447                        _ => {}
448                    }
449                }
450                "GovHydroWEH.fp3" => {
451                    match val {
452                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp3 = Some(v); } }
453                        crate::base::FieldValue::TextList(svs) => {
454                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp3 = Some(v); } }
455                        }
456                        _ => {}
457                    }
458                }
459                "GovHydroWEH.fp4" => {
460                    match val {
461                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp4 = Some(v); } }
462                        crate::base::FieldValue::TextList(svs) => {
463                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp4 = Some(v); } }
464                        }
465                        _ => {}
466                    }
467                }
468                "GovHydroWEH.fp5" => {
469                    match val {
470                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp5 = Some(v); } }
471                        crate::base::FieldValue::TextList(svs) => {
472                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp5 = Some(v); } }
473                        }
474                        _ => {}
475                    }
476                }
477                "GovHydroWEH.fp6" => {
478                    match val {
479                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp6 = Some(v); } }
480                        crate::base::FieldValue::TextList(svs) => {
481                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp6 = Some(v); } }
482                        }
483                        _ => {}
484                    }
485                }
486                "GovHydroWEH.fp7" => {
487                    match val {
488                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp7 = Some(v); } }
489                        crate::base::FieldValue::TextList(svs) => {
490                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp7 = Some(v); } }
491                        }
492                        _ => {}
493                    }
494                }
495                "GovHydroWEH.fp8" => {
496                    match val {
497                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp8 = Some(v); } }
498                        crate::base::FieldValue::TextList(svs) => {
499                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp8 = Some(v); } }
500                        }
501                        _ => {}
502                    }
503                }
504                "GovHydroWEH.fp9" => {
505                    match val {
506                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.fp9 = Some(v); } }
507                        crate::base::FieldValue::TextList(svs) => {
508                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.fp9 = Some(v); } }
509                        }
510                        _ => {}
511                    }
512                }
513                "GovHydroWEH.gmax" => {
514                    match val {
515                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gmax = Some(v); } }
516                        crate::base::FieldValue::TextList(svs) => {
517                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gmax = Some(v); } }
518                        }
519                        _ => {}
520                    }
521                }
522                "GovHydroWEH.gmin" => {
523                    match val {
524                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gmin = Some(v); } }
525                        crate::base::FieldValue::TextList(svs) => {
526                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gmin = Some(v); } }
527                        }
528                        _ => {}
529                    }
530                }
531                "GovHydroWEH.gtmxcl" => {
532                    match val {
533                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gtmxcl = Some(v); } }
534                        crate::base::FieldValue::TextList(svs) => {
535                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gtmxcl = Some(v); } }
536                        }
537                        _ => {}
538                    }
539                }
540                "GovHydroWEH.gtmxop" => {
541                    match val {
542                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gtmxop = Some(v); } }
543                        crate::base::FieldValue::TextList(svs) => {
544                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gtmxop = Some(v); } }
545                        }
546                        _ => {}
547                    }
548                }
549                "GovHydroWEH.gv1" => {
550                    match val {
551                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv1 = Some(v); } }
552                        crate::base::FieldValue::TextList(svs) => {
553                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv1 = Some(v); } }
554                        }
555                        _ => {}
556                    }
557                }
558                "GovHydroWEH.gv2" => {
559                    match val {
560                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv2 = Some(v); } }
561                        crate::base::FieldValue::TextList(svs) => {
562                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv2 = Some(v); } }
563                        }
564                        _ => {}
565                    }
566                }
567                "GovHydroWEH.gv3" => {
568                    match val {
569                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv3 = Some(v); } }
570                        crate::base::FieldValue::TextList(svs) => {
571                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv3 = Some(v); } }
572                        }
573                        _ => {}
574                    }
575                }
576                "GovHydroWEH.gv4" => {
577                    match val {
578                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv4 = Some(v); } }
579                        crate::base::FieldValue::TextList(svs) => {
580                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv4 = Some(v); } }
581                        }
582                        _ => {}
583                    }
584                }
585                "GovHydroWEH.gv5" => {
586                    match val {
587                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv5 = Some(v); } }
588                        crate::base::FieldValue::TextList(svs) => {
589                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv5 = Some(v); } }
590                        }
591                        _ => {}
592                    }
593                }
594                "GovHydroWEH.kd" => {
595                    match val {
596                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kd = Some(v); } }
597                        crate::base::FieldValue::TextList(svs) => {
598                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kd = Some(v); } }
599                        }
600                        _ => {}
601                    }
602                }
603                "GovHydroWEH.ki" => {
604                    match val {
605                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.ki = Some(v); } }
606                        crate::base::FieldValue::TextList(svs) => {
607                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.ki = Some(v); } }
608                        }
609                        _ => {}
610                    }
611                }
612                "GovHydroWEH.kp" => {
613                    match val {
614                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kp = Some(v); } }
615                        crate::base::FieldValue::TextList(svs) => {
616                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kp = Some(v); } }
617                        }
618                        _ => {}
619                    }
620                }
621                "GovHydroWEH.mwbase" => {
622                    match val {
623                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.mwbase = Some(v); } }
624                        crate::base::FieldValue::TextList(svs) => {
625                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.mwbase = Some(v); } }
626                        }
627                        _ => {}
628                    }
629                }
630                "GovHydroWEH.pmss1" => {
631                    match val {
632                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss1 = Some(v); } }
633                        crate::base::FieldValue::TextList(svs) => {
634                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss1 = Some(v); } }
635                        }
636                        _ => {}
637                    }
638                }
639                "GovHydroWEH.pmss10" => {
640                    match val {
641                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss10 = Some(v); } }
642                        crate::base::FieldValue::TextList(svs) => {
643                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss10 = Some(v); } }
644                        }
645                        _ => {}
646                    }
647                }
648                "GovHydroWEH.pmss2" => {
649                    match val {
650                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss2 = Some(v); } }
651                        crate::base::FieldValue::TextList(svs) => {
652                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss2 = Some(v); } }
653                        }
654                        _ => {}
655                    }
656                }
657                "GovHydroWEH.pmss3" => {
658                    match val {
659                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss3 = Some(v); } }
660                        crate::base::FieldValue::TextList(svs) => {
661                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss3 = Some(v); } }
662                        }
663                        _ => {}
664                    }
665                }
666                "GovHydroWEH.pmss4" => {
667                    match val {
668                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss4 = Some(v); } }
669                        crate::base::FieldValue::TextList(svs) => {
670                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss4 = Some(v); } }
671                        }
672                        _ => {}
673                    }
674                }
675                "GovHydroWEH.pmss5" => {
676                    match val {
677                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss5 = Some(v); } }
678                        crate::base::FieldValue::TextList(svs) => {
679                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss5 = Some(v); } }
680                        }
681                        _ => {}
682                    }
683                }
684                "GovHydroWEH.pmss6" => {
685                    match val {
686                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss6 = Some(v); } }
687                        crate::base::FieldValue::TextList(svs) => {
688                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss6 = Some(v); } }
689                        }
690                        _ => {}
691                    }
692                }
693                "GovHydroWEH.pmss7" => {
694                    match val {
695                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss7 = Some(v); } }
696                        crate::base::FieldValue::TextList(svs) => {
697                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss7 = Some(v); } }
698                        }
699                        _ => {}
700                    }
701                }
702                "GovHydroWEH.pmss8" => {
703                    match val {
704                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss8 = Some(v); } }
705                        crate::base::FieldValue::TextList(svs) => {
706                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss8 = Some(v); } }
707                        }
708                        _ => {}
709                    }
710                }
711                "GovHydroWEH.pmss9" => {
712                    match val {
713                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmss9 = Some(v); } }
714                        crate::base::FieldValue::TextList(svs) => {
715                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmss9 = Some(v); } }
716                        }
717                        _ => {}
718                    }
719                }
720                "GovHydroWEH.rpg" => {
721                    match val {
722                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.rpg = Some(v); } }
723                        crate::base::FieldValue::TextList(svs) => {
724                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.rpg = Some(v); } }
725                        }
726                        _ => {}
727                    }
728                }
729                "GovHydroWEH.rpp" => {
730                    match val {
731                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.rpp = Some(v); } }
732                        crate::base::FieldValue::TextList(svs) => {
733                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.rpp = Some(v); } }
734                        }
735                        _ => {}
736                    }
737                }
738                "GovHydroWEH.td" => {
739                    match val {
740                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.td = Some(v); } }
741                        crate::base::FieldValue::TextList(svs) => {
742                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.td = Some(v); } }
743                        }
744                        _ => {}
745                    }
746                }
747                "GovHydroWEH.tdv" => {
748                    match val {
749                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tdv = Some(v); } }
750                        crate::base::FieldValue::TextList(svs) => {
751                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tdv = Some(v); } }
752                        }
753                        _ => {}
754                    }
755                }
756                "GovHydroWEH.tg" => {
757                    match val {
758                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tg = Some(v); } }
759                        crate::base::FieldValue::TextList(svs) => {
760                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tg = Some(v); } }
761                        }
762                        _ => {}
763                    }
764                }
765                "GovHydroWEH.tp" => {
766                    match val {
767                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tp = Some(v); } }
768                        crate::base::FieldValue::TextList(svs) => {
769                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tp = Some(v); } }
770                        }
771                        _ => {}
772                    }
773                }
774                "GovHydroWEH.tpe" => {
775                    match val {
776                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tpe = Some(v); } }
777                        crate::base::FieldValue::TextList(svs) => {
778                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tpe = Some(v); } }
779                        }
780                        _ => {}
781                    }
782                }
783                "GovHydroWEH.tw" => {
784                    match val {
785                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tw = Some(v); } }
786                        crate::base::FieldValue::TextList(svs) => {
787                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tw = Some(v); } }
788                        }
789                        _ => {}
790                    }
791                }
792                "TurbineGovernorDynamics.AsynchronousMachineDynamics" => {
793                    if let crate::base::FieldValue::Resource(sv) = val {
794                        obj.base.asynchronous_machine_dynamics = Some(crate::base::MridRef { mrid: sv.clone() });
795                    }
796                }
797                "TurbineGovernorDynamics.SynchronousMachineDynamics" => {
798                    if let crate::base::FieldValue::Resource(sv) = val {
799                        obj.base.synchronous_machine_dynamics = Some(crate::base::MridRef { mrid: sv.clone() });
800                    }
801                }
802                "DynamicsFunctionBlock.enabled" => {
803                    match val {
804                        crate::base::FieldValue::Text(sv) => { obj.base.base.enabled = Some(sv.trim() == "true"); }
805                        crate::base::FieldValue::TextList(svs) => {
806                            if let Some(sv) = svs.last() { obj.base.base.enabled = Some(sv.trim() == "true"); }
807                        }
808                        _ => {}
809                    }
810                }
811                "IdentifiedObject.description" => {
812                    match val {
813                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.description = sv.clone(); }
814                        crate::base::FieldValue::TextList(svs) => {
815                            if let Some(sv) = svs.last() { obj.base.base.base.description = sv.clone(); }
816                        }
817                        _ => {}
818                    }
819                }
820                "IdentifiedObject.energyIdentCodeEic" => {
821                    match val {
822                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
823                        crate::base::FieldValue::TextList(svs) => {
824                            if let Some(sv) = svs.last() { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
825                        }
826                        _ => {}
827                    }
828                }
829                "IdentifiedObject.mRID" => {
830                    match val {
831                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.m_rid = sv.clone(); }
832                        crate::base::FieldValue::TextList(svs) => {
833                            if let Some(sv) = svs.last() { obj.base.base.base.m_rid = sv.clone(); }
834                        }
835                        _ => {}
836                    }
837                }
838                "IdentifiedObject.name" => {
839                    match val {
840                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.name = sv.clone(); }
841                        crate::base::FieldValue::TextList(svs) => {
842                            if let Some(sv) = svs.last() { obj.base.base.base.name = sv.clone(); }
843                        }
844                        _ => {}
845                    }
846                }
847                "IdentifiedObject.shortName" => {
848                    match val {
849                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.short_name = sv.clone(); }
850                        crate::base::FieldValue::TextList(svs) => {
851                            if let Some(sv) = svs.last() { obj.base.base.base.short_name = sv.clone(); }
852                        }
853                        _ => {}
854                    }
855                }
856                _ => {}
857            }
858        }
859        obj
860    }
861}