diff --git a/site_ansto/instrument/util/gen_sct.py b/site_ansto/instrument/util/gen_sct.py index de3f7457..e6de8e13 100755 --- a/site_ansto/instrument/util/gen_sct.py +++ b/site_ansto/instrument/util/gen_sct.py @@ -1411,17 +1411,17 @@ def put_read_config(MyDriver): txt += ['proc %s::read_config {} {' % MyDriver['namespace']] txt += [' set catch_status [ catch {'] txt += [' set ns "%s"' % MyDriver['namespace']] - txt += [' dict for {k v} $::config_dict {'] - txt += [' if { [dict exists $v "implementation"] } {'] - txt += [' if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {'] + txt += [' dict for {k u} $::config_dict {'] + txt += [' if { [dict exists $u "implementation"] } {'] + txt += [' if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } {'] txt += [' continue'] txt += [' }'] - txt += [' set enabled [string tolower [dict get $v "enabled"]]'] + txt += [' set enabled [string tolower [dict get $u "enabled"]]'] txt += [' if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } {'] txt += [' continue'] txt += [' }'] - txt += [' set name [dict get $v name]'] - txt += [' set implementation [dict get $v "implementation"]'] + txt += [' set name [dict get $u name]'] + txt += [' set implementation [dict get $u "implementation"]'] txt += [' if { !([dict exists $::config_dict $implementation]) } {'] txt += [' continue'] txt += [' }'] @@ -1459,15 +1459,21 @@ def put_read_config(MyDriver): txt += [' }'] txt += [' }'] if 'make_args' in MyDriver: - txt += [' set arg_list [list]'] + txt += [' set arg_list [list]'] + txt += [' set missing_list [list]'] txt += [' foreach arg {' + MyDriver['make_args'] + '} {'] - txt += [' if {[dict exists $v $arg]} {'] + txt += [' if {[dict exists $u $arg]} {'] + txt += [' lappend arg_list "[dict get $u $arg]"'] + txt += [' } elseif {[dict exists $v $arg]} {'] txt += [' lappend arg_list "[dict get $v $arg]"'] txt += [' } else {'] txt += [' ${ns}::sics_log 9 "Missing configuration value $arg"'] - txt += [' error "Missing configuration value $arg"'] + txt += [' lappend missing_list $arg'] txt += [' }'] txt += [' }'] + txt += [' if { [llength $missing_list] > 0 } {'] + txt += [' error "$name is missing configuration values $missing_list"'] + txt += [' }'] txt += [' if { [string equal -nocase ${asyncqueue} "sct"] } {'] txt += [' add_%s ${name} ${IP} ${PORT} {*}$arg_list' % MyDriver['name']] txt += [' } else {']