Skip to main content

DcsTemplate

Struct DcsTemplate 

Source
pub struct DcsTemplate {
Show 27 fields pub name: String, pub revert_mode: bool, pub proportional_type: ProportionalType, pub integral_type: IntegralType, pub integral_unit: TimeUnit, pub derivative_type: DerivativeType, pub derivative_unit: TimeUnit, pub process_variable_suffix: String, pub manipulated_variable_suffix: String, pub setpoint_variable_suffix: String, pub controller_direction_suffix: String, pub controller_mode_suffix: String, pub mode_attribute_suffix: String, pub upper_pv_range_suffix: String, pub lower_pv_range_suffix: String, pub upper_mv_range_suffix: String, pub lower_mv_range_suffix: String, pub proportional_constant_suffix: String, pub integral_constant_suffix: String, pub derivative_constant_suffix: String, pub mode_manual_value: String, pub mode_auto_value: String, pub mode_attribute_program_value: Option<String>, pub controller_action_direct_value: String, pub versions: Vec<String>, pub description: Option<String>, pub source: Option<String>,
}
Expand description

One DCS/PLC vendor’s conventions.

Fields§

§name: String§revert_mode: bool

If true, the controller mode is switched back to its original mode (e.g. Auto/Cascade) after a completed MRFT test. Has no effect if the loop was already in Manual at test start.

§proportional_type: ProportionalType§integral_type: IntegralType§integral_unit: TimeUnit§derivative_type: DerivativeType§derivative_unit: TimeUnit§process_variable_suffix: String

OPC item-name suffixes, combined with a PV tag’s path prefix by crate::tags::derive_tag to fill in the rest of the tag set. An empty suffix means the corresponding tag is not applicable for this DCS (e.g. some DCS families have no mode-attribute concept).

§manipulated_variable_suffix: String§setpoint_variable_suffix: String§controller_direction_suffix: String§controller_mode_suffix: String§mode_attribute_suffix: String§upper_pv_range_suffix: String§lower_pv_range_suffix: String§upper_mv_range_suffix: String§lower_mv_range_suffix: String§proportional_constant_suffix: String§integral_constant_suffix: String§derivative_constant_suffix: String§mode_manual_value: String

The DCS-specific raw values a Mode tag holds for Manual/Auto.

§mode_auto_value: String§mode_attribute_program_value: Option<String>

The raw value a Mode Attribute tag holds when in “Program” mode (permits external OPC writes). None when the DCS has no mode-attribute concept.

§controller_action_direct_value: String

The raw value a Controller Direction tag holds when the controller is Direct acting; see crate::direction::ControllerDirection::from_raw_tag_value.

§versions: Vec<String>

DCS/PLC releases this mapping is known to apply to (e.g. ["R5", "R6"]), in each vendor’s own version-naming convention rather than a normalized scheme. A newer release that changes tag conventions gets its own template entry with its own name and versions list – never an edit to this one in place, since sites still running the older release depend on the existing mapping (see docs/dcs-templates.md). May be empty for a contribution whose version coverage isn’t yet known; name is what makes a template unique, not versions.

§description: Option<String>

Free-text description of the control system this template targets.

§source: Option<String>

Citation for where this mapping came from (a manual, a field deployment). Provenance, not a correctness guarantee – there is deliberately no separate “verified” trust field; everything accepted into the catalog is treated as verified, and real mapping errors are fixed as bugs when they surface.

Implementations§

Source§

impl DcsTemplate

Source

pub fn validate(&self) -> Result<(), TemplateError>

Validates cross-field invariants a data file can’t express on its own: a name, a PV suffix, and an MV suffix are always required (without them tag derivation is impossible); a mode suffix requires both a manual and an auto value; a mode-attribute suffix requires its program value. Mirrors LoopConfig::validate’s rationale (see AGENTS.md’s “Live-plant safety hardening”) – a half-configured template should fail loudly at parse/import time, not mid-tune against a live loop. Called on every template parsed from the embedded catalog (parse_catalog), an imported file, or the user catalog.

Trait Implementations§

Source§

impl Clone for DcsTemplate

Source§

fn clone(&self) -> DcsTemplate

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComposeSchema for DcsTemplate

Source§

fn compose(generics: Vec<RefOr<Schema>>) -> RefOr<Schema>

Source§

impl Debug for DcsTemplate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DcsTemplate

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for DcsTemplate

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for DcsTemplate

Source§

fn eq(&self, other: &DcsTemplate) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for DcsTemplate

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DcsTemplate

Source§

impl ToSchema for DcsTemplate

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference [utoipa::openapi::schema::Schema]s for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.