qumbia-tango-controls 1.x
Library on top of cumbia-qtcontrols and cumbia-tango
|
implements CuControlsReaderA abstract class and provides an interface to connect a Tango reader to a source. More...
#include <cutcontrolsreader.h>
Public Member Functions | |
CuTControlsReader (Cumbia *cumbia_tango, CuDataListener *tl) | |
class constructor that's configured with CumbiaTango and CuDataListener instances More... | |
virtual | ~CuTControlsReader () |
the class destructor. More... | |
void | setSource (const QString &s) |
connect the reader to the Tango control system and start reading More... | |
QString | source () const |
void | unsetSource () |
Stops the reader. More... | |
void | setOptions (const CuData &o) |
configures the reader through the options passed as parameter More... | |
void | sendData (const CuData &d) |
forwards the data passed as parameter to the underlying CuTReader More... | |
void | getData (CuData &d_ino) const |
send a CuData bundle as input argument to the CuTReader associated to this object with this source and get a reply. More... | |
implements CuControlsReaderA abstract class and provides an interface to connect a Tango reader to a source.
Built with references to CumbiaTango and CuDataListener, CuTControlsReader implements CuControlsReaderA and connects a reader to the Tango control system through the setSource method. setOptions can discretionary be called before setSource.
For a list of options recognised by CuTReader, see CuTReader::getData
Parameters and configuration can be sent and queried with sendData and getData respectively.
unsetSource can finally be called in order to stop a running reader, and if CuTControlsReader is deleted, unsetSource is called automatically.
CuTControlsReader::CuTControlsReader | ( | Cumbia * | cumbia_tango, |
CuDataListener * | tl | ||
) |
class constructor that's configured with CumbiaTango and CuDataListener instances
cumbia_tango | a pointer to a CumbiaTango instance |
CuDataListener | a pointer to an object implementing the CuDataListener interface |
|
virtual |
the class destructor.
The class destructors sets the invalidate flag on the listener, so that it won't be used later, and calls unsetSource
References unsetSource().
void CuTControlsReader::getData | ( | CuData & | d_ino | ) | const |
send a CuData bundle as input argument to the CuTReader associated to this object with this source and get a reply.
d_ino | a (non const) reference to a CuData compiled with the input arguments recognised by the CuTReader. When the function returns, the CuData will contain the reply. |
This method finds the CuTangoActionI with the source of this reader and calls getData on it, passing d_ino as argument.
void CuTControlsReader::sendData | ( | const CuData & | data | ) |
forwards the data passed as parameter to the underlying CuTReader
This method finds the CuTangoActionI with the source of this reader and calls sendData on it.
void CuTControlsReader::setOptions | ( | const CuData & | o | ) |
configures the reader through the options passed as parameter
o | CuData with the options to set on the reader |
See CuTReaderFactory::setOptions and CuTangoOptBuilder documentation.
This is usually called by CuTReaderFactory::create immediately after CuTControlsWriter is instantiated.
Referenced by CuTReaderFactory::create().
void CuTControlsReader::setSource | ( | const QString & | s | ) |
connect the reader to the Tango control system and start reading
s | the name of the source (Tango device attribute or command) for the reader |
References CuTControlsUtils::replaceWildcards().
QString CuTControlsReader::source | ( | ) | const |
returns the source of the reader.
void CuTControlsReader::unsetSource | ( | ) |
Stops the reader.
This must be called from the main thread.
Referenced by ~CuTControlsReader().