Skip to content

emccalib: ignore ini refs embedded in pin names (#4165)#4166

Open
grandixximo wants to merge 1 commit into
LinuxCNC:2.9from
grandixximo:fix-4165-emccalib-iniref
Open

emccalib: ignore ini refs embedded in pin names (#4165)#4166
grandixximo wants to merge 1 commit into
LinuxCNC:2.9from
grandixximo:fix-4165-emccalib-iniref

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Fixes #4165.

The calibration tool (emccalib.tcl) crashed with invalid command name ".main.top.fpage2.next-(mesa_pwm_pin).dither true" when a HAL file used ini-variable expansion inside a pin name, e.g.:

setp hm2_[MESA](BOARD).0.pwmgen.[JOINT_2](MESA_PWM_PIN).dither true

find_ini_refs matched the stanza anywhere on the line and derived the ini name by splitting the whole line on ] and taking the last token. That assumes the ini reference is the setp value (setp pid.0.Pgain [JOINT_0]PGAIN). With the reference in the pin name it produced (mesa_pwm_pin).dither true, yielding an invalid Tk widget path that later blew up in iniTuneButtonpress.

Fix: only treat a line as tunable when the ini reference is the setp value (3rd token), and derive the name from that token (stripping parens for the [SEC](NAME) form).

Verified on @NoGare's config: pin-name refs are now ignored, while genuine tunables on the same lines (.scale [JOINT_2]SCALE, [JOINT_2](ENCODER_SCALE)) still appear; normal setp pin [SEC]NAME configs are unaffected.

@NoGare please test against your config and confirm.

Only treat a setp line as tunable when the ini reference is the value
being set, not when it appears inside the pin name.  Fixes the invalid
widget name crash in the calibration tool (issue LinuxCNC#4165).
@grandixximo

Copy link
Copy Markdown
Contributor Author

If this works should merge to 2.10

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

Labels

2.10-candidate would be nice to have fixed in 2.10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant