|
|
@ -10,9 +10,12 @@ proc ::scobj::lakeshore_218::debug_log {tc_root debug_level debug_string} {
|
|
|
|
set catch_status [ catch {
|
|
|
|
set catch_status [ catch {
|
|
|
|
set debug_threshold [hgetpropval ${tc_root} debug_threshold]
|
|
|
|
set debug_threshold [hgetpropval ${tc_root} debug_threshold]
|
|
|
|
if {${debug_level} >= ${debug_threshold}} {
|
|
|
|
if {${debug_level} >= ${debug_threshold}} {
|
|
|
|
set fd [open "../log/lakeshore_218_[basename ${tc_root}].log" "a"]
|
|
|
|
set now [clock seconds]
|
|
|
|
set line "[clock format [clock seconds] -format "%T"] ${debug_string}"
|
|
|
|
set ts [clock format ${now} -format "%Y%m%d"]
|
|
|
|
puts ${fd} "${line}"
|
|
|
|
set log_file_name "../log/lakeshore_218_[basename ${tc_root}]_${ts}.log"
|
|
|
|
|
|
|
|
set fd [open "${log_file_name}" "a"]
|
|
|
|
|
|
|
|
set ts [clock format ${now} -format "%T"]
|
|
|
|
|
|
|
|
puts ${fd} "${ts} ${debug_string}"
|
|
|
|
close ${fd}
|
|
|
|
close ${fd}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch_message ]
|
|
|
|
} catch_message ]
|
|
|
@ -62,7 +65,7 @@ proc ::scobj::lakeshore_218::getTemp {tc_root nextState cmd_str} {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set cmd "${cmd_str}"
|
|
|
|
set cmd "${cmd_str}"
|
|
|
|
# getTemp hook code starts
|
|
|
|
# getTemp hook code starts
|
|
|
|
set temps [split "[hval ${tc_root}/krdg]" ","]
|
|
|
|
set temps [split "[hgetpropval ${tc_root}/krdg real_data]" ","]
|
|
|
|
sct result [lindex ${temps} ${cmd_str}]
|
|
|
|
sct result [lindex ${temps} ${cmd_str}]
|
|
|
|
set cmd "@@NOSEND@@"
|
|
|
|
set cmd "@@NOSEND@@"
|
|
|
|
# getTemp hook code ends
|
|
|
|
# getTemp hook code ends
|
|
|
@ -133,6 +136,39 @@ proc ::scobj::lakeshore_218::rdValue {tc_root} {
|
|
|
|
handle_exception ${catch_status} ${catch_message}
|
|
|
|
handle_exception ${catch_status} ${catch_message}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# function to parse the read of a parameter on a device
|
|
|
|
|
|
|
|
proc ::scobj::lakeshore_218::read_krdg {tc_root} {
|
|
|
|
|
|
|
|
set catch_status [ catch {
|
|
|
|
|
|
|
|
debug_log ${tc_root} 1 "read_krdg tc_root=${tc_root} sct=[sct] result=[sct result]"
|
|
|
|
|
|
|
|
if { [hpropexists [sct] geterror] } {
|
|
|
|
|
|
|
|
hdelprop [sct] geterror
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
set data [sct result]
|
|
|
|
|
|
|
|
set nextState "idle"
|
|
|
|
|
|
|
|
if {[string equal -nocase -length 7 ${data} "ASCERR:"]} {
|
|
|
|
|
|
|
|
# the protocol driver has reported an error
|
|
|
|
|
|
|
|
sct geterror "${data}"
|
|
|
|
|
|
|
|
error "[sct geterror]"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
# read_krdg hook code starts
|
|
|
|
|
|
|
|
sct real_data "${data}"
|
|
|
|
|
|
|
|
set data "Hidden in real_data property"
|
|
|
|
|
|
|
|
# read_krdg hook code ends
|
|
|
|
|
|
|
|
if { [hpropexists [sct] geterror] } {
|
|
|
|
|
|
|
|
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
|
|
|
|
|
|
|
|
error "[sct geterror]"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if { ${data} != [sct oldval] } {
|
|
|
|
|
|
|
|
debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]"
|
|
|
|
|
|
|
|
sct oldval ${data}
|
|
|
|
|
|
|
|
sct update ${data}
|
|
|
|
|
|
|
|
sct utime readtime
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ${nextState}
|
|
|
|
|
|
|
|
} catch_message ]
|
|
|
|
|
|
|
|
handle_exception ${catch_status} ${catch_message}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# function to write a parameter value on a device
|
|
|
|
# function to write a parameter value on a device
|
|
|
|
proc ::scobj::lakeshore_218::setValue {tc_root nextState cmd_str} {
|
|
|
|
proc ::scobj::lakeshore_218::setValue {tc_root nextState cmd_str} {
|
|
|
|
set catch_status [ catch {
|
|
|
|
set catch_status [ catch {
|
|
|
@ -157,8 +193,8 @@ proc ::scobj::lakeshore_218::setValue {tc_root nextState cmd_str} {
|
|
|
|
handle_exception ${catch_status} ${catch_message}
|
|
|
|
handle_exception ${catch_status} ${catch_message}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } {
|
|
|
|
proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port {num_chans 8} } {
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "::scobj::lakeshore_218::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "::scobj::lakeshore_218::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${num_chans}"
|
|
|
|
set ns "[namespace current]"
|
|
|
|
set ns "[namespace current]"
|
|
|
|
set catch_status [ catch {
|
|
|
|
set catch_status [ catch {
|
|
|
|
|
|
|
|
|
|
|
@ -170,149 +206,219 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
|
|
|
set scobj_hpath /sics/${name}
|
|
|
|
set scobj_hpath /sics/${name}
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/krdg plain user text
|
|
|
|
hfactory ${scobj_hpath}/krdg plain user text
|
|
|
|
hsetprop ${scobj_hpath}/krdg read ${ns}::getValue ${scobj_hpath} rdValue {KRDG? 0}
|
|
|
|
hsetprop ${scobj_hpath}/krdg read ${ns}::getValue ${scobj_hpath} read_krdg {KRDG? 0}
|
|
|
|
hsetprop ${scobj_hpath}/krdg rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
hsetprop ${scobj_hpath}/krdg read_krdg ${ns}::read_krdg ${scobj_hpath}
|
|
|
|
hsetprop ${scobj_hpath}/krdg control false
|
|
|
|
hsetprop ${scobj_hpath}/krdg control false
|
|
|
|
hsetprop ${scobj_hpath}/krdg data false
|
|
|
|
hsetprop ${scobj_hpath}/krdg data false
|
|
|
|
hsetprop ${scobj_hpath}/krdg mutable true
|
|
|
|
hsetprop ${scobj_hpath}/krdg mutable true
|
|
|
|
hsetprop ${scobj_hpath}/krdg nxsave false
|
|
|
|
hsetprop ${scobj_hpath}/krdg nxsave false
|
|
|
|
hsetprop ${scobj_hpath}/krdg oldval 0,0,0,0,0,0,0,0
|
|
|
|
hsetprop ${scobj_hpath}/krdg oldval "Hidden in real_data property"
|
|
|
|
hset ${scobj_hpath}/krdg 0,0,0,0,0,0,0,0
|
|
|
|
hset ${scobj_hpath}/krdg "Hidden in real_data property"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/krdg real_data "0,0,0,0,0,0,0,0"
|
|
|
|
hsetprop ${scobj_hpath}/krdg sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
hsetprop ${scobj_hpath}/krdg sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
hsetprop ${scobj_hpath}/krdg type "part"
|
|
|
|
hsetprop ${scobj_hpath}/krdg type "part"
|
|
|
|
hsetprop ${scobj_hpath}/krdg nxalias "${name}_krdg"
|
|
|
|
hsetprop ${scobj_hpath}/krdg nxalias "${name}_krdg"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/krdg 1
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/krdg simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/krdg simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath} data "false"
|
|
|
|
hsetprop ${scobj_hpath} data "false"
|
|
|
|
hsetprop ${scobj_hpath} klass "@none"
|
|
|
|
hsetprop ${scobj_hpath} klass "@none"
|
|
|
|
hsetprop ${scobj_hpath} type "part"
|
|
|
|
hsetprop ${scobj_hpath} type "part"
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
hfactory ${scobj_hpath}/sensor plain spy none
|
|
|
|
${sct_controller} poll ${scobj_hpath}/krdg 1
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if {${num_chans} > 0} {
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch1 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 read ${ns}::getTemp ${scobj_hpath} rdValue {0}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 nxalias "${name}_sensor_ch1"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch1 15
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor plain spy none
|
|
|
|
if {${num_chans} > 1} {
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch2 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 read ${ns}::getTemp ${scobj_hpath} rdValue {1}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 nxalias "${name}_sensor_ch2"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch2 15
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {${num_chans} > 2} {
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch3 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 read ${ns}::getTemp ${scobj_hpath} rdValue {2}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 nxalias "${name}_sensor_ch3"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch3 15
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {${num_chans} > 3} {
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch4 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 read ${ns}::getTemp ${scobj_hpath} rdValue {3}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 nxalias "${name}_sensor_ch4"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch4 15
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {${num_chans} > 4} {
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch5 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 read ${ns}::getTemp ${scobj_hpath} rdValue {4}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 nxalias "${name}_sensor_ch5"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch5 15
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {${num_chans} > 5} {
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch6 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 read ${ns}::getTemp ${scobj_hpath} rdValue {5}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 nxalias "${name}_sensor_ch6"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch6 15
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {${num_chans} > 6} {
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch7 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 read ${ns}::getTemp ${scobj_hpath} rdValue {6}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 nxalias "${name}_sensor_ch7"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch7 15
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {${num_chans} > 7} {
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch8 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 read ${ns}::getTemp ${scobj_hpath} rdValue {7}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 nxalias "${name}_sensor_ch8"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch8 15
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 simulated false
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 simulated true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
hsetprop ${scobj_hpath}/sensor data "true"
|
|
|
|
hsetprop ${scobj_hpath}/sensor data "true"
|
|
|
|
hsetprop ${scobj_hpath}/sensor klass "@none"
|
|
|
|
hsetprop ${scobj_hpath}/sensor klass "@none"
|
|
|
|
hsetprop ${scobj_hpath}/sensor type "part"
|
|
|
|
hsetprop ${scobj_hpath}/sensor type "part"
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch1 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 read ${ns}::getTemp ${scobj_hpath} rdValue {0}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch1 nxalias "${name}_sensor_ch1"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch2 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 read ${ns}::getTemp ${scobj_hpath} rdValue {1}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch2 nxalias "${name}_sensor_ch2"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch3 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 read ${ns}::getTemp ${scobj_hpath} rdValue {2}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch3 nxalias "${name}_sensor_ch3"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch4 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 read ${ns}::getTemp ${scobj_hpath} rdValue {3}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch4 nxalias "${name}_sensor_ch4"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch5 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 read ${ns}::getTemp ${scobj_hpath} rdValue {4}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch5 nxalias "${name}_sensor_ch5"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch6 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 read ${ns}::getTemp ${scobj_hpath} rdValue {5}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch6 nxalias "${name}_sensor_ch6"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch7 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 read ${ns}::getTemp ${scobj_hpath} rdValue {6}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch7 nxalias "${name}_sensor_ch7"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hfactory ${scobj_hpath}/sensor/ch8 plain user float
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 read ${ns}::getTemp ${scobj_hpath} rdValue {7}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 rdValue ${ns}::rdValue ${scobj_hpath}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 control true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 data true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 mutable true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 nxsave true
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 oldval 0.0
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 klass "parameter"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 sdsinfo "::nexus::scobj::sdsinfo"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 type "part"
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath}/sensor/ch8 nxalias "${name}_sensor_ch8"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch1 1
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch2 1
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch3 1
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch4 1
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch5 1
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch6 1
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch7 1
|
|
|
|
|
|
|
|
${sct_controller} poll ${scobj_hpath}/sensor/ch8 1
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
hsetprop ${scobj_hpath} klass ${device_class}
|
|
|
|
hsetprop ${scobj_hpath} klass ${device_class}
|
|
|
|
hsetprop ${scobj_hpath} data true
|
|
|
|
hsetprop ${scobj_hpath} data true
|
|
|
|
hsetprop ${scobj_hpath} debug_threshold 5
|
|
|
|
hsetprop ${scobj_hpath} debug_threshold 5
|
|
|
@ -323,7 +429,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
|
|
|
|
|
|
|
|
|
|
|
proc ::scobj::lakeshore_218::add_driver {name device_class simulation_flag ip_address tcp_port} {
|
|
|
|
proc ::scobj::lakeshore_218::add_driver {name device_class simulation_flag ip_address tcp_port} {
|
|
|
|
set catch_status [ catch {
|
|
|
|
set catch_status [ catch {
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "::scobj::lakeshore_218::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "::scobj::lakeshore_218::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${num_chans}"
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
|
|
|
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
|
|
|
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
|
|
@ -333,10 +439,12 @@ proc ::scobj::lakeshore_218::add_driver {name device_class simulation_flag ip_ad
|
|
|
|
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
|
|
|
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for lakeshore_218"
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for lakeshore_218"
|
|
|
|
|
|
|
|
::scobj::lakeshore_218::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
|
|
|
|
|
|
|
makesctcontroller sct_${name} aqadapter NULL
|
|
|
|
}
|
|
|
|
}
|
|
|
|
::scobj::lakeshore_218::sics_log 1 "::scobj::lakeshore_218::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
|
|
|
::scobj::lakeshore_218::sics_log 1 "::scobj::lakeshore_218::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${num_chans}"
|
|
|
|
::scobj::lakeshore_218::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
|
|
|
::scobj::lakeshore_218::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${num_chans}
|
|
|
|
} catch_message ]
|
|
|
|
} catch_message ]
|
|
|
|
handle_exception ${catch_status} ${catch_message}
|
|
|
|
handle_exception ${catch_status} ${catch_message}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -351,7 +459,7 @@ namespace eval ::scobj::lakeshore_218 {
|
|
|
|
|
|
|
|
|
|
|
|
proc add_lakeshore_218 {name ip_address tcp_port} {
|
|
|
|
proc add_lakeshore_218 {name ip_address tcp_port} {
|
|
|
|
set simulation_flag "[string tolower [SplitReply [detector_simulation]]]"
|
|
|
|
set simulation_flag "[string tolower [SplitReply [detector_simulation]]]"
|
|
|
|
::scobj::lakeshore_218::add_driver ${name} "NXdetector" "${simulation_flag}" ${ip_address} ${tcp_port}
|
|
|
|
::scobj::lakeshore_218::add_driver ${name} "NXdetector" ${simulation_flag} ${ip_address} ${tcp_port}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
clientput "file evaluation of sct_lakeshore_218.tcl"
|
|
|
|
clientput "file evaluation of sct_lakeshore_218.tcl"
|
|
|
@ -390,20 +498,31 @@ proc ::scobj::lakeshore_218::read_config {} {
|
|
|
|
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
|
|
|
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
|
|
|
set asyncqueue "null"
|
|
|
|
set asyncqueue "null"
|
|
|
|
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
|
|
|
${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"] } {
|
|
|
|
} elseif { [dict exists $v "asyncqueue"] } {
|
|
|
|
set asyncqueue [dict get $v "asyncqueue"]
|
|
|
|
set asyncqueue [dict get $v "asyncqueue"]
|
|
|
|
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
|
|
|
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
|
|
|
set ip_address [dict get $v ip]
|
|
|
|
set ip_address [dict get $v ip]
|
|
|
|
set tcp_port [dict get $v port]
|
|
|
|
set tcp_port [dict get $v port]
|
|
|
|
}
|
|
|
|
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if { [dict exists $v "asyncprotocol"] } {
|
|
|
|
if { [dict exists $v "asyncprotocol"] } {
|
|
|
|
set asyncprotocol [dict get $v "asyncprotocol"]
|
|
|
|
set asyncprotocol [dict get $v "asyncprotocol"]
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
set asyncprotocol ${name}_protocol
|
|
|
|
set asyncprotocol ${name}_protocol
|
|
|
|
MakeAsyncProtocol ${asyncprotocol}
|
|
|
|
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"]"
|
|
|
|
${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"]"
|
|
|
|
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -414,12 +533,28 @@ proc ::scobj::lakeshore_218::read_config {} {
|
|
|
|
if { [dict exists $v "timeout"] } {
|
|
|
|
if { [dict exists $v "timeout"] } {
|
|
|
|
${asyncqueue} timeout "[dict get $v "timeout"]"
|
|
|
|
${asyncqueue} timeout "[dict get $v "timeout"]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
|
|
|
set arg_list [list]
|
|
|
|
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
|
|
|
set missing_list [list]
|
|
|
|
} else {
|
|
|
|
array unset default_map
|
|
|
|
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue}
|
|
|
|
array set default_map [list num_chans 8]
|
|
|
|
|
|
|
|
foreach arg {num_chans} {
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|