#[non_exhaustive]pub enum Command {
VersionString,
Login {
user_name: String,
password: String,
},
Logout,
LoadFile {
path: String,
},
Start {
sequence: String,
},
Run {
sequence_file: String,
sequence: String,
},
Terminate {
execution_id: i32,
},
Control {
execution_id: Option<i32>,
control: ExecutionControl,
},
ReadValue {
execution_id: i32,
lookup: String,
},
Shutdown,
}Expand description
A request from a front end, addressed to the host that owns the engine.
Every variant is something the engine can do on its own thread, because that
is where the host will run it. Nothing here returns a COM reference: a
command’s answer is a Response, which is data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
VersionString
Ask the engine what it is.
Answers with Engine.VersionString and Engine.Is64Bit, which are the
members it reads. Named for them rather than for a greeting: a command
called hello describes the conversation, not the engine operation, and
somebody reading the vendor documentation would not find it.
Cheap, and worth sending first: it distinguishes “the socket connected” from “the engine is up”, which are not the same and fail differently.
Login
Log a user in, by name.
The host looks the account up, checks the password, and makes it current. An account with no password takes an empty string, which is ordinary on a station where the operator is identified but not authenticated.
Fields
Logout
Log the current user out, leaving nobody logged in.
LoadFile
Open a sequence file and hold it, without running anything.
Separate from Start because loading is where a bad path
or a missing dependency shows up, and a panel wants that answer before
it offers a run button.
Start
Start a sequence in the file already loaded.
Run
Load a sequence file and start one of its sequences in one step.
Fields
Terminate
Ask a running execution to stop.
Termination, not abort: cleanup still runs, so hardware is left safe.
Fields
execution_id: i32Which execution, as reported by
MessageEvent::execution_id.
Control
Change what a running execution is doing.
One command carrying a verb rather than six commands, so the wire shape
stays stable as more controls land, and so a panel acting on whatever is
running can leave execution_id out instead of tracking it.
The engine binding has had these members for a while. Without this variant none were reachable from a client, which left a panel able to start a run and stop it and do nothing in between.
Fields
control: ExecutionControlWhat to do to it.
ReadValue
Read a value out of a running execution’s context.
lookup is an ordinary property path, Locals.Result or
FileGlobals.SerialNumber. This is how a panel gets data it was not
pushed: the host resolves the path and answers with the subtree as data,
because the reference itself could never leave the process.
Shutdown
Stop the host after the current run finishes.
Implementations§
Source§impl Command
impl Command
Sourcepub const fn name(&self) -> &'static str
pub const fn name(&self) -> &'static str
A short name for logging, without rendering the whole command.
Sourcepub const fn is_control(&self) -> bool
pub const fn is_control(&self) -> bool
Whether this command changes what the station is doing.
A host that serves more than one panel wants to treat these differently from reads: two observers are fine, two controllers are a decision somebody has to make.