Regenerate all the SCT drivers with new generator

This commit is contained in:
Douglas Clowes
2014-11-07 09:14:09 +11:00
parent 6c6292bbb2
commit 9909c1412e
42 changed files with 2483 additions and 1186 deletions

View File

@@ -150,9 +150,6 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulat
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/Level plain spy none
hsetprop ${scobj_hpath}/Level data "true"
hsetprop ${scobj_hpath}/Level klass "@none"
hsetprop ${scobj_hpath}/Level type "part"
hfactory ${scobj_hpath}/Level/Helium plain user float
hsetprop ${scobj_hpath}/Level/Helium read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:HEL:LEV}
@@ -169,6 +166,14 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulat
hsetprop ${scobj_hpath}/Level/Helium type "part"
hsetprop ${scobj_hpath}/Level/Helium nxalias "${name}_Level_Helium"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/Level/Helium 15
hsetprop ${scobj_hpath}/Level/Helium simulated false
} else {
::scobj::mercury_level::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_level"
hsetprop ${scobj_hpath}/Level/Helium simulated true
}
hfactory ${scobj_hpath}/Level/Nitrogen plain user float
hsetprop ${scobj_hpath}/Level/Nitrogen read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:NIT:LEV}
hsetprop ${scobj_hpath}/Level/Nitrogen rdValue ${ns}::rdValue ${scobj_hpath}
@@ -185,11 +190,15 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulat
hsetprop ${scobj_hpath}/Level/Nitrogen nxalias "${name}_Level_Nitrogen"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/Level/Helium 15
${sct_controller} poll ${scobj_hpath}/Level/Nitrogen 15
hsetprop ${scobj_hpath}/Level/Nitrogen simulated false
} else {
::scobj::mercury_level::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_level"
hsetprop ${scobj_hpath}/Level/Nitrogen simulated true
}
hsetprop ${scobj_hpath}/Level data "true"
hsetprop ${scobj_hpath}/Level klass "@none"
hsetprop ${scobj_hpath}/Level type "part"
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
@@ -210,7 +219,9 @@ proc ::scobj::mercury_level::add_driver {name device_class simulation_flag ip_ad
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
}
} else {
::scobj::mercury_level::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for mercury_level"
::scobj::mercury_level::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for mercury_level"
::scobj::mercury_level::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::mercury_level::sics_log 1 "::scobj::mercury_level::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
::scobj::mercury_level::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}
@@ -228,7 +239,7 @@ namespace eval ::scobj::mercury_level {
proc add_mercury_level {name ip_address tcp_port {id 99}} {
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
::scobj::mercury_level::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}"
::scobj::mercury_level::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id}
}
clientput "file evaluation of sct_mercury_level.tcl"
@@ -267,20 +278,31 @@ proc ::scobj::mercury_level::read_config {} {
if { ![string equal -nocase "${simulation_flag}" "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
} elseif { [dict exists $v "asyncqueue"] } {
set asyncqueue [dict get $v "asyncqueue"]
if { [string equal -nocase ${asyncqueue} "sct"] } {
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
}
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
} else {
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
} else {
if { [dict exists $v "asyncprotocol"] } {
set asyncprotocol [dict get $v "asyncprotocol"]
} else {
set asyncprotocol ${name}_protocol
MakeAsyncProtocol ${asyncprotocol}
if { [dict exists $v "terminator"] } {
if { [dict exists $v "sendterminator"] } {
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
}
if { [dict exists $v "replyterminator"] } {
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
}
}
@@ -291,6 +313,7 @@ proc ::scobj::mercury_level::read_config {} {
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
set arg_list [list]
set missing_list [list]
@@ -307,11 +330,7 @@ proc ::scobj::mercury_level::read_config {} {
if { [llength $missing_list] > 0 } {
error "$name is missing configuration values $missing_list"
}
if { [string equal -nocase ${asyncqueue} "sct"] } {
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
} else {
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
}
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
}
}
}