Transient Recorder Framework
|
Transient Recorder configuration parameter. More...
#include <TRConfigParam.h>
Public Member Functions | |
TRConfigParam () | |
Default constructor for configuration parameters. More... | |
ValueType | getSnapshot () |
Return the current snapshot value of the parameter. More... | |
ValueType | getSnapshotFast () |
Like getSnapshot but does not have any asserts. More... | |
void | setIrrelevant () |
Mark this parameter as irrelevant for the current configuration. More... | |
void | setSnapshot (ValueType value) |
Adjust the snapshot value for the current configuration. More... | |
ValueType | getDesired () |
Return the current desired value of the parameter. More... | |
void | setDesired (ValueType value) |
Set the desired value of an internal parameter. More... | |
int | desiredParamIndex () |
Return the asyn parameter index of the desired-value parameter. More... | |
Friends | |
class | TRBaseDriver |
Transient Recorder configuration parameter.
A configuration parameter includes two asyn parameters, one for the desired value and one for the effective value. At the start of arming, a snapshot of the desired value is taken and the driver layer will only be able to access this snapshot, which is guaranteed to not change until the next arming.
The ValueType template parameter is the data type of the desired parameter and the snapshot value. The EffectiveValueType template parameter is the data type of the effective-value parameter. The only supported combinations of pairs are:
|
inline |
Default constructor for configuration parameters.
The parameter should be initialized using TRBaseDriver::initConfigParam or TRBaseDriver::initInternalParam after it is constructed. Public functions of TRConfigParam MUST NOT be called before the parameter has been initialized.
|
inline |
Return the current snapshot value of the parameter.
This function MUST NOT be called before TRBaseDriver::checkSettings is called or after TRBaseDriver::stopAcquisition returns (until the next checkSettings call). Refer to TRBaseDriver documentation for details.
|
inline |
Like getSnapshot but does not have any asserts.
This is recommended when performance is important and especially in interrupt context.
|
inline |
Mark this parameter as irrelevant for the current configuration.
The intended use of this is in TRBaseDriver::checkSettings to inform the framework that this configuration parameter is irrelevant, so that the effective value asyn parameter will be set to the invalid value instead of the snapshot value.
This function MUST NOT be called outside of TRBaseDriver::checkSettings.
|
inline |
Adjust the snapshot value for the current configuration.
There are two reasons why this would be used:
This function MUST NOT be called outside of TRBaseDriver::checkSettings.
value | The new snapshot value. |
ValueType TRConfigParam< ValueType, EffectiveValueType >::getDesired | ( | ) |
Return the current desired value of the parameter.
The desired value is controlled by the external interface (EPICS) or alteratively by the driver itself for internal parameters using setDesired.
This function MUST be called with the TRBaseDriver port locked.
Using this function should not be needed for most parameters because TRBaseDriver will make a snapshot of the desired value at the start of arming and the snapshot value is what is meant to be used by the driver. It should be used only when the driver calculates the values of internal configuration parameters based on this parameter.
void TRConfigParam< ValueType, EffectiveValueType >::setDesired | ( | ValueType | value | ) |
Set the desired value of an internal parameter.
This function MUST be called with the TRBaseDriver port locked.
This function MUST NOT be called for configuration parameters that were not initialized using TRBaseDriver::initInternalParam.
value | The new desired value. |
|
inline |
Return the asyn parameter index of the desired-value parameter.
This can be used in overridden parameter write functions to determine when the desired value is being changed. There is currently only one foreseen use case, when the driver wishes to apply configuration changes immediately while not armed. See TRBaseDriver::onDisarmed for instructions to do this correctly.