Pullback from Echidna 2015-02-19
This commit is contained in:
@ -7,7 +7,6 @@ namespace eval counter {
|
||||
|
||||
proc ::counter::transferscript {} {
|
||||
variable isc_numchannels
|
||||
bm status
|
||||
set val [SplitReply [bm1 gettime]]
|
||||
for {set i 1} {$i <= $isc_numchannels} {incr i} {
|
||||
append val " [SplitReply [bm$i getcounts] ]"
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
namespace eval ::scobj::knauer_pump {
|
||||
set debug_threshold 0
|
||||
set debug_threshold 5
|
||||
}
|
||||
|
||||
proc ::scobj::knauer_pump::debug_log {tc_root debug_level debug_string} {
|
||||
@ -1755,7 +1755,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio
|
||||
}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 0
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_pump_volume_sp ${scobj_hpath}/pump/volume_sp ${scobj_hpath}/pump/volume_pv ${sct_controller}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
|
||||
|
||||
proc debug_log {debug_level arg_string} {
|
||||
# write a timestamped string message to a log file for debugging
|
||||
set debug_threshold 0
|
||||
set debug_threshold 5
|
||||
if {$debug_level >= $debug_threshold} {
|
||||
set fd [open "[set [namespace current]::log_file]" "a"]
|
||||
set line "[clock format [clock seconds] -format "%T"] $arg_string"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,33 @@ proc ::scobj::west_6100::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
# checklimits function for driveable interface
|
||||
proc ::scobj::west_6100::checklimits {tc_root} {
|
||||
set catch_status [ catch {
|
||||
debug_log ${tc_root} 1 "checklimits tc_root=${tc_root} sct=[sct] target=[sct target]"
|
||||
set setpoint [sct target]
|
||||
if { [hpropexists [sct] lowerlimit] } {
|
||||
set lolimit [sct lowerlimit]
|
||||
} else {
|
||||
# lowerlimit not set, use target
|
||||
set lolimit [sct target]
|
||||
}
|
||||
if { [hpropexists [sct] upperlimit] } {
|
||||
set hilimit [sct upperlimit]
|
||||
} else {
|
||||
# upperlimit not set, use target
|
||||
set hilimit [sct target]
|
||||
}
|
||||
# checklimits hook code goes here
|
||||
if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {
|
||||
sct driving 0
|
||||
error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"
|
||||
}
|
||||
return OK
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
# check function for hset change
|
||||
proc ::scobj::west_6100::checkrange {tc_root} {
|
||||
set catch_status [ catch {
|
||||
@ -53,6 +80,40 @@ proc ::scobj::west_6100::checkrange {tc_root} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
# checkstatus function for driveable interface
|
||||
proc ::scobj::west_6100::checkstatus {tc_root} {
|
||||
set catch_status [ catch {
|
||||
# checkstatus hook code goes here
|
||||
if {[sct driving]} {
|
||||
set sp "[sct target]"
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
|
||||
if { [hpropexists [sct] settle_time] } {
|
||||
if { [hpropexists [sct] settle_time_start] } {
|
||||
if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} {
|
||||
sct driving 0
|
||||
return "idle"
|
||||
}
|
||||
return "busy"
|
||||
} else {
|
||||
sct utime settle_time_start
|
||||
return "busy"
|
||||
}
|
||||
}
|
||||
sct driving 0
|
||||
return "idle"
|
||||
}
|
||||
if { [hpropexists [sct] settle_time_start] } {
|
||||
hdelprop [sct] settle_time_start
|
||||
}
|
||||
return "busy"
|
||||
} else {
|
||||
return "idle"
|
||||
}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
# function to request the read of a parameter on a device
|
||||
proc ::scobj::west_6100::getDecimal {tc_root nextState cmd_str} {
|
||||
set catch_status [ catch {
|
||||
@ -101,6 +162,18 @@ proc ::scobj::west_6100::getInteger {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
# halt function for driveable interface
|
||||
proc ::scobj::west_6100::halt {tc_root} {
|
||||
set catch_status [ catch {
|
||||
debug_log ${tc_root} 1 "halt tc_root=${tc_root} sct=[sct] driving=[sct driving]"
|
||||
### TODO hset [sct] [hval [sct]]
|
||||
# halt hook code goes here
|
||||
sct driving 0
|
||||
return "idle"
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
# function to check the write parameter on a device
|
||||
proc ::scobj::west_6100::noResponse {tc_root} {
|
||||
set catch_status [ catch {
|
||||
@ -262,8 +335,8 @@ proc ::scobj::west_6100::wrInteger {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port dev_id } {
|
||||
::scobj::west_6100::sics_log 9 "::scobj::west_6100::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}"
|
||||
proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id } {
|
||||
::scobj::west_6100::sics_log 9 "::scobj::west_6100::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
set ns "[namespace current]"
|
||||
set catch_status [ catch {
|
||||
|
||||
@ -358,6 +431,8 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor data true
|
||||
hsetprop ${scobj_hpath}/sensor mutable true
|
||||
hsetprop ${scobj_hpath}/sensor nxsave true
|
||||
hsetprop ${scobj_hpath}/sensor permlink data_set "T[format "%02d" ${id}]S01"
|
||||
hsetprop ${scobj_hpath}/sensor @description "T[format "%02d" ${id}]S01"
|
||||
hsetprop ${scobj_hpath}/sensor oldval 0.0
|
||||
hsetprop ${scobj_hpath}/sensor klass "parameter"
|
||||
hsetprop ${scobj_hpath}/sensor sdsinfo "::nexus::scobj::sdsinfo"
|
||||
@ -370,14 +445,25 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/setpoint write ${ns}::wrDecimal ${scobj_hpath} noResponse {2}
|
||||
hsetprop ${scobj_hpath}/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/setpoint check ${ns}::checkrange ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/setpoint driving 0
|
||||
hsetprop ${scobj_hpath}/setpoint checklimits ${ns}::checklimits ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/setpoint halt ${ns}::halt ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/setpoint driveable sensor
|
||||
hsetprop ${scobj_hpath}/setpoint control true
|
||||
hsetprop ${scobj_hpath}/setpoint data true
|
||||
hsetprop ${scobj_hpath}/setpoint mutable true
|
||||
hsetprop ${scobj_hpath}/setpoint nxsave true
|
||||
hsetprop ${scobj_hpath}/setpoint lowerlimit 0
|
||||
hsetprop ${scobj_hpath}/setpoint upperlimit 1600
|
||||
hsetprop ${scobj_hpath}/setpoint tolerance 1
|
||||
hsetprop ${scobj_hpath}/setpoint permlink data_set "T[format "%02d" ${id}]SP01"
|
||||
hsetprop ${scobj_hpath}/setpoint @description "T[format "%02d" ${id}]SP01"
|
||||
hsetprop ${scobj_hpath}/setpoint oldval 0.0
|
||||
hsetprop ${scobj_hpath}/setpoint klass "parameter"
|
||||
hsetprop ${scobj_hpath}/setpoint sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/setpoint type "part"
|
||||
hsetprop ${scobj_hpath}/setpoint settle_time "30"
|
||||
hsetprop ${scobj_hpath}/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint"
|
||||
|
||||
hfactory ${scobj_hpath}/w_sp plain user float
|
||||
@ -471,14 +557,17 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_address tcp_port dev_id} {
|
||||
proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_address tcp_port id} {
|
||||
set catch_status [ catch {
|
||||
::scobj::west_6100::sics_log 9 "::scobj::west_6100::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}"
|
||||
::scobj::west_6100::sics_log 9 "::scobj::west_6100::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
@ -490,8 +579,8 @@ proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_addres
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for west_6100"
|
||||
}
|
||||
::scobj::west_6100::sics_log 1 "::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}"
|
||||
::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}
|
||||
::scobj::west_6100::sics_log 1 "::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
@ -504,9 +593,9 @@ namespace eval ::scobj::west_6100 {
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
proc add_west_6100 {name ip_address tcp_port dev_id} {
|
||||
proc add_west_6100 {name ip_address tcp_port id} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::west_6100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${dev_id}"
|
||||
::scobj::west_6100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_west_6100.tcl"
|
||||
@ -572,7 +661,7 @@ proc ::scobj::west_6100::read_config {} {
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
foreach arg {dev_id} {
|
||||
foreach arg {id} {
|
||||
if {[dict exists $u $arg]} {
|
||||
lappend arg_list "[dict get $u $arg]"
|
||||
} elseif {[dict exists $v $arg]} {
|
||||
|
@ -20,10 +20,12 @@ MakeRS232Controller sertemp $IP 502
|
||||
sertemp timeout 300
|
||||
sertemp sendterminator 0x0
|
||||
sertemp replyterminator 0x0
|
||||
EvFactory new tc1 west4100 sertemp $ID 2
|
||||
#ffr 2014-09-22: The modbus addr should be 1 for single port moxas (Not $ID which is a SICS ID)
|
||||
# EvFactory new tc1 west4100 sertemp $ID 2
|
||||
EvFactory new $temp_sobj west4100 sertemp 1 2
|
||||
|
||||
sicslist setatt tc1 units kelvin
|
||||
sicslist setatt tc1 klass @none
|
||||
sicslist setatt $temp_sobj units kelvin
|
||||
sicslist setatt $temp_sobj klass @none
|
||||
}
|
||||
|
||||
# @brief Adds a west400 temperature controller object.
|
||||
|
@ -390,7 +390,7 @@ namespace eval histogram_memory {
|
||||
if [ catch {
|
||||
set det_height_mm [SplitReply [detector_active_height_mm]]
|
||||
set max_chan [OAT_TABLE Y -getdata MAX_CHAN]
|
||||
set scale_factor [expr {$det_height_mm / $max_chan}]
|
||||
set scale_factor [expr {1.0 * $det_height_mm / $max_chan}]
|
||||
set offset 0.0
|
||||
::histogram_memory::calc_axis "y_pixel_offset" $scale_factor $offset [OAT_TABLE Y -getdata BOUNDARIES]
|
||||
if {$args == "-get_data_ref"} {
|
||||
@ -426,7 +426,7 @@ namespace eval histogram_memory {
|
||||
if [ catch {
|
||||
set det_width_mm [SplitReply [detector_active_width_mm]]
|
||||
set max_chan [OAT_TABLE X -getdata MAX_CHAN]
|
||||
set scale_factor [expr {$det_width_mm / $max_chan}]
|
||||
set scale_factor [expr {1.0 * $det_width_mm / $max_chan}]
|
||||
set offset 0.0
|
||||
::histogram_memory::calc_axis "x_pixel_offset" $scale_factor $offset [OAT_TABLE X -getdata BOUNDARIES]
|
||||
if {$args == "-get_data_ref"} {
|
||||
|
@ -124,7 +124,7 @@ proc ::scobj::positmotor::mot2ID {mot precision table} {
|
||||
if {abs($mot - $m) <= $precision} {
|
||||
return $i
|
||||
} elseif {[expr {$sign * ($mot - $m)} ] < 0} {
|
||||
return [expr {($mot-$mprev)*($i - $iprev)/($m - $mprev)+$iprev}]
|
||||
return [expr {1.0 * ($mot-$mprev)*($i - $iprev)/($m - $mprev)+$iprev}]
|
||||
}
|
||||
set iprev $i
|
||||
set mprev $m
|
||||
|
@ -24,7 +24,8 @@ set my_Home 8389613
|
||||
#set mx_Home 7580366
|
||||
set mx_Home 8392083
|
||||
#set mom_Home 13442930
|
||||
set mom_Home 8218065
|
||||
#set mom_Home 8218065
|
||||
set mom_Home 8295887
|
||||
set mtth_Home 11534660
|
||||
set pcx_Home 6330515
|
||||
set pcr_Home 21650101
|
||||
|
@ -40,16 +40,12 @@ fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_ls340.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_lakeshore_m370.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_mercury_base.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_mercury_level.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_mercury_pres.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_mercury_scpi.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_mercury_temp.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_mercury_valve.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl
|
||||
fileeval $cfPath(environment)/sct_protek_common.tcl
|
||||
fileeval $cfPath(environment)/sct_protekmm.tcl
|
||||
fileeval $cfPath(environment)/temperature/west400.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_west4100.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_west_6100.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_watlow_pm.tcl
|
||||
fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl
|
||||
fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl
|
||||
|
Reference in New Issue
Block a user