Hello everyone! o> o/
[img]http://img153.imageshack.us/img153/3052/capturadetelas.png[/img]
This post is basically to ask an advice while constructing a GUI window using Qt that uses Orocos from background.
My application works with an Activity of 0.001 seconds and is a Data Aquisition Software for a Hall Thuster. I already finished with the Orocos kernel and I'm creating a beautiful and color window with displays and buttons that run my commands and methods from Orocos.
The LCDNumbers are running Ok.
The problem is: I can't make the buttons run my methods. I couldn't connect the signal 'clicked()' to my method: 'runDiagnosis()'. I'm almost 2 weeks trying and I couldn't get it! I made my Window Class inehrits a TaskContext too, it's really nice but it doesn't work with buttons, only lcdNumbers.
I want to ask an advice for you guys. What kind of libraries, softwares, do you ever used for a colorfull GUI Window with displays and buttons? Qt is easy to use but hard to make work...
GTK+? Anything? Free softwares?
I really thank anyone for the help.
Attachment | Size |
---|---|
Captura_de_tela.png | 356.51 KB |
[Advices for me?] Problems while constructing a GUI (Window usin
On Feb 12, 2010, at 20:01 , Alexandrenagy [..] ... wrote:
> Hello everyone! o> o/
>
> [img]http://img153.imageshack.us/img153/3052/capturadetelas.png[/img]
> http://img153.imageshack.us/img153/3052/capturadetelas.png
>
> This post is basically to ask an advice while constructing a GUI window using Qt that uses Orocos from background.
Do you mean that Orocos is running in a deployer in another process?
> My application works with an Activity of 0.001 seconds and is a Data Aquisition Software for a Hall Thuster. I already finished with the Orocos kernel and I'm creating a beautiful and color window with displays and buttons that run my commands and methods from Orocos.
>
> The LCDNumbers are running Ok.
>
> The problem is: I can't make the buttons run my methods. I couldn't connect the signal 'clicked()' to my method: 'runDiagnosis()'. I'm almost 2 weeks trying and I couldn't get it! I made my Window Class inehrits a TaskContext too, it's really nice but it doesn't work with buttons, only lcdNumbers.
Are you trying to connect Qt slots/signals to Orocos methods? Is that what I read above?
We've never tried to mix Qt and Orocos implementations in the same class, that is an interesting idea. Our approach has been to create a Qt-object based class that has all the methods, ports, etc, we want from the remote system. We then manually connect each of the ports, methods, etc, turning them into proxies for these items in the remote component. The Qt-object based class then wraps everything up with slots/signals for the Qt application to use.
> I want to ask an advice for you guys. What kind of libraries, softwares, do you ever used for a colorfull GUI Window with displays and buttons? Qt is easy to use but hard to make work...
> GTK+? Anything? Free softwares?
We use Qt extensively with Orocos. For methods from a remote component (e.g. in a deployer process, not in the GUI), particularly those with parameters, make sure you also call ControlTaskServer::ThreadOrb() at the GUI. This is needed to connect methods with parameters, as when the GUI attempts to connect to the remote component, that remote component will call back into the GUI. We were caught by this early on [1].
HTH
Stephen
[1] http://orocos.org/forum/orocos/orocos-users/mixing-corba-controltaskprox...
[Advices for me?]
I think I have made it work!
My GUI is an Orocos Peer and the class is like this:
class MyWindow : Public TaskContext, Public QWidget {
...
void updateHook();
void configureHook();
public slots:
void clickButton1();
void clickButton2();
void clickButton3();
...
}
On the ConfigureHook(), I used pointers to the methods and commands from my other Peers, exaclty like the examples from Orocos.
bool configureHook() {
...
TaskContext* peerAnode = this->getPeer("Anode");
Method1 = peerAnode->methods()->getMethod<double(void)>("VoltageAnode");
...
// many others.
}
Each Peer represents a Component of the Thuster. I construct a Peer for the Cathode, for the Anode, for the Energy Analyzer, and all others... I used connectPeers(MyWindow, otherOne) on the Main.cpp and worked fine. My Main.cpp starts all Peers and the last Peer is the MyWindow one, that open that GUI.
It's the same process.
I made the connections work! I connected the SIGNAL clicked() from the buttons to the SLOT wich is a void function. This void functions, for an example clickButton1(), is like this:
void clickButton1() {
.... Method1(); // this one, is a Pointer configured on configureHook().
}
I don't know if this is correct and if it keeps the 'real time' and 'thread-safe' property of Orocos. I'm using a normal clickButton1() function to call another Peer Method.
The LCDNumbers are updated in the updateHook() like this:
void updateHook() {
...
lcdAnode->display( voltageAnode() );
lcdCathode->display( voltageCathode() );
...
}
The Methods voltageAnode() and voltageCathode() are pointers for another Peer Methods, configured at configureHook() too.
I think it's running fine. All LCDNumbers are updated in each 0.001 second. I click on a button and it calls a method or a command from my another peers(components).
PS: I tried to connect the SIGNAL clicked() directly to a Method configured at configureHook() and didn't work. I could not make the Method turns into a SLOT. I think it's impossible. Anyway, I connected to a 'normal' method and on this method, I called the Peer's method. So, I think its working fine. :)
PS²: I let qt-creator to create my Makefile and the MOC things from QT. Since this, the connection of the buttons into functions worked :)
Thanks guys!
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
[Advices for me?] Problems while constructing a GUI (Window usin
I think I have made it work!
My GUI is an Orocos Peer and the class is like this:
class MyWindow : Public TaskContext, Public QWidget {
...
void updateHook();
void configureHook();
public slots:
void clickButton1();
void clickButton2();
void clickButton3();
...
}
On the ConfigureHook(), I used pointers to the methods and commands from my other Peers, exaclty like the examples from Orocos.
bool configureHook() {
... TaskContext* peerAnode = this->getPeer("Anode"); Method1 = peerAnode->methods()->getMethod<double(void)>("VoltageAnode");
... // many others. }
Each Peer represents a Component of the Thuster. I construct a Peer for the Cathode, for the Anode, for the Energy Analyzer, and all others... I used connectPeers(MyWindow, otherOne) on the Main.cpp and worked fine. My Main.cpp starts all Peers and the last Peer is the MyWindow one, that open that GUI.
I made the connections work! I connected the SIGNAL clicked() from the buttons to the SLOT wich is a void function. This void functions, for an example clickButton1(), is like this:void clickButton1() {
.... Method1(); // this one, is a Pointer configured on configureHook(). }
I don't know if this is correct and if it keeps the 'real time' and 'thread-safe' property of Orocos. I'm using a normal clickButton1() function to call another Peer Method.
The LCDNumbers are updated in the updateHook() like this:void updateHook() {
... lcdAnode->display( voltageAnode() );
lcdCathode->display( voltageCathode() );
... }
The Methods voltageAnode() and voltageCathode() are pointers for another Peer Methods, configured at configureHook() too.
I think it's running fine. All LCDNumbers are updated in each 0.001 second. I click on a button and it calls a method or a command from my another peers(components).
PS: I tried to connect the SIGNAL clicked() directly to a Method configured at configureHook() and didn't work. I could not make the Method turns into a SLOT. I think it's impossible. Anyway, I connected to a 'normal' method and on this method, I called the Peer's method. So, I think its working fine. :)
PS²: I let qt-creator to create my Makefile and the MOC things from QT. Since this, the connection of the buttons into functions worked :)
Thanks guys!
[Advices for me?] Problems while constructing a GUI (Window usin
Hello everyone! o> o/
[img]http://img153.imageshack.us/img153/3052/capturadetelas.png[/img]
http://img153.imageshack.us/img153/3052/capturadetelas.png
This post is basically to ask an advice while constructing a GUI window using Qt that uses Orocos from background.
My application works with an Activity of 0.001 seconds and is a Data Aquisition Software for a Hall Thuster. I already finished with the Orocos kernel and I'm creating a beautiful and color window with displays and buttons that run my commands and methods from Orocos.
The LCDNumbers are running Ok.
The problem is: I can't make the buttons run my methods. I couldn't connect the signal 'clicked()' to my method: 'runDiagnosis()'. I'm almost 2 weeks trying and I couldn't get it! I made my Window Class inehrits a TaskContext too, it's really nice but it doesn't work with buttons, only lcdNumbers.
I want to ask an advice for you guys. What kind of libraries, softwares, do you ever used for a colorfull GUI Window with displays and buttons? Qt is easy to use but hard to make work...
GTK+? Anything? Free softwares?
I really thank anyone for the help.