Skip to content

configs: replace scripted (tcl) HALFILEs with flat hal files in sample configs - #4881

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:flatten-sim-configs
Open

grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:flatten-sim-configs

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

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 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 #4524

…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
@andypugh

Copy link
Copy Markdown
Collaborator

I was possibly the originator of this idea, so I am in favour.
However, I would like to see some more opinions before comitting to merging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants