Repository navigation
Replies: 9 comments 3 replies
|
if I understand the problem correctly, the "race condition" is caused only if the MDI command is executed from Halui commands. That is why I am asking myself, should an MDI command be handled through halui, or is an MDI command in the responsibility of the GUI? IMHO halui is not the correct way to handle halui commands. A lot of problems we solved on gmoccapy was caused by mixing Halui stuff and GUI related parts. I would suggest a way, where a GUI does get an information if an halui MDI command should be run, as this way the GUI may avoid mode switches I am open for more discussion. |
|
I think that, technically, it should be possible to make several different architectures work reliably and without bugs. However, I don't want to get involved in the discussion about which architecture would be better for us. I have done that in the past, and in the end I think I only added confusion to the discussion. So I can discuss LinuxCNC only from the perspective of a tester, user, and integrator. Personally, I don't want to advocate either HALUI MDI commands or GUI MDI commands. What I would like to advocate for, though, is that there should not be two different ways of doing the same thing, each with different behavior or different problems. I think we should look for a solution that is consistent and reliable from the user's point of view, regardless of which architecture is used internally. Are you familiar with Chris's work with ZMQ? #3580 If I understand it correctly, he has actually created a third approach: halui.gui.mdi-command. Here, I have proposed a new type of macro from the perspective of the user and the integrator: |
|
In my opinion this should clearly be a part of task(Im moving halui into task) - running a mdi command is also useful if you dont have a gui at all. |
|
So HALUI has MDI commands for when you might not have a GUI. But because it was easy for users to use it was used when there was a GUI in the mix. That does not work well as we agree. So you should not get rid of the HALUI mdi command, you just shouldn't use it when using a GUI. If using a GUI, the GUI must be the one to run the command for several reasons. My HALIU ZMQ code allowed three different ways, only to support the popular ways till we agreed on a single process. |
|
@zz912 What the most amount of MDI commands you have added to a system? |
|
How does the UI know the MDI command is finished? Does it need to know? |
|
I have to agree with zz19 here, there should be one way of doing it, that works. mode switchingall the problems with mode switching are gone in my branch - mode is readonly, and cannot be changed. running mdi from HAL pinthis should be a buildin feature of task, that always works with any UI, or even without any UI present. running mdi from the UII dont know why hal/halui needs to be involved here at all? you can just run the command, show messages, check things, and do whatever you want. its one line of code. just run the command. ConfigurationIt probably makes sense to unify the configuration. |
|
Hello Rene, I’ve already started working on a configuration proposal for shared MDI commands here: #3580 (comment) I approached it purely from the perspective of a LinuxCNC integrator, not a LinuxCNC developer. What do you think about this approach? |
|
nice, I have not seen that! this is exactly what I talked about, one way of defining the macros, and multiple ways of running them, depending on what you need. |
Uh oh!
There was an error while loading. Please reload this page.
Background
There are currently several ways to start an MDI command in LinuxCNC. This can lead to different behavior depending on how the command was triggered and how the particular GUI handles the resulting mode changes.
I originally opened PR #3441 to address a specific problem in Gmoccapy. When a
haluiMDI command is executed, LinuxCNC temporarily switches to MDI mode and then returns to the previous mode:Original mode → MDI → Original modeFor short commands, this can happen so quickly that the GUI may only briefly switch to the MDI page. In Gmoccapy, I have also seen cases where the rapid sequence of mode changes can result in GUI elements remaining disabled when they should not be.
I don't think that making this screen change less visible, or simply preventing the GUI from switching pages, is the right long-term solution.
One mechanism for MDI commands
I would prefer LinuxCNC to have one common mechanism for creating/executing MDI commands, rather than maintaining several parallel mechanisms with different behavior.
This was already discussed in PR #3580. I wrote:
HansU replied:
PR #3580 then explored using communication between HALUI and the GUI, with the GUI being responsible for executing the INI-defined MDI command. The idea was interesting because it also allows the GUI to decide how it should react to the command, instead of reacting afterwards to mode changes initiated elsewhere.
The particular implementation of #3580 was later reverted, so I don't want to prescribe that implementation here. The architectural question, however, still seems relevant to me.
What I would like to achieve
I would like to see a common way of handling MDI commands which:
Original → MDI → OriginalGUI page switching;The exact implementation should be decided separately. This issue is intentionally not proposing a specific implementation.
Why I am closing PR #3441
PR #3441 addresses a real problem, but I no longer think that its Gmoccapy-specific implementation should be merged as the final solution.
The problem is more general than Gmoccapy, and I think it would be better to solve it at the appropriate level so that all GUIs can benefit from the same behavior.
For that reason, I am closing #3441 in favor of this issue rather than continuing to modify Gmoccapy around the current MDI mechanism.
Current situation
I also think it makes sense to wait before implementing another solution here.
Chris has been working on the HALUI ↔ GUI communication using ZMQ. I don't understand the ZMQ implementation well enough to judge what the final architecture should look like, and I don't want to introduce another solution in parallel while that work is still evolving.
My preference is therefore to keep this issue as a record of the problem and the desired direction, and first see where the work on the HALUI/GUI communication leads.
Once that direction is clear, this issue can be revisited and the appropriate solution can be implemented at a level that is useful for all GUIs, rather than adding another Gmoccapy-specific workaround.
All reactions