cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
|
A class that can be used to write values from (almost) any kind of widget or object. More...
#include <quwriter.h>
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... | |
QuValueFilter * | refreshFilter () 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 |
A class that can be used to write values from (almost) any kind of widget or object.
QuWriter::QuWriter | ( | QObject * | parent, |
Cumbia * | cumbia, | ||
const CuControlsWriterFactoryI & | w_fac | ||
) |
the class constructor
parent | the QObject which will be the parent for the QuWriter. |
QuWriter::QuWriter | ( | QObject * | w, |
CumbiaPool * | cumbia_pool, | ||
const CuControlsFactoryPool & | fpool | ||
) |
|
virtual |
|
virtual |
Signal signal of the executor is connected to the execute method of this class.
The available slots are listed below.
executor | the QObject to which we connect to receive an execution signal |
signal | the signal name, declared with the SIGNAL macro which we are listening for |
setPointSlot | provide a custom slot to initialize the set point value inside the auto configuration method. |
connType | the Qt connection type. |
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.
|
virtualslot |
empty argument version. Takes the input arguments to write from the targets
\bref the execute method tailored for a void input value
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.
|
virtualslot |
\bref the execute method tailored for boolean values
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
virtualslot |
\bref the execute method tailored for string values
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
virtualslot |
The execute method tailored for a list of strings.
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
virtualslot |
The execute method tailored for a vector of booleans.
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
virtualslot |
The execute method tailored for a vector of double.
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
virtualslot |
The execute method tailored for a vector of integers.
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
virtualslot |
\bref the execute method tailored for double values
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
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().
|
virtualslot |
\bref the execute method tailored for short integer values
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
virtualslot |
\bref the execute method tailored for unsigned integer values
References CuControlsWriterA::execute(), postExecute(), Qumbiaizer::quizer_ptr, and CuControlsWriterA::setArgs().
|
slot |
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().
|
slot |
References CuControlsWriterA::setTarget(), and target.
QString QuWriter::target | ( | ) | const |
References CuControlsWriterA::target().
|
readwrite |
Referenced by execute(), and setTarget().