-
Notifications
You must be signed in to change notification settings - Fork 1.3k
DRAFT: ZMQ messages from HALUI to GUIs #3580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| FIELD(hal_bit_t,program_is_running) /* pin for notifying user that program is running */ \ | ||
| FIELD(hal_bit_t,halui_mdi_is_running) /* pin for notifying user that halui MDI commands is running */ \ | ||
| FIELD(hal_bit_t,program_is_paused) /* pin for notifying user that program is paused */ \ | ||
| FIELD(hal_bit_t,cycle_start) /* pin for running program */ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* pin for running program */
I think, this is ctrl+c ctrl+v bug.
What is different between cycle and program?
|
What is the "HALBRIDGE = hal_bridge" command in an ini file good for? In some ini files you use it, in some you don't, and in some it is commented out. |
|
Feel free to tell me what I should focus on in testing. |
|
Thank you for testing - I will try to answer your questions. Yes the control panel was just for basic testing, it would be nice to come up with a list of 'standard' buttons that each GUI would be expected to support. each GUI requires some code work to fully integrate. Dialog control is for the popup dialogs such as tool change or warnings. I believe I only coded Qtdragon to respond for manual tool changes and warnings when unpausing the spindle when the spindle is auto lifted. Panel.ui is just for testing the basic code - I have put no thought into final naming and most likely would build a gladevcp based panel for gmoccapy. I just copied and pasted for speed. program_run starts the program thru linuxcnc's command channel (so bypasses the GUI). I would be interested if HALUI INI MDI commands work better when they are a 'request' form HALUI for the GUI to run them. As I remember, you had some timing problems in Gmoccapy. |
|
I see the MDI buttons work in the gmoccapy test panel. Can you simulate the problem you had with HALUI MDI commands? |
|
I had three problems: |
|
I think both problems are improved by using this halui technique. I'll be interested in what you find. |
|
Hi, I need to explain more what is the goal of implementing ZMQ? I studied the codes of this PR today. I am even more confused. Previously, there were halui.mdi_commands in halui. These commands were triggered by the hal signal. The halui.cc file switched modes and triggered MDI commands. That was it. Now there is halui.gui.mdi-command-MACRO0. These commands are triggered by the hal signal as well. |
|
The HALUI pin halui.gui.mdi-command-MACRO0 uses ZMQ messages to request the GUI to run the commands it's self. The best place to make sure mode changes and widget changes that are in sync with the MDI commands is the GUI. HALUI is probably the most common way to connect a panel to the GUI, but because it thinks it's the only UI, some things like MDI and jogging do not work so well. HALUI and bridge are really the same program. Bridge is a python library pulled into HALUI. Gmoccapy use the library qtk_action to run the INI macro command. The key here is that Gmoccapy is the one that runs the INI macro command, so it can be programed to set appropriate widgets and modes without having to worry about what HALUI is doing. |
Not gtk_action.py? |
|
Thank you for picture. Right now, I can only be your rubber duck until I understand the whole thing.
@Sigma1912 made something similar #3504 Why is bridge just a library? Could you describe to me better how MACRO0 works when using Gmoccapy? MOTION CONTROLLER is still some kind of abstract thing for me. Which specific files are these? gtk_action.py / qtk_action.py should be in the GUI image. |
I miss spelled gtk_action |
|
ZMQ is not realtime.
gtk_action is just a library of python functions for doing GUI related chores such as sending MDI commands defined in the INI. bridge is part of HALUI, it extends HALUI to do the new functions. It can not work without HALUI. While there are other ways to work around these problems, I believe this is better and also it covers all the GUIs (when it;s finished) and a consistent interface for users. To summarize: |
Is NML realtime? |
|
Do you think that HAL between GUI and HALUI should be replaced by ZMQ in the future? |
|
Possibly but certainly not necessarily. I think the things that are very standard (say jogging, axis selection) are better done in standard way (in this case I chose HALUI) that does not require connecting HAL pins. I would bet that non standard things would still be added using HAL pins - it's easy to do |
|
Well I said without connecting HAL pins, but I meant not connecting HAL pins from the GUI to HALUI, you still connect some HAL pins in HALUI, say for a control panel. |
|
I always wondered why we need NML or ZMQ when theoretically we could be done via HAL? |
|
Outside my cone of hard knowledge, but as I under stand it, NML is a Neutral Message Layer for networking. I believer the idea was the GUI, IO controller and motion controller could be on different computers. Certainly the GUI side could be networked at one time. |
|
What advantages does ZMQ have over HAL? |
|
In this case, zmq automically connects the gui to halui and any other program that registers to it. This creates consistent information in the system and a consistent connection path for doing jogging or axis selection. |
|
Thank you for explaining your thoughts. Now I can get back to testing. My test procedure: Test number 1: Test number 2: Test number 3: |
|
For another test: You must modify in INI file: You must modify in gmoccapy.py My test procedure: Old mdi_commands make errors: New gui_mdi_commands can be broken by another python command without any message. |
|
Ok Excellent notes. Thank you for testing! |
mdi commands with a comma in it (ie MSG, text) would not be interpeted properly
named INI MDI commands were not recognised.
you can use STATUS messages to 'press' ok or cancel
so you can use halui to accept the toolchange
so GUIs not basd in gobject can run the message system
The indicator shows state, so we don't need to chow checked state. in a real panel the buttons would be momentary buttons anyways
this must have been fix in master after I branched
s32 is more common the u32 (easier to connect to) also axis select uses -1 as 'unselected'
Some GUIs use the MPG for other things then jogging. Qtdragon uses MPG for scrolling and needs a selected pin.
like if you want to send responses to the current showing dialog
halui 'ok' or 'cancel' messages
ok and cancel are used by the system unlock dialog as an example. To do this properly for all dialogs would require some more thought.
Sends out a jog rate gobject message
13f28ee to
98dd380
Compare
|
I don't want to discuss the pros/cons of Bridge now. |









This is the on going work started here:
#3528
This generalizes the idea for messages.
There are three proof of concept sims:
axis_halui_test.ini
gmoccapy_halui_test.ini
qtdragon_halui_test.ini
They will load the respective gui and a separate simulated control panel.
You can notice the jograte slider on the control panel changes the jog rate on the gui.
I would love it if someone could test these rough changes.