QTango questions

Hi,

I'm currently using QTango (latest version from svn) to build a GUI.

Regarding the implemented GUI widgets I have a few questions

Is it possible to fill the values of the TComboBox dynamically? E.g from a tango Command/attribute returning a DevVarStringArray?

I'd like to have a widget supporting the following things:
- Plot scalar attribute x vs scalar attribute y (I want to visualize a point in a 2D space)
- Changeable grid properties
- Changeable background color
Is modifying TPlotLightMarker the right thing to do?

Are there any widgets for displaying image data? In my case I need to visualize a gray16 encoded attribute. What is a good starting widget for my own implementation?

I want to call a commmand with a DevString array from a TPushButton. From my understanding this is currently not possible. What is the best place, source code wise, to tackle this?

Thanks a lot,
Thomas
Edited 8 years ago
Hello Thomas.
I've just joined the forum.
I quote here the email text I forwarded to the mailing list.
Best regards.

Giacomo



Hello Thomas, here some hints:

Is it possible to fill the values of the TComboBox dynamically? E.g from
a tango Command/attribute returning a DevVarStringArray?

No, but it is possible to fill it in with a "values" attribute property,
where the list elements are separated by newline.

I'd like to have a widget supporting the following things:

- Plot scalar attribute x vs scalar attribute y (I want to visualize a
point in a 2D space)

You can directly use QwtPlot, EPlotLightMarker (Qwt-derived) or
QGraphicsPlot, but there are no automatic QTango plots able to do it
automatically.

What I suggest is using a couple of QTWatcher (QTango watcher, i.e. a
reader) attached on x and y.
In the attached code you can find also an example of QTWatcher usage.

Anyway, in brief:

QTWatcher *xWatcher = new QTWatcher(this);
xWatcher->attach(this, SLOT(updateX(const QVector<double>&) ) );
xWatcher->setSource("$1/myXData");

/* the same for yWatcher */

Then inside updateX() and updateY() slots you change x and y data of the
plots.


Upon refresh, You can take the QVector<double> data and put it on the
plot axes, manually.
The advantage of using QTWatcher is that they are multi threaded.

- Changeable grid properties

Use Qwt methods on QwtPlot or EPlotLightXXX or use the documented
methods of QGraphicsPlot.
Right click on the QGraphicsPlot pops up a dialog where you can change
the properties of the grid and of every object.
The name of those properties reflect the names of the methods to call
programmatically in order to change them.

- Changeable background color
Is modifying TPlotLightMarker the right thing to do?

As stated before, you can choose between Qwt or QGraphicsPlot.
QGraphicsPlot is well documented.

Are there any widgets for displaying image data? In my case I need to
visualize a gray16 encoded attribute. What is a good starting widget for
my own implementation?

There is currently no such automatic reader. Take a look at the attached
code for an example.


I want to call a commmand with a DevString array from a TPushButton.
From my understanding this is currently not possible. What is the best
place, source code wise, to tackle this?

yes it is. myTPushButton->setTargets("$1->Command(my,string,array)");

just like it is possible, in general, to impart a command with multiple
argins by specifying the single values separate by commas in
the argument of the command:

myTPushButton->setTargets("$1->CommandIntegers(1,2,3)");

Also, if the values have to be read from other widgets (e.g. TLineEdit)
and then sent to a command:


myTPushButton->setTargets("$1->CommandStrings(&tLineEdit1,&tLineEdit2,&tLineEdit3)");

where tLineEdit1, tLineEdit2 and tLineEdit3 are the objectName of the
three TLineEdit.



Feel free to directly contact me at giacomo.strangolino@elettra.eu for
further details.

Giacomo.
Hello Thomas, here some hints:

Is it possible to fill the values of the TComboBox dynamically? E.g from
a tango Command/attribute returning a DevVarStringArray?

No, but it is possible to fill it in with a "values" attribute property,
where the list elements are separated by newline.

I'd like to have a widget supporting the following things:

- Plot scalar attribute x vs scalar attribute y (I want to visualize a
point in a 2D space)

You can directly use QwtPlot, EPlotLightMarker (Qwt-derived) or
QGraphicsPlot, but there are no automatic QTango plots able to do it
automatically.

What I suggest is using a couple of QTWatcher (QTango watcher, i.e. a
reader) attached on x and y.
In the attached code you can find also an example of QTWatcher usage.

Anyway, in brief:

QTWatcher *xWatcher =  new QTWatcher(this);
xWatcher->attach(this, SLOT(updateX(const QVector<double>&) ) );
xWatcher->setSource("$1/myXData");

/* the same for yWatcher */

Then inside updateX() and updateY() slots you change x and y data of the
plots.


Upon refresh, You can take the QVector<double> data and put it on the
plot axes, manually.
The advantage of using QTWatcher is that they are multi threaded.

- Changeable grid properties

Use Qwt methods on QwtPlot or EPlotLightXXX or use the documented
methods of QGraphicsPlot.
Right click on the QGraphicsPlot pops up a dialog where you can change
the properties of the grid and of every object.
The name of those properties reflect the names of the methods to call
programmatically in order to change them.

- Changeable background color
Is modifying TPlotLightMarker the right thing to do?

As stated before, you can choose between Qwt or QGraphicsPlot.
QGraphicsPlot is well documented.

Are there any widgets for displaying image data? In my case I need to
visualize a gray16 encoded attribute. What is a good starting widget for
my own implementation?

There is currently no such automatic reader. Take a look at the attached
code for an example.


I want to call a commmand with a DevString array from a TPushButton.
From my understanding this is currently not possible. What is the best
place, source code wise, to tackle this?

yes it is. myTPushButton->setTargets("$1->Command(my,string,array)");

just like it is possible, in general, to impart a command with multiple
argins by specifying the single values separate by commas in
the argument of the command:

    myTPushButton->setTargets("$1->CommandIntegers(1,2,3)");
Also, if the values have to be read from other widgets (e.g. TLineEdit)
and then sent to a command:


myTPushButton->setTargets("$1->CommandStrings(&tLineEdit1,&tLineEdit2,&tLineEdit3)");
where tLineEdit1, tLineEdit2 and tLineEdit3 are the objectName of the
three TLineEdit.



Feel free to directly contact me at giacomo.strangolino@elettra.eu for
further details.

Giacomo.
Thanks Giacomo for the explanations. I'll work through them and get back to you if more questions arise.
 
Register or login to create to post a reply.