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

@@ -273,6 +273,14 @@ proc ::scobj::reactor_status::mkDriver { sct_controller name device_class simula
hsetprop ${scobj_hpath}/status type "part"
hsetprop ${scobj_hpath}/status nxalias "${name}_status"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/status 30
hsetprop ${scobj_hpath}/status simulated false
} else {
::scobj::reactor_status::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for reactor_status"
hsetprop ${scobj_hpath}/status simulated true
}
hfactory ${scobj_hpath}/tg123 plain spy float
hsetprop ${scobj_hpath}/tg123 control true
hsetprop ${scobj_hpath}/tg123 data true
@@ -299,12 +307,6 @@ proc ::scobj::reactor_status::mkDriver { sct_controller name device_class simula
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/status 30
} else {
::scobj::reactor_status::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for reactor_status"
}
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
@@ -326,7 +328,9 @@ proc ::scobj::reactor_status::add_driver {name device_class simulation_flag ip_a
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
}
} else {
::scobj::reactor_status::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for reactor_status"
::scobj::reactor_status::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for reactor_status"
::scobj::reactor_status::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::reactor_status::sics_log 1 "::scobj::reactor_status::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
::scobj::reactor_status::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
@@ -344,7 +348,7 @@ namespace eval ::scobj::reactor_status {
proc add_reactor_status {name ip_address tcp_port} {
set simulation_flag "[string tolower [SplitReply [opal_simulation]]]"
::scobj::reactor_status::add_driver ${name} "NXsource" "${simulation_flag}" ${ip_address} ${tcp_port}
::scobj::reactor_status::add_driver ${name} "NXsource" ${simulation_flag} ${ip_address} ${tcp_port}
}
clientput "file evaluation of sct_reactor_status.tcl"
@@ -383,20 +387,31 @@ proc ::scobj::reactor_status::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"]"
}
}
@@ -407,12 +422,9 @@ proc ::scobj::reactor_status::read_config {} {
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
if { [string equal -nocase ${asyncqueue} "sct"] } {
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
} else {
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue}
}
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
}
}
}