Repository navigation
configs: replace scripted (tcl) HALFILEs with flat hal files in sample configs - #4881
grandixximo wants to merge 1 commit into
Conversation
…e configs Sample sim configs built most of their hal setup by running LIB:basic_sim.tcl (and some additionally LIB:hookup_moveoff.tcl, LIB:wheeljogpins.tcl, LIB:xhc-hb04.tcl, ./extrajoints.tcl, or the plasmac sim tcl files) at startup. Per issue LinuxCNC#4524 the sample configs should be plain flat hal again: each affected ini now loads a <name>.hal (or <name>_core.hal where that name is already used) containing the explicit halcmd commands the scripts issued for that configuration. The flat files were generated by running each configuration and recording the resulting hal state (the equivalent-halfile mechanism built into basic_sim.tcl for the single-script configs, a full `halcmd save allu` dump for the multi-halfile configs), then verified by booting every modified config and by comparing the final hal state (components, signals, parameters) against the scripted originals. Default-valued dump noise is omitted; non-default settings are retained. Sim configs without base-thread functions use base_period_nsec=0 instead of creating an unused fast thread. - 77 configs that used only LIB:basic_sim.tcl get a flat file with the commands basic_sim.tcl issued for that ini, honoring its -no_* options - 18 configs with additional scripted halfiles (moveoff demos, extrajoints, locking-indexer wheeljog demos, xhc-hb04 pendant demos, plasmac2 sims) get a single flat file replacing their whole [HAL]HALFILE list; the [HAL]TWOPASS entries that only existed for the tcl scripts are removed - Tcl-only XHC_HB04_CONFIG and XHC_HB04_BUTTONS stanzas are replaced by explicit HAL settings and nets; HALUI MDI commands remain in the ini includes - the qtplasmac sims share qtplasmac_{metric,imperial}.hal through the existing common ini includes; the xz lathe demos get per-variant flat files since kinstype=BOTH changes the generated commands - mark xyzab-tdr-gui.py executable so its existing HALCMD loadusr works from a fresh checkout Not touched: configs/sim/axis/simtcl (deliberate haltcl/twopass demo). The hallib tcl files (basic_sim.tcl, sim_lib.tcl, hookup_moveoff.tcl, xhc-hb04.tcl, wheeljogpins.tcl) remain in place for user configs that reference them. Refs LinuxCNC#4524
|
I was possibly the originator of this idea, so I am in favour. |
|
Yes, it was discussed and agreed upon that all the example configs should be flat files and not depend on tcl/coded constructs. |
|
The core reasoning to do this, is to lower the entry bar to tweak Hal. It is a lot of lines to add, and from a programming perspective it seems atrocious, but this is being done for the first time users, opening a configuration and they will see the simple blocks they can play with, instead of trying to figure out how TCL parses stuff and where the base config lives. These configs are good to use as a base to then muck around and create your own, this is how I started with linuxcnc, and was quite disappointed seeing them become a further barrier of entry. |
Sample sim configs built most of their hal setup by running LIB:basic_sim.tcl (and some additionally LIB:hookup_moveoff.tcl, LIB:wheeljogpins.tcl, LIB:xhc-hb04.tcl, ./extrajoints.tcl, or the plasmac sim tcl files) at startup. Per issue #4524 the sample configs should be plain flat hal again: each affected ini now loads a .hal (or _core.hal where that name is already used) containing the explicit halcmd commands the scripts issued for that configuration.
The flat files were generated by running each configuration and recording the resulting hal state (the equivalent-halfile mechanism built into basic_sim.tcl for the single-script configs, a full
halcmd save alludump for the multi-halfile configs), then verified by booting every modified config and by comparing the final hal state (components, signals, parameters) against the scripted originals. Default-valued dump noise is omitted; non-default settings are retained. Sim configs without base-thread functions use base_period_nsec=0 instead of creating an unused fast thread.Not touched: configs/sim/axis/simtcl (deliberate haltcl/twopass demo).
The hallib tcl files (basic_sim.tcl, sim_lib.tcl, hookup_moveoff.tcl, xhc-hb04.tcl, wheeljogpins.tcl) remain in place for user configs that reference them.
Refs #4524