Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Control multiple machines with one gui
I have to do a GUI for control eight machines. All the machines have the same options.
I can do a GUI that contains all the buttons, text edits, etc, but this mean that I have to replicate the code eight times.
I don't know if it is possible do only one and get the control of all machines based on it. Any type of help is welcome.
the_ last edited by
Maybe you can provide some more information so it will make it easier to help
- what kind of machines are you talking about?
- what do you mean with "control" them?
Control them mean:
Select the function mode (manual or automatic)
In manual mode, move x meters, validate results
Report operation errors
But how do you connect or talk to machine?
We send the command to other "pc" that interact with machines using MODBUS-TCP. The commands of buttons have the same function but they have to act over different devices. For example I have eight move buttons, all of them have the same function (send the command move) but each one send the command to a different device.
PD: sorry if my english is not good but it is not my maternal language
Your english is fine. :) most of us are not native English either.
Ok. via TCP.
So why cannot you not have a a machine selector. Like Combobox
where u select machine. ?
And then the move buttons will send to that machine.
If u choose no 2 machine, it sends to that one. etc.
It would be strange design to have 8 Move buttons. Unless there is
good reason , i completely missed :)
the_ last edited by
One reason could be that you want send the same command to multiple machines at the same time.
Maybe a ListView with multiselect would be a slightly better solution.
Indeed. In such case a list will be better. :)
But having 8 move buttons
would still not really be at same time as there would be delay
moving mouse between them and clicking.
But Im just guessing. Not sure what his requirements are. :)
Imagine this GUI (image hear). I can have an Id for each machine but in that case I need a switch/if...else to select the correct objective.
I want know if it is posible only do the GUI for machine1, then do a complete gui with multiple elements of type GUI for machine1 and manage those elements with some class/function of high level of Qt.
Are you asking if its possible to just have one GUI instead of many of the same
and then just select machine or
what is the real question?
I dont understand the last part.
"if it is posible only do the GUI for machine1, then do a complete gui with multiple elements of type GUI for machine1"
But most likely the answer is yes :)
So when you press button it will call
DoMoveCommand( SelectedMachine, xxx)
A Former User last edited by
Hi! In Qt Creator, in your project, select "Add new...", then "Qt Designer Form Class" and then choose "Widget" as a form template. You can now build a widget containing all the buttons and stuff to control a single machine. This widget is reusable, this means you can add as many instances of it to your main window as you like.
...You can now build a widget containing all the buttons and stuff to control a single machine. This widget is reusable, this means you can add as many instances of it to your main window as you like.
Ok, that is the idea. I'll try build a widget.
Thank you all.
so you want 8 times the same GUI?
Not 1 GUI and u select machine?
Yes, it is a requisite
Ok, then a widget is best approach.
And then create 8 instances in the mainwindow.