Skip to main content

cimstructs/
GovHydro4.rs

1/// Hydro turbine and governor. Represents plants with straight-forward penstock configurations and hydraulic governors of the traditional 'dashpot' type. This model can be used to represent simple, Francis/Pelton or Kaplan turbines.
2#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)]
3pub struct GovHydro4 {
4    #[serde(flatten)]
5    pub base: super::TurbineGovernorDynamics,
6    /// Turbine gain (At). Typical value = 1,2.
7    #[serde(skip_serializing_if = "Option::is_none")]
8    pub at: Option<f64>,
9    /// Kaplan blade servo point 0 (Bgv0) (= 0 for simple, = 0 for Francis/Pelton). Typical value for Kaplan = 0.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub bgv0: Option<f64>,
12    /// Kaplan blade servo point 1 (Bgv1) (= 0 for simple, = 0 for Francis/Pelton). Typical value for Kaplan = 0.
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub bgv1: Option<f64>,
15    /// Kaplan blade servo point 2 (Bgv2) (= 0 for simple, = 0 for Francis/Pelton). Typical value for Kaplan = 0,1.
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub bgv2: Option<f64>,
18    /// Kaplan blade servo point 3 (Bgv3) (= 0 for simple, = 0 for Francis/Pelton). Typical value for Kaplan = 0,667.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub bgv3: Option<f64>,
21    /// Kaplan blade servo point 4 (Bgv4) (= 0 for simple, = 0 for Francis/Pelton). Typical value for Kaplan = 0,9.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub bgv4: Option<f64>,
24    /// Kaplan blade servo point 5 (Bgv5) (= 0 for simple, = 0 for Francis/Pelton). Typical value for Kaplan = 1.
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub bgv5: Option<f64>,
27    /// Maximum blade adjustment factor (Bmax) (= 0 for simple, = 0 for Francis/Pelton). Typical value for Kaplan = 1,1276.
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub bmax: Option<f64>,
30    /// Intentional deadband width (db1). Unit = Hz. Typical value = 0.
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub db1: Option<f64>,
33    /// Unintentional dead-band (db2). Unit = MW. Typical value = 0.
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub db2: Option<f64>,
36    /// Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Typical value for simple = 0,5, Francis/Pelton = 1,1, Kaplan = 1,1.
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub dturb: Option<f64>,
39    /// Intentional db hysteresis (eps). Unit = Hz. Typical value = 0.
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub eps: Option<f64>,
42    /// Maximum gate opening, PU of MWbase (Gmax) (> GovHydro4.gmin). Typical value = 1.
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub gmax: Option<f64>,
45    /// Minimum gate opening, PU of MWbase (Gmin) (< GovHydro4.gmax). Typical value = 0.
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub gmin: Option<f64>,
48    /// Nonlinear gain point 0, PU gv (Gv0) (= 0 for simple). Typical for Francis/Pelton = 0,1, Kaplan = 0,1.
49    #[serde(skip_serializing_if = "Option::is_none")]
50    pub gv0: Option<f64>,
51    /// Nonlinear gain point 1, PU gv (Gv1) (= 0 for simple, > GovHydro4.gv0 for Francis/Pelton and Kaplan). Typical value for Francis/Pelton = 0,4, Kaplan = 0,4.
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub gv1: Option<f64>,
54    /// Nonlinear gain point 2, PU gv (Gv2) (= 0 for simple, > GovHydro4.gv1 for Francis/Pelton and Kaplan). Typical value for Francis/Pelton = 0,5, Kaplan = 0,5.
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub gv2: Option<f64>,
57    /// Nonlinear gain point 3, PU gv (Gv3) (= 0 for simple, > GovHydro4.gv2 for Francis/Pelton and Kaplan). Typical value for Francis/Pelton = 0,7, Kaplan = 0,7.
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub gv3: Option<f64>,
60    /// Nonlinear gain point 4, PU gv (Gv4) (= 0 for simple, > GovHydro4.gv3 for Francis/Pelton and Kaplan). Typical value for Francis/Pelton = 0,8, Kaplan = 0,8.
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub gv4: Option<f64>,
63    /// Nonlinear gain point 5, PU gv (Gv5) (= 0 for simple, < 1 and > GovHydro4.gv4 for Francis/Pelton and Kaplan). Typical value for Francis/Pelton = 0,9, Kaplan = 0,9.
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub gv5: Option<f64>,
66    /// Head available at dam (hdam). Typical value = 1.
67    #[serde(skip_serializing_if = "Option::is_none")]
68    pub hdam: Option<f64>,
69    /// The kind of model being represented (simple, Francis/Pelton or Kaplan).
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub model: Option<super::base::UriRef>,
72    /// Base for power values (MWbase) (> 0). Unit = MW.
73    #[serde(skip_serializing_if = "Option::is_none")]
74    pub mwbase: Option<f64>,
75    /// Nonlinear gain point 0, PU power (Pgv0) (= 0 for simple). Typical value = 0.
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub pgv0: Option<f64>,
78    /// Nonlinear gain point 1, PU power (Pgv1) (= 0 for simple). Typical value for Francis/Pelton = 0,42, Kaplan = 0,35.
79    #[serde(skip_serializing_if = "Option::is_none")]
80    pub pgv1: Option<f64>,
81    /// Nonlinear gain point 2, PU power (Pgv2) (= 0 for simple). Typical value for Francis/Pelton = 0,56, Kaplan = 0,468.
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub pgv2: Option<f64>,
84    /// Nonlinear gain point 3, PU power (Pgv3) (= 0 for simple). Typical value for Francis/Pelton = 0,8, Kaplan = 0,796.
85    #[serde(skip_serializing_if = "Option::is_none")]
86    pub pgv3: Option<f64>,
87    /// Nonlinear gain point 4, PU power (Pgv4) (= 0 for simple). Typical value for Francis/Pelton = 0,9, Kaplan = 0,917.
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub pgv4: Option<f64>,
90    /// Nonlinear gain point 5, PU power (Pgv5) (= 0 for simple). Typical value for Francis/Pelton = 0,97, Kaplan = 0,99.
91    #[serde(skip_serializing_if = "Option::is_none")]
92    pub pgv5: Option<f64>,
93    /// No-load flow at nominal head (Qnl). Typical value for simple = 0,08, Francis/Pelton = 0, Kaplan = 0.
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub qnl: Option<f64>,
96    /// Permanent droop (Rperm) (>= 0). Typical value = 0,05.
97    #[serde(skip_serializing_if = "Option::is_none")]
98    pub rperm: Option<f64>,
99    /// Temporary droop (Rtemp) (>= 0). Typical value = 0,3.
100    #[serde(skip_serializing_if = "Option::is_none")]
101    pub rtemp: Option<f64>,
102    /// Blade servo time constant (Tblade) (>= 0). Typical value = 100.
103    #[serde(skip_serializing_if = "Option::is_none")]
104    pub tblade: Option<f64>,
105    /// Gate servo time constant (Tg) (> 0). Typical value = 0,5.
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub tg: Option<f64>,
108    /// Pilot servo time constant (Tp) (>= 0). Typical value = 0,1.
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub tp: Option<f64>,
111    /// Dashpot time constant (Tr) (>= 0). Typical value = 5.
112    #[serde(skip_serializing_if = "Option::is_none")]
113    pub tr: Option<f64>,
114    /// Water inertia time constant (Tw) (> 0). Typical value = 1.
115    #[serde(skip_serializing_if = "Option::is_none")]
116    pub tw: Option<f64>,
117    /// Max gate closing velocity (Uc). Typical value = 0,2.
118    #[serde(skip_serializing_if = "Option::is_none")]
119    pub uc: Option<f64>,
120    /// Max gate opening velocity (Uo). Typical value = 0,2.
121    #[serde(skip_serializing_if = "Option::is_none")]
122    pub uo: Option<f64>,
123}
124impl crate::base::CimElement for GovHydro4 {
125    fn mrid(&self) -> &str { &self.base.base.base.id }
126    fn type_name(&self) -> &'static str { "GovHydro4" }
127    fn as_any(&self) -> &dyn std::any::Any { self }
128    fn to_json_value(&self) -> serde_json::Value {
129        serde_json::to_value(self).unwrap_or(serde_json::Value::Null)
130    }
131    fn to_block(&self) -> crate::base::RdfBlock {
132        let mut block = self.base.to_block();
133        block.type_name = "GovHydro4".to_string();
134        if let Some(v) = self.at {
135            block.fields.insert("GovHydro4.at".into(), crate::base::FieldValue::Text(v.to_string()));
136        }
137        if let Some(v) = self.bgv0 {
138            block.fields.insert("GovHydro4.bgv0".into(), crate::base::FieldValue::Text(v.to_string()));
139        }
140        if let Some(v) = self.bgv1 {
141            block.fields.insert("GovHydro4.bgv1".into(), crate::base::FieldValue::Text(v.to_string()));
142        }
143        if let Some(v) = self.bgv2 {
144            block.fields.insert("GovHydro4.bgv2".into(), crate::base::FieldValue::Text(v.to_string()));
145        }
146        if let Some(v) = self.bgv3 {
147            block.fields.insert("GovHydro4.bgv3".into(), crate::base::FieldValue::Text(v.to_string()));
148        }
149        if let Some(v) = self.bgv4 {
150            block.fields.insert("GovHydro4.bgv4".into(), crate::base::FieldValue::Text(v.to_string()));
151        }
152        if let Some(v) = self.bgv5 {
153            block.fields.insert("GovHydro4.bgv5".into(), crate::base::FieldValue::Text(v.to_string()));
154        }
155        if let Some(v) = self.bmax {
156            block.fields.insert("GovHydro4.bmax".into(), crate::base::FieldValue::Text(v.to_string()));
157        }
158        if let Some(v) = self.db1 {
159            block.fields.insert("GovHydro4.db1".into(), crate::base::FieldValue::Text(v.to_string()));
160        }
161        if let Some(v) = self.db2 {
162            block.fields.insert("GovHydro4.db2".into(), crate::base::FieldValue::Text(v.to_string()));
163        }
164        if let Some(v) = self.dturb {
165            block.fields.insert("GovHydro4.dturb".into(), crate::base::FieldValue::Text(v.to_string()));
166        }
167        if let Some(v) = self.eps {
168            block.fields.insert("GovHydro4.eps".into(), crate::base::FieldValue::Text(v.to_string()));
169        }
170        if let Some(v) = self.gmax {
171            block.fields.insert("GovHydro4.gmax".into(), crate::base::FieldValue::Text(v.to_string()));
172        }
173        if let Some(v) = self.gmin {
174            block.fields.insert("GovHydro4.gmin".into(), crate::base::FieldValue::Text(v.to_string()));
175        }
176        if let Some(v) = self.gv0 {
177            block.fields.insert("GovHydro4.gv0".into(), crate::base::FieldValue::Text(v.to_string()));
178        }
179        if let Some(v) = self.gv1 {
180            block.fields.insert("GovHydro4.gv1".into(), crate::base::FieldValue::Text(v.to_string()));
181        }
182        if let Some(v) = self.gv2 {
183            block.fields.insert("GovHydro4.gv2".into(), crate::base::FieldValue::Text(v.to_string()));
184        }
185        if let Some(v) = self.gv3 {
186            block.fields.insert("GovHydro4.gv3".into(), crate::base::FieldValue::Text(v.to_string()));
187        }
188        if let Some(v) = self.gv4 {
189            block.fields.insert("GovHydro4.gv4".into(), crate::base::FieldValue::Text(v.to_string()));
190        }
191        if let Some(v) = self.gv5 {
192            block.fields.insert("GovHydro4.gv5".into(), crate::base::FieldValue::Text(v.to_string()));
193        }
194        if let Some(v) = self.hdam {
195            block.fields.insert("GovHydro4.hdam".into(), crate::base::FieldValue::Text(v.to_string()));
196        }
197        if let Some(ref v) = self.model {
198            block.fields.insert("GovHydro4.model".into(), crate::base::FieldValue::Resource(v.uri.clone()));
199        }
200        if let Some(v) = self.mwbase {
201            block.fields.insert("GovHydro4.mwbase".into(), crate::base::FieldValue::Text(v.to_string()));
202        }
203        if let Some(v) = self.pgv0 {
204            block.fields.insert("GovHydro4.pgv0".into(), crate::base::FieldValue::Text(v.to_string()));
205        }
206        if let Some(v) = self.pgv1 {
207            block.fields.insert("GovHydro4.pgv1".into(), crate::base::FieldValue::Text(v.to_string()));
208        }
209        if let Some(v) = self.pgv2 {
210            block.fields.insert("GovHydro4.pgv2".into(), crate::base::FieldValue::Text(v.to_string()));
211        }
212        if let Some(v) = self.pgv3 {
213            block.fields.insert("GovHydro4.pgv3".into(), crate::base::FieldValue::Text(v.to_string()));
214        }
215        if let Some(v) = self.pgv4 {
216            block.fields.insert("GovHydro4.pgv4".into(), crate::base::FieldValue::Text(v.to_string()));
217        }
218        if let Some(v) = self.pgv5 {
219            block.fields.insert("GovHydro4.pgv5".into(), crate::base::FieldValue::Text(v.to_string()));
220        }
221        if let Some(v) = self.qnl {
222            block.fields.insert("GovHydro4.qnl".into(), crate::base::FieldValue::Text(v.to_string()));
223        }
224        if let Some(v) = self.rperm {
225            block.fields.insert("GovHydro4.rperm".into(), crate::base::FieldValue::Text(v.to_string()));
226        }
227        if let Some(v) = self.rtemp {
228            block.fields.insert("GovHydro4.rtemp".into(), crate::base::FieldValue::Text(v.to_string()));
229        }
230        if let Some(v) = self.tblade {
231            block.fields.insert("GovHydro4.tblade".into(), crate::base::FieldValue::Text(v.to_string()));
232        }
233        if let Some(v) = self.tg {
234            block.fields.insert("GovHydro4.tg".into(), crate::base::FieldValue::Text(v.to_string()));
235        }
236        if let Some(v) = self.tp {
237            block.fields.insert("GovHydro4.tp".into(), crate::base::FieldValue::Text(v.to_string()));
238        }
239        if let Some(v) = self.tr {
240            block.fields.insert("GovHydro4.tr".into(), crate::base::FieldValue::Text(v.to_string()));
241        }
242        if let Some(v) = self.tw {
243            block.fields.insert("GovHydro4.tw".into(), crate::base::FieldValue::Text(v.to_string()));
244        }
245        if let Some(v) = self.uc {
246            block.fields.insert("GovHydro4.uc".into(), crate::base::FieldValue::Text(v.to_string()));
247        }
248        if let Some(v) = self.uo {
249            block.fields.insert("GovHydro4.uo".into(), crate::base::FieldValue::Text(v.to_string()));
250        }
251        block
252    }
253}
254
255impl GovHydro4 {
256    pub fn from_block(b: &crate::base::RdfBlock) -> Self {
257        let mut obj = Self::default();
258        obj.base.base.base.id.clone_from(&b.mrid);
259        for (key, val) in &b.fields {
260            match key.as_str() {
261                "GovHydro4.at" => {
262                    match val {
263                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.at = Some(v); } }
264                        crate::base::FieldValue::TextList(svs) => {
265                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.at = Some(v); } }
266                        }
267                        _ => {}
268                    }
269                }
270                "GovHydro4.bgv0" => {
271                    match val {
272                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.bgv0 = Some(v); } }
273                        crate::base::FieldValue::TextList(svs) => {
274                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.bgv0 = Some(v); } }
275                        }
276                        _ => {}
277                    }
278                }
279                "GovHydro4.bgv1" => {
280                    match val {
281                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.bgv1 = Some(v); } }
282                        crate::base::FieldValue::TextList(svs) => {
283                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.bgv1 = Some(v); } }
284                        }
285                        _ => {}
286                    }
287                }
288                "GovHydro4.bgv2" => {
289                    match val {
290                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.bgv2 = Some(v); } }
291                        crate::base::FieldValue::TextList(svs) => {
292                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.bgv2 = Some(v); } }
293                        }
294                        _ => {}
295                    }
296                }
297                "GovHydro4.bgv3" => {
298                    match val {
299                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.bgv3 = Some(v); } }
300                        crate::base::FieldValue::TextList(svs) => {
301                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.bgv3 = Some(v); } }
302                        }
303                        _ => {}
304                    }
305                }
306                "GovHydro4.bgv4" => {
307                    match val {
308                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.bgv4 = Some(v); } }
309                        crate::base::FieldValue::TextList(svs) => {
310                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.bgv4 = Some(v); } }
311                        }
312                        _ => {}
313                    }
314                }
315                "GovHydro4.bgv5" => {
316                    match val {
317                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.bgv5 = Some(v); } }
318                        crate::base::FieldValue::TextList(svs) => {
319                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.bgv5 = Some(v); } }
320                        }
321                        _ => {}
322                    }
323                }
324                "GovHydro4.bmax" => {
325                    match val {
326                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.bmax = Some(v); } }
327                        crate::base::FieldValue::TextList(svs) => {
328                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.bmax = Some(v); } }
329                        }
330                        _ => {}
331                    }
332                }
333                "GovHydro4.db1" => {
334                    match val {
335                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.db1 = Some(v); } }
336                        crate::base::FieldValue::TextList(svs) => {
337                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.db1 = Some(v); } }
338                        }
339                        _ => {}
340                    }
341                }
342                "GovHydro4.db2" => {
343                    match val {
344                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.db2 = Some(v); } }
345                        crate::base::FieldValue::TextList(svs) => {
346                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.db2 = Some(v); } }
347                        }
348                        _ => {}
349                    }
350                }
351                "GovHydro4.dturb" => {
352                    match val {
353                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.dturb = Some(v); } }
354                        crate::base::FieldValue::TextList(svs) => {
355                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.dturb = Some(v); } }
356                        }
357                        _ => {}
358                    }
359                }
360                "GovHydro4.eps" => {
361                    match val {
362                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.eps = Some(v); } }
363                        crate::base::FieldValue::TextList(svs) => {
364                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.eps = Some(v); } }
365                        }
366                        _ => {}
367                    }
368                }
369                "GovHydro4.gmax" => {
370                    match val {
371                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gmax = Some(v); } }
372                        crate::base::FieldValue::TextList(svs) => {
373                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gmax = Some(v); } }
374                        }
375                        _ => {}
376                    }
377                }
378                "GovHydro4.gmin" => {
379                    match val {
380                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gmin = Some(v); } }
381                        crate::base::FieldValue::TextList(svs) => {
382                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gmin = Some(v); } }
383                        }
384                        _ => {}
385                    }
386                }
387                "GovHydro4.gv0" => {
388                    match val {
389                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv0 = Some(v); } }
390                        crate::base::FieldValue::TextList(svs) => {
391                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv0 = Some(v); } }
392                        }
393                        _ => {}
394                    }
395                }
396                "GovHydro4.gv1" => {
397                    match val {
398                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv1 = Some(v); } }
399                        crate::base::FieldValue::TextList(svs) => {
400                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv1 = Some(v); } }
401                        }
402                        _ => {}
403                    }
404                }
405                "GovHydro4.gv2" => {
406                    match val {
407                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv2 = Some(v); } }
408                        crate::base::FieldValue::TextList(svs) => {
409                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv2 = Some(v); } }
410                        }
411                        _ => {}
412                    }
413                }
414                "GovHydro4.gv3" => {
415                    match val {
416                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv3 = Some(v); } }
417                        crate::base::FieldValue::TextList(svs) => {
418                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv3 = Some(v); } }
419                        }
420                        _ => {}
421                    }
422                }
423                "GovHydro4.gv4" => {
424                    match val {
425                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv4 = Some(v); } }
426                        crate::base::FieldValue::TextList(svs) => {
427                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv4 = Some(v); } }
428                        }
429                        _ => {}
430                    }
431                }
432                "GovHydro4.gv5" => {
433                    match val {
434                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.gv5 = Some(v); } }
435                        crate::base::FieldValue::TextList(svs) => {
436                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.gv5 = Some(v); } }
437                        }
438                        _ => {}
439                    }
440                }
441                "GovHydro4.hdam" => {
442                    match val {
443                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.hdam = Some(v); } }
444                        crate::base::FieldValue::TextList(svs) => {
445                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.hdam = Some(v); } }
446                        }
447                        _ => {}
448                    }
449                }
450                "GovHydro4.model" => {
451                    if let crate::base::FieldValue::Resource(sv) = val {
452                        obj.model = Some(crate::base::UriRef { uri: sv.clone() });
453                    }
454                }
455                "GovHydro4.mwbase" => {
456                    match val {
457                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.mwbase = Some(v); } }
458                        crate::base::FieldValue::TextList(svs) => {
459                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.mwbase = Some(v); } }
460                        }
461                        _ => {}
462                    }
463                }
464                "GovHydro4.pgv0" => {
465                    match val {
466                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv0 = Some(v); } }
467                        crate::base::FieldValue::TextList(svs) => {
468                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv0 = Some(v); } }
469                        }
470                        _ => {}
471                    }
472                }
473                "GovHydro4.pgv1" => {
474                    match val {
475                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv1 = Some(v); } }
476                        crate::base::FieldValue::TextList(svs) => {
477                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv1 = Some(v); } }
478                        }
479                        _ => {}
480                    }
481                }
482                "GovHydro4.pgv2" => {
483                    match val {
484                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv2 = Some(v); } }
485                        crate::base::FieldValue::TextList(svs) => {
486                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv2 = Some(v); } }
487                        }
488                        _ => {}
489                    }
490                }
491                "GovHydro4.pgv3" => {
492                    match val {
493                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv3 = Some(v); } }
494                        crate::base::FieldValue::TextList(svs) => {
495                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv3 = Some(v); } }
496                        }
497                        _ => {}
498                    }
499                }
500                "GovHydro4.pgv4" => {
501                    match val {
502                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv4 = Some(v); } }
503                        crate::base::FieldValue::TextList(svs) => {
504                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv4 = Some(v); } }
505                        }
506                        _ => {}
507                    }
508                }
509                "GovHydro4.pgv5" => {
510                    match val {
511                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.pgv5 = Some(v); } }
512                        crate::base::FieldValue::TextList(svs) => {
513                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.pgv5 = Some(v); } }
514                        }
515                        _ => {}
516                    }
517                }
518                "GovHydro4.qnl" => {
519                    match val {
520                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.qnl = Some(v); } }
521                        crate::base::FieldValue::TextList(svs) => {
522                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.qnl = Some(v); } }
523                        }
524                        _ => {}
525                    }
526                }
527                "GovHydro4.rperm" => {
528                    match val {
529                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.rperm = Some(v); } }
530                        crate::base::FieldValue::TextList(svs) => {
531                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.rperm = Some(v); } }
532                        }
533                        _ => {}
534                    }
535                }
536                "GovHydro4.rtemp" => {
537                    match val {
538                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.rtemp = Some(v); } }
539                        crate::base::FieldValue::TextList(svs) => {
540                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.rtemp = Some(v); } }
541                        }
542                        _ => {}
543                    }
544                }
545                "GovHydro4.tblade" => {
546                    match val {
547                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tblade = Some(v); } }
548                        crate::base::FieldValue::TextList(svs) => {
549                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tblade = Some(v); } }
550                        }
551                        _ => {}
552                    }
553                }
554                "GovHydro4.tg" => {
555                    match val {
556                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tg = Some(v); } }
557                        crate::base::FieldValue::TextList(svs) => {
558                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tg = Some(v); } }
559                        }
560                        _ => {}
561                    }
562                }
563                "GovHydro4.tp" => {
564                    match val {
565                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tp = Some(v); } }
566                        crate::base::FieldValue::TextList(svs) => {
567                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tp = Some(v); } }
568                        }
569                        _ => {}
570                    }
571                }
572                "GovHydro4.tr" => {
573                    match val {
574                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tr = Some(v); } }
575                        crate::base::FieldValue::TextList(svs) => {
576                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tr = Some(v); } }
577                        }
578                        _ => {}
579                    }
580                }
581                "GovHydro4.tw" => {
582                    match val {
583                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tw = Some(v); } }
584                        crate::base::FieldValue::TextList(svs) => {
585                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tw = Some(v); } }
586                        }
587                        _ => {}
588                    }
589                }
590                "GovHydro4.uc" => {
591                    match val {
592                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.uc = Some(v); } }
593                        crate::base::FieldValue::TextList(svs) => {
594                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.uc = Some(v); } }
595                        }
596                        _ => {}
597                    }
598                }
599                "GovHydro4.uo" => {
600                    match val {
601                        crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.uo = Some(v); } }
602                        crate::base::FieldValue::TextList(svs) => {
603                            if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.uo = Some(v); } }
604                        }
605                        _ => {}
606                    }
607                }
608                "TurbineGovernorDynamics.AsynchronousMachineDynamics" => {
609                    if let crate::base::FieldValue::Resource(sv) = val {
610                        obj.base.asynchronous_machine_dynamics = Some(crate::base::MridRef { mrid: sv.clone() });
611                    }
612                }
613                "TurbineGovernorDynamics.SynchronousMachineDynamics" => {
614                    if let crate::base::FieldValue::Resource(sv) = val {
615                        obj.base.synchronous_machine_dynamics = Some(crate::base::MridRef { mrid: sv.clone() });
616                    }
617                }
618                "DynamicsFunctionBlock.enabled" => {
619                    match val {
620                        crate::base::FieldValue::Text(sv) => { obj.base.base.enabled = Some(sv.trim() == "true"); }
621                        crate::base::FieldValue::TextList(svs) => {
622                            if let Some(sv) = svs.last() { obj.base.base.enabled = Some(sv.trim() == "true"); }
623                        }
624                        _ => {}
625                    }
626                }
627                "IdentifiedObject.description" => {
628                    match val {
629                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.description = sv.clone(); }
630                        crate::base::FieldValue::TextList(svs) => {
631                            if let Some(sv) = svs.last() { obj.base.base.base.description = sv.clone(); }
632                        }
633                        _ => {}
634                    }
635                }
636                "IdentifiedObject.energyIdentCodeEic" => {
637                    match val {
638                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
639                        crate::base::FieldValue::TextList(svs) => {
640                            if let Some(sv) = svs.last() { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
641                        }
642                        _ => {}
643                    }
644                }
645                "IdentifiedObject.mRID" => {
646                    match val {
647                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.m_rid = sv.clone(); }
648                        crate::base::FieldValue::TextList(svs) => {
649                            if let Some(sv) = svs.last() { obj.base.base.base.m_rid = sv.clone(); }
650                        }
651                        _ => {}
652                    }
653                }
654                "IdentifiedObject.name" => {
655                    match val {
656                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.name = sv.clone(); }
657                        crate::base::FieldValue::TextList(svs) => {
658                            if let Some(sv) = svs.last() { obj.base.base.base.name = sv.clone(); }
659                        }
660                        _ => {}
661                    }
662                }
663                "IdentifiedObject.shortName" => {
664                    match val {
665                        crate::base::FieldValue::Text(sv) => { obj.base.base.base.short_name = sv.clone(); }
666                        crate::base::FieldValue::TextList(svs) => {
667                            if let Some(sv) = svs.last() { obj.base.base.base.short_name = sv.clone(); }
668                        }
669                        _ => {}
670                    }
671                }
672                _ => {}
673            }
674        }
675        obj
676    }
677}