pdcomm::GemFormattedProgramExecutionAction
Class
One action that the library asks the application to perform for an execution.
class GemFormattedProgramExecutionActionAn execution never touches equipment hardware. Instead it hands the application one action at a time: a start action with the program, a step action with the next command, or a cancel action. Perform the action on the tool, then report the result with submitFormattedProgramExecutionActionResult() using token(). The action owns copies of all data it exposes.
auto start = pdcomm::startFormattedProgramExecution(equipment, selection, report);
pdcomm::submitFormattedProgramExecutionActionResult(
equipment, start.action.token(),
PDCOMM_GEM_FORMATTED_PROGRAM_EXECUTION_ACTION_RESULT_ACCEPTED);
auto step = pdcomm::stepFormattedProgramExecution(equipment, start.token);
auto code = step.commandCode(); // apply the command on the tool
pdcomm::submitFormattedProgramExecutionActionResult(
equipment, step.token(), PDCOMM_GEM_FORMATTED_PROGRAM_EXECUTION_ACTION_RESULT_APPLIED);Notes
- Move-only RAII wrapper. Getters may run concurrently; destruction must not race with them. Getters on an empty action throw pdcomm::Error with
PDCOMM_INVALID_ARGUMENT.
Members
GemFormattedProgramExecutionAction
Constructor
Creates an empty action that owns no native handle.
GemFormattedProgramExecutionAction() noexcept = defaultGemFormattedProgramExecutionAction
Constructor
Takes ownership of the native handle owned by other.
GemFormattedProgramExecutionAction(GemFormattedProgramExecutionAction &&other) noexceptParameters
| Name | Description |
|---|---|
other | Source wrapper; it becomes empty. |
GemFormattedProgramExecutionAction
Constructor
Copying is disabled; the wrapper exclusively owns its native handle.
GemFormattedProgramExecutionAction(const GemFormattedProgramExecutionAction &) = deletecommandCode
Method
Returns the CCODE of the command a step action asks to apply.
SecsItem commandCode() constReturns
An independently owned item.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen the action carries no command.
info
Method
Describes the action.
GemFormattedProgramExecutionActionInfo info() constReturns
Kind, presence bits, identities, command position and counts.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_ARGUMENTfor an empty action.
model
Method
Copies the MDLN carried by a start action.
std::string model() constReturns
The model text.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen the action carries no program.
operator bool
Method
Reports whether the wrapper owns a native action.
explicit operator bool() const noexceptReturns
true when an action is owned.
operator=
Method
Releases the current handle, then takes ownership of the handle owned by other.
GemFormattedProgramExecutionAction &operator=(GemFormattedProgramExecutionAction &&other) noexceptParameters
| Name | Description |
|---|---|
other | Source wrapper; it becomes empty. |
Returns
This wrapper.
operator=
Method
Copy assignment is disabled; the wrapper exclusively owns its native handle.
GemFormattedProgramExecutionAction &operator=(const GemFormattedProgramExecutionAction &) = deleteparameter
Method
Returns one PPARM of the command a step action asks to apply.
SecsItem parameter(size_t index) constParameters
| Name | Description |
|---|---|
index | Zero-based parameter position, less than GemFormattedProgramExecutionActionInfo::parameterCount. |
Returns
An independently owned item.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen the action carries no command;PDCOMM_OUT_OF_RANGEfor an invalidindex.
programId
Method
Returns the PPID carried by a start action.
SecsItem programId() constReturns
An independently owned ASCII or Binary item.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen the action carries no program.
softwareRevision
Method
Copies the SOFTREV carried by a start action.
std::string softwareRevision() constReturns
The software revision text.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen the action carries no program.
token
Method
Returns the token to report this action's result with.
GemFormattedProgramExecutionActionToken token() constReturns
The action token built from info().
Notes
- Throws
pdcomm::Error: Same statuses as info().
~GemFormattedProgramExecutionAction
Method
Releases the native handle with pdcomm_gem_formatted_program_execution_action_destroy().
~GemFormattedProgramExecutionAction()An empty action releases nothing.