UI for HAL development

More
5 years 3 months ago - 5 years 3 months ago #214250 by Aciera
Replied by Aciera on topic UI for HAL development
As far as I know it is not possible to add components at runtime. There has been work on this in machinekit but, as far as I'm aware, none of it has been incorporated into linuxcnc.
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.
Last edit: 5 years 3 months ago by Aciera.
The following user(s) said Thank You: mic

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #214271 by mic
Replied by mic on topic UI for HAL development

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?

Because I think thats the easiest way to build a drag and drop editor for HAL image missing /media/kunena/emoticons/laughing.png. 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.

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #214273 by Aciera
Replied by Aciera on topic UI for HAL development
Yes, but would it not be sufficient to run the hal file once, grab the pin list and then close it again?
The following user(s) said Thank You: mic

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #214332 by Grotius
Replied by Grotius on topic UI for HAL development
I think one way is to perform a "halcmd stop" then "halrun -U or a cleanup command" then reload hal file and then "halcmd start"
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.




 
The following user(s) said Thank You: mic

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #214458 by andypugh
Replied by andypugh on topic UI for HAL development

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?

I think that is the way to do it. Record the existing component links, unload the component, reload with one more, and re-make the connections.

Machinekit has the option to add extra instances at runtime. I think. My suggestion that this was a waste of time was met with an invitation to leave the project.

(I stand by that, in general, most configs are nearly static once they work) A config GUI like your project is a special case.
The following user(s) said Thank You: mic

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago - 5 years 3 months ago #214780 by mic
Replied by mic on topic UI for HAL development
Thank you very much. I´ll test the suggestions but it will take some time.First I have to deal with some performance issues because the canvas with all lcnc components is round about 100 times bigger than my screen image missing /media/kunena/emoticons/shocked.png
Last edit: 5 years 3 months ago by mic.

Please Log in or Create an account to join the conversation.

Time to create page: 0.185 seconds
Powered by Kunena Forum