Does anyone have any workarounds for getting multiple loadrt lines in .hal files so they do not conflict when they need the same modules? Machinekit has a workaround called instcomp which allows additional instances of a component to be incrementally added later.
www.machinekit.io/docs/hal/instcomp/
I would like to have the various hal files for my machine load their module dependencies and names on their own without crashing because the modules are already loaded. This is for the goal of code abstraction and configuration file reuse. It comes up in the context of me wanting to migrate my machine configuration from a parallel port configuration to a Mesa 7i76e and undoing the decade of config file sins I have committed (via git at
github.com/yeltrow/theshiz
)
I know I can put:
loadrt sum2 names=snazzysummer,dumbfilesummer
but that doesn't achieve a level of abstraction that could be useful. When do I see wanting that? To make things like PNCConf spit out a base set of definitions for things like pid loops that I can just add my configs to instead of needing go back and hand edit them.
for example in
#somethingsnazzy.hal
loadrt sum2 names=snazzysummer
#dumbfile.hal
loadrt sum2 names=dumbfilesummer
and then in mymachine.ini
[HAL]
HALFILE = somethingsnazzy.hal
HALFILE = dumbfile.hal
Maybe some sort of pre-processor?
Thank you very much for your thoughts. I really appreciate it!