qumbia-tango-controls 1.x
Library on top of cumbia-qtcontrols and cumbia-tango
Public Member Functions | List of all members
CuTControlsWriter Class Reference

implements CuControlsWriterA abstract class and provides an interface to connect a Tango writer to a target. More...

#include <cutcontrolswriter.h>

Inheritance diagram for CuTControlsWriter:
Inheritance graph
[legend]

Public Member Functions

 CuTControlsWriter (Cumbia *cumbia_tango, CuDataListener *tl)
 class constructor that's configured with CumbiaTango and CuDataListener instances More...
 
virtual ~CuTControlsWriter ()
 the class destructor. More...
 
QString target () const
 returns the configured target, or an empty string More...
 
void clearTarget ()
 remove the configured target, if any. More...
 
void setTarget (const QString &s)
 connect the writer to the Tango control system target More...
 
virtual void execute ()
 execute the target configured with setTarget. The value to write is taken from the return value of getArgs. More...
 
void sendData (const CuData &d)
 This is not implemented yet. More...
 
void getData (CuData &d_ino) const
 This is not implemented yet. More...
 
void setOptions (const CuData &o)
 set the options on the writer (before setTarget) More...
 

Detailed Description

implements CuControlsWriterA abstract class and provides an interface to connect a Tango writer to a target.

Built with references to CumbiaTango and CuDataListener, CuTControlsWriter implements CuControlsWriterA and connects a writer to the Tango control system through the setTarget method. setOptions can discretionary be called before setTarget.

Parameters and configuration can be sent and queried with sendData and getData respectively.

clearTarget can finally be called in order disconnect a writer, and if CuTControlsWriter is deleted, clearTarget is called automatically.

Constructor & Destructor Documentation

◆ CuTControlsWriter()

CuTControlsWriter::CuTControlsWriter ( Cumbia *  cumbia_tango,
CuDataListener *  tl 
)

class constructor that's configured with CumbiaTango and CuDataListener instances

Parameters
cumbia_tangoa pointer to a CumbiaTango instance
CuDataListenera pointer to an object implementing the CuDataListener interface

◆ ~CuTControlsWriter()

CuTControlsWriter::~CuTControlsWriter ( )
virtual

the class destructor.

The class destructors sets the invalidate flag on the listener, so that it won't be used later, and calls clearTarget

References clearTarget().

Member Function Documentation

◆ clearTarget()

void CuTControlsWriter::clearTarget ( )

remove the configured target, if any.

  • unlinks the attribute configuration listener
  • unlinks the writer listener

Referenced by ~CuTControlsWriter().

◆ execute()

void CuTControlsWriter::execute ( )
virtual

execute the target configured with setTarget. The value to write is taken from the return value of getArgs.

A CuTangoWriterFactory is used to start an activity managed by CumbiaTango. The activity deals with writing the value on an attribute or imparting a command once.

◆ getData()

void CuTControlsWriter::getData ( CuData &  d_ino) const

This is not implemented yet.

◆ sendData()

void CuTControlsWriter::sendData ( const CuData &  d)

This is not implemented yet.

◆ setOptions()

void CuTControlsWriter::setOptions ( const CuData &  o)

set the options on the writer (before setTarget)

This is usually called by CuTWriterFactory::create immediately after CuTControlsWriter is instantiated.

Referenced by CuTWriterFactory::create().

◆ setTarget()

void CuTControlsWriter::setTarget ( const QString &  s)

connect the writer to the Tango control system target

Parameters
sthe name of the writer target (Tango device attribute or command)
Usage
Normally, cumbia-qtcontrols widgets provide a setTarget method that deals with writer set up through CuContext. If you need to implement a custom writer, please refer to the CuContext documentation and to the examples offered by QuButton, QuApplyNumeric or QuWriter.
Target syntax
  • test/device/1/double_scalar(100.0): write 100.0 on the Tango double_scalar attribute
  • test/device/1/double_scalar: connect and prepare for later writing
  • inj/diagnostics/cm_inj.01->AcquireBackground: connect and prepare for imparting a command later on
  • $1->AcquireBackground same as above, but $1 is replaced by the first device name found in the command line arguments of the application
  • $1/double_scalar(&doubleSpinBox) same as above, but the parameter is sent according to the "value" property of the spin box with the name specified
This method starts one activity to configure the target (i.e. get attribute configuration or get command info). The configuration step is exploited by graphical elements to set minimum, maximum, alarm values, units and so on.

References CuTControlsUtils::replaceWildcards().

◆ target()

QString CuTControlsWriter::target ( ) const

returns the configured target, or an empty string

Returns
the configured target or an empty string if setTarget hasn't been called yet.
note
The returned string will contain the actual target, after wildcards have been replaced.

The documentation for this class was generated from the following files: