Regenerate all the SCT drivers with new generator
This commit is contained in:
@@ -86,7 +86,12 @@ proc ::scobj::hiden_xcs::checkstatus {tc_root} {
|
||||
# checkstatus hook code goes here
|
||||
if {[sct driving]} {
|
||||
set sp "[sct target]"
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {
|
||||
set pv "${sp}"
|
||||
hupdateif ${tc_root}/[sct driveable] ${sp}
|
||||
}
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
}
|
||||
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
|
||||
if { [hpropexists [sct] settle_time] } {
|
||||
if { [hpropexists [sct] settle_time_start] } {
|
||||
@@ -826,6 +831,15 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/enabled type "part"
|
||||
hsetprop ${scobj_hpath}/enabled nxalias "${name}_enabled"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/enabled 10
|
||||
${sct_controller} write ${scobj_hpath}/enabled
|
||||
hsetprop ${scobj_hpath}/enabled simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/enabled simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/flow1 plain user float
|
||||
hsetprop ${scobj_hpath}/flow1 control false
|
||||
hsetprop ${scobj_hpath}/flow1 data false
|
||||
@@ -887,17 +901,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath} nxsave "true"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/enabled 10
|
||||
${sct_controller} write ${scobj_hpath}/enabled
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog plain spy none
|
||||
hsetprop ${scobj_hpath}/analog data "false"
|
||||
hsetprop ${scobj_hpath}/analog klass "@none"
|
||||
hsetprop ${scobj_hpath}/analog type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/ansto_temp plain user float
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,12}
|
||||
@@ -913,6 +917,14 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp type "part"
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp nxalias "${name}_analog_ansto_temp"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/ansto_temp 5
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog/pv1 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv1 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,0}
|
||||
hsetprop ${scobj_hpath}/analog/pv1 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -927,6 +939,14 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/pv1 type "part"
|
||||
hsetprop ${scobj_hpath}/analog/pv1 nxalias "${name}_analog_pv1"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv1 5
|
||||
hsetprop ${scobj_hpath}/analog/pv1 simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/pv1 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog/pv2 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv2 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,1}
|
||||
hsetprop ${scobj_hpath}/analog/pv2 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -941,6 +961,14 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/pv2 type "part"
|
||||
hsetprop ${scobj_hpath}/analog/pv2 nxalias "${name}_analog_pv2"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv2 5
|
||||
hsetprop ${scobj_hpath}/analog/pv2 simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/pv2 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog/pv3 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv3 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,2}
|
||||
hsetprop ${scobj_hpath}/analog/pv3 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -955,6 +983,14 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/pv3 type "part"
|
||||
hsetprop ${scobj_hpath}/analog/pv3 nxalias "${name}_analog_pv3"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv3 5
|
||||
hsetprop ${scobj_hpath}/analog/pv3 simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/pv3 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog/rhsense plain user float
|
||||
hsetprop ${scobj_hpath}/analog/rhsense read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,9}
|
||||
hsetprop ${scobj_hpath}/analog/rhsense read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -969,6 +1005,14 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/rhsense type "part"
|
||||
hsetprop ${scobj_hpath}/analog/rhsense nxalias "${name}_analog_rhsense"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/rhsense 5
|
||||
hsetprop ${scobj_hpath}/analog/rhsense simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/rhsense simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog/rhtemp plain user float
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,8}
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -983,6 +1027,14 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp type "part"
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp nxalias "${name}_analog_rhtemp"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/rhtemp 5
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog/sp1 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp1 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,0}
|
||||
hsetprop ${scobj_hpath}/analog/sp1 read_twelve ${ns}::read_twelve ${scobj_hpath}
|
||||
@@ -1000,6 +1052,15 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/sp1 type "part"
|
||||
hsetprop ${scobj_hpath}/analog/sp1 nxalias "${name}_analog_sp1"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/sp1 5
|
||||
${sct_controller} write ${scobj_hpath}/analog/sp1
|
||||
hsetprop ${scobj_hpath}/analog/sp1 simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/sp1 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog/sp2 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp2 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,1}
|
||||
hsetprop ${scobj_hpath}/analog/sp2 read_twelve ${ns}::read_twelve ${scobj_hpath}
|
||||
@@ -1017,6 +1078,15 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/sp2 type "part"
|
||||
hsetprop ${scobj_hpath}/analog/sp2 nxalias "${name}_analog_sp2"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/sp2 5
|
||||
${sct_controller} write ${scobj_hpath}/analog/sp2
|
||||
hsetprop ${scobj_hpath}/analog/sp2 simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/sp2 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/analog/sp3 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp3 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,2}
|
||||
hsetprop ${scobj_hpath}/analog/sp3 read_twelve ${ns}::read_twelve ${scobj_hpath}
|
||||
@@ -1035,27 +1105,18 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/analog/sp3 nxalias "${name}_analog_sp3"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/ansto_temp 5
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv1 5
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv2 5
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv3 5
|
||||
${sct_controller} poll ${scobj_hpath}/analog/rhsense 5
|
||||
${sct_controller} poll ${scobj_hpath}/analog/rhtemp 5
|
||||
${sct_controller} poll ${scobj_hpath}/analog/sp1 5
|
||||
${sct_controller} poll ${scobj_hpath}/analog/sp2 5
|
||||
${sct_controller} poll ${scobj_hpath}/analog/sp3 5
|
||||
${sct_controller} write ${scobj_hpath}/analog/sp1
|
||||
${sct_controller} write ${scobj_hpath}/analog/sp2
|
||||
${sct_controller} write ${scobj_hpath}/analog/sp3
|
||||
hsetprop ${scobj_hpath}/analog/sp3 simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/analog/sp3 simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/analog data "false"
|
||||
hsetprop ${scobj_hpath}/analog klass "@none"
|
||||
hsetprop ${scobj_hpath}/analog type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/flow plain spy none
|
||||
hsetprop ${scobj_hpath}/flow data "true"
|
||||
hsetprop ${scobj_hpath}/flow klass "@none"
|
||||
hsetprop ${scobj_hpath}/flow nxsave "true"
|
||||
hsetprop ${scobj_hpath}/flow type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/flow/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/flow/sensor read ${ns}::fetch_flow ${scobj_hpath} read_flow {None}
|
||||
@@ -1079,6 +1140,14 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/flow/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/flow/sensor nxalias "${name}_flow_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/flow/sensor 1
|
||||
hsetprop ${scobj_hpath}/flow/sensor simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/flow/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/flow/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/flow/setpoint read ${ns}::getTarget ${scobj_hpath} rdValue {@}
|
||||
hsetprop ${scobj_hpath}/flow/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -1107,18 +1176,20 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/flow/setpoint nxalias "${name}_flow_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/flow/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/flow/setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/flow/setpoint
|
||||
hsetprop ${scobj_hpath}/flow/setpoint simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/flow/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/flow data "true"
|
||||
hsetprop ${scobj_hpath}/flow klass "@none"
|
||||
hsetprop ${scobj_hpath}/flow nxsave "true"
|
||||
hsetprop ${scobj_hpath}/flow type "part"
|
||||
ansto_makesctdrive ${name}_flow_setpoint ${scobj_hpath}/flow/setpoint ${scobj_hpath}/flow/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/humidity plain spy none
|
||||
hsetprop ${scobj_hpath}/humidity data "true"
|
||||
hsetprop ${scobj_hpath}/humidity klass "@none"
|
||||
hsetprop ${scobj_hpath}/humidity nxsave "true"
|
||||
hsetprop ${scobj_hpath}/humidity type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/humidity/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/humidity/sensor read ${ns}::getValue ${scobj_hpath} read_all_data {?ALL DATA}
|
||||
@@ -1142,6 +1213,14 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/humidity/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor nxalias "${name}_humidity_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/humidity/sensor 1
|
||||
hsetprop ${scobj_hpath}/humidity/sensor simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/humidity/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint read ${ns}::getTarget ${scobj_hpath} rdValue {@}
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -1170,19 +1249,21 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint nxalias "${name}_humidity_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/humidity/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/humidity/setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/humidity/setpoint
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/humidity data "true"
|
||||
hsetprop ${scobj_hpath}/humidity klass "@none"
|
||||
hsetprop ${scobj_hpath}/humidity nxsave "true"
|
||||
hsetprop ${scobj_hpath}/humidity type "part"
|
||||
ansto_makesctdrive ${name}_humidity_setpoint ${scobj_hpath}/humidity/setpoint ${scobj_hpath}/humidity/sensor ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_flow_setpoint ${scobj_hpath}/flow/setpoint ${scobj_hpath}/flow/sensor ${sct_controller}
|
||||
ansto_makesctdrive ${name}_humidity_setpoint ${scobj_hpath}/humidity/setpoint ${scobj_hpath}/humidity/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code starts
|
||||
# mkDriver hook code ends
|
||||
} catch_message ]
|
||||
@@ -1201,7 +1282,9 @@ proc ::scobj::hiden_xcs::add_driver {name device_class simulation_flag ip_addres
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for hiden_xcs"
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for hiden_xcs"
|
||||
::scobj::hiden_xcs::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::hiden_xcs::sics_log 1 "::scobj::hiden_xcs::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
::scobj::hiden_xcs::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
@@ -1219,7 +1302,7 @@ namespace eval ::scobj::hiden_xcs {
|
||||
|
||||
proc add_hiden_xcs {name ip_address tcp_port id} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::hiden_xcs::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}"
|
||||
::scobj::hiden_xcs::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_hiden_xcs.tcl"
|
||||
@@ -1258,20 +1341,31 @@ proc ::scobj::hiden_xcs::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"]"
|
||||
}
|
||||
}
|
||||
@@ -1282,6 +1376,7 @@ proc ::scobj::hiden_xcs::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]
|
||||
@@ -1298,11 +1393,7 @@ proc ::scobj::hiden_xcs::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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user