| State Variables | ![]() |
State variables are variables that are write protected while the run state is not Inactive. State variables are intended to be used to document conditions of a run. State variables are written to the event stream at state transitions. The CStateVariable class provides this functionality and is derived from the CTCLVariable class. A sample use of a state variable would be to log the target used for the run.
To create a State variable, you can either:
To programmatically create a statevar you need to:
The example below shows how to create a run variable. This code fragment should be put in the SetupRunVariables function.
...
CStateVariableCommand* pStatevarCommand =
rCore.getStateVariables();
CStateVariable* pTemp =
pStatevarCommand.Create(string("target"));
if(!pTemp) {
cerr << "Attempted to double create statevar "target"
<< endl;
}
...
| State Variables | ![]() |