Skip to main content

TuneArgs

Struct TuneArgs 

Source
pub struct TuneArgs {
Show 28 fields pub tagname: String, pub template: String, pub process_type: ProcessTypeArg, pub controller_type: ControllerTypeArg, pub relay_amp: f32, pub cycles_skip: Option<u32>, pub cycles_count: Option<u32>, pub noise_protection_secs: Option<u32>, pub driver: DriverKindArg, pub bridge_host: Option<String>, pub server: Option<String>, pub sim_gain: f32, pub sim_tau: f32, pub sim_dead_time: f32, pub sim_noise: f32, pub sim_seed: u64, pub sim_initial_pv: f32, pub sim_initial_mv: f32, pub pv_range_high: Option<f32>, pub pv_range_low: Option<f32>, pub mv_range_high: Option<f32>, pub mv_range_low: Option<f32>, pub direction: Option<DirectionArg>, pub tag_overrides: Option<TagOverrides>, pub notes: Option<String>, pub yes: bool, pub write_pid: Option<ResponseLevelArg>, pub output: OutputFormat,
}
Expand description

Flags shared by tune and (a defaulted subset of) simulate.

Fields§

§tagname: String

PV tag prefix; the rest of the tag set is derived from it using --template’s suffix convention. Ignored for --driver simulator, which uses two fixed internal tag names instead.

§template: String

DCS/PLC template name (see bhtune template list).

§process_type: ProcessTypeArg§controller_type: ControllerTypeArg§relay_amp: f32

Relay amplitude, as a percentage of the MV range.

§cycles_skip: Option<u32>

Relay cycles to skip before counting begins (default: looked up per --process-type).

§cycles_count: Option<u32>

Relay cycles to count once the skip period ends (default: looked up per --process-type).

§noise_protection_secs: Option<u32>

Seconds a switch must persist before it’s accepted (default: looked up per --process-type).

§driver: DriverKindArg

Which driver drives this tune.

§bridge_host: Option<String>

opcda-bridge gateway address. bhtune connects to the bridge gateway rather than a DCOM host directly — see AGENTS.md’s OPC DA integration notes. Only meaningful with --driver opcda (default: crate::config::DEFAULT_BRIDGE_HOST, overridable via the BHTUNE_BRIDGE_HOST env var or the config file’s bridge_host key).

§server: Option<String>

OPC DA server ProgID (legacy: -s/--opcServerID). Required with --driver opcda.

§sim_gain: f32

Simulator process gain (--driver simulator only).

§sim_tau: f32

Simulator process time constant, in seconds (--driver simulator only).

§sim_dead_time: f32

Simulator dead time, in seconds (--driver simulator only).

§sim_noise: f32

Simulator measurement noise amplitude (--driver simulator only).

§sim_seed: u64

Simulator RNG seed, for reproducible noise (--driver simulator only).

§sim_initial_pv: f32

Simulator initial PV (--driver simulator only).

§sim_initial_mv: f32

Simulator initial MV (--driver simulator only).

§pv_range_high: Option<f32>

Fixed PV range high, overriding a live tag read (legacy: the PV range “toggle tag/value” button). Required (defaults to 100.0) for --driver simulator, which has no range tags at all.

§pv_range_low: Option<f32>

Fixed PV range low, overriding a live tag read.

§mv_range_high: Option<f32>

Fixed MV range high, overriding a live tag read.

§mv_range_low: Option<f32>

Fixed MV range low, overriding a live tag read.

§direction: Option<DirectionArg>

Fixed controller direction, overriding a live tag read.

§tag_overrides: Option<TagOverrides>

Per-tune replacements for template-derived tag names. This is populated by the HTTP API/UI; the CLI has no separate flags for the nested object.

§notes: Option<String>

Operator notes to attach to this run. Notes can be edited or cleared from the web GUI while the run is active or after it finishes.

§yes: bool

Confirm an unattended PID write-back. Required alongside --write-pid – the command refuses to start otherwise – since writing to a live loop with no human present must be an explicit, deliberate choice. Has no effect without --write-pid.

§write_pid: Option<ResponseLevelArg>

Non-interactively write this response level’s calculated PID parameters back to the DCS instead of prompting on stdin – the flag that makes a scheduled/scripted tune able to actually update a loop with no one watching. Requires --yes.

§output: OutputFormat

How to print this run’s final outcome line.

Trait Implementations§

Source§

impl Args for TuneArgs

Source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

impl Clone for TuneArgs

Source§

fn clone(&self) -> TuneArgs

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 CommandFactory for TuneArgs

Source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
Source§

impl Debug for TuneArgs

Source§

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

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

impl FromArgMatches for TuneArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for TuneArgs

§

fn parse() -> Self

Parse from std::env::args_os(), [exit][Error::exit] on error.
§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, [exit][Error::exit] on error.
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, [exit][Error::exit] on error. Read more
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

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> 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.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more