pub struct StartRunRequest {Show 27 fields
pub tagname: String,
pub template: String,
pub process_type: ProcessType,
pub controller_type: ControllerType,
pub relay_amp: f32,
pub cycles_skip: Option<u32>,
pub cycles_count: Option<u32>,
pub noise_protection_secs: Option<u32>,
pub driver: TuneDriver,
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<ControllerDirection>,
pub tag_overrides: Option<TagOverrides>,
pub notes: Option<String>,
pub yes: bool,
pub write_pid: Option<ResponseLevel>,
}Expand description
The body of POST /api/runs contains the per-run tune inputs. Operational timing values
are intentionally absent: they are resolved from the global [tuning] configuration by
prepare(), just as they are for a CLI invocation. Every field that has a CLI default
(--sim-gain, etc.) repeats that exact default here via #[serde(default = "...")], so an
HTTP caller that omits a field gets identical behavior to a CLI invocation that omits the
matching flag. Option<T> fields need no #[serde(default)] of their own – serde already
treats a missing key as None for an Option field.
Also derives Serialize so the exact same type can serve as GET /api/runs/last-request’s
response (ui-prefill-last-run, in routes::history::last_request): that endpoint parses
a run’s stored request_json straight into a StartRunRequest rather than duplicating
its ~30 fields into a second struct, giving a “what you GET is exactly what you’d POST
to repeat it” symmetry in both the Rust types and the generated OpenAPI schema. This is
safe precisely because request_json is already built to this exact shape –
bhtune-cli’s RequestSnapshot doc comment describes the two as kept in sync by
convention.
Fields§
§tagname: StringPV tag prefix; ignored for driver: "simulator". See TuneArgs::tagname.
template: StringDCS/PLC template name (see GET /api/templates).
process_type: ProcessType§controller_type: ControllerType§relay_amp: f32Relay 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: TuneDriverWhich driver drives this tune. "replay" is rejected – that driver exists only
for offline golden-trace validation, not for starting a live/simulated run.
bridge_host: Option<String>opcda-bridge gateway address. Only meaningful with driver: "opcda" (default:
resolved the same way the CLI resolves --bridge-host, via this process’s own
config/env).
server: Option<String>OPC DA server ProgID. Required with driver: "opcda".
sim_gain: f32Simulator process gain (driver: "simulator" only).
sim_tau: f32Simulator process time constant, in seconds (driver: "simulator" only).
sim_dead_time: f32Simulator dead time, in seconds (driver: "simulator" only).
sim_noise: f32Simulator measurement noise amplitude (driver: "simulator" only).
sim_seed: u64Simulator RNG seed, for reproducible noise (driver: "simulator" only).
sim_initial_pv: f32Simulator initial PV (driver: "simulator" only).
sim_initial_mv: f32Simulator initial MV (driver: "simulator" only).
pv_range_high: Option<f32>Fixed PV range high, overriding a live tag read. Required 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<ControllerDirection>Fixed controller direction, overriding a live tag read.
tag_overrides: Option<TagOverrides>Per-tune replacements for template-derived OPC tag names. Blank or missing fields use the template-derived tag.
notes: Option<String>Operator notes to attach to this run. Notes can be edited or cleared later through the run-history endpoints.
yes: boolConfirm an unattended PID write-back. Required alongside write_pid – the request
is rejected otherwise, identically to --write-pid without --yes on the CLI.
write_pid: Option<ResponseLevel>Non-interactively write this response level’s calculated PID parameters back to the
DCS. Requires yes: true.
Trait Implementations§
Source§impl ComposeSchema for StartRunRequest
impl ComposeSchema for StartRunRequest
Source§impl Debug for StartRunRequest
impl Debug for StartRunRequest
Source§impl<'de> Deserialize<'de> for StartRunRequest
impl<'de> Deserialize<'de> for StartRunRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for StartRunRequest
impl Serialize for StartRunRequest
Auto Trait Implementations§
impl Freeze for StartRunRequest
impl RefUnwindSafe for StartRunRequest
impl Send for StartRunRequest
impl Sync for StartRunRequest
impl Unpin for StartRunRequest
impl UnsafeUnpin for StartRunRequest
impl UnwindSafe for StartRunRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].