/// IEEE 421.5-2005 type DC3A model. This model represents older systems, in particular those DC commutator exciters with non-continuously acting regulators that were commonly used before the development of the continuously acting varieties. These systems respond at basically two different rates, depending upon the magnitude of voltage error. For small errors, adjustment is made periodically with a signal to a motor-operated rheostat. Larger errors cause resistors to be quickly shorted or inserted and a strong forcing signal applied to the exciter. Continuous motion of the motor-operated rheostat occurs for these larger error signals, even though it is bypassed by contactor action. Reference: IEEE 421.5-2005, 5.3.
#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)]
pub struct ExcIEEEDC3A {
#[serde(flatten)]
pub base: super::ExcitationSystemDynamics,
/// Exciter voltage at which exciter saturation is defined (EFD1) (> 0). Typical value = 3,375.
#[serde(skip_serializing_if = "Option::is_none")]
pub efd1: Option<f64>,
/// Exciter voltage at which exciter saturation is defined (EFD2) (> 0). Typical value = 3,15.
#[serde(skip_serializing_if = "Option::is_none")]
pub efd2: Option<f64>,
/// (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical value = true.
#[serde(skip_serializing_if = "Option::is_none")]
pub exclim: Option<bool>,
/// Exciter constant related to self-excited field (KE). Typical value = 0,05.
#[serde(skip_serializing_if = "Option::is_none")]
pub ke: Option<f64>,
/// Fast raise/lower contact setting (KV) (> 0). Typical value = 0,05.
#[serde(skip_serializing_if = "Option::is_none")]
pub kv: Option<f64>,
/// Exciter saturation function value at the corresponding exciter voltage, EFD1 (SE[EFD1]) (>= 0). Typical value = 0,267.
#[serde(skip_serializing_if = "Option::is_none")]
pub seefd1: Option<f64>,
/// Exciter saturation function value at the corresponding exciter voltage, EFD2 (SE[EFD2]) (>= 0). Typical value = 0,068.
#[serde(skip_serializing_if = "Option::is_none")]
pub seefd2: Option<f64>,
/// Exciter time constant, integration rate associated with exciter control (TE) (> 0). Typical value = 0,5.
#[serde(skip_serializing_if = "Option::is_none")]
pub te: Option<f64>,
/// Rheostat travel time (TRH) (> 0). Typical value = 20.
#[serde(skip_serializing_if = "Option::is_none")]
pub trh: Option<f64>,
/// Maximum voltage regulator output (VRMAX) (> 0). Typical value = 1.
#[serde(skip_serializing_if = "Option::is_none")]
pub vrmax: Option<f64>,
/// Minimum voltage regulator output (VRMIN) (<= 0). Typical value = 0.
#[serde(skip_serializing_if = "Option::is_none")]
pub vrmin: Option<f64>,
}
impl crate::base::CimElement for ExcIEEEDC3A {
fn mrid(&self) -> &str { &self.base.base.base.id }
fn type_name(&self) -> &'static str { "ExcIEEEDC3A" }
fn as_any(&self) -> &dyn std::any::Any { self }
fn to_json_value(&self) -> serde_json::Value {
serde_json::to_value(self).unwrap_or(serde_json::Value::Null)
}
fn to_block(&self) -> crate::base::RdfBlock {
let mut block = self.base.to_block();
block.type_name = "ExcIEEEDC3A".to_string();
if let Some(v) = self.efd1 {
block.fields.insert("ExcIEEEDC3A.efd1".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.efd2 {
block.fields.insert("ExcIEEEDC3A.efd2".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.exclim {
block.fields.insert("ExcIEEEDC3A.exclim".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.ke {
block.fields.insert("ExcIEEEDC3A.ke".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.kv {
block.fields.insert("ExcIEEEDC3A.kv".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.seefd1 {
block.fields.insert("ExcIEEEDC3A.seefd1".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.seefd2 {
block.fields.insert("ExcIEEEDC3A.seefd2".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.te {
block.fields.insert("ExcIEEEDC3A.te".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.trh {
block.fields.insert("ExcIEEEDC3A.trh".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.vrmax {
block.fields.insert("ExcIEEEDC3A.vrmax".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.vrmin {
block.fields.insert("ExcIEEEDC3A.vrmin".into(), crate::base::FieldValue::Text(v.to_string()));
}
block
}
}
impl ExcIEEEDC3A {
pub fn from_block(b: &crate::base::RdfBlock) -> Self {
let mut obj = Self::default();
obj.base.base.base.id.clone_from(&b.mrid);
for (key, val) in &b.fields {
match key.as_str() {
"ExcIEEEDC3A.efd1" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.efd1 = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.efd1 = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.efd2" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.efd2 = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.efd2 = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.exclim" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.exclim = Some(sv.trim() == "true"); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.exclim = Some(sv.trim() == "true"); }
}
_ => {}
}
}
"ExcIEEEDC3A.ke" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.ke = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.ke = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.kv" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kv = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kv = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.seefd1" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.seefd1 = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.seefd1 = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.seefd2" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.seefd2 = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.seefd2 = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.te" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.te = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.te = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.trh" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.trh = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.trh = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.vrmax" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.vrmax = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.vrmax = Some(v); } }
}
_ => {}
}
}
"ExcIEEEDC3A.vrmin" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.vrmin = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.vrmin = Some(v); } }
}
_ => {}
}
}
"ExcitationSystemDynamics.SynchronousMachineDynamics" => {
if let crate::base::FieldValue::Resource(sv) = val {
obj.base.synchronous_machine_dynamics = Some(crate::base::MridRef { mrid: sv.clone() });
}
}
"DynamicsFunctionBlock.enabled" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.enabled = Some(sv.trim() == "true"); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.enabled = Some(sv.trim() == "true"); }
}
_ => {}
}
}
"IdentifiedObject.description" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.description = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.description = sv.clone(); }
}
_ => {}
}
}
"IdentifiedObject.energyIdentCodeEic" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
}
_ => {}
}
}
"IdentifiedObject.mRID" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.m_rid = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.m_rid = sv.clone(); }
}
_ => {}
}
}
"IdentifiedObject.name" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.name = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.name = sv.clone(); }
}
_ => {}
}
}
"IdentifiedObject.shortName" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.short_name = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.short_name = sv.clone(); }
}
_ => {}
}
}
_ => {}
}
}
obj
}
}