Remove superfluous trailing white space from TCL files

This commit is contained in:
Douglas Clowes
2014-05-16 12:30:51 +10:00
parent 89e4e37f9e
commit 92d3acb5d5
230 changed files with 1835 additions and 1835 deletions

View File

@@ -6,7 +6,7 @@ AntiCollisionInstall
namespace eval anticollider {
variable veto_region
}
array unset ::anticollider::veto_region
array unset ::anticollider::veto_region
array set ::anticollider::veto_region ""
# Don't show 'acscript' call on error. This is done by the anticollider
@@ -45,7 +45,7 @@ proc handle_acscript_exception {status message args} {
proc ::anticollider::loadscript {args} {
variable veto_rules
set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ]
set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ]
while {[gets $fh line] >= 0} {
# Skip empty lines and comments
if [regexp {^\s*$|^ *#} $line] {
@@ -60,7 +60,7 @@ proc ::anticollider::loadscript {args} {
# for the anticollider script.
#
# @param veto_rules, an anticollider declaration as a list of quote enclosed lines.
# @return Generates the ::anticollider::veto_region lookup table.
# @return Generates the ::anticollider::veto_region lookup table.
#
# Example\n
# forbid {160 167} for stth when mtth in {87 88}\n
@@ -72,7 +72,7 @@ proc ::anticollider::loadscript {args} {
# forbid {0 10} for samx whenall { samrot in {0 5} samy in {0 15} }\n
proc ::anticollider::genveto {veto_rules} {
variable veto_region
array unset veto_region
array unset veto_region
set lnum 1
foreach line $veto_rules {
@@ -98,7 +98,7 @@ proc ::anticollider::genveto {veto_rules} {
}
##
# @brief Instrument specific configurations should re-implement this if they want
# @brief Instrument specific configurations should re-implement this if they want
# to override the anticollision detection on some conditions
#
# @param args list of motorname target pairs
@@ -113,7 +113,7 @@ proc ::anticollider::enable {args} {
# WARNING: This does not handle sequencing. Only run one motor at a time.
# This script requires that an ::anticollider::veto_region has been generated
# by the ::anticollider::genveto procedure.
#
#
# The ::anticollider::veto_region is a hash indexed by the names of the motors
# which have been registered with the anticollision module.
proc ::anticollider::veto_region_acscript {args} {

View File

@@ -86,7 +86,7 @@ command hdb_bmonscan {
text=monitor,timer mode
float preset
int=0,2 channel
} {
} {
bmonscan clear
# bmonscan configure script
@@ -154,7 +154,7 @@ scriptcallback connect bm COUNTSTART "::monitor::count -set feedback status BUSY
scriptcallback connect bm COUNTEND "::monitor::count -set feedback status IDLE"
################################################################################
# Generate the following commands,
# Generate the following commands,
# ::motor::go_home
namespace eval ::motor {
set NS [uplevel namespace current]
@@ -162,8 +162,8 @@ scriptcallback connect bm COUNTEND "::monitor::count -set feedback status IDLE
return -code error "ERROR: Instrument specific command config must set ${NS}::is_homing_list\n"
}
command go_home "text=$is_homing_list motors" {
# Instrument specific command configurations must define
# ::motor::is_homing_list, this is a possibly empty comma separated list
# Instrument specific command configurations must define
# ::motor::is_homing_list, this is a possibly empty comma separated list
# of motors which are safe to send to home
variable is_homing_list

View File

@@ -4,13 +4,13 @@ set scaleval 1000.0
proc SetVoltScale {newscaleval} {
global scaleval
set scaleval $newscaleval
}
}
proc VoltScale {involt} {
global scaleval
return [expr {($involt*1.0)/$scaleval}]
}
proc SetVolt {volt} {
if {$volt== 0} {
PulserOff
@@ -56,7 +56,7 @@ proc VoltRamp {start step fin oscno} {
newfile HISTOGRAM_XY
set loopvar 1
set i 0
set i 0
while {$loopvar} {
set j [expr {$i*$step+$start}]
if {$j> $fin && $step > 0} {break}
@@ -71,7 +71,7 @@ proc VoltRamp {start step fin oscno} {
oscmd start $oscno
hmm countblock
save $i
incr i
incr i
}
oscmd stop
}
@@ -81,7 +81,7 @@ proc VoltTextureRamp {start step fin mot tstart tstep tfin oscno} {
set loopvar 1
set i 0
set i 0
while {$loopvar} {
set j [expr {$i*$step+$start}]
if {$j> $fin && $step > 0} {break}
@@ -105,7 +105,7 @@ proc VoltTextureRamp {start step fin mot tstart tstep tfin oscno} {
oscmd start $oscno
hmm countblock
save $m
incr m
incr m
}
oscmd stop
incr i
@@ -121,14 +121,14 @@ proc SquarePulseTexture {motor start step numsteps volt freq bins oscno} {
set pulservolt [VoltScale $volt]
PulserSquare $freq $pulservolt
PulserOn
for {set i 0} {$i < $numsteps} {incr i} {
drive $motor [expr $i*$step+$start]
oscmd start $oscno
hmm countblock
save $i
}
oscmd stop
}
@@ -140,14 +140,14 @@ proc UniPulseTexture {motor start step numsteps volt freq bins oscno} {
set pulservolt [VoltScale [expr ($volt*1.0/2)]]
PulserSquareOffs $freq $pulservolt $pulservolt
PulserOn
for {set i 0} {$i < $numsteps} {incr i} {
drive $motor [expr $i*$step+$start]
oscmd start $oscno
hmm countblock
save $i
}
oscmd stop
}
@@ -167,7 +167,7 @@ proc BehlkePulseTexture {motor start step numsteps freq bins oscno} {
}
}
proc SquarePulseVolt {start step fin freq bins oscno} {
histmem mode unlimited
@@ -175,7 +175,7 @@ proc SquarePulseVolt {start step fin freq bins oscno} {
histmem_period_strobo $freq $bins
wait 3
set loopvar 1
set i 0
set i 0
while {$loopvar} {
set j [expr {$i*$step+$start}]
if {$j> $fin && $step > 0} {break}
@@ -191,7 +191,7 @@ proc SquarePulseVolt {start step fin freq bins oscno} {
oscmd start $oscno
hmm countblock
save $i
incr i
incr i
}
oscmd stop
}
@@ -200,7 +200,7 @@ proc SquarePulseFreq {volt freqlist bins oscno} {
histmem mode unlimited
newfile HISTOGRAM_XYT
set loopvar 1
set i 0
set i 0
foreach freq $freqlist {
set pulservolt [VoltScale $volt]
histmem_period_strobo $freq $bins
@@ -211,7 +211,7 @@ proc SquarePulseFreq {volt freqlist bins oscno} {
oscmd start $oscno
hmm countblock
save $i
incr i
incr i
}
oscmd stop
}
@@ -259,7 +259,7 @@ proc UniPulseFreq {volt freqlist bins oscno} {
histmem mode unlimited
newfile HISTOGRAM_XYT
set loopvar 1
set i 0
set i 0
foreach freq $freqlist {
set pulservolt [VoltScale [expr ($volt*1.0/2)]]
histmem_period_strobo $freq $bins
@@ -271,7 +271,7 @@ proc UniPulseFreq {volt freqlist bins oscno} {
oscmd start $oscno
hmm countblock
save $i
incr i
incr i
}
oscmd stop
}
@@ -298,7 +298,7 @@ proc UniPulseFatigue {volt freq bins oscno reps runs} {
}
proc PulserBurst {} {
@@ -341,7 +341,7 @@ proc VoltPulseRun {vlo vhi freq cycl} {
proc VoltPulses {vlo vhi freq cycl} {
PulserOff
PulserOff
pulser send "FUNC SQU;:FUNC?"
VoltPulseRun $vlo $vhi $freq $cycl
}
@@ -350,7 +350,7 @@ proc VoltTriPulses {vlo vhi freq cycl} {
PulserOff
pulser send "FUNC RAMP;:FUNC?"
pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
VoltPulseRun $vlo $vhi $freq $cycl
VoltPulseRun $vlo $vhi $freq $cycl
}
proc OneTri {volt period} {
@@ -375,7 +375,7 @@ proc OneTri {volt period} {
PulserOff
}
publish GetVolt user
publish SetDC user

View File

@@ -58,7 +58,7 @@ proc PulserDC {Volt} {
}
publish PulserOn user

View File

@@ -2,7 +2,7 @@ namespace eval counter {
variable isc_numchannels
variable isc_monitor_address
variable isc_portlist
variable isc_beam_monitor_list
variable isc_beam_monitor_list
}
proc ::counter::transferscript {} {
@@ -21,7 +21,7 @@ proc ::counter::ic_initialize {} {
variable isc_numchannels
variable isc_monitor_address
variable isc_portlist
variable isc_beam_monitor_list
variable isc_beam_monitor_list
set sim_mode [SplitReply [counter_simulation]]
if {$sim_mode == "true"} {

View File

@@ -1,5 +1,5 @@
##
# @file He3 controller
# @file He3 controller
#
# Author: Jing Chen (jgn@ansto.gov.au) June 2010
#
@@ -10,7 +10,7 @@
# PORT 6290
# tuning 1
# interval 2
# }
# }
#
# NOTE:
# If tuning=1 this will generate gom/set_gom, gchi/set_gchi and gphi/set_gphi
@@ -20,7 +20,7 @@
namespace eval ::scobj::he3 {
}
##
# @brief Request a state from the He3 controller by sending a get command
proc ::scobj::he3::rqStatFunc {} {
@@ -44,12 +44,12 @@ proc ::scobj::he3::rdStatFunc {basePath} {
hset $basePath/Amplitude $stateArr(amp)
hset $basePath/Frequence $stateArr(fre)
hset $basePath/NaN $stateArr(nan)
hset $basePath/T2 $stateArr(t2)
hset $basePath/NaN $stateArr(nan)
hset $basePath/T2 $stateArr(t2)
broadcast "Amp:$stateArr(amp); Fre:$stateArr(fre); NaN:$stateArr(nan); T2:$stateArr(t2)\n"
}
if {$replyStr != [sct oldval]} {
sct oldval $replyStr
sct update $replyStr
@@ -81,14 +81,14 @@ proc ::scobj::he3::checkReplyFunc {basePath} {
##
# @brief Make a He3 controller
#
# @param argList, {name "he3" IP localhost PORT 62900 tuning 1 interval 2}
#
# @param argList, {name "he3" IP localhost PORT 62900 tuning 1 interval 2}
#
# name: name of he3 controller object
# IP: IP address of RF generator moxa box
# PORT: Port number assigned to the generator on the moxa-box
# tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions
# interval: polling and ramping interval in seconds.
# interval: polling and ramping interval in seconds.
proc ::scobj::he3::mkHe3 {argList} {
# Generate parameter array from the argument list
foreach {k v} $argList {
@@ -136,8 +136,8 @@ proc ::scobj::he3::mkHe3 {argList} {
hsetprop $hdbPath mutable $mutable
hsetprop $hdbPath sdsinfo ::nexus::scobj::sdsinfo
}
::scobj::hinitprops $pa(NAME)
::scobj::hinitprops $pa(NAME)
makesctcontroller sct_he3 std $pa(IP):$pa(PORT)
@@ -145,7 +145,7 @@ proc ::scobj::he3::mkHe3 {argList} {
hsetprop $hPath rdState ::scobj::he3::rdStatFunc $hPath
# Initialise properties required for generating the API for GumTree and to save data
#::scobj::hinitprops $pa(NAME) Amplitude Frequence NaN T2
#::scobj::hinitprops $pa(NAME) Amplitude Frequence NaN T2
if {[SplitReply [environment_simulation]]=="false"} {
sct_he3 poll $hPath $pa(INTERVAL)
@@ -158,7 +158,7 @@ proc ::scobj::he3::mkHe3 {argList} {
::scobj::hinitprops $pa(NAME) send_trigger
hsetprop $hPath/send_trigger write ::scobj::he3::sendTrigger
hsetprop $hPath/send_trigger write ::scobj::he3::sendTrigger
hsetprop $hPath/send_trigger checkReply ::scobj::he3::checkReplyFunc /sics/$pa(NAME)
if {[SplitReply [environment_simulation]]=="false"} {
@@ -173,7 +173,7 @@ proc He3Trigger {} {
sct_he3 send $cmd
}
publish He3Trigger user
publish He3Trigger user
# main driver call

View File

@@ -575,7 +575,7 @@ proc ExtractValue {response lastQueryCmd} {
# update the node last_error_msg
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg $::scobj::bruker_BEC1::bruker_BEC1_errMsg
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2
#if { 0 != [string compare -length 4 $lastQueryCmd "POL/"]
#if { 0 != [string compare -length 4 $lastQueryCmd "POL/"]
# || $::scobj::bruker_BEC1::bruker_BEC1_polarityUnitAbsent == false} {
#}
}
@@ -1318,7 +1318,7 @@ proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol CID CTYPE} {
# for generating the GumTree interface and saving data for script context objects (hdf file)
# @param scobj, name of script context object (path to a node)
# @param par, optional parameter (name of the node variable)
# Changed ffr 20100625: do not call hinitprops to avoid a conflict with a change in SICServer vers. 2_5
#::scobj::hinitprops $tempobj/sensor nominal_outp_current
hsetprop $scobj_hpath/pwrctrl/statusByte control false

View File

@@ -1,5 +1,5 @@
##
# @file Green Magnetic Controller
# @file Green Magnetic Controller
#
# This is a driver for SICS to make following communication with the Labview Green Magnet device
#
@@ -67,14 +67,14 @@ proc ::scobj::green::rqGreenMagnetFunc {basePath} {
##
# @brief Make a Green Magnet Controller
#
# @param argList, {name "magnetic" IP localhost PORT 65123 tuning 1 interval 1}
#
# @param argList, {name "magnetic" IP localhost PORT 65123 tuning 1 interval 1}
#
# name: name of green magnet controller object
# IP: IP address of RF generator moxa box
# POT: Port number assigned to the generator on the moxa-box
# tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions
# interval: polling and ramping interval in seconds.
# interval: polling and ramping interval in seconds.
proc ::scobj::green::mkGreen {argList} {
# Generate parameter array from the argument list
@@ -84,12 +84,12 @@ proc ::scobj::green::mkGreen {argList} {
}
MakeSICSObj $pa(NAME) SCT_OBJECT
sicslist setatt $pa(NAME) klass environment
sicslist setatt $pa(NAME) klass environment
sicslist setatt $pa(NAME) long_name $pa(NAME)
set scobj_hpath /sics/$pa(NAME)
hfactory $scobj_hpath/output plain user float
hfactory $scobj_hpath/output plain user float
hfactory $scobj_hpath/PSU_Vol plain user float
hfactory $scobj_hpath/ramping_rate plain user text
hfactory $scobj_hpath/insTarget plain user float
@@ -118,7 +118,7 @@ proc ::scobj::green::mkGreen {argList} {
hsetprop $scobj_hpath type part
hsetprop $scobj_hpath control true
hsetprop $scobj_hpath data true
foreach {hpath klass control data nxsave mutable priv alias} {
output NXenvironment true true true true user green_output
PSU_Vol NXenvironment true true true true user green_PSU_Vol
@@ -143,11 +143,11 @@ proc ::scobj::green::mkGreen {argList} {
hsetprop $scobj_hpath/pollNode oldval "UNKNOWN"
#if {[SplitReply [environment_simulation]]=="false"} {
sct_green poll $scobj_hpath/pollNode $pa(INTERVAL)
#}
sct_green poll $scobj_hpath/pollNode $pa(INTERVAL)
#}
}
# Set the magnetic voltage field
# Set the magnetic voltage field
proc greenVol {{vol ""} args} {
set NAME "green_magnet"
@@ -156,7 +156,7 @@ proc greenVol {{vol ""} args} {
} else {
if {$vol<[SplitReply [hgetprop /sample/$NAME/output lowlimit]] || \
$vol>[SplitReply [hgetprop /sample/$NAME/output uplimit]]} {
return -code error "setpoint violates limits"
return -code error "setpoint violates limits"
} else {
if {$vol > [hval /sample/$NAME/Bmax]} {
broadcast "Maximum field limit is [hval /sample/$NAME/Bmax], reset again!"
@@ -164,7 +164,7 @@ proc greenVol {{vol ""} args} {
} else {
#hset /sample/$NAME/setPoint $vol
set comm "set $vol\r\n"
sct_green send $comm
sct_green send $comm
#after 2000
#while {[hval /sample/$NAME/status] == "busy"} {
# broadcast "Magnet Ramping at [hval /sample/$NAME/output]"
@@ -192,7 +192,7 @@ publish greenVol user
#PORT 22
::scobj::green::mkGreen {
name "green_magnet"
IP 137.157.204.57
IP 137.157.204.57
PORT 22
tuning 1
interval 3

View File

@@ -190,8 +190,8 @@ debug_log "rdState $tc_root state=$my_state"
} elseif {$my_state == "STATE_UNIT"} {
hsetprop $tc_root/ls460_state my_state "STATE_CHNL_SET"
hsetprop [sct] unit [sct result]
hsetprop $tc_root/Display/$my_chan units [SplitReply [hgetprop [sct] unit]]
hsetprop $tc_root/Display/$my_chan mult [SplitReply [hgetprop [sct] mult]]
hsetprop $tc_root/Display/$my_chan units [SplitReply [hgetprop [sct] unit]]
hsetprop $tc_root/Display/$my_chan mult [SplitReply [hgetprop [sct] mult]]
hsetprop $tc_root/Display/$my_chan field [SplitReply [hgetprop [sct] field]]
switch -exact [SplitReply [hgetprop [sct] mult]] {
"u" { set multiplier 0.000001 }

View File

@@ -166,7 +166,7 @@ debug_log "getState $tc_root $nextState $cmd sct=[sct]"
} elseif {$my_state == "STATE_I"} {
if { [hval $tc_root/Display/H] == 1 } {
set my_cmd "I[hval $tc_root/Display/OutputCurrent]"
} elseif { ([hval $tc_root/Display/H] == 0 || [hval $tc_root/Display/H] == 2) } {
} elseif { ([hval $tc_root/Display/H] == 0 || [hval $tc_root/Display/H] == 2) } {
set my_cmd "I[hval $tc_root/Display/PstntCurrent]"
}
} elseif {$my_state == "STATE_J"} {

View File

@@ -1,5 +1,5 @@
##
# @file Magnetic Controller
# @file Magnetic Controller
#
# This is a driver for SICS to make following communication with the Labview Oxford device
#
@@ -37,13 +37,13 @@ proc ::scobj::magnetic::setting {field basePath} {
switch -exact $field {
"field" {set comm "setF $fieldVal\r\n"
hset $basePath/fieldSetPoint $fieldVal
hset $basePath/fieldSetPoint $fieldVal
}
"rate" {set comm "setR $fieldVal\r\n"
hset $basePath/fieldSetRate $fieldVal
hset $basePath/fieldSetRate $fieldVal
}
"DiluxTemp" {set comm "setDilutTemp $fieldVal\r\n"
hset $basePath/DilutTempSetPoint $fieldVal
hset $basePath/DilutTempSetPoint $fieldVal
}
"HelioxTemp" {set comm "setHelioxTemp $fieldVal\r\n"
hset $basePath/HelioxTempSetPoint $fieldVal
@@ -181,7 +181,7 @@ proc ::scobj::magnetic::rdTempStateFunc {basePath field} {
hset $basePath/Temp_s1 $paraArr(T1)
hset $basePath/Temp_s2 $paraArr(T2)
hset $basePath/Temp_s3 $paraArr(T3)
set logText "Displayed Temp : $paraArr(T1) $paraArr(T2) $paraArr(T3)"
}
"Heliox" {set s1 [string trimright $replyStr "\n"]
@@ -222,14 +222,14 @@ proc ::scobj::magnetic::rdTempStateFunc {basePath field} {
##
# @brief Make a Magnetic Controller
#
# @param argList, {name "magnetic" IP localhost PORT 65123 tuning 1 interval 1}
#
# @param argList, {name "magnetic" IP localhost PORT 65123 tuning 1 interval 1}
#
# name: name of magnetic controller object
# IP: IP address of RF generator moxa box
# POT: Port number assigned to the generator on the moxa-box
# tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions
# interval: polling and ramping interval in seconds.
# interval: polling and ramping interval in seconds.
proc ::scobj::magnetic::mkMagnetic {argList} {
# Generate parameter array from the argument list
@@ -244,7 +244,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
set hPath /sics/$pa(NAME)
hfactory $hPath/field plain user text
hfactory $hPath/field plain user text
hfactory $hPath/magneticFieldCurrent plain user float
hfactory $hPath/magneticFieldTesla plain user float
@@ -274,10 +274,10 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
hset $hPath/magneticFieldTesla 10
hset $hPath/fieldSetPoint 0
# Setting Heliox Temperature & initiate
# Setting Heliox Temperature & initiate
hfactory $hPath/HelioxTempSetPoint plain user float
# This feature needs to implement the Labview code to get current reading of the Heliox tempterature
hfactory $hPath/HelioxTempReading plain user float
hfactory $hPath/HelioxTempReading plain user float
hset $hPath/HelioxTempSetPoint 0
hset $hPath/HelioxTempReading 0
@@ -294,7 +294,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
hsetprop $hPath/field oldval UNKNOWN
hsetprop $hPath/HelioxTempReading oldval UNKNOWN
hsetprop $hPath/DilutTempReading oldval UNKNOWN
# add HDB file
hsetprop $hPath klass environment
hsetprop $hPath privilege spy
@@ -323,7 +323,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
}
# Initialise properties required for generating the API for GumTree and to save data
::scobj::hinitprops $pa(NAME)
::scobj::hinitprops $pa(NAME)
# proc ::histogram_memory::pre_count "{fPath $pa(NAME)}" {
# hset /sics/$fPath/start_magnetic [hval /sics/$fPath/magneticFieldCurrent]
@@ -343,7 +343,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
makesctcontroller sct_magnetic std $pa(IP):$pa(PORT)
hsetprop $hPath/field read ::scobj::magnetic::rqFieldFunc
hsetprop $hPath/field read ::scobj::magnetic::rqFieldFunc
hsetprop $hPath/field rdFieldState ::scobj::magnetic::rdFieldStateFunc $hPath
hsetprop $hPath/Temp read ::scobj::magnetic::rqTempFunc "sample"
@@ -356,11 +356,11 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
hsetprop $hPath/DilutTempReading rdTempState ::scobj::magnetic::rdTempStateFunc $hPath "Dilut"
if {[SplitReply [environment_simulation]]=="false"} {
sct_magnetic poll $hPath/field $pa(INTERVAL)
sct_magnetic poll $hPath/field $pa(INTERVAL)
sct_magnetic poll $hPath/Temp $pa(INTERVAL)
sct_magnetic poll $hPath/HelioxTempReading $pa(INTERVAL)
sct_magnetic poll $hPath/DilutTempReading $pa(INTERVAL)
}
}
hsetprop $hPath tuning $pa(TUNING)
@@ -372,25 +372,25 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
hfactory $hPath/set_HeaterSwitch plain user text
hsetprop $hPath/set_magneticField write ::scobj::magnetic::setting "field" $hPath
hsetprop $hPath/set_rate write ::scobj::magnetic::setting "rate" $hPath
hsetprop $hPath/set_rate write ::scobj::magnetic::setting "rate" $hPath
hsetprop $hPath/set_DiluxTemp write ::scobj::magnetic::setting "DiluxTemp" $hPath
hsetprop $hPath/set_HelioxTemp write ::scobj::magnetic::setting "HelioxTemp" $hPath
hsetprop $hPath/set_HeaterSwitch write ::scobj::magnetic::setting "HeaterS" $hPath
hsetprop $hPath/set_magneticField checkReply ::scobj::magnetic::checkReplyFunc $hPath
hsetprop $hPath/set_magneticField checkReply ::scobj::magnetic::checkReplyFunc $hPath
if {[SplitReply [environment_simulation]]=="false"} {
sct_magnetic write $hPath/set_rate
sct_magnetic write $hPath/set_magneticField
sct_magnetic write $hPath/set_magneticField
sct_magnetic write $hPath/set_DiluxTemp
sct_magnetic write $hPath/set_HelioxTemp
sct_magnetic write $hPath/set_HeaterSwitch
}
}
}
}
# Querying/Setting the magnetic field
# command is : OxfordSetField fieldValue P ; where "P" is an optinal parameter and if set will change
# Querying/Setting the magnetic field
# command is : OxfordSetField fieldValue P ; where "P" is an optinal parameter and if set will change
# to posistent mode after changig the magnetic field
proc OxfordSetField {{setPoint ""} {mode ""} args} {
set NAME "magnetic"
@@ -405,10 +405,10 @@ proc OxfordSetField {{setPoint ""} {mode ""} args} {
if {$mode == ""} {
set comm "setF $setPoint\r\n"
sct_magnetic send $comm
sct_magnetic send $comm
} elseif {$mode == "P"} {
set comm "setF $setPoint Pers\r\n"
sct_magnetic send $comm
sct_magnetic send $comm
} else {
broadcast "Wrong parameters being provided, check!"
return

View File

@@ -78,7 +78,7 @@ debug_log "setPoint: sct=[sct] target=[sct target] writestatus=[sct writestatus]
set err_msg "Invalid Pallet_ Num: [hval $tc_root/Control/Pallet_Nam]"
} elseif { [hval $tc_root/Control/Pallet_Idx] < 1 || [hval $tc_root/Control/Pallet_Idx] > 50 } {
set err_msg "Invalid Pallet_Idx: [hval $tc_root/Control/Pallet_Idx]"
}
}
if { $err_msg != "" } {
sct print "error:$err_msg"
debug_log "error:$err_msg"

View File

@@ -101,14 +101,14 @@ debug_log "chkWrite new data for $tc_root [sct] result=\"$data\""
set data [expr {[sct target]}]
if { $data < 1 || $data > 6 } {
set err_msg "Invalid Position: $data"
}
}
if { $err_msg != "" } {
sct print "error:$err_msg"
debug_log "error:$err_msg"
return -code error "$err_msg"
}
if { [hval $tc_root/Control/Direction] == "cw" } {
set par "0"
set par "0"
} elseif { [hval $tc_root/Control/Direction] == "ccw" } {
set par "1"
} else {
@@ -117,13 +117,13 @@ debug_log "chkWrite new data for $tc_root [sct] result=\"$data\""
sct oldval 1
}
if {($data - [sct oldval]) < -2} {
set par "0"
set par "0"
} elseif {($data - [sct oldval]) < 0} {
set par "1"
set par "1"
} elseif {($data - [sct oldval]) > 3} {
set par "1"
set par "1"
} else {
set par "0"
set par "0"
}
}
if {$data != [sct oldval]} {

View File

@@ -33,9 +33,9 @@
# PERCENT2:1/0 dBm2:1/0
# m2:1/0 V2:1/0 A2:1/0 DEGK2:1/0
# G2:1/0 M2:1/0 k2:1/0 OHM2:1/0 Hz2:1/0
# ROTSWITCH:[0-8]
### The return values for nine bytes is undocumented,
### they are labelled as X1 to X9
# X[1-9]:?
@@ -125,7 +125,7 @@ proc MakeProtek {name IP PORT {scale 1.0} {offset 0.0} {interval 0.5} {cbFunc "r
sicslist setatt $sobjName long_name $sobjName
hfactory /sics/$soState/state plain user text
hsetprop /sics/$soState/state read rqStateRep
hsetprop /sics/$soState/state read rqStateRep
hsetprop /sics/$soState/state rdStateRep rdStateRep
hsetprop /sics/$soState/state oldval "UNKNOWN"
hsetprop /sics/$sobjName read rqVal "reportVal"

View File

@@ -6,7 +6,7 @@
# /*--------------------------------------------------------------------------
# L A K E S H O R E 3 x x S E R I E S D R I V E R
#
# This file contains the implementation of a driver for the Lakeshore 218
# This file contains the implementation of a driver for the Lakeshore 218
# controller implemented as a scriptcontext object in TCL.
# object in TCL.
#
@@ -43,7 +43,7 @@ proc ::scobj::ls218::getValue {idx cmd chID nextState} {
if {[ catch {
if {[hpropexists [sct] geterror]} {
hdelprop [sct] geterror
}
}
if {$chID == 1} {
set comm "$cmd $idx"
@@ -57,7 +57,7 @@ proc ::scobj::ls218::getValue {idx cmd chID nextState} {
}
} else {
return -code error "in getValue: error input Ch ID"
}
}
sct send "$comm\r\n"
} message ]} {
return -code error "in getValue: $message"
@@ -79,7 +79,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
if {[string first "ASCERR" $replyData] != -1} {
sct geterror $replyData
return -code error "Error in LS218 Response: $replyData"
return -code error "Error in LS218 Response: $replyData"
} elseif {[string length $replyData] < 1} {
return -code error "Error in LS218: no message returned from device"
} else {
@@ -88,7 +88,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
}
switch -exact $varName {
"alarm" { if {[lindex $fields 0] == 0} {
"alarm" { if {[lindex $fields 0] == 0} {
hset $nodeName/offOn off
} else {
hset $nodeName/offOn on
@@ -105,7 +105,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName/deadband [lindex $fields 4]
hset $nodeName/latchEnable [lindex $fields 5]
}
"aStatus" { if {[lindex $fields 0] == 0} {
"aStatus" { if {[lindex $fields 0] == 0} {
hset $nodeName/highStatus Unactivated
} else {
hset $nodeName/highStatus Activated
@@ -116,8 +116,8 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName/lowStatus Activated
}
}
"Celsius" { hset $nodeName [lindex $fields 0]
set curValue [lindex $fields 0]
"Celsius" { hset $nodeName [lindex $fields 0]
set curValue [lindex $fields 0]
}
"CurveHd" { hset $nodeName/curve [lindex $fields 0]
hset $nodeName/name [lindex $fields 1]
@@ -127,7 +127,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
3 {hset $nodeName/format Ohm/K}
4 {hset $nodeName/format "log Ohm/K"}
default {}
}
}
hset $nodeName/limitValue [lindex $fields 4]
switch -exact [lindex $fields 5] {
1 {hset $nodeName/coefficient negative}
@@ -165,7 +165,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName UNKNOW}
}
}
"Kelvin" { hset $nodeName $fields
"Kelvin" { hset $nodeName $fields
#append $logString " Kelvin - $fields;"
set curValue $fields
}
@@ -178,7 +178,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName/xSource UNKNOW}
}
}
"LinearEquData" { hset $nodeName $fields
"LinearEquData" { hset $nodeName $fields
set curValue $fields
}
"mnmxSource" { switch -exact [lindex $fields 0] {
@@ -190,17 +190,17 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
}
}
"mnmxValue" { hset $nodeName "[lindex $fields 0] , [lindex $fields 1]"}
"status" {
"status" {
# RDGST? chID Reads input status returns an integer with the following meaning
# Bit Weighting StatusIndicator
# 4 16 temp underrange
# 5 32 temp overrange
# 6 64 units under range
# 7 128 untis over range
# 6 64 units under range
# 7 128 untis over range
set field [string trimleft $fields 0]
if {[string length $field] == 0} {
set field 0
}
}
set str ""
set i [format %x $field]
@@ -219,11 +219,11 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName $str
}
"SensorUnitValue" { hset $nodeName $fields
"SensorUnitValue" { hset $nodeName $fields
#append $logString " SensorUnitValue - $fields;"
set curValue $fields
}
"data" { hset $nodeName $fields
"data" { hset $nodeName $fields
set curValue $fields
}
"aOutput" { switch -exact [lindex $fields 0] {
@@ -247,7 +247,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
}
hset $nodeName/highValue [lindex $fields 4]
hset $nodeName/lowValue [lindex $fields 5]
hset $nodeName/manualValue [lindex $fields 6]
hset $nodeName/manualValue [lindex $fields 6]
}
"IDN" { hset $nodeName/manufacturer [lindex $fields 0]
hset $nodeName/model [lindex $fields 1]
@@ -273,7 +273,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName/alarmType UNKNOW }
}
}
default { return -code error "in rdValue: wrong input parameter"}
default { return -code error "in rdValue: wrong input parameter"}
}
if {$curValue != [sct oldval]} {
sct oldval $curValue
@@ -310,7 +310,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
# @param type attribute for HDB tree
# @param nxsave attribute for HDB tree
# @param mutable attribute for HDB tree
# @param nxalias attribute for HDB tree
# @param nxalias attribute for HDB tree
# @return OK
proc createNode {scobj_hpath idx sct_controller cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} {
@@ -341,9 +341,9 @@ proc createNode {scobj_hpath idx sct_controller cmdGroup varName readable pollEn
}
if {$readable == 1} {
hsetprop $nodeName read ${ns}::getValue $idx $rdCmd $chID rdFuncState
hsetprop $nodeName read ${ns}::getValue $idx $rdCmd $chID rdFuncState
hsetprop $nodeName rdFuncState ${ns}::rdValue $nodeName $varName $idx
hsetprop $nodeName oldval UNKNOW
hsetprop $nodeName oldval UNKNOW
}
if {$pollEnabled == 1} {
if {[SplitReply [environment_simulation]]=="false"} {
@@ -397,13 +397,13 @@ proc ::scobj::ls218::mkLS218 {argList} {
makesctcontroller sct_$pa(NAME) std $pa(IP):$pa(PORT)
# create parent nodes for input, output, and relay
# create parent nodes for input, output, and relay
foreach chanType {input output relay} {
switch -exact $chanType {
"input" {set chanList $pa(INPUTCHAN)}
"output" {set chanList $pa(OUTPUTCHAN)}
"relay" {set chanList $pa(RELAYCHAN)}
}
}
if {[string length $chanList] > 0} {
set hPath $scobj_hpath/$chanType
hfactory $hPath plain user none
@@ -443,7 +443,7 @@ proc ::scobj::ls218::mkLS218 {argList} {
# rdFunc nextState Function to be called after the getValue function, typically rdValue()
# hdbTree set to 1 if a HDB needs to be created at the node
# klass type of klass of the HDB node
# control type of contrl of the HDB node
# control type of contrl of the HDB node
# data type of data of the HDB node
# priv type of previlige level of the HDB node
# type type of the HDB node
@@ -453,35 +453,35 @@ proc ::scobj::ls218::mkLS218 {argList} {
###########################################################################################################
set inputNodes {
{} alarm 1 1 none user {ALARM?} 1 {rdValue}
alarm offOn 0 0 text user {} 0 {}
alarm source 0 0 text user {} 0 {}
alarm highValue 0 0 float user {} 0 {}
alarm lowValue 0 0 float user {} 0 {}
alarm deadband 0 0 float user {} 0 {}
alarm latchEnable 0 0 int user {} 0 {}
{} aStatus 1 1 none user {ALARMST?} 1 {rdValue}
aStatus highStatus 0 0 text user {} 0 {}
aStatus lowStatus 0 0 text user {} 0 {}
{} alarm 1 1 none user {ALARM?} 1 {rdValue}
alarm offOn 0 0 text user {} 0 {}
alarm source 0 0 text user {} 0 {}
alarm highValue 0 0 float user {} 0 {}
alarm lowValue 0 0 float user {} 0 {}
alarm deadband 0 0 float user {} 0 {}
alarm latchEnable 0 0 int user {} 0 {}
{} aStatus 1 1 none user {ALARMST?} 1 {rdValue}
aStatus highStatus 0 0 text user {} 0 {}
aStatus lowStatus 0 0 text user {} 0 {}
{} Celsius 1 1 float user {CRDG?} 1 {rdValue}
{} CurveHd 1 1 none user {CRVHDR?} 0 {rdValue}
CurveHd curve 0 0 text user {} 0 {}
CurveHd name 0 0 text user {} 0 {}
CurveHd SN 0 0 text user {} 0 {}
CurveHd format 0 0 text user {} 0 {}
CurveHd limitValue 0 0 float user {} 0 {}
CurveHd coefficient 0 0 text user {} 0 {}
{} CurveID 1 1 text user {INCRV?} 1 {rdValue}
{} control 1 1 text user {INPUT?} 1 {rdValue}
{} inputType 1 1 text user {INTYPE?} G {rdValue}
{} CurveHd 1 1 none user {CRVHDR?} 0 {rdValue}
CurveHd curve 0 0 text user {} 0 {}
CurveHd name 0 0 text user {} 0 {}
CurveHd SN 0 0 text user {} 0 {}
CurveHd format 0 0 text user {} 0 {}
CurveHd limitValue 0 0 float user {} 0 {}
CurveHd coefficient 0 0 text user {} 0 {}
{} CurveID 1 1 text user {INCRV?} 1 {rdValue}
{} control 1 1 text user {INPUT?} 1 {rdValue}
{} inputType 1 1 text user {INTYPE?} G {rdValue}
{} Kelvin 1 1 float user {KRDG?} 1 {rdValue}
{} Linear 1 1 none user {LINEAR?} 1 {rdValue}
Linear varM 0 0 float user {} 0 {}
Linear xSource 0 0 text user {} 0 {}
Linear varB 0 0 float user {} 0 {}
{} LinearEquData 1 1 float user {LRDG?} 1 {rdValue}
{} mnmxSource 1 1 text user {MNMX?} 1 {rdValue}
{} mnmxValue 1 1 text user {MNMXRDG?} 1 {rdValue}
{} Linear 1 1 none user {LINEAR?} 1 {rdValue}
Linear varM 0 0 float user {} 0 {}
Linear xSource 0 0 text user {} 0 {}
Linear varB 0 0 float user {} 0 {}
{} LinearEquData 1 1 float user {LRDG?} 1 {rdValue}
{} mnmxSource 1 1 text user {MNMX?} 1 {rdValue}
{} mnmxValue 1 1 text user {MNMXRDG?} 1 {rdValue}
{} status 1 1 text user {RDGST?} 1 {rdValue}
{} SensorUnitValue 1 1 float user {SRDG?} 1 {rdValue}
}
@@ -489,33 +489,33 @@ proc ::scobj::ls218::mkLS218 {argList} {
set outputNodes {
{} data 1 1 float user {AOUT?} 1 {rdValue}
{} aOutput 1 1 none user {ANALOG?} 1 {rdValue}
aOutput bipolarEnable 0 0 text user {} 0 {}
aOutput monitorMode 0 0 text user {} 0 {}
aOutput inputChID 0 0 int user {} 0 {}
aOutput source 0 0 text user {} 0 {}
aOutput highValue 0 0 float user {} 0 {}
aOutput lowValue 0 0 float user {} 0 {}
aOutput manualValue 0 0 int user {} 0 {}
aOutput bipolarEnable 0 0 text user {} 0 {}
aOutput monitorMode 0 0 text user {} 0 {}
aOutput inputChID 0 0 int user {} 0 {}
aOutput source 0 0 text user {} 0 {}
aOutput highValue 0 0 float user {} 0 {}
aOutput lowValue 0 0 float user {} 0 {}
aOutput manualValue 0 0 int user {} 0 {}
}
set relayNodes {
{} relay 1 1 none user {RELAY?} 1 {rdValue}
relay mode 0 0 text user {} 0 {}
relay input 0 0 int user {} 0 {}
relay alarmType 0 0 text user {} 0 {}
{} relay 1 1 none user {RELAY?} 1 {rdValue}
relay mode 0 0 text user {} 0 {}
relay input 0 0 int user {} 0 {}
relay alarmType 0 0 text user {} 0 {}
}
set otherNodes {
{} IDN 1 1 none user {*IDN?} 0 {rdValue}
IDN manufacturer 0 0 text user {} 0 {}
IDN model 0 0 text user {} 0 {}
IDN serialNumber 0 0 text user {} 0 {}
IDN firmwareDate 0 0 text user {} 0 {}
{} logStatus 1 1 text user {LOG?} 0 {rdValue}
{} IDN 1 1 none user {*IDN?} 0 {rdValue}
IDN manufacturer 0 0 text user {} 0 {}
IDN model 0 0 text user {} 0 {}
IDN serialNumber 0 0 text user {} 0 {}
IDN firmwareDate 0 0 text user {} 0 {}
{} logStatus 1 1 text user {LOG?} 0 {rdValue}
}
# create sub-tree for all 8 input channels
foreach idx $pa(INPUTCHAN) {
foreach idx $pa(INPUTCHAN) {
foreach {cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} $inputNodes {
createNode $scobj_hpath/input $idx sct_$pa(NAME) $cmdGroup $varName $readable $pollEnabled $dataType $permission $rdCmd $chID $rdFunc
}
@@ -535,7 +535,7 @@ proc ::scobj::ls218::mkLS218 {argList} {
}
}
# create "other" sub-tree
# create "other" sub-tree
foreach {cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} $otherNodes {
createNode $scobj_hpath/other 0 sct_$pa(NAME) $cmdGroup $varName $readable $pollEnabled $dataType $permission $rdCmd $chID $rdFunc
}
@@ -572,9 +572,9 @@ proc ::scobj::ls218::mkLS218 {argList} {
if {[string length $pa(INPUTCHAN)] > 0} {
foreach idx $pa(INPUTCHAN) {
foreach {item klass control data nxsave mutable priv alias} {
Celsius sensor true true true true user Celsius
Celsius sensor true true true true user Celsius
Kelvin sensor true true true true user Kelvin
SensorUnitValue sensor true true true true user SensorUnitValue
SensorUnitValue sensor true true true true user SensorUnitValue
} {
set hpath /sics/ls218/input/ch$idx/$item
hsetprop $hpath nxalias ls218-input-ch$idx-$alias
@@ -594,11 +594,11 @@ proc ::scobj::ls218::mkLS218 {argList} {
set hpath /sics/ls218/output/ch$idx/data
hsetprop $hpath nxalias ls218-output-ch$idx-data
hsetprop $hpath klass sensor
hsetprop $hpath privilege user
hsetprop $hpath control true
hsetprop $hpath data true
hsetprop $hpath nxsave true
hsetprop $hpath mutable true
hsetprop $hpath privilege user
hsetprop $hpath control true
hsetprop $hpath data true
hsetprop $hpath nxsave true
hsetprop $hpath mutable true
hsetprop $hpath sdsinfo ::nexus::scobj::sdsinfo
}
}
@@ -610,7 +610,7 @@ proc ::scobj::ls218::mkLS218 {argList} {
}
}
# end of namespace ::scobj::ls218
# end of namespace ::scobj::ls218
# Main process call
# @param name short name for the Lakeshore Temp controller 218

View File

@@ -1718,7 +1718,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hfactory $scobj_hpath/sensor plain spy none
# Flags ls340 and ls336 indicate whether this command is support by Lakeshore model ls340 and ls336, respectively
foreach {cmdGroup varName readable writable pollEnabled drivable idx ls340 ls336 dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommandToplevel {
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
}
# create a base node for each commandGroup element - these are all polled
@@ -1729,7 +1729,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hfactory $scobj_hpath/other plain spy none
foreach {cmdGroup varName readable writable pollEnabled drivable idx ls340 ls336 dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand {
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse
# helpNotes4user $scobj_hpath $cmdGroup $varName
}

View File

@@ -228,7 +228,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
return -code error "[sct geterror]"
}
if { $ramp_rate < 0.001 || $ramp_rate > 10 } {
if { $ramp_enable == 1 } {
if { $ramp_enable == 1 } {
sct geterror "RAMP bad rate from [sct result]"
return -code error "[sct geterror]"
}

View File

@@ -811,7 +811,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
hsetprop $scobj_hpath klass parameter
hsetprop $scobj_hpath sdsinfo ::nexus::scobj::sdsinfo
set point 1
if {0} {
if {0} {
::scobj::hinitprops $the_name Loop1
set point 2
::scobj::hinitprops $the_name Loop2/setpoint

View File

@@ -68,7 +68,7 @@ debug_log "rdValue [sct] [sct result]"
sct send "$cmd"
return $nextState
}
proc rdTemp {tc_root} {
debug_log "rdTemp [sct] [sct result]"
set data [sct result]
@@ -132,7 +132,7 @@ debug_log "rdValue [sct] [sct result]"
sct send $cmd
return $nextState
}
proc rdSpeed {tc_root} {
debug_log "rdSpeed [sct] [sct result]"
set data [sct result]
@@ -547,12 +547,12 @@ debug_log "setPoint $cmd $par"
set the_valu [lindex $parts 2]
set the_ramp [lindex $parts 3]
if {$the_type == "I"} {
set the_valu [expr {round($the_valu * 20.0)}]
set the_ramp [expr {round($the_ramp * 20.0)}]
set the_valu [expr {round($the_valu * 20.0)}]
set the_ramp [expr {round($the_ramp * 20.0)}]
} elseif {$the_type == "S"} {
} elseif {$the_type == "T"} {
set the_valu [expr {round($the_valu * 20.0)}]
set the_ramp [expr {round($the_ramp * 20.0 /45 * 32768)}]
set the_valu [expr {round($the_valu * 20.0)}]
set the_ramp [expr {round($the_ramp * 20.0 /45 * 32768)}]
} else {
sct geterror "Profile error: $line"
sct print "Profile error: $line"

View File

@@ -224,7 +224,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/Loop1/setpoint [sct target]
return idle
}
proc setPoint {tc_root nextState cmd} {
set dev "[hval $tc_root/dev_id]"
set par [sct target]

View File

@@ -232,7 +232,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/Loop1/setpoint [sct target]
return idle
}
proc setPoint {tc_root nextState cmd} {
set dev "[hval $tc_root/dev_id]"
set par [sct target]
@@ -417,7 +417,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
set scobj_hpath /sics/$tempobj
#
#
# These addresses are modbus addresses on the RUI/gateway over two devices
# The RMC is at address 1 and the modbus offset on the RUI for gateway 1
# is zero, so these addresses are as specified in the manual.

View File

@@ -376,7 +376,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/status "busy"
return idle
}
# Get the High Limit Point
proc getLimHi {tc_root nextState cmd} {
set d1 [hval $tc_root/Loop1/limit_hi]
@@ -402,7 +402,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/Loop4/limit_hi [sct target]
return idle
}
# Set the All Set Points
proc setAll {tc_root nextState cmd} {
debug_log "setAll $tc_root $nextState $cmd [sct]=[sct target] [hget [sct]]"
@@ -413,7 +413,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/device_control/previous_error [expr [sct target] - [hval $tc_root/samplesensor]]
return idle
}
proc setPoint {tc_root nextState cmd} {
set dev "[hval $tc_root/dev_id]"
set par [sct target]
@@ -645,7 +645,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
hfactory $scobj_hpath/Loop2 plain spy none
hfactory $scobj_hpath/Loop3 plain spy none
hfactory $scobj_hpath/Loop4 plain spy none
foreach {cmdGroup varName readable writable drivable dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand {
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $drivable $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klass
}

View File

@@ -42,7 +42,7 @@ proc ::environment::temperature::add_west400 {IP} {
tc1 tolerance 10
}
sicslist setatt tc1 environment_name tc1
sicslist setatt tc1 environment_name tc1
sicslist setatt tc1 long_name control_sensor_reading
::environment::mkenvinfo tc1 {ramprate {priv user} powerlimit {priv manager} }
#::environment::mkenvinfo tc1 {heateron {priv user} range {priv manager} }

View File

@@ -97,7 +97,7 @@ set NXgeometry_template {
set NXaperture_template [subst -novariables {
NXaperture {
$name {
$name {
sobjlist {$paramarr(material) $paramarr(description)}
[ set NXgeometry_template ]
}
@@ -192,7 +192,7 @@ proc ::hdb::MakeVelocity_Selector {name paramlist} {
# A NeXus-class template is a keyed-list which has Tcl variables for some of the nodes,
# if the Tcl variables aren't defined for some branch then that branch is removed.
# All other variables are expanded in place, also all 'sobjlists' are split up into type
# specific lists. This is intended as a helper function for commands which generate
# specific lists. This is intended as a helper function for commands which generate
# NeXus-class keyed lists from a simple set of optional parameters.
#
# @param NXklist, This is a keyed list representation of the NeXus class which will be augmented
@@ -215,7 +215,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
foreach var $v {
if {[string index $var 0] == "$"} {
set vn [string range $var 1 end]
upvar $level $vn lvar
upvar $level $vn lvar
if [info exists lvar] {
foreach sobj $lvar {
lappend [getatt $sobj type]_list $sobj
@@ -244,7 +244,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
array set linkinfo $v
if {[string index $linkinfo(target) 0] == "$"} {
set vn [string range $linkinfo(target) 1 end]
upvar $level $vn lvar
upvar $level $vn lvar
if [info exists lvar] {
set linktarget $lvar
}
@@ -253,7 +253,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
}
if {[string index $linkinfo(nxalias) 0] == "$"} {
set vn [string range $linkinfo(nxalias) 1 end]
upvar $level $vn avar
upvar $level $vn avar
if [info exists avar] {
set linkname $avar
}
@@ -268,7 +268,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
default {
if {[string range $n 0 1] == "NX"} {
set node $n
} elseif {[string index $n 0] == "$"} {
} elseif {[string index $n 0] == "$"} {
set vn [string range $n 1 end]
upvar $level $vn lvar
if [info exists lvar] {
@@ -316,14 +316,14 @@ proc ::hdb::set_subtree_props {st_name klass {control "true"} {privilege "user"}
publish $st_name mugger
sicslist setatt $st_name klass $klass
sicslist setatt $st_name control $control
sicslist setatt $st_name privilege $privilege
sicslist setatt $st_name privilege $privilege
sicslist setatt $st_name kind "hdb_subtree"
sicslist setatt $st_name long_name "@none"
sicslist setatt $st_name data "true"
sicslist setatt $st_name nxsave "true"
}
# @brief Add a subtree to a given hipadaba path.
# @brief Add a subtree to a given hipadaba path.
#
# @param hpath, Basepath for subtree
# @param object, SICS object name
@@ -331,10 +331,10 @@ proc ::hdb::set_subtree_props {st_name klass {control "true"} {privilege "user"}
# @param type, the SICS object type if we are adding SICS object node. Optional, default = @none.
# @param makenode, type of node to make. Optional, default = @none.
proc ::hdb::add_subtree {hpath subtree {object @none} {type @none} {makenode @none}} {
set ::errorInfo ""
set ::errorInfo ""
set SICStypes {sicsvariable macro}
if [catch {
switch $makenode {
switch $makenode {
"@none" {
foreach {n v} $subtree {
if {[lsearch -exact $::nexus_classes $n] >= 0} {
@@ -360,7 +360,7 @@ proc ::hdb::add_subtree {hpath subtree {object @none} {type @none} {makenode @no
if {$item==$object} {
error "ERROR: Infinite recursion, cannot add $item as a node to it's own hdb subtree"
}
set objtype [getatt $item type]
set objtype [getatt $item type]
if {$type != $objtype} {
error "ERROR: Specified type of '$type' doesn't match actual type, '$objtype', for $item"
}
@@ -468,7 +468,7 @@ proc ::hdb::add_node {basePath args} {
array unset arg_array
set catch_status [ catch {
array set arg_array $args
array set arg_array $args
if {[info exists arg_array(path)] && [info exists arg_array(prop_list)]} {
add_hpath $basePath $arg_array(path)
if {$basePath == "/"} {
@@ -499,7 +499,7 @@ proc ::hdb::add_node {basePath args} {
array set attribute [::utility::normalattlist $node_name]
switch $arg_array(kind) {
command {
# A command is a macro, node=macro name
# A command is a macro, node=macro name
set command $node_name
set cmd_path [add_command $basePath $command]
set node_path $cmd_path
@@ -508,7 +508,7 @@ proc ::hdb::add_node {basePath args} {
if {[string length [info procs ${command}_parameters]] > 0} {
${command}_parameters add_node $cmd_path
} else {
$command -map param ::hdb::add_cmd_par $cmd_path
$command -map param ::hdb::add_cmd_par $cmd_path
}
if {[string length [info procs ${command}_feedback]] > 0} {
add_hpath $cmd_path feedback
@@ -517,7 +517,7 @@ proc ::hdb::add_node {basePath args} {
} else {
add_hpath $cmd_path feedback
hsetprop $cmd_path/feedback type part
$command -map feedback ::hdb::add_feedback $cmd_path/feedback
$command -map feedback ::hdb::add_feedback $cmd_path/feedback
}
}
hobj {
@@ -561,7 +561,7 @@ proc ::hdb::add_node {basePath args} {
#hmakescript $node_path $arg_array(rscript) $arg_array(wscript) $arg_array(dtype) $arg_array(dlen)
}
}
if {[info exists attribute(units)]} {
if {[info exists attribute(units)]} {
hsetprop $node_path units [normalgetatt $node_name units]
}
if {[info exists arg_array(prop_list)]} {
@@ -569,10 +569,10 @@ proc ::hdb::add_node {basePath args} {
hsetprop $node_path $prop $pval
}
}
if {[info exists attribute(depends)]} {
if {[info exists attribute(depends)]} {
foreach dep [split [normalgetatt $node_name depends] , ] {
set sobjadd_state(depends) true
::hdb::sobjadd $node_path $dep
::hdb::sobjadd $node_path $dep
set sobjadd_state(depends) false
}
}
@@ -612,7 +612,7 @@ proc ::hdb::add_command {basePath command} {
hsetprop $cmd_path nxsave $cmd_atts(nxsave)
hsetprop $cmd_path sicsdev $cmd_atts(id)
return $cmd_path
}
}
##
# @brief Retrieve the list of attributes for the given sics object
@@ -624,7 +624,7 @@ proc ::hdb::attlist {sicsobj} {
foreach att [tolower_sicslist $sicsobj] {
lappend atts [split [string range $att 0 end-1] =]
}
return [join $atts]
return [join $atts]
} message ] {
if {$::errorCode=="NONE"} {return $message}
return -code error $message
@@ -722,7 +722,7 @@ proc ::hdb::sobjadd {hpath sobj args} {
if {[info exists sobjatt(group)]} {
set hpath [add_hpath $hpath $sobjatt(group)]
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
}
}
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)]
if {[catch {hsetprop $node_path sicsdev $sobj} err]} {clientput $err error}
@@ -733,19 +733,19 @@ proc ::hdb::sobjadd {hpath sobj args} {
if {[catch {hsetprop $node_path privilege $sobjatt(privilege)} err]} {clientput $err error}
} else {
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
}
}
}
node {
}
singlecounter {
# TODO
# TODO
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
}
histmem {
if {[info exists sobjatt(group)]} {
set hpath [add_hpath $hpath $sobjatt(group)]
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
}
}
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)]
if {[catch {hsetprop $node_path savecmd $sobjatt(savecmd)} err]} {clientput $err error}
@@ -761,7 +761,7 @@ proc ::hdb::sobjadd {hpath sobj args} {
if {[info exists sobjatt(group)]} {
set hpath [add_hpath $hpath $sobjatt(group)]
hsetprop $hpath type part
}
}
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)]
hsetprop $node_path sicsdev $sobj
@@ -772,18 +772,18 @@ proc ::hdb::sobjadd {hpath sobj args} {
hsetprop $node_path privilege $sobjatt(privilege)
} else {
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
}
}
}
nxscript {
# TODO
# TODO
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
}
sicsdata {
# TODO
# TODO
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
}
scanobject {
# TODO
# TODO
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
}
# TODO Can this be replaced with a sct_* glob?
@@ -836,7 +836,7 @@ proc ::hdb::sobjtypeadd {hpath sobjtype given_klass} {
##
# @brief Remove empty instrument dictionary nodes
# @brief Remove empty instrument dictionary nodes
#
# @param instdict name of the instrument dictionary structure
#
@@ -853,7 +853,7 @@ proc ::hdb::prune {instdict} {
while {[expr [llength $candidates]] > 0} {
set new_candidates ""
foreach name $candidates {
array unset dictval
array unset dictval
array set dictval $dictarr($name)
if {[lsearch $dictval(property) nxvgroup] >= 0} {
# Link targets are not candidates for pruning
@@ -939,7 +939,7 @@ upvar #0 $instDict dictionary
#
# @param hpath The save state of the nodes below this path will be set
# @param mode true or false
# @param top This is just here to make the recursion work from the top level, You don't need
# @param top This is just here to make the recursion work from the top level, You don't need
# to set this
proc ::hdb::set_save {hpath mode {top true}} {
if [ catch {
@@ -956,7 +956,7 @@ if [ catch {
foreach ps [lrange [split [string trim $hnode /] /] 0 end-1] {
set hp $hp/$ps
hsetprop $hp nxsave true
}
}
}
} else {
hsetprop $hnode nxsave $mode

View File

@@ -1,5 +1,5 @@
# The attributes and values for sics objects and instrument dictionaries must comply
# with the following lists.
# with the following lists.
set boolean {true false}
# INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION
@@ -49,7 +49,7 @@ set chopperadapter_attlist [subst {
sdsinfo {print}
nxalias {text}
mutable [subst {{$boolean}}]
}]
}]
set environment_controller_attlist [subst {
$sobj_attlist
@@ -59,12 +59,12 @@ set environment_controller_attlist [subst {
set histmem_attlist [subst {
$sobj_attlist
mutable [subst {{$boolean}}]
}]
}]
# A macro can be attached to an hdb node as a command or a script
set macro_attlist [subst {
$sobj_attlist
}]
}]
set motor_attlist [subst {
$sobj_attlist
@@ -72,40 +72,40 @@ set motor_attlist [subst {
savecmd {print}
nxalias {text}
mutable [subst {{$boolean}}]
}]
}]
set configurablevirtualmotor_attlist [subst {
$motor_attlist
}]
}]
set nxscript_attlist [subst {
$sobj_attlist
}]
}]
set scanobject_attlist [subst {
$sobj_attlist
}]
}]
set sct_object_attlist [subst {
$sobj_attlist
}]
}]
set sicsdata_attlist [subst {
$sobj_attlist
mutable [subst {{$boolean}}]
}]
}]
set sicsvariable_attlist [subst {
$sobj_attlist
mutable [subst {{$boolean}}]
}]
}]
set singlecounter_attlist [subst {
$sobj_attlist
mutable [subst {{$boolean}}]
}]
}]
# INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION
if 1 {
if 1 {
set nexus_classes { NXaperture NXattenuator NXbeam_stop NXbeam NXbending_magnet NXcharacterizations NXcollimator NXcrystal NXdata NXdetector NXdisk_chopper NXentry NXenvironment NXevent_data NXfermi_chopper NXfilter NXflipper NXgeometry NXguide NXinsertion_device NXinstrument NXlog NXmirror NXmoderator NXmonitor NXnote NXorientation NXpositioner NXprocess NXroot NXsample NXsensor NXshape NXsource NXtranslation NXuser NXvelocity_selector}
set dict_privilege_list {
@@ -115,7 +115,7 @@ if 1 {
# uniformly.
set dict_datatype_list { @none NX_CHAR NX_FLOAT32 NX_INT32 }
# link = name of an nxalias
# link = name of an nxalias
set dict_property_list [subst {
{data control nxsave} {$boolean}
klass {@none $nexus_classes}

View File

@@ -4,10 +4,10 @@
##
# @file Provides generic code and parameters for configuring the ANSTO histogram memory server
# The instrument specific histogram memory configuration files must define an initialisation
# function with the following signature
# The instrument specific histogram memory configuration files must define an initialisation
# function with the following signature
# @code proc ::histogram_memory::initialize {}
# this function should call the generic initalisation function,
# this function should call the generic initalisation function,
# ::histogram_memory::ic_initialize
#
#@see ::histogram_memory::ic_initialize
@@ -104,7 +104,7 @@ namespace eval histogram_memory {
::utility::mkVar detector_active_width_mm Float user active_width true detector true true
sicslist setatt detector_active_width_mm units mm
::utility::mkVar hmm_user_configpath Text manager user_configpath false detector false false
::utility::mkVar hmm_user_configpath Text manager user_configpath false detector false false
hmm_user_configpath ../user_config/hmm
::utility::mkVar hmm_mode Text user mode true detector true true
::utility::mkVar hmm_preset Float user preset true detector true true
@@ -232,9 +232,9 @@ namespace eval histogram_memory {
} message ] {
return -code error "([info level 0]) $message"
}
}
}
##
# @brief Returns the histogram memory server clock scale.
#
@@ -454,7 +454,7 @@ namespace eval histogram_memory {
sicslist setatt $script_name long_name x_pixel_offset
sicslist setatt $script_name units "mm"
unset script_name
sicsdatafactory new ::histogram_memory::time_channel_array
proc time_channel {args} {
variable state
@@ -502,7 +502,7 @@ proc ::histogram_memory::calc_boundaries {values channels} {
if {$bbnum > $maxbblen} {
error "ERROR: The number of bin boundaries must be less than or equal to $maxbblen"
}
set BOUNDARIES ""
set BOUNDARIES ""
if {$bbnum > 2} {
set BOUNDARIES $values
} elseif {$bbnum == 2} {
@@ -517,7 +517,7 @@ proc ::histogram_memory::calc_boundaries {values channels} {
# error "ERROR: $leftbb and $rightbb must bound a channel >= 0 or <= $maxchan"
# }
for {set bb $leftbb; set i 0} {$i < $maxbblen} {incr i; set bb [expr {$bb + $bstep}]} {
lappend BOUNDARIES $bb
lappend BOUNDARIES $bb
}
} else {
error "ERROR: You must specify at least two bin boundaries"
@@ -534,7 +534,7 @@ set hmm_xml ""
# @brief Provides a standard set of subcommands for the histogram server table
# configuration commands.
#
# @param tag Table identifier, one of BAT CAT FAT NAT OAT SAT SRV
# @param tag Table identifier, one of BAT CAT FAT NAT OAT SAT SRV
# @param attributes Defines the list of attributes which you will be allowed to set.
# @param element_list Defines the list of elements which you will be allowed to set.
# Use "" if your table doesn't contain any elements.
@@ -546,15 +546,15 @@ set hmm_xml ""
# -clear clears the table\n
# -init A list of name value pairs. If you use attribute or element names then
# the corresponding table entries will be initilised to the given values, any
# attributes or elements which aren't specified will be cleared. You can also
# specify extra parameters to store in the table which might be required to
# attributes or elements which aren't specified will be cleared. You can also
# specify extra parameters to store in the table which might be required to
# specify limits or constants which may be necessary for deriving configuration
# parameters.\n
# -get return the value for the named attribute or element\n
# -attlist list all of the attributes with their values.\n
# TODO Maintain "proposed" and "current" tables. Provide a setcurrent command which can
# only be called by the upload_config command to set the proposed tables as current
# TODO Allow for top level content in tables and attributes in sub-elements
# TODO Allow for top level content in tables and attributes in sub-elements
proc HISTMEM_TABLE {tpath args} {
global hmm_xml
@@ -564,25 +564,25 @@ proc HISTMEM_TABLE {tpath args} {
foreach {opt arglist} [::utility::get_opt_arglist $args] {}
switch -- $opt {
"-dump" {
foreach {k v} $hmm_xml {clientput $k; foreach {name val} $v {clientput "$name: $val"}}
foreach {k v} $hmm_xml {clientput $k; foreach {name val} $v {clientput "$name: $val"}}
}
"-allowed_attributes" {
if {[llength $arglist] == 0} {
set retVal [::utility::tabget hmm_xml $tpath/_ALLOWED_ATTRIBUTES_]
} else {
} else {
::utility::tabset hmm_xml $tpath/_ALLOWED_ATTRIBUTES_ [lindex $arglist 0]
}
}
"-allowed_elements" {
if {[llength $arglist] == 0} {
set retVal [::utility::tabget hmm_xml $tpath/_ALLOWED_ELEMENTS_]
} else {
} else {
::utility::tabset hmm_xml $tpath/_ALLOWED_ELEMENTS_ [lindex $arglist 0]
::utility::tabset hmm_xml $tpath/_ELEMENTS_ [lindex $arglist 0]
}
}
"-setel" {
set element [lindex $arglist 0]
set element [lindex $arglist 0]
set value [lindex $arglist 1]
if {[lsearch [::utility::tabget hmm_xml $tpath/_ALLOWED_ELEMENTS_] $element] >= 0} {
::utility::tabset hmm_xml $tpath/$element/_CONTENT_ $value
@@ -591,7 +591,7 @@ proc HISTMEM_TABLE {tpath args} {
}
}
"-setatt" {
set attname [lindex $arglist 0]
set attname [lindex $arglist 0]
set value [lindex $arglist 1]
if {[lsearch [::utility::tabget hmm_xml $tpath/_ALLOWED_ATTRIBUTES_] $attname] >= 0} {
::utility::tabset hmm_xml $tpath/_ATTLIST_/$attname $value
@@ -600,19 +600,19 @@ proc HISTMEM_TABLE {tpath args} {
}
}
"-getel" {
set element [lindex $arglist 0]
set element [lindex $arglist 0]
set retVal [::utility::tabget hmm_xml $tpath/$element/_CONTENT_]
}
"-getatt" {
set attribute [lindex $arglist 0]
set attribute [lindex $arglist 0]
set retVal [::utility::tabget hmm_xml $tpath/_ATTLIST_/$attribute]
}
"-delel" {
set element [lindex $arglist 0]
set element [lindex $arglist 0]
::utility::tabdel hmm_xml $tpath/$element
}
"-delatt" {
set attribute [lindex $arglist 0]
set attribute [lindex $arglist 0]
::utility::tabdel hmm_xml $tpath/_ATTLIST_/$attribute
}
"-clear" {
@@ -657,7 +657,7 @@ proc HISTMEM_TABLE {tpath args} {
}
}
##
##
# @brief Base Address Table configuration parameters as maintained by SICS
#
proc BAT_TABLE {args} {
@@ -665,7 +665,7 @@ proc BAT_TABLE {args} {
set attributes { NO_BAT_ENTRIES NO_BAT_PERIODS NO_REPEAT_ENTRY NO_REPEAT_TABLE NO_EXECUTE_TABLE }
set elements {{PERIOD_INDICES }}
set tag BAT
set tag BAT
foreach {opt arglist} [::utility::get_opt_arglist $args] {}
switch -- $opt {
"" {
@@ -745,7 +745,7 @@ proc BAT_TABLE {args} {
}
}
##
##
# @brief CAlibration Table configuration parameters as maintained by SICS
#
proc CAT_TABLE {args} {
@@ -753,7 +753,7 @@ proc CAT_TABLE {args} {
set attributes { FRAME_FREQUENCY SIZE_PERIOD COUNT_METHOD COUNT_SIZE READ_DATA_TYPE }
set elements {{MESYTEC_MPSD8_CHANNEL_GAINS MESYTEC_MPSD8_THRESHOLDS MESYTEC_TUBE_PAIR_RESISTANCE_RATIOS MESYTEC_TUBE_MAGNIFICATIONS MESYTEC_TUBE_OFFSETS MESYTEC_TUBE_HISTOGRAM_WEIGHTS }}
set tag CAT
set tag CAT
foreach {opt arglist} [::utility::get_opt_arglist $args] {}
switch -- $opt {
"" {
@@ -833,7 +833,7 @@ proc CAT_TABLE {args} {
}
}
##
##
# @brief Frequency Address Table configuration parameters as maintained by SICS
#
proc FAT_TABLE {args} {
@@ -842,7 +842,7 @@ proc FAT_TABLE {args} {
set elements {{ }}
set tag FAT
set tag FAT
foreach {opt arglist} [::utility::get_opt_arglist $args] {}
switch -- $opt {
"" {
@@ -1052,7 +1052,7 @@ proc OAT_TABLE {args} {
}
}
# @brief Spatial Allocation Table configuration parameters as maintained by SICS
# @brief Spatial Allocation Table configuration parameters as maintained by SICS
#
# Only one element, ie SPLIT with no content just attributes.
proc SAT_TABLE {args} {
@@ -1198,7 +1198,7 @@ proc ::histogram_memory::max_chan_num {axis} {
}
##
# @brief When called without arguments this returns the name of the filler defaults file
# for the histogram server. When called with an argument it sets the current name of the
# for the histogram server. When called with an argument it sets the current name of the
# filler defaults file.
#
# When anstohm_linked.xml is uploaded to the histogram server it calls this via
@@ -1245,7 +1245,7 @@ proc ::histogram_memory::number_of_channels {axis} {
# TODO Set current oat table after uploading proposed oat_table
proc ::histogram_memory::upload_config {filler_defaults} {
if [ catch {
::histogram_memory::synch_tables
::histogram_memory::synch_tables
::histogram_memory::filler_defaults $filler_defaults
hmm astop
hmm configure init 1
@@ -1325,7 +1325,7 @@ proc ::histogram_memory::get_frame_source {} {
proc ::histogram_memory::set_frame_source {srce} {
variable ic_fsrce_values
if [ catch {
if [ catch {
if {[lsearch $ic_fsrce_values $srce] == -1} {
error "ERROR: $srce is invalid, valid values are \"$ic_fsrce_values\""
}
@@ -1359,7 +1359,7 @@ proc ::histogram_memory::get_frame_freq {} {
# @param freq Frequency in Hz.\n
# @param frame_source INTERNAL or EXTERNAL(default)
#
# If freq=0 then it sets the frequency to 50Hz with an internal frame source. This is useful
# If freq=0 then it sets the frequency to 50Hz with an internal frame source. This is useful
# if you are setting the frequency from a chopper which is stopped.
proc ::histogram_memory::set_frame_freq {freq {frame_source EXTERNAL}} {
variable state
@@ -1521,7 +1521,7 @@ proc ::histogram_memory::ic_initialize {} {
::histogram_memory::clear_tables
# FAT_TABLE -set VIEW_MAG_X -1 VIEW_MAG_Y -1
foreach hm_obj [sicslist type histmem] {
foreach hm_obj [sicslist type histmem] {
set host [dict get $::HISTMEM_HOSTPORT HMM HOST]
set port [dict get $::HISTMEM_HOSTPORT HMM PORT]
$hm_obj configure hmaddress http://$host:$port
@@ -1578,7 +1578,7 @@ Publish SAT_TABLE user
# if {$monitor_controlled == "true"} {
# set hm_start {hmm count}
# } else {
# bm setmode timer
# bm setmode timer
# bm setpreset 32000000
# }
if {$blocking == "block"} {
@@ -1607,7 +1607,7 @@ Publish SAT_TABLE user
}
}
}
proc ::histogram_memory::veto {action} {
switch $action {
"on" {
@@ -1671,7 +1671,7 @@ Publish SAT_TABLE user
return [SplitReply [hmm_mode]]
}
if [ catch {
set modes $ic_count_methods
set modes $ic_count_methods
if {[lsearch $modes $method] == -1} {
error "ERROR: Count mode, $method, must be one of $modes"
}
@@ -1744,7 +1744,7 @@ Publish SAT_TABLE user
proc ::histogram_memory::stop_condition {condition} {
variable state
if [ catch {
array set count_stop {immediate IMMEDIATE period AT_END_OF_PERIOD}
array set count_stop {immediate IMMEDIATE period AT_END_OF_PERIOD}
if {$condition == ""} {
return $state(stop_cond)
} else {
@@ -1843,7 +1843,7 @@ namespace eval ::histogram_memory {
# @brief Set stop condition for histogram memory
#
# @param condition
#command stop_condition {text:immediate,period condition}
#command stop_condition {text:immediate,period condition}
}
@@ -1855,7 +1855,7 @@ namespace eval ::histogram_memory {
proc _histmem {cmd args} {
#TODO Add "continue"
set reply ""
if [ catch {
if [ catch {
switch $cmd {
"start" {
eval "::histogram_memory::start $args"

View File

@@ -11,7 +11,7 @@ namespace eval histogram_memory {
variable state
if [ catch {
#set deg_per_radian [SplitReply [deg_per_rad]]
set deg_per_radian 57.29577951308232
set deg_per_radian 57.29577951308232
set max_chan [OAT_TABLE X -getdata MAX_CHAN]
set bb_zero_offset [expr -1*($max_chan-1)]
set det_width_mm [SplitReply [detector_active_width_mm]]

View File

@@ -25,7 +25,7 @@ proc ::histogram_memory::select_read_type {type} {
# Instrument specific X and Y dimension names
variable INST_NXC
variable INST_NYC
if [catch {
$HMOBJ configure read_data_period_number 0
@@ -49,67 +49,67 @@ proc ::histogram_memory::select_read_type {type} {
$HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]]
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_XT"
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_XT"
set hmm_ext "_xt"
}
"HISTOGRAM_YT" - "HISTOPERIOD_YT" {
$HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_YT"
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_YT"
set hmm_ext "_ty"
}
"HISTOGRAM_X" - "HISTOPERIOD_X" {
$HMOBJ configure rank 1
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_X"
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_X"
set hmm_ext "_x"
}
"HISTOGRAM_Y" - "HISTOPERIOD_Y" {
$HMOBJ configure rank 1
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NYC]]
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_Y"
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_Y"
set hmm_ext "_y"
}
"HISTOGRAM_T" - "HISTOPERIOD_T" {
$HMOBJ configure rank 1
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_T"
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_T"
set hmm_ext "_t"
}
"TOTAL_HISTOGRAM_XY" {
$HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
$HMOBJ configure READ_DATA_TYPE $type
$HMOBJ configure READ_DATA_TYPE $type
set hmm_ext "_total_xy"
}
"TOTAL_HISTOGRAM_XT" {
$HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]]
$HMOBJ configure READ_DATA_TYPE $type
$HMOBJ configure READ_DATA_TYPE $type
set hmm_ext "_total_xt"
}
"TOTAL_HISTOGRAM_YT" {
$HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
$HMOBJ configure READ_DATA_TYPE $type
$HMOBJ configure READ_DATA_TYPE $type
set hmm_ext "_total_ty"
}
"TOTAL_HISTOGRAM_XP" {
$HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure dim1 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
$HMOBJ configure READ_DATA_TYPE $type
$HMOBJ configure READ_DATA_TYPE $type
set hmm_ext "_total_xp"
}
"TOTAL_HISTOGRAM_YP" {
$HMOBJ configure rank 2
$HMOBJ configure dim0 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
$HMOBJ configure READ_DATA_TYPE $type
$HMOBJ configure READ_DATA_TYPE $type
set hmm_ext "_total_py"
}
"TOTAL_HISTOGRAM_X" {
@@ -149,14 +149,14 @@ publish ::histogram_memory::select_read_type user
##
# @brief Instrument specific configurations can redefine this
# to select extra read data types or override one of the
# to select extra read data types or override one of the
# common data types for the histogram memory.
proc ::histogram_memory::is_select_read_type {type} {
variable HMOBJ
# Instrument specific X and Y dimension names
variable INST_NXC
variable INST_NYC
return "notfound"
}
publish ::histogram_memory::is_select_read_type user
@@ -166,7 +166,7 @@ publish ::histogram_memory::is_select_read_type user
# specific type then set a common type.
proc ::histogram_memory::hmm_set_read_type {type} {
variable HMOBJ
if [ catch {
set hmm_ext [is_select_read_type $type]
if {$hmm_ext == "notfound"} {
@@ -205,7 +205,7 @@ proc ::histogram_memory::set_axes {typelist} {
# Instrument specific X and Y dimension names
variable INST_NXC
variable INST_NYC
if [catch {
set signal 1
foreach type $typelist {
@@ -555,7 +555,7 @@ hsetprop $HP_HMM data true
hsetprop $HP_HMM klass parameter
hsetprop $HP_HMM nxalias hmscobj_hmm
hsetprop $HP_HMM sicsdev none
#hsetprop /sics/hmscobj/data
#hsetprop /sics/hmscobj/data
#sicspoll add /sics/hmscobj/data hdb
sicslist setatt $HMSCOBJ kind scobj

View File

@@ -1,6 +1,6 @@
##
# @file Implements control for the Ordela high voltage power supply using the odrhvps protocol handler.
#
#
# This controller implements voltage ramping and always reads the current value before
# attempting to set the new voltage.
@@ -28,10 +28,10 @@ proc ::scobj::dethvps::rqValue {nextSubState cmd} {
#
# @param vPath, Hdb node path for the voltage.
proc ::scobj::dethvps::rdValue {vPath} {
variable RAMPIDLE
variable RAMPSTOP
variable RAMPIDLE
variable RAMPSTOP
variable RAMPSTART
variable RAMPBUSY
variable RAMPBUSY
variable MAXPOTVAL
variable RAMPINTEREST
@@ -98,10 +98,10 @@ proc ::scobj::dethvps::rdValue {vPath} {
##
# @brief Checks the target voltage and sets the ramping superstate and ramp direction.
proc ::scobj::dethvps::setValue {nextSubState} {
variable RAMPIDLE
variable RAMPSTOP
variable RAMPIDLE
variable RAMPSTOP
variable RAMPSTART
variable RAMPBUSY
variable RAMPBUSY
set catch_status [ catch {
set par [sct target]
@@ -135,10 +135,10 @@ proc ::scobj::dethvps::setValue {nextSubState} {
##
# @brief Checks that a command has been acknowledged
proc ::scobj::dethvps::getACK {} {
variable RAMPIDLE
variable RAMPSTOP
variable RAMPIDLE
variable RAMPSTOP
variable RAMPSTART
variable RAMPBUSY
variable RAMPBUSY
set catch_status [ catch {
set currSuperState [sct ramping]
@@ -173,11 +173,11 @@ proc ::scobj::dethvps::getACK {} {
#
# @param cmd, The set voltage command
proc ::scobj::dethvps::ramping {cmd} {
variable RAMPIDLE
variable RAMPSTOP
variable RAMPIDLE
variable RAMPSTOP
variable RAMPSTART
variable RAMPBUSY
variable MINRAMPINTERVAL
variable RAMPBUSY
variable MINRAMPINTERVAL
set catch_status [ catch {
set rampstep [sct rampstep]
@@ -213,10 +213,10 @@ proc ::scobj::dethvps::ramping {cmd} {
##
# @brief Command interface for voltage controller
proc ::scobj::dethvps::drvCmd {} {
variable RAMPIDLE
variable RAMPSTOP
variable RAMPIDLE
variable RAMPSTOP
variable RAMPSTART
variable RAMPBUSY
variable RAMPBUSY
variable potValPath
set catch_status [ catch {

View File

@@ -44,9 +44,9 @@ namespace eval ::scobj::jogmotor {
}
return idle
}
proc jogCmd {sct_controller axis} {
variable cmd_table
variable cmd_table
set jcmd [string tolower [lindex [sct target] 0]]
switch $jcmd [subst {
@@ -76,7 +76,7 @@ namespace eval ::scobj::jogmotor {
}
}
# TODO Check thread 0 and motion control disabled?
proc check_motor {} {
set val [sct target]
@@ -171,8 +171,8 @@ proc updatestatus {} {
namespace import ::scobj::jogmotor::*
##
# Eg
# hfactory /controllers plain spy none
#
# hfactory /controllers plain spy none
#
# makesctcontroller /controllers/sct_mc1 std localhost:62034
#
# mk_sct_jogmotor sct_mc1 chi index { 1 0 2 15 3 20 }

View File

@@ -51,7 +51,7 @@ proc ::scobj::positmotor::setVal {ID2valXfn motor table} {
proc ::scobj::positmotor::noResponse {} {
return idle
}
##
# @brief Creates a controller which can drive motors to discrete labelled positions
#
@@ -69,7 +69,7 @@ proc mkPosit {sct_controller name type motor klass table} {
lappend ilist $i
}
sicslist setatt $name values [join $ilist ","]
sicslist setatt $name klass $klass
sicslist setatt $name klass $klass
sicslist setatt $name long_name $name
hfactory /sics/$name/precision script "getmotpar $motor precision" "$motor precision " float 1
hsetprop /sics/$name read ::scobj::positmotor::reqVal report $motor
@@ -137,7 +137,7 @@ proc ::scobj::positmotor::mot2ID {mot precision table} {
namespace import ::scobj::positmotor::*
##
# Eg
#
#
# makesctcontroller sct_mc3 std localhost:62034
#
# mkPosit sct_mc3 diameter float apx sample {2.5 0 5.0 -23 7.5 -47}

View File

@@ -203,7 +203,7 @@ proc ::nexus::link {args} {
##
# @brief Initialise state variables
# @brief Initialise state variables
proc ::nexus::init {} {
variable state
variable nexusdic
@@ -298,7 +298,7 @@ proc ::nexus::isValidFileType {type} {
# state(file,open) true
# /data/currentfiletype == UNKNOWN
proc ::nexus::newfile {type {namestyle data}} {
::nexus::newfile_collection -filetype $type -savetype $namestyle
::nexus::newfile_collection -filetype $type -savetype $namestyle
}
##
@@ -428,8 +428,8 @@ proc ::nexus::newfile_collection {args} {
##
# @brief Save data to the currently open file and then close it.
#
# @param point This is the array index for mutable data elements
#
# @param point This is the array index for mutable data elements
#
# This function provides the top level call to the recursive ::nexus::savetree
# function, it should only be called by the ::nexus::save command.
#
@@ -544,8 +544,8 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} {
} else {
::nexus::CallESProcs
# timestamp force [expr {[clock seconds] - $start_seconds_array($data_label)}]
timestamp force [expr {[clock seconds] - $start_seconds}]
# timestamp force [expr {[clock seconds] - $start_seconds_array($data_label)}]
timestamp force [expr {[clock seconds] - $start_seconds}]
dataFileName force $currFilename($data_label)
file_status force $file_states(O)
::nexus::nxreopenfile $currFilename($data_label)
@@ -558,7 +558,7 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} {
} message ] {
nxscript puttext data_save_error "([info level 0]) $message"
set caught_exception true
}
}
if {[info exists data_label] && [info exists currFilename($data_label)]} {
::nexus::nxclosefile $currFilename($data_label)
file_status force $file_states(C)
@@ -601,7 +601,7 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} {
}
} message ] {
return -code error "([info level 0]) $message"
}
}
}
##
@@ -631,21 +631,21 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} {
}
} message ] {
return -code error "([info level 0]) $message"
}
}
}
##
# @brief Traverse the hdb subtree from the given path and save the data in the currently open file
#
# @param hpath path of subtree to save, must not be "/"
# @param pt Current array index for mutable data (optional default=0)
# @param pt Current array index for mutable data (optional default=0)
proc ::nexus::savetree {hpath pt filestatus} {
set caught_exception false
foreach child [hlist /$hpath] {
if [ catch {
array unset p_arr
array set p_arr [hlistprop /$hpath/$child tcllist]
array set p_arr [hlistprop /$hpath/$child tcllist]
if {([info exists p_arr(type)] == 0) || ($p_arr(type) != "nxvgroup")} {
set data_type [lindex [split [hinfo /$hpath/$child] , ] 0]
if {[info exists p_arr(data)] && ($p_arr(data) == true) && ($p_arr(nxsave) == true) } {
@@ -687,14 +687,14 @@ proc ::nexus::savetree {hpath pt filestatus} {
##
# @brief Recursive portion of gen_nxdict function
#
#
# @param hpath hdb subtree path to generate dictionary fragment from, must not be "/"
# @param dictPath parent path for nexus dictionary fragment.
# @param name name for child dictionary path
# @param nxc Nexus class name
#
#
# If the klass name doesn't begin with NX then construct the SDS name by replacing '/' with '_' in the
# hdb path
# hdb path
#
# @see gen_nxdict
proc ::nexus::_gen_nxdict {hpath dictPath name nxc} {
@@ -707,11 +707,11 @@ proc ::nexus::_gen_nxdict {hpath dictPath name nxc} {
if {$nxc == "NXentry"} {
::nexus::_gen_nxdict $hpath/$child $dictPath $child $nxclass
} else {
::nexus::_gen_nxdict $hpath/$child $dictPath/$name,$nxc $child $nxclass
::nexus::_gen_nxdict $hpath/$child $dictPath/$name,$nxc $child $nxclass
}
}
}
array set p_arr [hlistprop /$hpath tcllist]
array set p_arr [hlistprop /$hpath tcllist]
set data_type [lindex [split [hinfo /$hpath] , ] 0]
if {$data_type != "none" || $p_arr(type) == "nxvgroup"} {
#XXX Do we need to check data_type here. This would skip NXVGROUP nodes
@@ -769,9 +769,9 @@ proc ::nexus::gen_NXentry_name {baseName} {
##
# @brief Generate a nexus dictionary file from the hdb tree
#
# An entry in the nexus dictionary is generated for each node in the
# An entry in the nexus dictionary is generated for each node in the
# hdb tree which has the following properties and values, data=true and nxsave=true
#
#
# @param baseName The base name of the file without suffix
# @param nexusdic Name of the nexus dictionary that will be created.
# @return Full path to the nexus dictionary.
@@ -780,7 +780,7 @@ proc ::nexus::gen_nxdict {nexusdic} {
variable nxdictionary
set catch_status [catch {
set nxdict_path $cfPath(nexus)/$nexusdic
array unset nxdictionary
array unset nxdictionary
foreach hp [hlist /] {
if {[hpropexists /$hp data] } {
if {[hgetpropval /$hp data] == true} {
@@ -825,15 +825,15 @@ proc ::nexus::gen_nxdict {nexusdic} {
sicslist setatt $sobj savecmd ::nexus::motor::save
sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo
}
foreach sobj [sicslist type configurablevirtualmotor] {
foreach sobj [sicslist type configurablevirtualmotor] {
sicslist setatt $sobj savecmd ::nexus::motor::save
sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo
}
foreach sobj [sicslist type TasMot] {
foreach sobj [sicslist type TasMot] {
sicslist setatt $sobj savecmd ::nexus::motor::save
sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo
}
foreach sobj [sicslist type histmem] {
foreach sobj [sicslist type histmem] {
sicslist setatt $sobj savecmd ::nexus::histmem::save
sicslist setatt $sobj sdsinfo ::nexus::histmem::sdsinfo
}
@@ -871,7 +871,7 @@ proc ::nexus::gen_nxdict {nexusdic} {
#
# @param dtype hdb data type
# @return Nexus data type
proc ::nexus::hdb2nx_type {dtype} {
proc ::nexus::hdb2nx_type {dtype} {
switch $dtype {
int {return NX_INT32}
intar {return NX_INT32}
@@ -889,7 +889,7 @@ proc ::nexus::hdb2nx_type {dtype} {
#
# The savecmd attribute of any histogram memory objects should be set to this function
#
# @see set_sobj_attributes
# @see set_sobj_attributes
proc ::nexus::histmem::save {hm nxalias hpath data_type filestatus args} {
variable HMOBJ
@@ -1313,7 +1313,7 @@ proc ::nexus::script::sdsinfo {sdsName data_type sobj args} {
if {$param(mutable) == true} {
set sdsStr "$sdsName -type $dtype $units_att -rank 2 -dim {-1,$size}"
} else {
set sdsStr "$sdsName -type $dtype $units_att -rank 1 -dim {$size}"
set sdsStr "$sdsName -type $dtype $units_att -rank 1 -dim {$size}"
}
}
} message ] {
@@ -1326,12 +1326,12 @@ namespace import ::nexus::*
foreach expt $::nexus::exports {
publish $expt user
sicslist setatt $expt privilege internal
}
}
# TODO Return filename from nxcreatefile and call nxreopen nxclose etc
# dictalias is a global hash which records the alias which the value of
# a sics object (eg motors) is written to. The has is indexed by the
# a sics object (eg motors) is written to. The has is indexed by the
# objects name. It is useful for making links to datasets.
# dim0 = vertical axis on detector
# dim1 = horizontal axis on detector

View File

@@ -1,4 +1,4 @@
set sim_mode [SplitReply [plc_simulation]]
set sim_mode [SplitReply [plc_simulation]]
namespace eval plc {
}

View File

@@ -93,7 +93,7 @@ debug_log "setPoint: sct=[sct] target=[sct target] writestatus=[sct writestatus]
set err_msg "Invalid Pallet_ Num: [hval $tc_root/Control/Pallet_Nam]"
} elseif { [hval $tc_root/Control/Pallet_Idx] < 1 || [hval $tc_root/Control/Pallet_Idx] > 50 } {
set err_msg "Invalid Pallet_Idx: [hval $tc_root/Control/Pallet_Idx]"
}
}
if { $err_msg != "" } {
sct print "error:$err_msg"
debug_log "error:$err_msg"

View File

@@ -13,7 +13,7 @@
#TODO Get rid of duplication in bmonscan and hmscan code
namespace eval scan {
variable ic_runscanpar
variable ic_runscanpar
variable ic_hmm_datatype
variable save_filetype
@@ -132,7 +132,7 @@ proc ::scan::ic_initialize {} {
hmscan function prepare ::scan::hmm_scan_prepare
hmscan function finish ::scan::hmm_scan_finish
# TODO Use ic_runscanpar to create the ::scan::runscan command and
# TODO Use ic_runscanpar to create the ::scan::runscan command and
# to validate the "runscan" proc parameters.
array set ic_runscanpar [subst {
scanvar text=drivable
@@ -143,7 +143,7 @@ proc ::scan::ic_initialize {} {
preset float=0,inf
datatype text=[join [array names ::nexus::histmem_filetype_spec] , ]
savetype text=save,nosave
force boolean
force boolean
}]
scriptcallback connect hmscan SCANEND ::scan::hmscanend_event
scriptcallback connect bmonscan SCANEND ::scan::bmonscanend_event
@@ -178,7 +178,7 @@ proc ::scan::check_limit {scan_variable limit_name target} {
#
# NOTE: The sics scan object alread checks if a variable is drivable
# so we don't have to.
# TODO We can't check limits of virtual motors yet because the
# TODO We can't check limits of virtual motors yet because the
# configurablevirtualmotor doesn't set a checklimits function.
proc ::scan::check_scanvar {sobj uobj} {
variable check_thread0
@@ -216,7 +216,7 @@ proc ::scan::check_scanvar {sobj uobj} {
# Returning an error will cause the scan to abort before it starts\n
# eg\n
# return -code error "error message"
proc ::scan::pre_hmm_scan_prepare {} {}
proc ::scan::pre_hmm_scan_prepare {} {}
##
# @brief Do some pre-scan checks and prime the DAE
@@ -294,7 +294,7 @@ proc ::scan::hmm_scan_finish {sobj uobj} {
# and clear any data links
::nexus::newfile clear data
if {$reset_position == "true"} {
# set reset_position "false"
# set reset_position "false"
foreach svar $scanvarlist initpos $scaninitposlist {
set svtype [getatt $svar type]
if {$svtype == "motor" || $svtype == "configurablevirtualmotor"} {
@@ -339,7 +339,7 @@ proc ::scan::bm_writepoint {sobj uobj pt} {
#TODO Feedback for Histogram memory scan
proc ::scan::hmm_writepoint {sobj uobj pt} {
variable save_filetype
variable save_filetype
# Write hdb tree
::nexus::save $pt
}
@@ -348,10 +348,10 @@ proc ::scan::donothing {args} {}
proc ::scan::bm_count {sobj uobj point mode preset} {
::scan::hdb_bmonscan -set mode $mode
::scan::hdb_bmonscan -set preset $preset
::scan::hdb_bmonscan -set feedback scanpoint $point;
::scan::hdb_bmonscan -set feedback mode $mode;
::scan::hdb_bmonscan -set feedback preset $preset;
::scan::hdb_bmonscan -set preset $preset
::scan::hdb_bmonscan -set feedback scanpoint $point;
::scan::hdb_bmonscan -set feedback mode $mode;
::scan::hdb_bmonscan -set feedback preset $preset;
::scan::hdb_bmonscan -set feedback scan_variable_value [SplitReply [[lindex $::scan::scanvarlist 0]]]
::monitor::count $mode $preset
}
@@ -396,7 +396,7 @@ proc ::scan::bm_scan_prepare {sobj uobj} {
::scan::hdb_bmonscan -set feedback status BUSY
run_mode "bmonscan"
array set bm_fb [::scan::hdb_bmonscan -list feedback]
set ::histogram_memory::histmem_axes(SVAR) [SplitReply [sicslist [lindex $::scan::scanvarlist 0] hdb_path] ]
::nexus::newfile BEAM_MONITOR $save_filetype
@@ -480,7 +480,7 @@ namespace eval scan {
switch $arg {
"force" {
if [string is boolean $val] {
set force_scan $val
set force_scan $val
} else {
error "ERROR: force must be true or false"
}
@@ -512,7 +512,7 @@ namespace eval scan {
# hmscan ignores mode and preset, we use FAT_COUNT_METHOD and FAT_COUNT_STOP
::histogram_memory::count_method $mode
::histogram_memory::count_size $preset
hmscan clear
hmscan clear
foreach scanvar $scanvarlist start $startlist step $steplist {
hmscan add $scanvar $start $step
}
@@ -523,7 +523,7 @@ namespace eval scan {
"monitor" { set bms_mode "monitor" }
default {return -code error "ERROR: mode should be 'time' or 'monitor' not $mode"}
}
bmonscan clear
bmonscan clear
foreach scanvar $scanvarlist start $startlist step $steplist {
bmonscan add $scanvar $start $step
}
@@ -560,7 +560,7 @@ namespace eval scan {
# Default filetype for histogram memory scans
set ic_hmm_datatype "HISTOGRAM_XYT"
# Default save uniquely numbered files
set savetype "save"
set savetype "save"
set reset_position [SplitReply [::scan::runscan_reset_position]]
checkarg $scanvar varname "Expecting a scan variable name, not $scanvar"
@@ -568,7 +568,7 @@ namespace eval scan {
checkarg $step double "Expecing a float for $scanvar step value, not $step"
lappend scanvarlist $scanvar
lappend startlist $start
lappend steplist $step
lappend steplist $step
for {set argindex 0} {1} {incr argindex 3} {
set par [lindex $args $argindex]
if {[string length $par] == 0} {
@@ -613,7 +613,7 @@ namespace eval scan {
return $message
}
}
#TODO Add counter (monitor_1 monitor_2 ... histmem) and filetype BEAM_MONITOR HISTMEM_?
##
# @brief Run a histogram memory scan
@@ -639,11 +639,11 @@ namespace eval scan {
set force_scan false
set hm_ft_names [array names ::nexus::histmem_filetype_spec]
# Default filetype for histogram memory scans
set ic_hmm_datatype "HISTOGRAM_XYT"
# Default save uniquely numbered files
set savetype "save"
set savetype "save"
set reset_position [SplitReply [::scan::runscan_reset_position]]
if {[is_drivable $scanvar] == 0} {
error "The scan variable <$scanvar> must be drivable"
@@ -673,7 +673,7 @@ namespace eval scan {
switch $arg {
"force" {
if [string is boolean $val] {
set force_scan $val
set force_scan $val
} else {
error "ERROR: force must be true or false"
}
@@ -705,7 +705,7 @@ namespace eval scan {
# hmscan ignores mode and preset, we use FAT_COUNT_METHOD and FAT_COUNT_STOP
::histogram_memory::count_method $mode
::histogram_memory::count_size $preset
hmscan clear
hmscan clear
hmscan add $scanvar $start $step
} elseif {$det_type == "bmon"} {
set mode [string tolower $mode]
@@ -714,7 +714,7 @@ namespace eval scan {
"monitor" { set bms_mode "monitor" }
default {return -code error "ERROR: mode should be 'time' or 'monitor' not $mode"}
}
bmonscan clear
bmonscan clear
bmonscan add $scanvar $start $step
} else {
return -code error "ERROR: detector type should be 'histmem' or 'bmon' not $det_type"
@@ -744,6 +744,6 @@ namespace eval scan {
}
namespace import ::scan::runscan
namespace import ::scan::mscan
publish runscan user
publish runscan user
publish mscan user
sicslist setatt runscan privilege internal

View File

@@ -12,7 +12,7 @@ if {$sim_mode == "true"} {
switch $status {
"CALIBRATED REACTOR POWER" {
return [lindex $opal_status 0]
}
}
"CNS HELIUM INLET TEMPERATURE" {
return [lindex $opal_status 1]
}
@@ -32,7 +32,7 @@ if {$sim_mode == "true"} {
}
publish opal user
} else {
MakeAsyncQueue lss_chan LSS 137.157.204.67 31250
MakeAsyncQueue lss_chan LSS 137.157.204.67 31250
MakeLSSMonitor opal lss_chan 0
}
::utility::macro::getset float reactor_power {} {
@@ -41,7 +41,7 @@ if {$sim_mode == "true"} {
if [string is double $value] {
return "reactor_power = $value"
} else {
return "reactor_power = -1"
return "reactor_power = -1"
}
}
sicslist setatt reactor_power klass source
@@ -57,9 +57,9 @@ proc ::source::ic_initialize {guide} {
set str [opal "CNS HELIUM INLET TEMPERATURE"]
set value [lindex [lindex [split $str =] 1] 0]
if [string is double $value] {
return "cns_inlet_temp = $value"
return "cns_inlet_temp = $value"
} else {
return "cns_inlet_temp = -1"
return "cns_inlet_temp = -1"
}
}
sicslist setatt cns_inlet_temp klass source
@@ -73,7 +73,7 @@ proc ::source::ic_initialize {guide} {
if [string is double $value] {
return "cns_outlet_temp = $value"
} else {
return "cns_outlet_temp = -1"
return "cns_outlet_temp = -1"
}
}
sicslist setatt cns_outlet_temp klass source
@@ -87,7 +87,7 @@ proc ::source::ic_initialize {guide} {
if [string is double $value] {
return "cns_flow = $value"
} else {
return "cns_flow = -1"
return "cns_flow = -1"
}
}
sicslist setatt cns_flow klass source