Public Member Functions | |
testAsynPortDriver (const char *portName, int maxArraySize) | |
Constructor for the testAsynPortDriver class. | |
virtual asynStatus | writeInt32 (asynUser *pasynUser, epicsInt32 value) |
Called when asyn clients call pasynInt32->write(). | |
virtual asynStatus | writeFloat64 (asynUser *pasynUser, epicsFloat64 value) |
Called when asyn clients call pasynFloat64->write(). | |
virtual asynStatus | readFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nElements, size_t *nIn) |
Called when asyn clients call pasynFloat64Array->read(). | |
virtual asynStatus | drvUserCreate (asynUser *pasynUser, const char *drvInfo, const char **pptypeName, size_t *psize) |
Called by asynManager to pass a pasynUser structure and drvInfo string to the driver; assigns pasynUser->reason to one of the testParams enum value based on the value of the drvInfo string. | |
void | simTask (void) |
Simulation task that runs as a separate thread. |
This class does a simple simulation of a digital oscilloscope. It computes a waveform, computes statistics on the waveform, and does callbacks with the statistics and the waveform data itself. I have made the methods of this class public in order to generate doxygen documentation for them, but they should really all be private.
testAsynPortDriver::testAsynPortDriver | ( | const char * | portName, | |
int | maxPoints | |||
) |
Constructor for the testAsynPortDriver class.
Calls constructor for the asynPortDriver base class.
[in] | portName | The name of the asyn port driver to be created. |
[in] | maxPoints | The maximum number of points in the volt and time arrays |
asynStatus testAsynPortDriver::writeInt32 | ( | asynUser * | pasynUser, | |
epicsInt32 | value | |||
) | [virtual] |
Called when asyn clients call pasynInt32->write().
This function sends a signal to the simTask thread if the value of P_Run has changed. For all parameters it sets the value in the parameter library and calls any registered callbacks..
[in] | pasynUser | pasynUser structure that encodes the reason and address. |
[in] | value | Value to write. |
Reimplemented from asynPortDriver.
asynStatus testAsynPortDriver::writeFloat64 | ( | asynUser * | pasynUser, | |
epicsFloat64 | value | |||
) | [virtual] |
Called when asyn clients call pasynFloat64->write().
This function sends a signal to the simTask thread if the value of P_UpdateTime has changed. For all parameters it sets the value in the parameter library and calls any registered callbacks.
[in] | pasynUser | pasynUser structure that encodes the reason and address. |
[in] | value | Value to write. |
Reimplemented from asynPortDriver.
asynStatus testAsynPortDriver::readFloat64Array | ( | asynUser * | pasynUser, | |
epicsFloat64 * | value, | |||
size_t | nElements, | |||
size_t * | nIn | |||
) | [virtual] |
Called when asyn clients call pasynFloat64Array->read().
Returns the value of the P_Waveform or P_TimeBase arrays.
[in] | pasynUser | pasynUser structure that encodes the reason and address. |
[in] | value | Pointer to the array to read. |
[in] | nElements | Number of elements to read. |
[out] | nIn | Number of elements actually read. |
Reimplemented from asynPortDriver.
asynStatus testAsynPortDriver::drvUserCreate | ( | asynUser * | pasynUser, | |
const char * | drvInfo, | |||
const char ** | pptypeName, | |||
size_t * | psize | |||
) | [virtual] |
Called by asynManager to pass a pasynUser structure and drvInfo string to the driver; assigns pasynUser->reason to one of the testParams enum value based on the value of the drvInfo string.
Simply calls asynPortDriver::drvUserCreateParam with the parameter table for this driver.
[in] | pasynUser | pasynUser structure that driver modifies |
[in] | drvInfo | String containing information about what driver function is being referenced |
[out] | pptypeName | Location in which driver puts a copy of drvInfo. |
[out] | psize | Location where driver puts size of param. |
Reimplemented from asynPortDriver.
void testAsynPortDriver::simTask | ( | void | ) |
Simulation task that runs as a separate thread.
When the P_Run parameter is set to 1 to rub the simulation it computes a 1 kHz sine wave with 1V amplitude and user-controllable noise, and displays it on a simulated scope. It computes waveforms for the X (time) and Y (volt) axes, and computes statistics about the waveform.