Skip to main content

cimstructs/
GovHydro3.rs

1/// Modified IEEE hydro governor-turbine. This model differs from that defined in the IEEE modelling guideline paper in that the limits on gate position and velocity do not permit 'wind up' of the upstream signals.
2#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)]
3pub struct GovHydro3 {
4    #[serde(flatten)]
5    pub base: super::TurbineGovernorDynamics,
6    /// Turbine gain (At) (>0). Typical value = 1,2.
7    #[serde(skip_serializing_if = "Option::is_none")]
8    pub at: Option<f64>,
9    /// Intentional dead-band width (db1). Unit = Hz. Typical value = 0.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub db1: Option<f64>,
12    /// Unintentional dead-band (db2). Unit = MW. Typical value = 0.
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub db2: Option<f64>,
15    /// Turbine damping factor (Dturb). Typical value = 0,2.
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub dturb: Option<f64>,
18    /// Intentional db hysteresis (eps). Unit = Hz. Typical value = 0.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub eps: Option<f64>,
21    /// Governor control flag (Cflag). true = PID control is active false = double derivative control is active. Typical value = true.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub governor_control: Option<bool>,
24    /// Nonlinear gain point 1, PU gv (Gv1). Typical value = 0.
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub gv1: Option<f64>,
27    /// Nonlinear gain point 2, PU gv (Gv2). Typical value = 0.
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub gv2: Option<f64>,
30    /// Nonlinear gain point 3, PU gv (Gv3). Typical value = 0.
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub gv3: Option<f64>,
33    /// Nonlinear gain point 4, PU gv (Gv4). Typical value = 0.
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub gv4: Option<f64>,
36    /// Nonlinear gain point 5, PU gv (Gv5). Typical value = 0.
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub gv5: Option<f64>,
39    /// Nonlinear gain point 6, PU gv (Gv6). Typical value = 0.
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub gv6: Option<f64>,
42    /// Turbine nominal head (H0). Typical value = 1.
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub h0: Option<f64>,
45    /// Derivative gain (K1). Typical value = 0,01.
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub k1: Option<f64>,
48    /// Double derivative gain, if Cflag = -1 (K2). Typical value = 2,5.
49    #[serde(skip_serializing_if = "Option::is_none")]
50    pub k2: Option<f64>,
51    /// Gate servo gain (Kg). Typical value = 2.
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub kg: Option<f64>,
54    /// Integral gain (Ki). Typical value = 0,5.
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub ki: Option<f64>,
57    /// Base for power values (MWbase) (> 0). Unit = MW.
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub mwbase: Option<f64>,
60    /// Nonlinear gain point 1, PU power (Pgv1). Typical value = 0.
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub pgv1: Option<f64>,
63    /// Nonlinear gain point 2, PU power (Pgv2). Typical value = 0.
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub pgv2: Option<f64>,
66    /// Nonlinear gain point 3, PU power (Pgv3). Typical value = 0.
67    #[serde(skip_serializing_if = "Option::is_none")]
68    pub pgv3: Option<f64>,
69    /// Nonlinear gain point 4, PU power (Pgv4). Typical value = 0.
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub pgv4: Option<f64>,
72    /// Nonlinear gain point 5, PU power (Pgv5). Typical value = 0.
73    #[serde(skip_serializing_if = "Option::is_none")]
74    pub pgv5: Option<f64>,
75    /// Nonlinear gain point 6, PU power (Pgv6). Typical value = 0.
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub pgv6: Option<f64>,
78    /// Maximum gate opening, PU of MWbase (Pmax) (> GovHydro3.pmin). Typical value = 1.
79    #[serde(skip_serializing_if = "Option::is_none")]
80    pub pmax: Option<f64>,
81    /// Minimum gate opening, PU of MWbase (Pmin) (< GovHydro3.pmax). Typical value = 0.
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub pmin: Option<f64>,
84    /// No-load turbine flow at nominal head (Qnl). Typical value = 0,08.
85    #[serde(skip_serializing_if = "Option::is_none")]
86    pub qnl: Option<f64>,
87    /// Steady-state droop, PU, for electrical power feedback (Relec). Typical value = 0,05.
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub relec: Option<f64>,
90    /// Steady-state droop, PU, for governor output feedback (Rgate). Typical value = 0.
91    #[serde(skip_serializing_if = "Option::is_none")]
92    pub rgate: Option<f64>,
93    /// Input filter time constant (Td) (>= 0). Typical value = 0,05.
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub td: Option<f64>,
96    /// Washout time constant (Tf) (>= 0). Typical value = 0,1.
97    #[serde(skip_serializing_if = "Option::is_none")]
98    pub tf: Option<f64>,
99    /// Gate servo time constant (Tp) (>= 0). Typical value = 0,05.
100    #[serde(skip_serializing_if = "Option::is_none")]
101    pub tp: Option<f64>,
102    /// Power feedback time constant (Tt) (>= 0). Typical value = 0,2.
103    #[serde(skip_serializing_if = "Option::is_none")]
104    pub tt: Option<f64>,
105    /// Water inertia time constant (Tw) (>= 0). If = 0, block is bypassed. Typical value = 1.
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub tw: Option<f64>,
108    /// Maximum gate closing velocity (Velcl). Unit = PU / s. Typical value = -0,2.
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub velcl: Option<f64>,
111    /// Maximum gate opening velocity (Velop). Unit = PU / s. Typical value = 0,2.
112    #[serde(skip_serializing_if = "Option::is_none")]
113    pub velop: Option<f64>,
114}
115impl crate::base::CimElement for GovHydro3 {
116    fn mrid(&self) -> &str { &self.base.base.base.id }
117    fn type_name(&self) -> &'static str { "GovHydro3" }
118    fn as_any(&self) -> &dyn std::any::Any { self }
119    fn to_json_value(&self) -> serde_json::Value {
120        serde_json::to_value(self).unwrap_or(serde_json::Value::Null)
121    }
122    fn to_block(&self) -> crate::base::RdfBlock {
123        let mut block = self.base.to_block();
124        block.type_name = "GovHydro3".to_string();
125        if let Some(v) = self.at {
126            block.fields.insert("GovHydro3.at".into(), crate::base::FieldValue::Text(v.to_string()));
127        }
128        if let Some(v) = self.db1 {
129            block.fields.insert("GovHydro3.db1".into(), crate::base::FieldValue::Text(v.to_string()));
130        }
131        if let Some(v) = self.db2 {
132            block.fields.insert("GovHydro3.db2".into(), crate::base::FieldValue::Text(v.to_string()));
133        }
134        if let Some(v) = self.dturb {
135            block.fields.insert("GovHydro3.dturb".into(), crate::base::FieldValue::Text(v.to_string()));
136        }
137        if let Some(v) = self.eps {
138            block.fields.insert("GovHydro3.eps".into(), crate::base::FieldValue::Text(v.to_string()));
139        }
140        if let Some(v) = self.governor_control {
141            block.fields.insert("GovHydro3.governorControl".into(), crate::base::FieldValue::Text(v.to_string()));
142        }
143        if let Some(v) = self.gv1 {
144            block.fields.insert("GovHydro3.gv1".into(), crate::base::FieldValue::Text(v.to_string()));
145        }
146        if let Some(v) = self.gv2 {
147            block.fields.insert("GovHydro3.gv2".into(), crate::base::FieldValue::Text(v.to_string()));
148        }
149        if let Some(v) = self.gv3 {
150            block.fields.insert("GovHydro3.gv3".into(), crate::base::FieldValue::Text(v.to_string()));
151        }
152        if let Some(v) = self.gv4 {
153            block.fields.insert("GovHydro3.gv4".into(), crate::base::FieldValue::Text(v.to_string()));
154        }
155        if let Some(v) = self.gv5 {
156            block.fields.insert("GovHydro3.gv5".into(), crate::base::FieldValue::Text(v.to_string()));
157        }
158        if let Some(v) = self.gv6 {
159            block.fields.insert("GovHydro3.gv6".into(), crate::base::FieldValue::Text(v.to_string()));
160        }
161        if let Some(v) = self.h0 {
162            block.fields.insert("GovHydro3.h0".into(), crate::base::FieldValue::Text(v.to_string()));
163        }
164        if let Some(v) = self.k1 {
165            block.fields.insert("GovHydro3.k1".into(), crate::base::FieldValue::Text(v.to_string()));
166        }
167        if let Some(v) = self.k2 {
168            block.fields.insert("GovHydro3.k2".into(), crate::base::FieldValue::Text(v.to_string()));
169        }
170        if let Some(v) = self.kg {
171            block.fields.insert("GovHydro3.kg".into(), crate::base::FieldValue::Text(v.to_string()));
172        }
173        if let Some(v) = self.ki {
174            block.fields.insert("GovHydro3.ki".into(), crate::base::FieldValue::Text(v.to_string()));
175        }
176        if let Some(v) = self.mwbase {
177            block.fields.insert("GovHydro3.mwbase".into(), crate::base::FieldValue::Text(v.to_string()));
178        }
179        if let Some(v) = self.pgv1 {
180            block.fields.insert("GovHydro3.pgv1".into(), crate::base::FieldValue::Text(v.to_string()));
181        }
182        if let Some(v) = self.pgv2 {
183            block.fields.insert("GovHydro3.pgv2".into(), crate::base::FieldValue::Text(v.to_string()));
184        }
185        if let Some(v) = self.pgv3 {
186            block.fields.insert("GovHydro3.pgv3".into(), crate::base::FieldValue::Text(v.to_string()));
187        }
188        if let Some(v) = self.pgv4 {
189            block.fields.insert("GovHydro3.pgv4".into(), crate::base::FieldValue::Text(v.to_string()));
190        }
191        if let Some(v) = self.pgv5 {
192            block.fields.insert("GovHydro3.pgv5".into(), crate::base::FieldValue::Text(v.to_string()));
193        }
194        if let Some(v) = self.pgv6 {
195            block.fields.insert("GovHydro3.pgv6".into(), crate::base::FieldValue::Text(v.to_string()));
196        }
197        if let Some(v) = self.pmax {
198            block.fields.insert("GovHydro3.pmax".into(), crate::base::FieldValue::Text(v.to_string()));
199        }
200        if let Some(v) = self.pmin {
201            block.fields.insert("GovHydro3.pmin".into(), crate::base::FieldValue::Text(v.to_string()));
202        }
203        if let Some(v) = self.qnl {
204            block.fields.insert("GovHydro3.qnl".into(), crate::base::FieldValue::Text(v.to_string()));
205        }
206        if let Some(v) = self.relec {
207            block.fields.insert("GovHydro3.relec".into(), crate::base::FieldValue::Text(v.to_string()));
208        }
209        if let Some(v) = self.rgate {
210            block.fields.insert("GovHydro3.rgate".into(), crate::base::FieldValue::Text(v.to_string()));
211        }
212        if let Some(v) = self.td {
213            block.fields.insert("GovHydro3.td".into(), crate::base::FieldValue::Text(v.to_string()));
214        }
215        if let Some(v) = self.tf {
216            block.fields.insert("GovHydro3.tf".into(), crate::base::FieldValue::Text(v.to_string()));
217        }
218        if let Some(v) = self.tp {
219            block.fields.insert("GovHydro3.tp".into(), crate::base::FieldValue::Text(v.to_string()));
220        }
221        if let Some(v) = self.tt {
222            block.fields.insert("GovHydro3.tt".into(), crate::base::FieldValue::Text(v.to_string()));
223        }
224        if let Some(v) = self.tw {
225            block.fields.insert("GovHydro3.tw".into(), crate::base::FieldValue::Text(v.to_string()));
226        }
227        if let Some(v) = self.velcl {
228            block.fields.insert("GovHydro3.velcl".into(), crate::base::FieldValue::Text(v.to_string()));
229        }
230        if let Some(v) = self.velop {
231            block.fields.insert("GovHydro3.velop".into(), crate::base::FieldValue::Text(v.to_string()));
232        }
233        block
234    }
235}
236
237impl GovHydro3 {
238    pub fn from_block(b: &crate::base::RdfBlock) -> Self {
239        let mut obj = Self::default();
240        obj.base.base.base.id.clone_from(&b.mrid);
241        for (key, val) in &b.fields {
242            match key.as_str() {
243                "GovHydro3.at" => {
244                    match val {
245                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.at = Some(v); } }
246                        crate::base::FieldValue::TextList(svs) => {
247                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.at = Some(v); } }
248                        }
249                        _ => {}
250                    }
251                }
252                "GovHydro3.db1" => {
253                    match val {
254                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.db1 = Some(v); } }
255                        crate::base::FieldValue::TextList(svs) => {
256                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.db1 = Some(v); } }
257                        }
258                        _ => {}
259                    }
260                }
261                "GovHydro3.db2" => {
262                    match val {
263                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.db2 = Some(v); } }
264                        crate::base::FieldValue::TextList(svs) => {
265                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.db2 = Some(v); } }
266                        }
267                        _ => {}
268                    }
269                }
270                "GovHydro3.dturb" => {
271                    match val {
272                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.dturb = Some(v); } }
273                        crate::base::FieldValue::TextList(svs) => {
274                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.dturb = Some(v); } }
275                        }
276                        _ => {}
277                    }
278                }
279                "GovHydro3.eps" => {
280                    match val {
281                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.eps = Some(v); } }
282                        crate::base::FieldValue::TextList(svs) => {
283                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.eps = Some(v); } }
284                        }
285                        _ => {}
286                    }
287                }
288                "GovHydro3.governorControl" => {
289                    match val {
290                        crate::base::FieldValue::Text(sv) => { obj.governor_control = Some(sv.trim() == "true"); }
291                        crate::base::FieldValue::TextList(svs) => {
292                            if let Some(sv) = svs.last() { obj.governor_control = Some(sv.trim() == "true"); }
293                        }
294                        _ => {}
295                    }
296                }
297                "GovHydro3.gv1" => {
298                    match val {
299                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv1 = Some(v); } }
300                        crate::base::FieldValue::TextList(svs) => {
301                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv1 = Some(v); } }
302                        }
303                        _ => {}
304                    }
305                }
306                "GovHydro3.gv2" => {
307                    match val {
308                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv2 = Some(v); } }
309                        crate::base::FieldValue::TextList(svs) => {
310                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv2 = Some(v); } }
311                        }
312                        _ => {}
313                    }
314                }
315                "GovHydro3.gv3" => {
316                    match val {
317                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv3 = Some(v); } }
318                        crate::base::FieldValue::TextList(svs) => {
319                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv3 = Some(v); } }
320                        }
321                        _ => {}
322                    }
323                }
324                "GovHydro3.gv4" => {
325                    match val {
326                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv4 = Some(v); } }
327                        crate::base::FieldValue::TextList(svs) => {
328                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv4 = Some(v); } }
329                        }
330                        _ => {}
331                    }
332                }
333                "GovHydro3.gv5" => {
334                    match val {
335                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv5 = Some(v); } }
336                        crate::base::FieldValue::TextList(svs) => {
337                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv5 = Some(v); } }
338                        }
339                        _ => {}
340                    }
341                }
342                "GovHydro3.gv6" => {
343                    match val {
344                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv6 = Some(v); } }
345                        crate::base::FieldValue::TextList(svs) => {
346                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv6 = Some(v); } }
347                        }
348                        _ => {}
349                    }
350                }
351                "GovHydro3.h0" => {
352                    match val {
353                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.h0 = Some(v); } }
354                        crate::base::FieldValue::TextList(svs) => {
355                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.h0 = Some(v); } }
356                        }
357                        _ => {}
358                    }
359                }
360                "GovHydro3.k1" => {
361                    match val {
362                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.k1 = Some(v); } }
363                        crate::base::FieldValue::TextList(svs) => {
364                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.k1 = Some(v); } }
365                        }
366                        _ => {}
367                    }
368                }
369                "GovHydro3.k2" => {
370                    match val {
371                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.k2 = Some(v); } }
372                        crate::base::FieldValue::TextList(svs) => {
373                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.k2 = Some(v); } }
374                        }
375                        _ => {}
376                    }
377                }
378                "GovHydro3.kg" => {
379                    match val {
380                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kg = Some(v); } }
381                        crate::base::FieldValue::TextList(svs) => {
382                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kg = Some(v); } }
383                        }
384                        _ => {}
385                    }
386                }
387                "GovHydro3.ki" => {
388                    match val {
389                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.ki = Some(v); } }
390                        crate::base::FieldValue::TextList(svs) => {
391                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.ki = Some(v); } }
392                        }
393                        _ => {}
394                    }
395                }
396                "GovHydro3.mwbase" => {
397                    match val {
398                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.mwbase = Some(v); } }
399                        crate::base::FieldValue::TextList(svs) => {
400                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.mwbase = Some(v); } }
401                        }
402                        _ => {}
403                    }
404                }
405                "GovHydro3.pgv1" => {
406                    match val {
407                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv1 = Some(v); } }
408                        crate::base::FieldValue::TextList(svs) => {
409                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv1 = Some(v); } }
410                        }
411                        _ => {}
412                    }
413                }
414                "GovHydro3.pgv2" => {
415                    match val {
416                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv2 = Some(v); } }
417                        crate::base::FieldValue::TextList(svs) => {
418                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv2 = Some(v); } }
419                        }
420                        _ => {}
421                    }
422                }
423                "GovHydro3.pgv3" => {
424                    match val {
425                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv3 = Some(v); } }
426                        crate::base::FieldValue::TextList(svs) => {
427                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv3 = Some(v); } }
428                        }
429                        _ => {}
430                    }
431                }
432                "GovHydro3.pgv4" => {
433                    match val {
434                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv4 = Some(v); } }
435                        crate::base::FieldValue::TextList(svs) => {
436                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv4 = Some(v); } }
437                        }
438                        _ => {}
439                    }
440                }
441                "GovHydro3.pgv5" => {
442                    match val {
443                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv5 = Some(v); } }
444                        crate::base::FieldValue::TextList(svs) => {
445                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv5 = Some(v); } }
446                        }
447                        _ => {}
448                    }
449                }
450                "GovHydro3.pgv6" => {
451                    match val {
452                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv6 = Some(v); } }
453                        crate::base::FieldValue::TextList(svs) => {
454                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv6 = Some(v); } }
455                        }
456                        _ => {}
457                    }
458                }
459                "GovHydro3.pmax" => {
460                    match val {
461                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmax = Some(v); } }
462                        crate::base::FieldValue::TextList(svs) => {
463                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmax = Some(v); } }
464                        }
465                        _ => {}
466                    }
467                }
468                "GovHydro3.pmin" => {
469                    match val {
470                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pmin = Some(v); } }
471                        crate::base::FieldValue::TextList(svs) => {
472                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pmin = Some(v); } }
473                        }
474                        _ => {}
475                    }
476                }
477                "GovHydro3.qnl" => {
478                    match val {
479                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.qnl = Some(v); } }
480                        crate::base::FieldValue::TextList(svs) => {
481                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.qnl = Some(v); } }
482                        }
483                        _ => {}
484                    }
485                }
486                "GovHydro3.relec" => {
487                    match val {
488                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.relec = Some(v); } }
489                        crate::base::FieldValue::TextList(svs) => {
490                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.relec = Some(v); } }
491                        }
492                        _ => {}
493                    }
494                }
495                "GovHydro3.rgate" => {
496                    match val {
497                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.rgate = Some(v); } }
498                        crate::base::FieldValue::TextList(svs) => {
499                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.rgate = Some(v); } }
500                        }
501                        _ => {}
502                    }
503                }
504                "GovHydro3.td" => {
505                    match val {
506                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.td = Some(v); } }
507                        crate::base::FieldValue::TextList(svs) => {
508                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.td = Some(v); } }
509                        }
510                        _ => {}
511                    }
512                }
513                "GovHydro3.tf" => {
514                    match val {
515                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tf = Some(v); } }
516                        crate::base::FieldValue::TextList(svs) => {
517                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tf = Some(v); } }
518                        }
519                        _ => {}
520                    }
521                }
522                "GovHydro3.tp" => {
523                    match val {
524                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tp = Some(v); } }
525                        crate::base::FieldValue::TextList(svs) => {
526                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tp = Some(v); } }
527                        }
528                        _ => {}
529                    }
530                }
531                "GovHydro3.tt" => {
532                    match val {
533                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tt = Some(v); } }
534                        crate::base::FieldValue::TextList(svs) => {
535                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tt = Some(v); } }
536                        }
537                        _ => {}
538                    }
539                }
540                "GovHydro3.tw" => {
541                    match val {
542                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tw = Some(v); } }
543                        crate::base::FieldValue::TextList(svs) => {
544                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tw = Some(v); } }
545                        }
546                        _ => {}
547                    }
548                }
549                "GovHydro3.velcl" => {
550                    match val {
551                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.velcl = Some(v); } }
552                        crate::base::FieldValue::TextList(svs) => {
553                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.velcl = Some(v); } }
554                        }
555                        _ => {}
556                    }
557                }
558                "GovHydro3.velop" => {
559                    match val {
560                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.velop = Some(v); } }
561                        crate::base::FieldValue::TextList(svs) => {
562                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.velop = Some(v); } }
563                        }
564                        _ => {}
565                    }
566                }
567                "TurbineGovernorDynamics.AsynchronousMachineDynamics" => {
568                    if let crate::base::FieldValue::Resource(sv) = val {
569                        obj.base.asynchronous_machine_dynamics = Some(crate::base::MridRef { mrid: sv.clone() });
570                    }
571                }
572                "TurbineGovernorDynamics.SynchronousMachineDynamics" => {
573                    if let crate::base::FieldValue::Resource(sv) = val {
574                        obj.base.synchronous_machine_dynamics = Some(crate::base::MridRef { mrid: sv.clone() });
575                    }
576                }
577                "DynamicsFunctionBlock.enabled" => {
578                    match val {
579                        crate::base::FieldValue::Text(sv) => { obj.base.base.enabled = Some(sv.trim() == "true"); }
580                        crate::base::FieldValue::TextList(svs) => {
581                            if let Some(sv) = svs.last() { obj.base.base.enabled = Some(sv.trim() == "true"); }
582                        }
583                        _ => {}
584                    }
585                }
586                "IdentifiedObject.description" => {
587                    match val {
588                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.description = sv.clone(); }
589                        crate::base::FieldValue::TextList(svs) => {
590                            if let Some(sv) = svs.last() { obj.base.base.base.description = sv.clone(); }
591                        }
592                        _ => {}
593                    }
594                }
595                "IdentifiedObject.energyIdentCodeEic" => {
596                    match val {
597                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
598                        crate::base::FieldValue::TextList(svs) => {
599                            if let Some(sv) = svs.last() { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
600                        }
601                        _ => {}
602                    }
603                }
604                "IdentifiedObject.mRID" => {
605                    match val {
606                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.m_rid = sv.clone(); }
607                        crate::base::FieldValue::TextList(svs) => {
608                            if let Some(sv) = svs.last() { obj.base.base.base.m_rid = sv.clone(); }
609                        }
610                        _ => {}
611                    }
612                }
613                "IdentifiedObject.name" => {
614                    match val {
615                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.name = sv.clone(); }
616                        crate::base::FieldValue::TextList(svs) => {
617                            if let Some(sv) = svs.last() { obj.base.base.base.name = sv.clone(); }
618                        }
619                        _ => {}
620                    }
621                }
622                "IdentifiedObject.shortName" => {
623                    match val {
624                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.short_name = sv.clone(); }
625                        crate::base::FieldValue::TextList(svs) => {
626                            if let Some(sv) = svs.last() { obj.base.base.base.short_name = sv.clone(); }
627                        }
628                        _ => {}
629                    }
630                }
631                _ => {}
632            }
633        }
634        obj
635    }
636}