PDComm.GemFormattedProgramSelectionSnapshot
Class
A read-only copy of the equipment's formatted process program selection.
public sealed class GemFormattedProgramSelectionSnapshot : GemOwnedSnapshotGemFormattedPrograms.GetSelectionSnapshot and GemFormattedPrograms.ValidateSelection, or their GemFormattedProgramsWorker counterparts, return it. It holds the selection state and the copy of the program taken when the program was selected; that copy does not follow later store changes. While nothing is selected, only GemFormattedProgramSelectionSnapshot.GetInfo succeeds and the program accessors fail with PdcommStatus.InvalidState. The caller owns the snapshot and must dispose it.
Members
GetCommandCode
Method
Gets the command code (CCODE) of one command of the selected program.
public SecsItem GetCommandCode(nuint command_index)Fails with PdcommStatus.InvalidState when the snapshot holds no selection.
Parameters
| Name | Description |
|---|---|
command_index | The zero-based index of the command. |
Returns
A new SecsItem holding the ASCII or unsigned integer command code (CCODE). The caller owns the returned item and must dispose it.
Notes
- Throws
ObjectDisposedException: The snapshot has been disposed. - Throws
PdcommException: The native accessor failed, for example withPdcommStatus.InvalidStatewhen the snapshot does not hold the requested data, or withPdcommStatus.OutOfRangewhen an index is past the end or the indexed entry is absent.
GetCommandInfo
Method
Gets the parameter count and the command code format of one command of the selected program.
public GemFormattedProgramCommandInfo GetCommandInfo(nuint command_index)Fails with PdcommStatus.InvalidState when the snapshot holds no selection.
Parameters
| Name | Description |
|---|---|
command_index | The zero-based index of the command, less than GemFormattedProgramSelectionInfo.CommandCount. |
Returns
The parameter count of the command and the SECS-II format of its command code (CCODE).
Notes
- Throws
ObjectDisposedException: The snapshot has been disposed. - Throws
PdcommException: The native accessor failed, for example withPdcommStatus.InvalidStatewhen the snapshot does not hold the requested data, or withPdcommStatus.OutOfRangewhen an index is past the end or the indexed entry is absent.
GetId
Method
Gets the process program ID (PPID) of the selected program.
public SecsItem GetId()Fails with PdcommStatus.InvalidState when the snapshot holds no selection.
Returns
A new ASCII or binary SecsItem holding the PPID. The caller owns the returned item and must dispose it.
Notes
- Throws
ObjectDisposedException: The snapshot has been disposed. - Throws
PdcommException: The native accessor failed, for example withPdcommStatus.InvalidStatewhen the snapshot does not hold the requested data.
GetInfo
Method
Gets the selection state captured by the snapshot.
public GemFormattedProgramSelectionInfo GetInfo()Returns
The selection state, the stale reason and the generations of the selection.
Notes
- Throws
ObjectDisposedException: The snapshot has been disposed. - Throws
PdcommException: The native accessor failed, for example withPdcommStatus.InvalidStatewhen the snapshot does not hold the requested data.
GetModel
Method
Gets the equipment model type (MDLN) of the selected program.
public string GetModel()Fails with PdcommStatus.InvalidState when the snapshot holds no selection.
Returns
The equipment model type (MDLN) text.
Notes
- Throws
ObjectDisposedException: The snapshot has been disposed. - Throws
PdcommException: The native accessor failed, for example withPdcommStatus.InvalidStatewhen the snapshot does not hold the requested data.
GetParameter
Method
Gets one parameter (PPARM) of one command of the selected program.
public SecsItem GetParameter(nuint command_index, nuint parameter_index)Fails with PdcommStatus.InvalidState when the snapshot holds no selection.
Parameters
| Name | Description |
|---|---|
command_index | The zero-based index of the command. |
parameter_index | The zero-based index of the parameter within the command. |
Returns
A new SecsItem holding the parameter (PPARM). The caller owns the returned item and must dispose it.
Notes
- Throws
ObjectDisposedException: The snapshot has been disposed. - Throws
PdcommException: The native accessor failed, for example withPdcommStatus.InvalidStatewhen the snapshot does not hold the requested data, or withPdcommStatus.OutOfRangewhen an index is past the end or the indexed entry is absent.
GetSoftwareRevision
Method
Gets the software revision (SOFTREV) of the selected program.
public string GetSoftwareRevision()Fails with PdcommStatus.InvalidState when the snapshot holds no selection.
Returns
The software revision (SOFTREV) text.
Notes
- Throws
ObjectDisposedException: The snapshot has been disposed. - Throws
PdcommException: The native accessor failed, for example withPdcommStatus.InvalidStatewhen the snapshot does not hold the requested data.