Make all sct drivers.
This commit is contained in:
@@ -27,7 +27,7 @@ proc ::scobj::west4100::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::west4100::mkDriver { sct_controller name IP dev_id} {
|
||||
proc ::scobj::west4100::mkDriver { sct_controller name IP dev_id } {
|
||||
::scobj::west4100::sics_log 9 "::scobj::west4100::mkDriver ${sct_controller} ${name} ${IP} ${dev_id}"
|
||||
set ns "[namespace current]"
|
||||
set catch_status [ catch {
|
||||
@@ -80,21 +80,20 @@ clientput "file evaluation of sct_west4100.tcl"
|
||||
proc ::scobj::west4100::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::west4100"
|
||||
dict for {k v} $::config_dict {
|
||||
if { [dict exists $v "implementation"] } {
|
||||
if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {
|
||||
dict for {k u} $::config_dict {
|
||||
if { [dict exists $u "implementation"] } {
|
||||
if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } {
|
||||
continue
|
||||
}
|
||||
set enabled [string tolower [dict get $v "enabled"]]
|
||||
set enabled [string tolower [dict get $u "enabled"]]
|
||||
if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } {
|
||||
continue
|
||||
}
|
||||
set name [dict get $v name]
|
||||
set implementation [dict get $v "implementation"]
|
||||
set name [dict get $u name]
|
||||
set implementation [dict get $u "implementation"]
|
||||
if { !([dict exists $::config_dict $implementation]) } {
|
||||
continue
|
||||
}
|
||||
set arg_list [list]
|
||||
set v [dict get $::config_dict $implementation]
|
||||
if { !([dict exists $v "driver"]) } {
|
||||
continue
|
||||
@@ -128,15 +127,21 @@ proc ::scobj::west4100::read_config {} {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
}
|
||||
set arg_list [list]
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
foreach arg {IP dev_id} {
|
||||
if {[dict exists $v $arg]} {
|
||||
if {[dict exists $u $arg]} {
|
||||
lappend arg_list "[dict get $u $arg]"
|
||||
} elseif {[dict exists $v $arg]} {
|
||||
lappend arg_list "[dict get $v $arg]"
|
||||
} else {
|
||||
${ns}::sics_log 9 "Missing configuration value $arg"
|
||||
error "Missing configuration value $arg"
|
||||
lappend missing_list $arg
|
||||
}
|
||||
}
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_west4100 ${name} ${IP} ${PORT} {*}$arg_list
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user