Regenerate SCT drivers

This commit is contained in:
Douglas Clowes
2014-11-13 13:53:04 +11:00
parent 30c23b1e0a
commit f076b537ed
2 changed files with 436 additions and 198 deletions

View File

@@ -4,6 +4,17 @@
namespace eval ::scobj::he3_polanal {
set debug_threshold 0
# preamble hook code starts
proc do_update { node dlist idx } {
if {[llength ${dlist}] > ${idx}} {
if {![string is double [lindex ${dlist} ${idx}]]} {
hupdateif ${node} 0.0
} else {
hupdateif ${node} [lindex ${dlist} ${idx}]
}
}
}
# preamble hook code ends
}
proc ::scobj::he3_polanal::debug_log {tc_root debug_level debug_string} {
@@ -62,6 +73,7 @@ proc ::scobj::he3_polanal::chkWrite {tc_root} {
debug_log ${tc_root} 1 "chkWrite tc_root=${tc_root} sct=[sct] resp=[sct result]"
# chkWrite hook code starts
[namespace current]::rdValue ${tc_root}
clientput [sct result]
# chkWrite hook code ends
return "idle"
} catch_message ]
@@ -129,25 +141,13 @@ proc ::scobj::he3_polanal::rdValue {tc_root} {
set data [lindex ${dlist} 1]
}
set path [pathname [sct]]
if {[llength ${dlist}] > 2} {
set new_value [lindex ${dlist} 2]
if { "${new_value}" == "NaN" } {
set new_value 0
}
hupdateif ${path}/Amplitude "${new_value}"
}
if {[llength ${dlist}] > 3} {
hupdateif ${path}/Freq "[lindex ${dlist} 3]"
}
if {[llength ${dlist}] > 4} {
hupdateif ${path}/Phase "[lindex ${dlist} 4]"
}
if {[llength ${dlist}] > 5} {
hupdateif ${path}/Time2 "[lindex ${dlist} 5]"
}
if {[llength ${dlist}] > 6} {
hupdateif ${path}/Field "[lindex ${dlist} 6]"
}
set timestamp [clock seconds]
[namespace current]::do_update ${path}/amplitude ${dlist} 2
[namespace current]::do_update ${path}/freq ${dlist} 3
[namespace current]::do_update ${path}/phase ${dlist} 4
[namespace current]::do_update ${path}/time2 ${dlist} 5
[namespace current]::do_update ${path}/field ${dlist} 6
hupdateif ${path}/timestamp ${timestamp}
# rdValue hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
@@ -178,6 +178,9 @@ proc ::scobj::he3_polanal::setValue {tc_root nextState 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} -"
}
@@ -187,6 +190,9 @@ proc ::scobj::he3_polanal::setValue {tc_root nextState 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} +"
}
@@ -212,8 +218,8 @@ proc ::scobj::he3_polanal::setValue {tc_root nextState cmd_str} {
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } {
::scobj::he3_polanal::sics_log 9 "::scobj::he3_polanal::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port {has_pol true} {has_anal true} } {
::scobj::he3_polanal::sics_log 9 "::scobj::he3_polanal::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${has_pol} ${has_anal}"
set ns "[namespace current]"
set catch_status [ catch {
@@ -223,186 +229,388 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
if {[string equal -nocase ${has_anal} "true"]} {
hfactory ${scobj_hpath}/analyser plain spy none
hfactory ${scobj_hpath}/analyser plain spy none
hfactory ${scobj_hpath}/analyser/Amplitude plain user text
hsetprop ${scobj_hpath}/analyser/Amplitude control true
hsetprop ${scobj_hpath}/analyser/Amplitude data true
hsetprop ${scobj_hpath}/analyser/Amplitude mutable true
hsetprop ${scobj_hpath}/analyser/Amplitude nxsave true
hsetprop ${scobj_hpath}/analyser/Amplitude oldval UNKNOWN
hsetprop ${scobj_hpath}/analyser/Amplitude klass "parameter"
hsetprop ${scobj_hpath}/analyser/Amplitude sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/Amplitude type "part"
hsetprop ${scobj_hpath}/analyser/Amplitude nxalias "${name}_analyser_Amplitude"
hfactory ${scobj_hpath}/analyser/amplitude plain user float
hsetprop ${scobj_hpath}/analyser/amplitude control true
hsetprop ${scobj_hpath}/analyser/amplitude data true
hsetprop ${scobj_hpath}/analyser/amplitude mutable true
hsetprop ${scobj_hpath}/analyser/amplitude nxsave true
hsetprop ${scobj_hpath}/analyser/amplitude oldval 0.0
hsetprop ${scobj_hpath}/analyser/amplitude klass "parameter"
hsetprop ${scobj_hpath}/analyser/amplitude sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/amplitude type "part"
hsetprop ${scobj_hpath}/analyser/amplitude nxalias "${name}_analyser_amplitude"
hfactory ${scobj_hpath}/analyser/Field plain user text
hsetprop ${scobj_hpath}/analyser/Field control true
hsetprop ${scobj_hpath}/analyser/Field data true
hsetprop ${scobj_hpath}/analyser/Field mutable true
hsetprop ${scobj_hpath}/analyser/Field nxsave true
hsetprop ${scobj_hpath}/analyser/Field units Oersted
hsetprop ${scobj_hpath}/analyser/Field oldval UNKNOWN
hsetprop ${scobj_hpath}/analyser/Field klass "parameter"
hsetprop ${scobj_hpath}/analyser/Field sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/Field type "part"
hsetprop ${scobj_hpath}/analyser/Field nxalias "${name}_analyser_Field"
hfactory ${scobj_hpath}/analyser/field plain user float
hsetprop ${scobj_hpath}/analyser/field control true
hsetprop ${scobj_hpath}/analyser/field data true
hsetprop ${scobj_hpath}/analyser/field mutable true
hsetprop ${scobj_hpath}/analyser/field nxsave true
hsetprop ${scobj_hpath}/analyser/field units Oersted
hsetprop ${scobj_hpath}/analyser/field oldval 0.0
hsetprop ${scobj_hpath}/analyser/field klass "parameter"
hsetprop ${scobj_hpath}/analyser/field sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/field type "part"
hsetprop ${scobj_hpath}/analyser/field nxalias "${name}_analyser_field"
hfactory ${scobj_hpath}/analyser/Freq plain user text
hsetprop ${scobj_hpath}/analyser/Freq control true
hsetprop ${scobj_hpath}/analyser/Freq data true
hsetprop ${scobj_hpath}/analyser/Freq mutable true
hsetprop ${scobj_hpath}/analyser/Freq nxsave true
hsetprop ${scobj_hpath}/analyser/Freq units Hertz
hsetprop ${scobj_hpath}/analyser/Freq oldval UNKNOWN
hsetprop ${scobj_hpath}/analyser/Freq klass "parameter"
hsetprop ${scobj_hpath}/analyser/Freq sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/Freq type "part"
hsetprop ${scobj_hpath}/analyser/Freq nxalias "${name}_analyser_Freq"
hfactory ${scobj_hpath}/analyser/freq plain user float
hsetprop ${scobj_hpath}/analyser/freq control true
hsetprop ${scobj_hpath}/analyser/freq data true
hsetprop ${scobj_hpath}/analyser/freq mutable true
hsetprop ${scobj_hpath}/analyser/freq nxsave true
hsetprop ${scobj_hpath}/analyser/freq units Hertz
hsetprop ${scobj_hpath}/analyser/freq oldval 0.0
hsetprop ${scobj_hpath}/analyser/freq klass "parameter"
hsetprop ${scobj_hpath}/analyser/freq sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/freq type "part"
hsetprop ${scobj_hpath}/analyser/freq nxalias "${name}_analyser_freq"
hfactory ${scobj_hpath}/analyser/Phase plain user text
hsetprop ${scobj_hpath}/analyser/Phase control true
hsetprop ${scobj_hpath}/analyser/Phase data true
hsetprop ${scobj_hpath}/analyser/Phase mutable true
hsetprop ${scobj_hpath}/analyser/Phase nxsave true
hsetprop ${scobj_hpath}/analyser/Phase units Degree
hsetprop ${scobj_hpath}/analyser/Phase oldval UNKNOWN
hsetprop ${scobj_hpath}/analyser/Phase klass "parameter"
hsetprop ${scobj_hpath}/analyser/Phase sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/Phase type "part"
hsetprop ${scobj_hpath}/analyser/Phase nxalias "${name}_analyser_Phase"
hfactory ${scobj_hpath}/analyser/phase plain user float
hsetprop ${scobj_hpath}/analyser/phase control true
hsetprop ${scobj_hpath}/analyser/phase data true
hsetprop ${scobj_hpath}/analyser/phase mutable true
hsetprop ${scobj_hpath}/analyser/phase nxsave true
hsetprop ${scobj_hpath}/analyser/phase units Degree
hsetprop ${scobj_hpath}/analyser/phase oldval 0.0
hsetprop ${scobj_hpath}/analyser/phase klass "parameter"
hsetprop ${scobj_hpath}/analyser/phase sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/phase type "part"
hsetprop ${scobj_hpath}/analyser/phase nxalias "${name}_analyser_phase"
hfactory ${scobj_hpath}/analyser/Time2 plain user text
hsetprop ${scobj_hpath}/analyser/Time2 control true
hsetprop ${scobj_hpath}/analyser/Time2 data true
hsetprop ${scobj_hpath}/analyser/Time2 mutable true
hsetprop ${scobj_hpath}/analyser/Time2 nxsave true
hsetprop ${scobj_hpath}/analyser/Time2 units Second
hsetprop ${scobj_hpath}/analyser/Time2 oldval UNKNOWN
hsetprop ${scobj_hpath}/analyser/Time2 klass "parameter"
hsetprop ${scobj_hpath}/analyser/Time2 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/Time2 type "part"
hsetprop ${scobj_hpath}/analyser/Time2 nxalias "${name}_analyser_Time2"
hfactory ${scobj_hpath}/analyser/spin plain user float
hsetprop ${scobj_hpath}/analyser/spin read ${ns}::getValue ${scobj_hpath} rdValue {analyser}
hsetprop ${scobj_hpath}/analyser/spin rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/analyser/spin write ${ns}::setValue ${scobj_hpath} chkWrite {analyser}
hsetprop ${scobj_hpath}/analyser/spin chkWrite ${ns}::chkWrite ${scobj_hpath}
hsetprop ${scobj_hpath}/analyser/spin check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/analyser/spin control true
hsetprop ${scobj_hpath}/analyser/spin data true
hsetprop ${scobj_hpath}/analyser/spin mutable true
hsetprop ${scobj_hpath}/analyser/spin nxsave true
hsetprop ${scobj_hpath}/analyser/spin values +,-,Refresh
hsetprop ${scobj_hpath}/analyser/spin oldval 0.0
hsetprop ${scobj_hpath}/analyser/spin klass "parameter"
hsetprop ${scobj_hpath}/analyser/spin sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/spin type "part"
hsetprop ${scobj_hpath}/analyser/spin nxalias "${name}_analyser_spin"
hfactory ${scobj_hpath}/analyser/spin plain user text
hsetprop ${scobj_hpath}/analyser/spin read ${ns}::getValue ${scobj_hpath} rdValue {analyser}
hsetprop ${scobj_hpath}/analyser/spin rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/analyser/spin write ${ns}::setValue ${scobj_hpath} chkWrite {analyser}
hsetprop ${scobj_hpath}/analyser/spin chkWrite ${ns}::chkWrite ${scobj_hpath}
hsetprop ${scobj_hpath}/analyser/spin check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/analyser/spin control true
hsetprop ${scobj_hpath}/analyser/spin data true
hsetprop ${scobj_hpath}/analyser/spin mutable true
hsetprop ${scobj_hpath}/analyser/spin nxsave true
hsetprop ${scobj_hpath}/analyser/spin values +,-,0
hsetprop ${scobj_hpath}/analyser/spin oldval UNKNOWN
hsetprop ${scobj_hpath}/analyser/spin klass "parameter"
hsetprop ${scobj_hpath}/analyser/spin sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/spin type "part"
hsetprop ${scobj_hpath}/analyser/spin nxalias "${name}_analyser_spin"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/analyser/spin 900
${sct_controller} write ${scobj_hpath}/analyser/spin
hsetprop ${scobj_hpath}/analyser/spin simulated false
} else {
::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal"
hsetprop ${scobj_hpath}/analyser/spin simulated true
}
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/analyser/spin 900
${sct_controller} write ${scobj_hpath}/analyser/spin
hsetprop ${scobj_hpath}/analyser/spin simulated false
} else {
::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal"
hsetprop ${scobj_hpath}/analyser/spin simulated true
hfactory ${scobj_hpath}/analyser/time2 plain user float
hsetprop ${scobj_hpath}/analyser/time2 control true
hsetprop ${scobj_hpath}/analyser/time2 data true
hsetprop ${scobj_hpath}/analyser/time2 mutable true
hsetprop ${scobj_hpath}/analyser/time2 nxsave true
hsetprop ${scobj_hpath}/analyser/time2 units Second
hsetprop ${scobj_hpath}/analyser/time2 oldval 0.0
hsetprop ${scobj_hpath}/analyser/time2 klass "parameter"
hsetprop ${scobj_hpath}/analyser/time2 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/time2 type "part"
hsetprop ${scobj_hpath}/analyser/time2 nxalias "${name}_analyser_time2"
hfactory ${scobj_hpath}/analyser/timestamp plain user float
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 klass "parameter"
hsetprop ${scobj_hpath}/analyser/timestamp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser/timestamp type "part"
hsetprop ${scobj_hpath}/analyser/timestamp nxalias "${name}_analyser_timestamp"
hsetprop ${scobj_hpath}/analyser data "true"
hsetprop ${scobj_hpath}/analyser klass "@none"
hsetprop ${scobj_hpath}/analyser type "part"
}
hsetprop ${scobj_hpath}/analyser data "true"
hsetprop ${scobj_hpath}/analyser klass "@none"
hsetprop ${scobj_hpath}/analyser type "part"
if {[string equal -nocase ${has_anal} "true"]} {
hfactory ${scobj_hpath}/polariser plain spy none
hfactory ${scobj_hpath}/analyser_start plain spy none
hfactory ${scobj_hpath}/polariser/Amplitude plain user text
hsetprop ${scobj_hpath}/polariser/Amplitude control true
hsetprop ${scobj_hpath}/polariser/Amplitude data true
hsetprop ${scobj_hpath}/polariser/Amplitude mutable true
hsetprop ${scobj_hpath}/polariser/Amplitude nxsave true
hsetprop ${scobj_hpath}/polariser/Amplitude oldval UNKNOWN
hsetprop ${scobj_hpath}/polariser/Amplitude klass "parameter"
hsetprop ${scobj_hpath}/polariser/Amplitude sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/Amplitude type "part"
hsetprop ${scobj_hpath}/polariser/Amplitude nxalias "${name}_polariser_Amplitude"
hfactory ${scobj_hpath}/analyser_start/amplitude plain user float
hsetprop ${scobj_hpath}/analyser_start/amplitude control true
hsetprop ${scobj_hpath}/analyser_start/amplitude data true
hsetprop ${scobj_hpath}/analyser_start/amplitude mutable true
hsetprop ${scobj_hpath}/analyser_start/amplitude nxsave true
hsetprop ${scobj_hpath}/analyser_start/amplitude oldval 0.0
hsetprop ${scobj_hpath}/analyser_start/amplitude klass "parameter"
hsetprop ${scobj_hpath}/analyser_start/amplitude sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser_start/amplitude type "part"
hsetprop ${scobj_hpath}/analyser_start/amplitude nxalias "${name}_analyser_start_amplitude"
hfactory ${scobj_hpath}/polariser/Field plain user text
hsetprop ${scobj_hpath}/polariser/Field control true
hsetprop ${scobj_hpath}/polariser/Field data true
hsetprop ${scobj_hpath}/polariser/Field mutable true
hsetprop ${scobj_hpath}/polariser/Field nxsave true
hsetprop ${scobj_hpath}/polariser/Field units Oersted
hsetprop ${scobj_hpath}/polariser/Field oldval UNKNOWN
hsetprop ${scobj_hpath}/polariser/Field klass "parameter"
hsetprop ${scobj_hpath}/polariser/Field sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/Field type "part"
hsetprop ${scobj_hpath}/polariser/Field nxalias "${name}_polariser_Field"
hfactory ${scobj_hpath}/analyser_start/field plain user float
hsetprop ${scobj_hpath}/analyser_start/field control true
hsetprop ${scobj_hpath}/analyser_start/field data true
hsetprop ${scobj_hpath}/analyser_start/field mutable true
hsetprop ${scobj_hpath}/analyser_start/field nxsave true
hsetprop ${scobj_hpath}/analyser_start/field units Oersted
hsetprop ${scobj_hpath}/analyser_start/field oldval 0.0
hsetprop ${scobj_hpath}/analyser_start/field klass "parameter"
hsetprop ${scobj_hpath}/analyser_start/field sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser_start/field type "part"
hsetprop ${scobj_hpath}/analyser_start/field nxalias "${name}_analyser_start_field"
hfactory ${scobj_hpath}/polariser/Freq plain user text
hsetprop ${scobj_hpath}/polariser/Freq control true
hsetprop ${scobj_hpath}/polariser/Freq data true
hsetprop ${scobj_hpath}/polariser/Freq mutable true
hsetprop ${scobj_hpath}/polariser/Freq nxsave true
hsetprop ${scobj_hpath}/polariser/Freq units Hertz
hsetprop ${scobj_hpath}/polariser/Freq oldval UNKNOWN
hsetprop ${scobj_hpath}/polariser/Freq klass "parameter"
hsetprop ${scobj_hpath}/polariser/Freq sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/Freq type "part"
hsetprop ${scobj_hpath}/polariser/Freq nxalias "${name}_polariser_Freq"
hfactory ${scobj_hpath}/analyser_start/freq plain user float
hsetprop ${scobj_hpath}/analyser_start/freq control true
hsetprop ${scobj_hpath}/analyser_start/freq data true
hsetprop ${scobj_hpath}/analyser_start/freq mutable true
hsetprop ${scobj_hpath}/analyser_start/freq nxsave true
hsetprop ${scobj_hpath}/analyser_start/freq units Hertz
hsetprop ${scobj_hpath}/analyser_start/freq oldval 0.0
hsetprop ${scobj_hpath}/analyser_start/freq klass "parameter"
hsetprop ${scobj_hpath}/analyser_start/freq sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser_start/freq type "part"
hsetprop ${scobj_hpath}/analyser_start/freq nxalias "${name}_analyser_start_freq"
hfactory ${scobj_hpath}/polariser/Phase plain user text
hsetprop ${scobj_hpath}/polariser/Phase control true
hsetprop ${scobj_hpath}/polariser/Phase data true
hsetprop ${scobj_hpath}/polariser/Phase mutable true
hsetprop ${scobj_hpath}/polariser/Phase nxsave true
hsetprop ${scobj_hpath}/polariser/Phase units Degree
hsetprop ${scobj_hpath}/polariser/Phase oldval UNKNOWN
hsetprop ${scobj_hpath}/polariser/Phase klass "parameter"
hsetprop ${scobj_hpath}/polariser/Phase sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/Phase type "part"
hsetprop ${scobj_hpath}/polariser/Phase nxalias "${name}_polariser_Phase"
hfactory ${scobj_hpath}/analyser_start/phase plain user float
hsetprop ${scobj_hpath}/analyser_start/phase control true
hsetprop ${scobj_hpath}/analyser_start/phase data true
hsetprop ${scobj_hpath}/analyser_start/phase mutable true
hsetprop ${scobj_hpath}/analyser_start/phase nxsave true
hsetprop ${scobj_hpath}/analyser_start/phase units Degree
hsetprop ${scobj_hpath}/analyser_start/phase oldval 0.0
hsetprop ${scobj_hpath}/analyser_start/phase klass "parameter"
hsetprop ${scobj_hpath}/analyser_start/phase sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser_start/phase type "part"
hsetprop ${scobj_hpath}/analyser_start/phase nxalias "${name}_analyser_start_phase"
hfactory ${scobj_hpath}/polariser/Time2 plain user text
hsetprop ${scobj_hpath}/polariser/Time2 control true
hsetprop ${scobj_hpath}/polariser/Time2 data true
hsetprop ${scobj_hpath}/polariser/Time2 mutable true
hsetprop ${scobj_hpath}/polariser/Time2 nxsave true
hsetprop ${scobj_hpath}/polariser/Time2 units Second
hsetprop ${scobj_hpath}/polariser/Time2 oldval UNKNOWN
hsetprop ${scobj_hpath}/polariser/Time2 klass "parameter"
hsetprop ${scobj_hpath}/polariser/Time2 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/Time2 type "part"
hsetprop ${scobj_hpath}/polariser/Time2 nxalias "${name}_polariser_Time2"
hfactory ${scobj_hpath}/analyser_start/spin plain user float
hsetprop ${scobj_hpath}/analyser_start/spin control true
hsetprop ${scobj_hpath}/analyser_start/spin data true
hsetprop ${scobj_hpath}/analyser_start/spin mutable true
hsetprop ${scobj_hpath}/analyser_start/spin nxsave true
hsetprop ${scobj_hpath}/analyser_start/spin oldval 0.0
hsetprop ${scobj_hpath}/analyser_start/spin klass "parameter"
hsetprop ${scobj_hpath}/analyser_start/spin sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser_start/spin type "part"
hsetprop ${scobj_hpath}/analyser_start/spin nxalias "${name}_analyser_start_spin"
hfactory ${scobj_hpath}/polariser/spin plain user text
hsetprop ${scobj_hpath}/polariser/spin read ${ns}::getValue ${scobj_hpath} rdValue {polariser}
hsetprop ${scobj_hpath}/polariser/spin rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/polariser/spin write ${ns}::setValue ${scobj_hpath} chkWrite {polariser}
hsetprop ${scobj_hpath}/polariser/spin chkWrite ${ns}::chkWrite ${scobj_hpath}
hsetprop ${scobj_hpath}/polariser/spin check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/polariser/spin control true
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 +,-,0
hsetprop ${scobj_hpath}/polariser/spin oldval UNKNOWN
hsetprop ${scobj_hpath}/polariser/spin klass "parameter"
hsetprop ${scobj_hpath}/polariser/spin sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/spin type "part"
hsetprop ${scobj_hpath}/polariser/spin nxalias "${name}_polariser_spin"
hfactory ${scobj_hpath}/analyser_start/time2 plain user float
hsetprop ${scobj_hpath}/analyser_start/time2 control true
hsetprop ${scobj_hpath}/analyser_start/time2 data true
hsetprop ${scobj_hpath}/analyser_start/time2 mutable true
hsetprop ${scobj_hpath}/analyser_start/time2 nxsave true
hsetprop ${scobj_hpath}/analyser_start/time2 units Second
hsetprop ${scobj_hpath}/analyser_start/time2 oldval 0.0
hsetprop ${scobj_hpath}/analyser_start/time2 klass "parameter"
hsetprop ${scobj_hpath}/analyser_start/time2 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser_start/time2 type "part"
hsetprop ${scobj_hpath}/analyser_start/time2 nxalias "${name}_analyser_start_time2"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/polariser/spin 900
${sct_controller} write ${scobj_hpath}/polariser/spin
hsetprop ${scobj_hpath}/polariser/spin simulated false
} else {
::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal"
hsetprop ${scobj_hpath}/polariser/spin simulated true
hfactory ${scobj_hpath}/analyser_start/timestamp plain user float
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 klass "parameter"
hsetprop ${scobj_hpath}/analyser_start/timestamp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/analyser_start/timestamp type "part"
hsetprop ${scobj_hpath}/analyser_start/timestamp nxalias "${name}_analyser_start_timestamp"
hsetprop ${scobj_hpath}/analyser_start data "true"
hsetprop ${scobj_hpath}/analyser_start klass "@none"
hsetprop ${scobj_hpath}/analyser_start type "part"
}
if {[string equal -nocase ${has_pol} "true"]} {
hfactory ${scobj_hpath}/polariser plain spy none
hfactory ${scobj_hpath}/polariser/amplitude plain user float
hsetprop ${scobj_hpath}/polariser/amplitude control true
hsetprop ${scobj_hpath}/polariser/amplitude data true
hsetprop ${scobj_hpath}/polariser/amplitude mutable true
hsetprop ${scobj_hpath}/polariser/amplitude nxsave true
hsetprop ${scobj_hpath}/polariser/amplitude oldval 0.0
hsetprop ${scobj_hpath}/polariser/amplitude klass "parameter"
hsetprop ${scobj_hpath}/polariser/amplitude sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/amplitude type "part"
hsetprop ${scobj_hpath}/polariser/amplitude nxalias "${name}_polariser_amplitude"
hfactory ${scobj_hpath}/polariser/field plain user float
hsetprop ${scobj_hpath}/polariser/field control true
hsetprop ${scobj_hpath}/polariser/field data true
hsetprop ${scobj_hpath}/polariser/field mutable true
hsetprop ${scobj_hpath}/polariser/field nxsave true
hsetprop ${scobj_hpath}/polariser/field units Oersted
hsetprop ${scobj_hpath}/polariser/field oldval 0.0
hsetprop ${scobj_hpath}/polariser/field klass "parameter"
hsetprop ${scobj_hpath}/polariser/field sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/field type "part"
hsetprop ${scobj_hpath}/polariser/field nxalias "${name}_polariser_field"
hfactory ${scobj_hpath}/polariser/freq plain user float
hsetprop ${scobj_hpath}/polariser/freq control true
hsetprop ${scobj_hpath}/polariser/freq data true
hsetprop ${scobj_hpath}/polariser/freq mutable true
hsetprop ${scobj_hpath}/polariser/freq nxsave true
hsetprop ${scobj_hpath}/polariser/freq units Hertz
hsetprop ${scobj_hpath}/polariser/freq oldval 0.0
hsetprop ${scobj_hpath}/polariser/freq klass "parameter"
hsetprop ${scobj_hpath}/polariser/freq sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/freq type "part"
hsetprop ${scobj_hpath}/polariser/freq nxalias "${name}_polariser_freq"
hfactory ${scobj_hpath}/polariser/phase plain user float
hsetprop ${scobj_hpath}/polariser/phase control true
hsetprop ${scobj_hpath}/polariser/phase data true
hsetprop ${scobj_hpath}/polariser/phase mutable true
hsetprop ${scobj_hpath}/polariser/phase nxsave true
hsetprop ${scobj_hpath}/polariser/phase units Degree
hsetprop ${scobj_hpath}/polariser/phase oldval 0.0
hsetprop ${scobj_hpath}/polariser/phase klass "parameter"
hsetprop ${scobj_hpath}/polariser/phase sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/phase type "part"
hsetprop ${scobj_hpath}/polariser/phase nxalias "${name}_polariser_phase"
hfactory ${scobj_hpath}/polariser/spin plain user float
hsetprop ${scobj_hpath}/polariser/spin read ${ns}::getValue ${scobj_hpath} rdValue {polariser}
hsetprop ${scobj_hpath}/polariser/spin rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/polariser/spin write ${ns}::setValue ${scobj_hpath} chkWrite {polariser}
hsetprop ${scobj_hpath}/polariser/spin chkWrite ${ns}::chkWrite ${scobj_hpath}
hsetprop ${scobj_hpath}/polariser/spin check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/polariser/spin control true
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 oldval 0.0
hsetprop ${scobj_hpath}/polariser/spin klass "parameter"
hsetprop ${scobj_hpath}/polariser/spin sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/spin type "part"
hsetprop ${scobj_hpath}/polariser/spin nxalias "${name}_polariser_spin"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/polariser/spin 900
${sct_controller} write ${scobj_hpath}/polariser/spin
hsetprop ${scobj_hpath}/polariser/spin simulated false
} else {
::scobj::he3_polanal::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for he3_polanal"
hsetprop ${scobj_hpath}/polariser/spin simulated true
}
hfactory ${scobj_hpath}/polariser/time2 plain user float
hsetprop ${scobj_hpath}/polariser/time2 control true
hsetprop ${scobj_hpath}/polariser/time2 data true
hsetprop ${scobj_hpath}/polariser/time2 mutable true
hsetprop ${scobj_hpath}/polariser/time2 nxsave true
hsetprop ${scobj_hpath}/polariser/time2 units Second
hsetprop ${scobj_hpath}/polariser/time2 oldval 0.0
hsetprop ${scobj_hpath}/polariser/time2 klass "parameter"
hsetprop ${scobj_hpath}/polariser/time2 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/time2 type "part"
hsetprop ${scobj_hpath}/polariser/time2 nxalias "${name}_polariser_time2"
hfactory ${scobj_hpath}/polariser/timestamp plain user float
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 klass "parameter"
hsetprop ${scobj_hpath}/polariser/timestamp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser/timestamp type "part"
hsetprop ${scobj_hpath}/polariser/timestamp nxalias "${name}_polariser_timestamp"
hsetprop ${scobj_hpath}/polariser data "true"
hsetprop ${scobj_hpath}/polariser klass "@none"
hsetprop ${scobj_hpath}/polariser type "part"
}
if {[string equal -nocase ${has_pol} "true"]} {
hfactory ${scobj_hpath}/polariser_start plain spy none
hfactory ${scobj_hpath}/polariser_start/amplitude plain user float
hsetprop ${scobj_hpath}/polariser_start/amplitude control true
hsetprop ${scobj_hpath}/polariser_start/amplitude data true
hsetprop ${scobj_hpath}/polariser_start/amplitude mutable true
hsetprop ${scobj_hpath}/polariser_start/amplitude nxsave true
hsetprop ${scobj_hpath}/polariser_start/amplitude oldval 0.0
hsetprop ${scobj_hpath}/polariser_start/amplitude klass "parameter"
hsetprop ${scobj_hpath}/polariser_start/amplitude sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser_start/amplitude type "part"
hsetprop ${scobj_hpath}/polariser_start/amplitude nxalias "${name}_polariser_start_amplitude"
hfactory ${scobj_hpath}/polariser_start/field plain user float
hsetprop ${scobj_hpath}/polariser_start/field control true
hsetprop ${scobj_hpath}/polariser_start/field data true
hsetprop ${scobj_hpath}/polariser_start/field mutable true
hsetprop ${scobj_hpath}/polariser_start/field nxsave true
hsetprop ${scobj_hpath}/polariser_start/field units Oersted
hsetprop ${scobj_hpath}/polariser_start/field oldval 0.0
hsetprop ${scobj_hpath}/polariser_start/field klass "parameter"
hsetprop ${scobj_hpath}/polariser_start/field sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser_start/field type "part"
hsetprop ${scobj_hpath}/polariser_start/field nxalias "${name}_polariser_start_field"
hfactory ${scobj_hpath}/polariser_start/freq plain user float
hsetprop ${scobj_hpath}/polariser_start/freq control true
hsetprop ${scobj_hpath}/polariser_start/freq data true
hsetprop ${scobj_hpath}/polariser_start/freq mutable true
hsetprop ${scobj_hpath}/polariser_start/freq nxsave true
hsetprop ${scobj_hpath}/polariser_start/freq units Hertz
hsetprop ${scobj_hpath}/polariser_start/freq oldval 0.0
hsetprop ${scobj_hpath}/polariser_start/freq klass "parameter"
hsetprop ${scobj_hpath}/polariser_start/freq sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser_start/freq type "part"
hsetprop ${scobj_hpath}/polariser_start/freq nxalias "${name}_polariser_start_freq"
hfactory ${scobj_hpath}/polariser_start/phase plain user float
hsetprop ${scobj_hpath}/polariser_start/phase control true
hsetprop ${scobj_hpath}/polariser_start/phase data true
hsetprop ${scobj_hpath}/polariser_start/phase mutable true
hsetprop ${scobj_hpath}/polariser_start/phase nxsave true
hsetprop ${scobj_hpath}/polariser_start/phase units Degree
hsetprop ${scobj_hpath}/polariser_start/phase oldval 0.0
hsetprop ${scobj_hpath}/polariser_start/phase klass "parameter"
hsetprop ${scobj_hpath}/polariser_start/phase sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser_start/phase type "part"
hsetprop ${scobj_hpath}/polariser_start/phase nxalias "${name}_polariser_start_phase"
hfactory ${scobj_hpath}/polariser_start/spin plain user float
hsetprop ${scobj_hpath}/polariser_start/spin control true
hsetprop ${scobj_hpath}/polariser_start/spin data true
hsetprop ${scobj_hpath}/polariser_start/spin mutable true
hsetprop ${scobj_hpath}/polariser_start/spin nxsave true
hsetprop ${scobj_hpath}/polariser_start/spin oldval 0.0
hsetprop ${scobj_hpath}/polariser_start/spin klass "parameter"
hsetprop ${scobj_hpath}/polariser_start/spin sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser_start/spin type "part"
hsetprop ${scobj_hpath}/polariser_start/spin nxalias "${name}_polariser_start_spin"
hfactory ${scobj_hpath}/polariser_start/time2 plain user float
hsetprop ${scobj_hpath}/polariser_start/time2 control true
hsetprop ${scobj_hpath}/polariser_start/time2 data true
hsetprop ${scobj_hpath}/polariser_start/time2 mutable true
hsetprop ${scobj_hpath}/polariser_start/time2 nxsave true
hsetprop ${scobj_hpath}/polariser_start/time2 units Second
hsetprop ${scobj_hpath}/polariser_start/time2 oldval 0.0
hsetprop ${scobj_hpath}/polariser_start/time2 klass "parameter"
hsetprop ${scobj_hpath}/polariser_start/time2 sdsinfo "::nexus::scobj::sdsinfo"
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
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 klass "parameter"
hsetprop ${scobj_hpath}/polariser_start/timestamp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/polariser_start/timestamp type "part"
hsetprop ${scobj_hpath}/polariser_start/timestamp nxalias "${name}_polariser_start_timestamp"
hsetprop ${scobj_hpath}/polariser_start data "true"
hsetprop ${scobj_hpath}/polariser_start klass "@none"
hsetprop ${scobj_hpath}/polariser_start type "part"
}
hsetprop ${scobj_hpath}/polariser data "true"
hsetprop ${scobj_hpath}/polariser klass "@none"
hsetprop ${scobj_hpath}/polariser type "part"
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 0
@@ -413,7 +621,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
proc ::scobj::he3_polanal::add_driver {name device_class simulation_flag ip_address tcp_port} {
set catch_status [ catch {
::scobj::he3_polanal::sics_log 9 "::scobj::he3_polanal::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
::scobj::he3_polanal::sics_log 9 "::scobj::he3_polanal::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${has_pol} ${has_anal}"
if {[string equal -nocase "${simulation_flag}" "false"]} {
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
::scobj::he3_polanal::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
@@ -427,8 +635,8 @@ proc ::scobj::he3_polanal::add_driver {name device_class simulation_flag ip_addr
::scobj::he3_polanal::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::he3_polanal::sics_log 1 "::scobj::he3_polanal::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
::scobj::he3_polanal::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
::scobj::he3_polanal::sics_log 1 "::scobj::he3_polanal::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${has_pol} ${has_anal}"
::scobj::he3_polanal::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${has_pol} ${has_anal}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
@@ -439,6 +647,13 @@ namespace eval ::scobj::he3_polanal {
namespace export sics_log
namespace export mkDriver
namespace export add_driver
# postamble hook code starts
proc stash {node} {
foreach arg {spin amplitude freq phase time2 field timestamp} {
hupdateif ${node}_start/${arg} [hval ${node}/${arg}]
}
}
# postamble hook code ends
}
proc add_he3_polanal {name ip_address tcp_port} {
@@ -519,7 +734,26 @@ proc ::scobj::he3_polanal::read_config {} {
}
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
set arg_list [list]
set missing_list [list]
array unset default_map
array set default_map [list has_pol true has_anal true]
foreach arg {has_pol has_anal} {
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"
}
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
}
}
}

View File

@@ -232,8 +232,8 @@ proc ::scobj::eurotherm_3200::setValue {tc_root nextState cmd_str} {
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id tol } {
::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id {tol 5} {lowerlimit 0} {upperlimit 500} } {
::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}"
set ns "[namespace current]"
set catch_status [ catch {
@@ -284,8 +284,8 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
hsetprop ${scobj_hpath}/loop1/setpoint data true
hsetprop ${scobj_hpath}/loop1/setpoint mutable true
hsetprop ${scobj_hpath}/loop1/setpoint nxsave true
hsetprop ${scobj_hpath}/loop1/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/loop1/setpoint upperlimit 40
hsetprop ${scobj_hpath}/loop1/setpoint lowerlimit ${lowerlimit}
hsetprop ${scobj_hpath}/loop1/setpoint upperlimit ${upperlimit}
hsetprop ${scobj_hpath}/loop1/setpoint tolerance ${tol}
hsetprop ${scobj_hpath}/loop1/setpoint permlink data_set "T[format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/loop1/setpoint @description "T[format "%02d" ${id}]SP01"
@@ -572,9 +572,9 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::eurotherm_3200::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id tol} {
proc ::scobj::eurotherm_3200::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id {tol 5 } {lowerlimit 0} {upperlimit 500}} {
set catch_status [ catch {
::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
::scobj::eurotherm_3200::sics_log 9 "::scobj::eurotherm_3200::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}"
if {[string equal -nocase "${simulation_flag}" "false"]} {
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
::scobj::eurotherm_3200::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
@@ -588,8 +588,8 @@ proc ::scobj::eurotherm_3200::add_driver {name device_class simulation_flag ip_a
::scobj::eurotherm_3200::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::eurotherm_3200::sics_log 1 "::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
::scobj::eurotherm_3200::sics_log 1 "::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}"
::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
@@ -602,9 +602,9 @@ namespace eval ::scobj::eurotherm_3200 {
namespace export add_driver
}
proc add_eurotherm_3200 {name ip_address tcp_port id datype dev_id tol} {
proc add_eurotherm_3200 {name ip_address tcp_port id datype dev_id {tol 5 } {lowerlimit 0} {upperlimit 500}} {
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
::scobj::eurotherm_3200::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
::scobj::eurotherm_3200::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol} ${lowerlimit} ${upperlimit}
}
clientput "file evaluation of eurotherm_3200_sct.tcl"
@@ -682,11 +682,15 @@ proc ::scobj::eurotherm_3200::read_config {} {
}
set arg_list [list]
set missing_list [list]
foreach arg {id datype dev_id tol} {
array unset default_map
array set default_map [list tol 5 lowerlimit 0 upperlimit 500]
foreach arg {id datype dev_id tol lowerlimit upperlimit} {
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