cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
Public Slots | Public Member Functions | Properties | List of all members
QuWriter Class Reference

A class that can be used to write values from (almost) any kind of widget or object. More...

#include <quwriter.h>

Inheritance diagram for QuWriter:
Inheritance graph
[legend]

Public Slots

void setTarget (const QString &target)
 
virtual void execute (int)
 the execute method tailored for integer values More...
 
virtual void execute (short)
 
virtual void execute (const QString &)
 
virtual void execute (double)
 
virtual void execute (unsigned int)
 
virtual void execute ()
 empty argument version. Takes the input arguments to write from the targets More...
 
virtual void execute (bool)
 
virtual void execute (const QStringList &)
 The execute method tailored for a list of strings. More...
 
virtual void execute (const QVector< int > &)
 The execute method tailored for a vector of integers. More...
 
virtual void execute (const QVector< double > &)
 The execute method tailored for a vector of double. More...
 
virtual void execute (const QVector< bool > &)
 The execute method tailored for a vector of booleans. More...
 
void onUpdate (const CuData &data)
 

Public Member Functions

 QuWriter (QObject *parent, Cumbia *cumbia, const CuControlsWriterFactoryI &w_fac)
 the class constructor More...
 
 QuWriter (QObject *w, CumbiaPool *cumbia_pool, const CuControlsFactoryPool &fpool)
 
virtual ~QuWriter ()
 
virtual void attach (QObject *executor, const char *signal, const char *setPointSlot=NULL, Qt::ConnectionType connType=Qt::AutoConnection)
 Signal signal of the executor is connected to the execute method of this class. More...
 
void postExecute ()
 executes some code after QTangoComProxyWriter::execute is called. More...
 
QString target () const
 
- Public Member Functions inherited from Qumbiaizer
 Qumbiaizer (QObject *parent)
 
virtual ~Qumbiaizer ()
 
bool error () const
 
QString message () const
 
virtual void attach (QObject *object, const char *method, const char *setPointSlot=NULL, Qt::ConnectionType connType=Qt::AutoConnection)
 associate a QObject and one or two methods to be invoked by the class on new data arrival (QTWatcher) or on target execution (QTWriter). More...
 
void attach (short *s)
 
void attach (double *d)
 
void attach (int *i)
 
void attach (unsigned int *u)
 
void attach (QString *qs)
 
void attach (bool *b)
 
void attach (QStringList *sl)
 
void attach (QVector< double > *v)
 
void attach (QVector< int > *vi)
 
void attach (QVector< bool > *vb)
 
Type type () const
 
QString slot () const
 
QString methodName () const
 returns the method name, without the full signature. More...
 
QString setPointSlot () const
 
QString setPointMethodName () const
 
void * data ()
 
Qt::ConnectionType connectionType () const
 
void setAutoConfSlot (AutoConfType act, const char *slot)
 when minimum and maximum values are available, these slots are invoked. More...
 
bool inTypeOfMethod (const QString &method, QObject *obj, char *in_type)
 writes into the in_type parameter the type of the input argument of the given method of the object obj. More...
 
int extractCode (QString &method)
 extracts the signal/slot code at the beginning of the method name More...
 
void removeRefreshFilter (QuValueFilter *filter)
 removes filter from the object. More...
 
void installRefreshFilter (QuValueFilter *filter)
 install the QTRefreshFilter filter into the QTangoizer. More...
 
QuValueFilterrefreshFilter () const
 returns the currently installed refresh filter. More...
 
void setSingleShot (bool singleShot)
 Call this one before setSource to ensure that only one read is performed. More...
 
void setAutoDestroy (bool autoDestroy)
 set single shot and then destroy the object right after the execution More...
 
bool autoDestroy () const
 returns true if the object auto destroys itself after first execution. More...
 
bool singleShot () const
 returns the singleShot property. More...
 
void setToolTipsDisabled (bool disable)
 
bool toolTipsDisabled () const
 
const char * type_str (Type t) const
 

Properties

QString target
 

Additional Inherited Members

- Public Types inherited from Qumbiaizer
enum  Type {
  Invalid = -1 , Void , Int , Double ,
  UInt , Short , String , Bool ,
  BoolVector , DoubleVector , StringVector , IntVector
}
 
enum  AutoConfType {
  Min , Max , MinWarn , MaxWarn ,
  MinErr , MaxErr , StdUnit , Unit ,
  DisplayUnit , Description , Label
}
 Supported auto configuration parameters with which you can invoke slots on the attached refreshee. More...
 
- Signals inherited from Qumbiaizer
void configured (const CuData &)
 auto configuration signal. More...
 
void connectionOk (bool ok)
 emitted when the type of data received within onUpdate is set to property More...
 
void connectionErrorMessage (const QString &msg)
 a signal that contains the error message related to setSource - or setTargets - failures. More...
 
void refreshMessage (const QString &message)
 Emitted by the refresh method. The message is taken from the TVariant. More...
 
void readOk (bool success)
 this signal is emitted by the QuWatcher::onUpdate method and the success parameter indicates whether the reading is successful or not. More...
 
void newData (short s)
 newData for short data types More...
 
void newData (int i)
 newData for int data types More...
 
void newData (double d)
 newData for double data types More...
 
void newData (const QString &s)
 newData for string data types More...
 
void newData ()
 
void newData (unsigned int ui)
 newData for unsigned int data types More...
 
void newData (unsigned short us)
 newData for unsigned short data types More...
 
void newData (bool b)
 newData for unsigned bool data types More...
 
void newData (const QVector< double > &)
 newData for vector of double data types More...
 
void newData (const QVector< int > &vi)
 newData for vector of int data types More...
 
void newData (const QVector< bool > &bv)
 newData for vector of boolean More...
 
void newData (const QStringList &slv)
 newData for string list More...
 
void newData (const CuData &data)
 newData signal passing the whole data bundle More...
 
- Protected Slots inherited from Qumbiaizer
virtual void configure (const CuData &data)
 Configures the attached object, if any. More...
 
virtual void updateValue (const CuData &v, bool read=true, const char *customMethod=NULL, QuValueFilter::State updateState=QuValueFilter::Update)
 updates the listener with the new value More...
 
- Protected Attributes inherited from Qumbiaizer
QumbiaizerPrivate * quizer_ptr
 

Detailed Description

A class that can be used to write values from (almost) any kind of widget or object.

Constructor & Destructor Documentation

◆ QuWriter() [1/2]

QuWriter::QuWriter ( QObject *  parent,
Cumbia *  cumbia,
const CuControlsWriterFactoryI w_fac 
)

the class constructor

Parameters
parentthe QObject which will be the parent for the QuWriter.

◆ QuWriter() [2/2]

QuWriter::QuWriter ( QObject *  w,
CumbiaPool *  cumbia_pool,
const CuControlsFactoryPool fpool 
)

◆ ~QuWriter()

QuWriter::~QuWriter ( )
virtual

Member Function Documentation

◆ attach()

void QuWriter::attach ( QObject *  executor,
const char *  signal,
const char *  setPointSlot = NULL,
Qt::ConnectionType  connType = Qt::AutoConnection 
)
virtual

Signal signal of the executor is connected to the execute method of this class.

The available slots are listed below.

Parameters
executorthe QObject to which we connect to receive an execution signal
signalthe signal name, declared with the SIGNAL macro which we are listening for
setPointSlotprovide a custom slot to initialize the set point value inside the auto configuration method.
connTypethe Qt connection type.
Example
QuWriter *dualWriter = new QuWriter(this);
dualWriter->attach(ui.writeDial, SIGNAL(sliderMoved(int)), SLOT(setValue(int)));
dualWriter->setTargets("test/device/1/double_scalar");
A class that can be used to write values from (almost) any kind of widget or object.
Definition: quwriter.h:27
virtual void attach(QObject *executor, const char *signal, const char *setPointSlot=NULL, Qt::ConnectionType connType=Qt::AutoConnection)
Signal signal of the executor is connected to the execute method of this class.
Definition: quwriter.cpp:60

Every time the slider is moved, it emits sliderMoved(int) signal. The QuWriter internally connects sliderMoved(int) signal to the execute(int) slot, recognizing the signal input parameter type. In the example above, when auto configuration of "test/device/1/double_scalar" is available, the current set point of double_scalar is set on the widget via the setValue(int) SLOT.

Reimplemented from Qumbiaizer.

References Qumbiaizer::attach(), execute(), Qumbiaizer::extractCode(), Qumbiaizer::inTypeOfMethod(), Qumbiaizer::setPointSlot(), and TYPELEN.

◆ execute [1/11]

void QuWriter::execute ( )
virtualslot

empty argument version. Takes the input arguments to write from the targets

\bref the execute method tailored for a void input value

See also
void execute(int)

targets are analysed and an input argument is extracted, if possible. Otherwise the writing is performed with an empty value. For example, if targets are

p/power_supply/super_ps/Current(&doubleSpinboxCurrent)

the value of the current is taken by the spinbox with name doubleSpinboxCurrent

References CuControlsWriterA::execute(), CuControlsUtils::getArgs(), postExecute(), Qumbiaizer::quizer_ptr, CuControlsWriterA::setArgs(), and target.

◆ execute [2/11]

void QuWriter::execute ( bool  bo)
virtualslot

\bref the execute method tailored for boolean values

See also
void execute(int)

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ execute [3/11]

void QuWriter::execute ( const QString &  s)
virtualslot

\bref the execute method tailored for string values

See also
void execute(int)

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ execute [4/11]

void QuWriter::execute ( const QStringList &  sl)
virtualslot

The execute method tailored for a list of strings.

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ execute [5/11]

void QuWriter::execute ( const QVector< bool > &  bv)
virtualslot

The execute method tailored for a vector of booleans.

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ execute [6/11]

void QuWriter::execute ( const QVector< double > &  dv)
virtualslot

The execute method tailored for a vector of double.

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ execute [7/11]

void QuWriter::execute ( const QVector< int > &  iv)
virtualslot

The execute method tailored for a vector of integers.

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ execute [8/11]

void QuWriter::execute ( double  dou)
virtualslot

\bref the execute method tailored for double values

See also
void execute(int)

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ execute [9/11]

void QuWriter::execute ( int  i)
virtualslot

the execute method tailored for integer values

The execute method can be reimplemented in subclasses to specialize its behaviour. By default, the signal provided inside attach method is connected to this slot, when the signal has an integer input type. For instance, when the value of a QSpinBox changes, this slot can be invoked.

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

Referenced by attach().

◆ execute [10/11]

void QuWriter::execute ( short  s)
virtualslot

\bref the execute method tailored for short integer values

See also
void execute(int)

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ execute [11/11]

void QuWriter::execute ( unsigned int  i)
virtualslot

\bref the execute method tailored for unsigned integer values

See also
void execute(int)

References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().

◆ onUpdate

void QuWriter::onUpdate ( const CuData &  data)
slot

◆ postExecute()

void QuWriter::postExecute ( )

executes some code after QTangoComProxyWriter::execute is called.

Normally it tests whether the user wants the object to be destroyed after execution

References Qumbiaizer::quizer_ptr.

Referenced by execute(), and onUpdate().

◆ setTarget

void QuWriter::setTarget ( const QString &  target)
slot

◆ target()

QString QuWriter::target ( ) const

Property Documentation

◆ target

QString QuWriter::target
readwrite

Referenced by execute(), and setTarget().


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