Regenerate SCT drivers

This commit is contained in:
Douglas Clowes
2014-11-13 14:20:52 +11:00
parent 8f977bb98f
commit ee4cd27f0e
5 changed files with 376 additions and 319 deletions

View File

@@ -175,27 +175,9 @@ proc ::scobj::he3_polanal::setValue {tc_root nextState cmd_str} {
set cmd "${cmd_str}${par}"
# setValue hook code starts
set cmd "${cmd_str}"
if {[string equal -nocase [sct target] "refresh"]} {
set cmd "${cmd_str}"
}
if {[string equal -nocase [sct target] "minus"]} {
set cmd "${cmd_str} -"
}
if {[string equal -nocase [sct target] "dn"]} {
set cmd "${cmd_str} -"
}
if {[string equal -nocase [sct target] "down"]} {
set cmd "${cmd_str} -"
}
if {[sct target] == "-" || [sct target] == -1} {
set cmd "${cmd_str} -"
}
if {[string equal -nocase [sct target] "plus"]} {
set cmd "${cmd_str} +"
}
if {[string equal -nocase [sct target] "up"]} {
set cmd "${cmd_str} +"
}
if {[sct target] == "+" || [sct target] == 1} {
set cmd "${cmd_str} +"
}
@@ -318,12 +300,12 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/analyser/time2 type "part"
hsetprop ${scobj_hpath}/analyser/time2 nxalias "${name}_analyser_time2"
hfactory ${scobj_hpath}/analyser/timestamp plain user float
hfactory ${scobj_hpath}/analyser/timestamp plain user int
hsetprop ${scobj_hpath}/analyser/timestamp control true
hsetprop ${scobj_hpath}/analyser/timestamp data true
hsetprop ${scobj_hpath}/analyser/timestamp mutable true
hsetprop ${scobj_hpath}/analyser/timestamp nxsave true
hsetprop ${scobj_hpath}/analyser/timestamp oldval 0.0
hsetprop ${scobj_hpath}/analyser/timestamp oldval 0
hsetprop ${scobj_hpath}/analyser/timestamp klass "parameter"
hsetprop ${scobj_hpath}/analyser/timestamp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/timestamp type "part"
@@ -406,12 +388,12 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/analyser_start/time2 type "part"
hsetprop ${scobj_hpath}/analyser_start/time2 nxalias "${name}_analyser_start_time2"
hfactory ${scobj_hpath}/analyser_start/timestamp plain user float
hfactory ${scobj_hpath}/analyser_start/timestamp plain user int
hsetprop ${scobj_hpath}/analyser_start/timestamp control true
hsetprop ${scobj_hpath}/analyser_start/timestamp data true
hsetprop ${scobj_hpath}/analyser_start/timestamp mutable true
hsetprop ${scobj_hpath}/analyser_start/timestamp nxsave true
hsetprop ${scobj_hpath}/analyser_start/timestamp oldval 0.0
hsetprop ${scobj_hpath}/analyser_start/timestamp oldval 0
hsetprop ${scobj_hpath}/analyser_start/timestamp klass "parameter"
hsetprop ${scobj_hpath}/analyser_start/timestamp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser_start/timestamp type "part"
@@ -481,7 +463,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/polariser/spin data true
hsetprop ${scobj_hpath}/polariser/spin mutable true
hsetprop ${scobj_hpath}/polariser/spin nxsave true
hsetprop ${scobj_hpath}/polariser/spin values +,-,Refresh
hsetprop ${scobj_hpath}/polariser/spin values -1,0,+1
hsetprop ${scobj_hpath}/polariser/spin oldval 0.0
hsetprop ${scobj_hpath}/polariser/spin klass "parameter"
hsetprop ${scobj_hpath}/polariser/spin sdsinfo "::nexus::scobj::sdsinfo"
@@ -509,12 +491,12 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/polariser/time2 type "part"
hsetprop ${scobj_hpath}/polariser/time2 nxalias "${name}_polariser_time2"
hfactory ${scobj_hpath}/polariser/timestamp plain user float
hfactory ${scobj_hpath}/polariser/timestamp plain user int
hsetprop ${scobj_hpath}/polariser/timestamp control true
hsetprop ${scobj_hpath}/polariser/timestamp data true
hsetprop ${scobj_hpath}/polariser/timestamp mutable true
hsetprop ${scobj_hpath}/polariser/timestamp nxsave true
hsetprop ${scobj_hpath}/polariser/timestamp oldval 0.0
hsetprop ${scobj_hpath}/polariser/timestamp oldval 0
hsetprop ${scobj_hpath}/polariser/timestamp klass "parameter"
hsetprop ${scobj_hpath}/polariser/timestamp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/timestamp type "part"
@@ -597,12 +579,12 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/polariser_start/time2 type "part"
hsetprop ${scobj_hpath}/polariser_start/time2 nxalias "${name}_polariser_start_time2"
hfactory ${scobj_hpath}/polariser_start/timestamp plain user float
hfactory ${scobj_hpath}/polariser_start/timestamp plain user int
hsetprop ${scobj_hpath}/polariser_start/timestamp control true
hsetprop ${scobj_hpath}/polariser_start/timestamp data true
hsetprop ${scobj_hpath}/polariser_start/timestamp mutable true
hsetprop ${scobj_hpath}/polariser_start/timestamp nxsave true
hsetprop ${scobj_hpath}/polariser_start/timestamp oldval 0.0
hsetprop ${scobj_hpath}/polariser_start/timestamp oldval 0
hsetprop ${scobj_hpath}/polariser_start/timestamp klass "parameter"
hsetprop ${scobj_hpath}/polariser_start/timestamp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser_start/timestamp type "part"

View File

@@ -347,8 +347,8 @@ proc ::scobj::isotech_ps::add_driver {name device_class simulation_flag ip_addre
::scobj::isotech_ps::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port}
} else {
::scobj::isotech_ps::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \"\\r\""
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} "\r"
::scobj::isotech_ps::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \\r"
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \r
}
} else {
::scobj::isotech_ps::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for isotech_ps"
@@ -420,7 +420,7 @@ proc ::scobj::isotech_ps::read_config {} {
set arg_list [list]
set missing_list [list]
array unset default_map
array set default_map [list terminator "\r"]
array set default_map [list terminator \r]
foreach arg {terminator} {
if {[dict exists $u $arg]} {
lappend arg_list "[dict get $u $arg]"

View File

@@ -697,8 +697,8 @@ proc ::scobj::julabo_lh45_gen::add_driver {name device_class simulation_flag ip_
::scobj::julabo_lh45_gen::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port}
} else {
::scobj::julabo_lh45_gen::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \"\\r\""
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} "\r"
::scobj::julabo_lh45_gen::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \\r"
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \r
}
} else {
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for julabo_lh45_gen"
@@ -770,7 +770,7 @@ proc ::scobj::julabo_lh45_gen::read_config {} {
set arg_list [list]
set missing_list [list]
array unset default_map
array set default_map [list terminator "\r"]
array set default_map [list terminator \r]
foreach arg {terminator} {
if {[dict exists $u $arg]} {
lappend arg_list "[dict get $u $arg]"

View File

@@ -30,7 +30,7 @@ proc ::scobj::ls340::sics_log {debug_level debug_string} {
} catch_message ]
}
proc ::scobj::ls340::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype tol1 tol2 } {
proc ::scobj::ls340::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype {tol1 1.0} {tol2 1.0} } {
::scobj::ls340::sics_log 9 "::scobj::ls340::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
set ns "[namespace current]"
set catch_status [ catch {
@@ -59,8 +59,8 @@ proc ::scobj::ls340::add_driver {name device_class simulation_flag ip_address tc
::scobj::ls340::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port}
} else {
::scobj::ls340::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
::scobj::ls340::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \\r\\n"
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} \r\n
}
} else {
::scobj::ls340::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for ls340"
@@ -129,7 +129,26 @@ proc ::scobj::ls340::read_config {} {
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}
set arg_list [list]
set missing_list [list]
array unset default_map
array set default_map [list terminator \r\n]
foreach arg {terminator} {
if {[dict exists $u $arg]} {
lappend arg_list "[dict get $u $arg]"
} elseif {[dict exists $v $arg]} {
lappend arg_list "[dict get $v $arg]"
} elseif {[info exists default_map($arg)]} {
lappend arg_list $default_map($arg)
} else {
${ns}::sics_log 9 "Missing configuration value $arg"
lappend missing_list $arg
}
}
if { [llength $missing_list] > 0 } {
error "$name is missing configuration values $missing_list"
}
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} {*}$arg_list
} else {
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
@@ -161,11 +180,15 @@ proc ::scobj::ls340::read_config {} {
}
set arg_list [list]
set missing_list [list]
array unset default_map
array set default_map [list tol1 1.0 tol2 1.0]
foreach arg {id datype tol1 tol2} {
if {[dict exists $u $arg]} {
lappend arg_list "[dict get $u $arg]"
} elseif {[dict exists $v $arg]} {
lappend arg_list "[dict get $v $arg]"
} elseif {[info exists default_map($arg)]} {
lappend arg_list $default_map($arg)
} else {
${ns}::sics_log 9 "Missing configuration value $arg"
lappend missing_list $arg