From 86ccb3b884f8ff25eb1b0e9d06c5565de4239d4b Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Mon, 15 Jun 2026 09:36:09 +0800 Subject: [PATCH] emccalib: ignore ini refs embedded in pin names 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 #4165). --- tcl/bin/emccalib.tcl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tcl/bin/emccalib.tcl b/tcl/bin/emccalib.tcl index 16b0d1f76d2..c856e9e5d03 100755 --- a/tcl/bin/emccalib.tcl +++ b/tcl/bin/emccalib.tcl @@ -179,12 +179,16 @@ proc find_ini_refs {stanza} { if { [lindex $halcommand 1] == "\=" } { set tmpstring "setp [lindex $halcommand 0] [lindex $halcommand 2]" } + # tunable item is the setp value (3rd token); ignore ini refs + # that only appear inside the pin name (issue #4165) + set valuestring [lindex $tmpstring 2] for {set sfx 0} {$sfx < $::EC($stanza,howmany)} {incr sfx} { set tabno $::EC($stanza,$sfx,tabno) set itag [lindex $::EC($stanza,suffixes) $sfx] - if {[string match *${stanza}${itag}* $tmpstring]} { + if {[string match *${stanza}${itag}* $valuestring]} { # this is a hal file search ordered loop - set thisininame [string trimright [lindex [split $tmpstring "\]" ] end ]] + set thisininame [lindex [split $valuestring "\]" ] end ] + set thisininame [string map {( "" ) ""} $thisininame] set lowername "[string tolower $thisininame]" set thishalcommand [lindex $tmpstring 1] set tmpval [string trim [hal getp [halcmdSubstitute $thishalcommand]]]