Regenerate all the SCT drivers with new generator
This commit is contained in:
@@ -217,6 +217,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/id type "part"
|
||||
hsetprop ${scobj_hpath}/id nxalias "${name}_id"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/id 600
|
||||
hsetprop ${scobj_hpath}/id simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/id simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_01 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_01 read ${ns}::getSensor ${scobj_hpath} readSensor {1}
|
||||
hsetprop ${scobj_hpath}/sensor_01 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -230,6 +238,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_01 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_01 nxalias "${name}_sensor_01"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_01 60
|
||||
hsetprop ${scobj_hpath}/sensor_01 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_01 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_02 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_02 read ${ns}::getSensor ${scobj_hpath} readSensor {2}
|
||||
hsetprop ${scobj_hpath}/sensor_02 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -243,6 +259,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_02 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_02 nxalias "${name}_sensor_02"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_02 600
|
||||
hsetprop ${scobj_hpath}/sensor_02 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_02 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_03 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_03 read ${ns}::getSensor ${scobj_hpath} readSensor {3}
|
||||
hsetprop ${scobj_hpath}/sensor_03 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -256,6 +280,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_03 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_03 nxalias "${name}_sensor_03"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_03 600
|
||||
hsetprop ${scobj_hpath}/sensor_03 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_03 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_04 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_04 read ${ns}::getSensor ${scobj_hpath} readSensor {4}
|
||||
hsetprop ${scobj_hpath}/sensor_04 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -269,6 +301,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_04 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_04 nxalias "${name}_sensor_04"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_04 600
|
||||
hsetprop ${scobj_hpath}/sensor_04 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_04 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_05 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_05 read ${ns}::getSensor ${scobj_hpath} readSensor {5}
|
||||
hsetprop ${scobj_hpath}/sensor_05 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -282,6 +322,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_05 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_05 nxalias "${name}_sensor_05"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_05 600
|
||||
hsetprop ${scobj_hpath}/sensor_05 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_05 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_06 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_06 read ${ns}::getSensor ${scobj_hpath} readSensor {6}
|
||||
hsetprop ${scobj_hpath}/sensor_06 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -295,6 +343,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_06 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_06 nxalias "${name}_sensor_06"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_06 600
|
||||
hsetprop ${scobj_hpath}/sensor_06 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_06 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_07 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_07 read ${ns}::getSensor ${scobj_hpath} readSensor {7}
|
||||
hsetprop ${scobj_hpath}/sensor_07 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -308,6 +364,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_07 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_07 nxalias "${name}_sensor_07"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_07 600
|
||||
hsetprop ${scobj_hpath}/sensor_07 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_07 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_08 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_08 read ${ns}::getSensor ${scobj_hpath} readSensor {8}
|
||||
hsetprop ${scobj_hpath}/sensor_08 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -321,23 +385,17 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_08 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_08 nxalias "${name}_sensor_08"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_08 600
|
||||
hsetprop ${scobj_hpath}/sensor_08 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_08 simulated true
|
||||
}
|
||||
|
||||
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}/id 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_01 60
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_02 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_03 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_04 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_05 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_06 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_07 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_08 600
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
@@ -358,7 +416,9 @@ proc ::scobj::srs_sr630::add_driver {name device_class simulation_flag ip_addres
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for srs_sr630"
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for srs_sr630"
|
||||
::scobj::srs_sr630::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::srs_sr630::sics_log 1 "::scobj::srs_sr630::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
||||
::scobj::srs_sr630::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
@@ -376,7 +436,7 @@ namespace eval ::scobj::srs_sr630 {
|
||||
|
||||
proc add_srs_sr630 {name ip_address tcp_port} {
|
||||
set simulation_flag "[string tolower [SplitReply [detector_simulation]]]"
|
||||
::scobj::srs_sr630::add_driver ${name} "NXdetector" "${simulation_flag}" ${ip_address} ${tcp_port}
|
||||
::scobj::srs_sr630::add_driver ${name} "NXdetector" ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_srs_sr630.tcl"
|
||||
@@ -415,20 +475,31 @@ proc ::scobj::srs_sr630::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"]"
|
||||
}
|
||||
}
|
||||
@@ -439,12 +510,9 @@ proc ::scobj::srs_sr630::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}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user