UI for HAL development
in this Thread i want to show some work in progress and collect some ideas to deal with unsolved issues.
There are some current Threads about HAL visualisation like halviewer but for users wich are new to lcnc it´s not very easy to deal with HAL.
For that reason and for easy debugging a graphical representation of the complete HAL environment would be very nice.
Current Features:
- Show HAL Component Instances
- Connect Component Instances with Drag and Drop
- Show all available HAL Components with description
- Add Instances of Components to HAL with Drag and Drop (multiple instances not supported)
- Show HAL Values of Signals
Planned Features:
- Generate and edit HAL Files
Now the Repo is available on Github: github.com/dev-git-usr/HAL-Editor
But pay attention - it´s only a proof of concept, it may crash your LCNC instance -> don´t use in production environment.
Ideas and feedback is also very welcome.
Please Log in or Create an account to join the conversation.
Hi together,Most features can be done with halcmd but it´s not able to list all availble components. Does anyone know how to list all available Components with the Pins and Parameters of these Components without adding them to HAL?
I think that it is a difficult problem, as the HAL pins can be altered by load-time parameters. (And in the case of Mesa smart-serial devices the pin names are chosen by the daughter-card firmware, so are not even in the LinuxCNC database)
I am afraid that the only option I can think of is look in /usr/lib/linuxcnc/modules for the list.
Then consider parsing the manpage output to find the modparams.
For modules that are already loaded, it may be possible to interrogate files in /proc/ and /sys/ but having started a halrun session and loaded an and2 I was not able to find it anywhere. (bit maybe I looked incompetently)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
www.dropbox.com/s/fid4uskzyyuoulf/HAL-Editor_small.mp4?dl=0
now it´s possible to view Manuals, add and remove Components to HAL an connect them by Signals...
At the moment i have some trouble adding multiple instances of a Component like "loadrt and2 count=3" - HAL does not support adding an instance if another instance of a component does already exist.
Question to some experienced HAL-Guys: Is there a possibility to deal with adding Components at Runtime?
Could I use a workaround like removing the Component and adding the needed count of Instances and connect the previous existing ones again or are there some pitfalls?
Thank you very much.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The Manual says:
With TWOPASS processing, all [HAL]HALFILES are first read and multiple appearances of loadrt directives for each module are accumulated. User components (loadusr) are loaded in order but no other hal commands are executed in the initial pass.
Please Log in or Create an account to join the conversation.
But maybe Andy has more information on this.
I don't quite understand why you need to add the components at runtime. Why would you run the hal file and edit it at the same time? Would you not create/edit the hal file and then run it, just like when using a texteditor?
I guess it could be interesting to use your editor at runtime to monitor signals but for that there is no need to add components while monitoring.
Please Log in or Create an account to join the conversation.
Because I think thats the easiest way to build a drag and drop editor for HAL . As Andy said it´s possible that ports are altered by runtime parameters, so I have to simulate the complete HAL to build a proper "offline" editor. I thought it´s easier to go the other way round and send some commands to HAL like "add component xy", see what´s happened and view the result it in the editor.I don't quite understand why you need to add the components at runtime. Why would you run the hal file and edit it at the same time? Would you not create/edit the hal file and then run it, just like when using a texteditor?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
If you imagine the halpin's etc in a circulair buffer. This buffer must reserve memory before it can add pin's. Therefore
the hal has to be stopped.
In programming land, inserting value's into a existing array's (vectors) is in fact copying the whole array again with a new value with it.
One way to insert pin's at runtime is to copy the hal into another thread and switch back when the process of moderating is finished. I did not test this. It's just an idea.
Please Log in or Create an account to join the conversation.