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

@@ -218,6 +218,14 @@ proc ::scobj::shutters::mkDriver { sct_controller name device_class simulation_f
hsetprop ${scobj_hpath}/fast_shutter sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/fast_shutter type "part"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/fast_shutter 1
hsetprop ${scobj_hpath}/fast_shutter simulated false
} else {
::scobj::shutters::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for shutters"
hsetprop ${scobj_hpath}/fast_shutter simulated true
}
hfactory ${scobj_hpath}/rough_100 plain user text
hsetprop ${scobj_hpath}/rough_100 read ${ns}::getValue ${scobj_hpath} read_switch_pair {MG @IN[15], @IN[16]}
hsetprop ${scobj_hpath}/rough_100 read_switch_pair ${ns}::read_switch_pair ${scobj_hpath}
@@ -235,6 +243,15 @@ proc ::scobj::shutters::mkDriver { sct_controller name device_class simulation_f
hsetprop ${scobj_hpath}/rough_100 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/rough_100 type "part"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/rough_100 1
${sct_controller} write ${scobj_hpath}/rough_100
hsetprop ${scobj_hpath}/rough_100 simulated false
} else {
::scobj::shutters::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for shutters"
hsetprop ${scobj_hpath}/rough_100 simulated true
}
hfactory ${scobj_hpath}/rough_40 plain user text
hsetprop ${scobj_hpath}/rough_40 read ${ns}::getValue ${scobj_hpath} read_switch_pair {MG @IN[13], @IN[14]}
hsetprop ${scobj_hpath}/rough_40 read_switch_pair ${ns}::read_switch_pair ${scobj_hpath}
@@ -252,20 +269,19 @@ proc ::scobj::shutters::mkDriver { sct_controller name device_class simulation_f
hsetprop ${scobj_hpath}/rough_40 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/rough_40 type "part"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/rough_40 1
${sct_controller} write ${scobj_hpath}/rough_40
hsetprop ${scobj_hpath}/rough_40 simulated false
} else {
::scobj::shutters::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for shutters"
hsetprop ${scobj_hpath}/rough_40 simulated true
}
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} nxsave "true"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/fast_shutter 1
${sct_controller} poll ${scobj_hpath}/rough_100 1
${sct_controller} poll ${scobj_hpath}/rough_40 1
${sct_controller} write ${scobj_hpath}/rough_100
${sct_controller} write ${scobj_hpath}/rough_40
} else {
::scobj::shutters::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for shutters"
}
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
@@ -287,7 +303,9 @@ proc ::scobj::shutters::add_driver {name device_class simulation_flag ip_address
makesctcontroller sct_${name} dmc2280 ${ip_address}:${tcp_port}
}
} else {
::scobj::shutters::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for shutters"
::scobj::shutters::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for shutters"
::scobj::shutters::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::shutters::sics_log 1 "::scobj::shutters::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
::scobj::shutters::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
@@ -305,7 +323,7 @@ namespace eval ::scobj::shutters {
proc add_shutters {name ip_address tcp_port} {
set simulation_flag "[string tolower [SplitReply [motor_simulation]]]"
::scobj::shutters::add_driver ${name} "instrument" "${simulation_flag}" ${ip_address} ${tcp_port}
::scobj::shutters::add_driver ${name} "instrument" ${simulation_flag} ${ip_address} ${tcp_port}
}
clientput "file evaluation of sct_shutters.tcl"
@@ -344,20 +362,31 @@ proc ::scobj::shutters::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} dmc2280 ${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"]"
}
}
@@ -368,12 +397,9 @@ proc ::scobj::shutters::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}
}
}
}