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

@ -174,11 +174,11 @@ proc getCMD {channel line} {
} }
} }
} }
# Reads a command from a DMC2280 client and then performs an appropriate # Reads a command from a DMC2280 client and then performs an appropriate
# action depending on whether or not the command produces output or has # action depending on whether or not the command produces output or has
# been defined. # been defined.
proc readLine {who channel} { proc readLine {who channel} {
global didRead global didRead
global B global B
global validUID global validUID
global validPWD global validPWD
@ -191,7 +191,7 @@ proc readLine {who channel} {
puts "RECEIVED EOF: $line" puts "RECEIVED EOF: $line"
close $f close $f
return -code error "Got EOF, close channel" return -code error "Got EOF, close channel"
} else { } else {
puts "RECEIVED: $line" puts "RECEIVED: $line"
switch $serverState { switch $serverState {
"UID" { "UID" {

View File

@ -2,7 +2,7 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Creates a fake motion controller based on an # Creates a fake motion controller based on an
# instrument configuration file. # instrument configuration file.
# Usage ./cont.tcl -cont <cnum> -port <portname> # Usage ./cont.tcl -cont <cnum> -port <portname>
# where cnum is the controller number (1,2,3,4) and # where cnum is the controller number (1,2,3,4) and

View File

@ -10,16 +10,16 @@ proc serverOpen {channel addr port} {
return; return;
} }
# Reads a command from a DMC2280 client and then performs an appropriate # Reads a command from a DMC2280 client and then performs an appropriate
# action depending on whether or not the command produces output or has # action depending on whether or not the command produces output or has
# been defined. # been defined.
proc readLine {who channel} { proc readLine {who channel} {
global didRead global didRead
global B global B
if {[gets $channel line]<0} { if {[gets $channel line]<0} {
fileevent $channel readable {} fileevent $channel readable {}
after idle "close $channel;set out 1" after idle "close $channel;set out 1"
} else { } else {
puts "RECEIVED: $line" puts "RECEIVED: $line"
foreach cmd [split $line ";"] { foreach cmd [split $line ";"] {

View File

@ -7,7 +7,7 @@
#parses CM exp, _CM<axis,num>, {TP,TD}<axis>, CM<axis>=exp, CM<axis>, CM #parses CM exp, _CM<axis,num>, {TP,TD}<axis>, CM<axis>=exp, CM<axis>, CM
# axis=ABCDEFGH, num=01234567 # axis=ABCDEFGH, num=01234567
proc parse {cmdst args} { proc parse {cmdst args} {
# CM exp, handles MG # CM exp, handles MG
if {[string length $args] > 0} {return "$cmdst $args"} if {[string length $args] > 0} {return "$cmdst $args"}
# _CM<axis,num>, {TP,TD}<axis> get an axis property or position # _CM<axis,num>, {TP,TD}<axis> get an axis property or position
@ -17,18 +17,18 @@ proc parse {cmdst args} {
if {$num == 2 && [string first $cmd "TD TP"] != -1} { if {$num == 2 && [string first $cmd "TD TP"] != -1} {
return "dmget $cmd $axis"; return "dmget $cmd $axis";
} }
# CM<axis>=exp # CM<axis>=exp
# Try # Try
# set line "DPB=(_TPB - 7818915)*(25000/8192) + 0" # set line "DPB=(_TPB - 7818915)*(25000/8192) + 0"
# parse $line # parse $line
set cmdlst [split $cmdst =]; set cmdlst [split $cmdst =];
if {[llength $cmdlst] == 2} { if {[llength $cmdlst] == 2} {
set num [scan [lindex $cmdlst 0] {%2s%1[ABCDEFGH0-7]} cmd axis]; set num [scan [lindex $cmdlst 0] {%2s%1[ABCDEFGH0-7]} cmd axis];
return "dmset $cmd $axis [lindex $cmdlst 1]"; return "dmset $cmd $axis [lindex $cmdlst 1]";
} }
# CM<par> # CM<par>
set num [scan $cmdst {%2s%1[ABCDEFGH0-7]} cmd par]; set num [scan $cmdst {%2s%1[ABCDEFGH0-7]} cmd par];
if {$num == 2} {return "dmcall $cmd $par"} if {$num == 2} {return "dmcall $cmd $par"}
set num [scan $cmdst {_%2s%1[ABCDEFGH0-7]} cmd par]; set num [scan $cmdst {_%2s%1[ABCDEFGH0-7]} cmd par];

View File

@ -17,7 +17,7 @@ proc loadConfig {fName} {
if [info exists ContList] {unset ContList} if [info exists ContList] {unset ContList}
# Temporarily define unknown proc to skip undefined procs # Temporarily define unknown proc to skip undefined procs
rename ::unknown _unknown rename ::unknown _unknown
proc ::unknown {args} {} proc ::unknown {args} {}
if [catch {uplevel #0 source $fName} errMsg] { if [catch {uplevel #0 source $fName} errMsg] {
rename ::unknown "" rename ::unknown ""
rename _unknown ::unknown rename _unknown ::unknown

View File

@ -53,7 +53,7 @@ proc mkSimAxes {instrument} {
global IPtoContName motors ContList simConts; global IPtoContName motors ContList simConts;
puts [array get IPtoContName]; puts [array get IPtoContName];
puts $motors; puts $motors;
foreach c $ContList { foreach c $ContList {
set simFile($c) [open ${c}_sim.tcl w]; set simFile($c) [open ${c}_sim.tcl w];
} }

View File

@ -151,21 +151,21 @@ proc nextstep {paxis step args} {
set currPos [expr ($axis(TP) - $axis(ABSHOME))/abs(double($axis(cntsperx)))] set currPos [expr ($axis(TP) - $axis(ABSHOME))/abs(double($axis(cntsperx)))]
if {$axis(ST) == 1} { if {$axis(ST) == 1} {
set axis(TS) 44; # Stopped, limit switches open set axis(TS) 44; # Stopped, limit switches open
set axis(BG) 0; # motor has stopped set axis(BG) 0; # motor has stopped
set axis(ST) 0; # make sure stop flag is unset set axis(ST) 0; # make sure stop flag is unset
set axis(SC) 4; # motor stopped by stop command (ST) set axis(SC) 4; # motor stopped by stop command (ST)
set axis(ATLIM) false set axis(ATLIM) false
set finished true set finished true
} elseif {$currPos >= $axis(UPLIM)} { } elseif {$currPos >= $axis(UPLIM)} {
set axis(TS) 36; # Stopped on forward limit switch set axis(TS) 36; # Stopped on forward limit switch
set axis(BG) 0; # motor has stopped set axis(BG) 0; # motor has stopped
set axis(ST) 0; # make sure stop flag is unset set axis(ST) 0; # make sure stop flag is unset
set axis(SC) 2; # motor stopped by limit switch set axis(SC) 2; # motor stopped by limit switch
set axis(ATLIM) upper set axis(ATLIM) upper
set finished true set finished true
} elseif {$currPos <= $axis(LOLIM)} { } elseif {$currPos <= $axis(LOLIM)} {
set axis(TS) 40; # Stopped on reverse limit switch set axis(TS) 40; # Stopped on reverse limit switch
set axis(BG) 0; # motor has stopped set axis(BG) 0; # motor has stopped
set axis(ST) 0; # make sure stop flag is unset set axis(ST) 0; # make sure stop flag is unset
set axis(SC) 3; # motor stopped by limit switch set axis(SC) 3; # motor stopped by limit switch
set axis(ATLIM) lower set axis(ATLIM) lower
@ -176,7 +176,7 @@ proc nextstep {paxis step args} {
# set axis(TP) [expr int(round($diff*$mult + $axis(TP)))]; # set axis(TP) [expr int(round($diff*$mult + $axis(TP)))];
# set axis(TD) [expr int($target)]; # set axis(TD) [expr int($target)];
set axis(TS) 44; # Stopped, limit switches open set axis(TS) 44; # Stopped, limit switches open
set axis(BG) 0; # motor has stopped set axis(BG) 0; # motor has stopped
set axis(ST) 0; # make sure stop flag is unset set axis(ST) 0; # make sure stop flag is unset
set axis(SC) 1; # motor stopped at commanded position set axis(SC) 1; # motor stopped at commanded position
set axis(ATLIM) false set axis(ATLIM) false

View File

@ -129,7 +129,7 @@ proc readLine {channel} {
} }
default { default {
puts stderr "ERROR: Unknown command type $cmdType, should be 'L' or 'S'" puts stderr "ERROR: Unknown command type $cmdType, should be 'L' or 'S'"
} }
} }
flush stdout flush stdout
flush stderr flush stderr

View File

@ -90,7 +90,7 @@ global STB
} }
gets $channel data gets $channel data
puts "RECEIVED: $data" puts "RECEIVED: $data"
switch [llength $data] { switch [llength $data] {
0 { 0 {
puts "Oops received nothing" puts "Oops received nothing"
set cmd XXX set cmd XXX
@ -208,12 +208,12 @@ global STB
} }
} }
} }
flush stdout flush stdout
flush stderr flush stderr
flush $channel flush $channel
} }
# startserver -port 1034 # startserver -port 1034

View File

@ -1,15 +1,15 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# @file This is a barebones SICS configuration file, it's useful for testing # @file This is a barebones SICS configuration file, it's useful for testing
# drivers in isolation. # drivers in isolation.
# #
# NOTE\n # NOTE\n
# This configuration does not create a GumTree interface or let you # This configuration does not create a GumTree interface or let you
# save nexus data files. # save nexus data files.
# Required by server_config.tcl # Required by server_config.tcl
VarMake Instrument Text Internal VarMake Instrument Text Internal
Instrument bear Instrument bear
Instrument lock Instrument lock
#START SERVER CONFIGURATION SECTION #START SERVER CONFIGURATION SECTION
@ -19,24 +19,24 @@ source sics_ports.tcl
set sicsroot ../ set sicsroot ../
source util/utility.tcl source util/utility.tcl
ServerOption LogFileBaseName $sicsroot/log/serverlog ServerOption LogFileBaseName $sicsroot/log/serverlog
###### installprotocolhandler ###### installprotocolhandler
ServerOption statusfile $sicsroot/log/status.tcl ServerOption statusfile $sicsroot/log/status.tcl
ServerOption RedirectFile $sicsroot/log/stdout ServerOption RedirectFile $sicsroot/log/stdout
ServerOption LogFileDir $sicsroot/log ServerOption LogFileDir $sicsroot/log
ServerOption QuieckPort [get_portnum $quieckport ] ServerOption QuieckPort [get_portnum $quieckport ]
ServerOption ServerPort [get_portnum $serverport ] ServerOption ServerPort [get_portnum $serverport ]
ServerOption InterruptPort [get_portnum $interruptport ] ServerOption InterruptPort [get_portnum $interruptport ]
ServerOption TelWord sicslogin ServerOption TelWord sicslogin
ServerOption TelnetPort [get_portnum $telnetport ] ServerOption TelnetPort [get_portnum $telnetport ]
ServerOption ReadUserPasswdTimeout 600000 ServerOption ReadUserPasswdTimeout 600000
ServerOption AcceptTimeOut 10 ServerOption AcceptTimeOut 10
ServerOption ReadTimeOut 1000 ServerOption ReadTimeOut 1000
SicsUser manager ansto 1 SicsUser manager ansto 1
SicsUser user sydney 2 SicsUser user sydney 2
SicsUser spy 007 3 SicsUser spy 007 3
MakeDrive MakeDrive
#InstallHdb #InstallHdb

View File

@ -1,8 +1,8 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Required by server_config.tcl # Required by server_config.tcl
VarMake Instrument Text Internal VarMake Instrument Text Internal
Instrument bilby Instrument bilby
Instrument lock Instrument lock
#START SERVER CONFIGURATION SECTION #START SERVER CONFIGURATION SECTION

View File

@ -1,6 +1,6 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
fileeval $cfPath(anticollider)/anticollider_common.tcl fileeval $cfPath(anticollider)/anticollider_common.tcl
namespace eval ::anticollider { namespace eval ::anticollider {
set guide_posit 1 set guide_posit 1

View File

@ -10,7 +10,7 @@ if {$sim_mode == false} {
} }
::utility::macro::getset int master_chopper_id {args} { ::utility::macro::getset int master_chopper_id {args} {
variable sim_mode [SplitReply [chopper_simulation]] variable sim_mode [SplitReply [chopper_simulation]]
if {$sim_mode == false} { if {$sim_mode == false} {
if {$args == ""} { if {$args == ""} {
chopsel send {get master chopper} chopsel send {get master chopper}

View File

@ -22,20 +22,20 @@ namespace eval motor {
# (Xbbs, Zbbs) = beam pos in beamstop coords # (Xbbs, Zbbs) = beam pos in beamstop coords
# (Xdf,Zdf) = detector pos in frame coords # (Xdf,Zdf) = detector pos in frame coords
# (Xbsf,Zbsf) = beamstop pos in frame coords # (Xbsf,Zbsf) = beamstop pos in frame coords
# #
# (Xbf,Zbf) = (Xdf+Xbd, Zdf+Zbd) = (Xbsf+Xbbs, Zbsf+Zbbs) # (Xbf,Zbf) = (Xdf+Xbd, Zdf+Zbd) = (Xbsf+Xbbs, Zbsf+Zbbs)
# Origin of detector coords = frame origin # Origin of detector coords = frame origin
# #
# Detector and beamstop motor readings with beamstop disk centers # Detector and beamstop motor readings with beamstop disk centers
# overlapping over detector center mark. # overlapping over detector center mark.
# Xdf = 264.542 (7283813) Zdf = 0 # Xdf = 264.542 (7283813) Zdf = 0
# Xbbs = 296.291 (8054270) # Xbbs = 296.291 (8054270)
# Zbbs = 259.641 (13488244) # Zbbs = 259.641 (13488244)
# Xbd = dethw, Zbd = (dethh) # Xbd = dethw, Zbd = (dethh)
# #
# 264.542+dethw = Xbsf+296.291 # 264.542+dethw = Xbsf+296.291
# 0+dethh = Zbsf+259.641 # 0+dethh = Zbsf+259.641
# #
# Xbsf = -31.749 + dethw, Zbsf = -259.641 + dethh # Xbsf = -31.749 + dethw, Zbsf = -259.641 + dethh
proc selbs {bs {bx "UNDEF"} {bz "UNDEF"}} { proc selbs {bs {bx "UNDEF"} {bz "UNDEF"}} {
set bsdriving false set bsdriving false
@ -153,7 +153,7 @@ namespace eval optics {
VarMake ::optics::select::section text user VarMake ::optics::select::section text user
VarMake ::optics::polarizer::in text user VarMake ::optics::polarizer::in text user
VarMake ::optics::lens::selection text user VarMake ::optics::lens::selection text user
command rotary_attenuator {int=0,15,45,90,180 angle} { command rotary_attenuator {int=0,15,45,90,180 angle} {
drive att $angle drive att $angle
} }
@ -180,7 +180,7 @@ namespace eval optics {
# @param row, selects a row from the guide configuration table # @param row, selects a row from the guide configuration table
# #
# eg\n # eg\n
# guide ga # guide ga
command guide " command guide "
text=[join [array names ::optics::guide_configuration] , ] configuration text=[join [array names ::optics::guide_configuration] , ] configuration
" { " {
@ -193,7 +193,7 @@ namespace eval optics {
foreach {compselection position} $guide_configuration($configuration) { foreach {compselection position} $guide_configuration($configuration) {
foreach el $compselection guide $guide_configuration_columns { foreach el $compselection guide $guide_configuration_columns {
lappend to_config $guide lappend to_config $guide
lappend to_config [set ::optics::${guide}_map($el)] lappend to_config [set ::optics::${guide}_map($el)]
} }
::optics::guide -set feedback status BUSY ::optics::guide -set feedback status BUSY
set msg [eval "drive $to_config"] set msg [eval "drive $to_config"]

View File

@ -5,7 +5,7 @@ namespace eval counter {
variable isc_numchannels variable isc_numchannels
variable isc_monitor_address variable isc_monitor_address
variable isc_portlist variable isc_portlist
variable isc_beam_monitor_list variable isc_beam_monitor_list
proc set_sobj_attributes {} { proc set_sobj_attributes {} {
} }
} }

View File

@ -4,7 +4,7 @@ set sim_mode [SplitReply [hmm_simulation]]
proc ::histogram_memory::init_OAT_TABLE {} { proc ::histogram_memory::init_OAT_TABLE {} {
if [ catch { if [ catch {
# We don't need a MAX_CHAN parameter for time because the time channel # We don't need a MAX_CHAN parameter for time because the time channel
# is scaled by calling the ::histogram_memory::clock_scale function # is scaled by calling the ::histogram_memory::clock_scale function
OAT_TABLE X -setdata MAX_CHAN 240 OAT_TABLE X -setdata MAX_CHAN 240
OAT_TABLE Y -setdata MAX_CHAN 256 OAT_TABLE Y -setdata MAX_CHAN 256
@ -19,7 +19,7 @@ proc ::histogram_memory::init_OAT_TABLE {} {
hmm configure fat_frame_frequency $freq hmm configure fat_frame_frequency $freq
hmm configure fat_frame_source INTERNAL hmm configure fat_frame_source INTERNAL
OAT_TABLE -set X { 239.5 238.5 } NXC 240 Y { -0.5 0.5 } NYC 256 T { 0 20000 } NTC 1 OAT_TABLE -set X { 239.5 238.5 } NXC 240 Y { -0.5 0.5 } NYC 256 T { 0 20000 } NTC 1
} message ] { } message ] {
return -code error $message return -code error $message
} }

View File

@ -45,7 +45,7 @@ if {$sim_mode == false} {
} }
# ap1 configuration # ap1 configuration
# Aperture Selector (Collimator SEG 1 Start) # Aperture Selector (Collimator SEG 1 Start)
# Axis number 1 # Axis number 1
Motor ap1 $motor_driver_type [params\ Motor ap1 $motor_driver_type [params\
asyncqueue mc1\ asyncqueue mc1\

View File

@ -1,17 +1,17 @@
namespace eval optics { namespace eval optics {
array set AttRotLookupTable { array set AttRotLookupTable {
0 { 0.0 1 } 0 { 0.0 1 }
30 { 1.3 0.498782 } 30 { 1.3 0.498782 }
60 { 3.3 0.176433 } 60 { 3.3 0.176433 }
90 { 4.9 0.0761367 } 90 { 4.9 0.0761367 }
120 { 6.4 0.0353985 } 120 { 6.4 0.0353985 }
150 { 8.3 0.0137137 } 150 { 8.3 0.0137137 }
180 { 9.6 0.00614167 } 180 { 9.6 0.00614167 }
210 {11.2 0.00264554 } 210 {11.2 0.00264554 }
240 {13.1 0.000994504 } 240 {13.1 0.000994504 }
270 {15.0 0.000358897 } 270 {15.0 0.000358897 }
300 {18.0 7.2845e-05 } 300 {18.0 7.2845e-05 }
330 {25.0 1.67827e-06 } 330 {25.0 1.67827e-06 }
} }
array set EApLookupTable { array set EApLookupTable {

View File

@ -1,5 +1,5 @@
## ##
# @file # @file
# A guide configuration table where each line describes the setup # A guide configuration table where each line describes the setup
# for a mode of operation. # for a mode of operation.
# The table will have a corresponding interpretation list which provides # The table will have a corresponding interpretation list which provides
@ -7,7 +7,7 @@
namespace eval optics { namespace eval optics {
## ##
# @brief These arrays map the component identifiers (G, MT, etc) to the # @brief These arrays map the component identifiers (G, MT, etc) to the
# position index for each guide motor (c1, c2 ... c9) # position index for each guide motor (c1, c2 ... c9)
array set c1_map {G 1 MT 2 P 3} array set c1_map {G 1 MT 2 P 3}
array set c2_map {MT 1 G 2 A 3} array set c2_map {MT 1 G 2 A 3}
@ -20,43 +20,43 @@ namespace eval optics {
array set c9_map {L 1 MT 2 G 3 A 4 LP 5} array set c9_map {L 1 MT 2 G 3 A 4 LP 5}
# The guide configuration table is indexed by a configuration # The guide configuration table is indexed by a configuration
# identifier (ga, mt, lp, etc). Each row has two elements, # identifier (ga, mt, lp, etc). Each row has two elements,
# 1. A list of components selected for each guide (MT A ... etc) # 1. A list of components selected for each guide (MT A ... etc)
# 2. The entrance aperature position in mm # 2. The entrance aperature position in mm
# Eg $guide_configuration(p2) returns the following list # Eg $guide_configuration(p2) returns the following list
# {{P G A A A A A A A } 6934} # {{P G A A A A A A A } 6934}
array set guide_configuration { array set guide_configuration {
ga {{MT A A A A A A A A } 675} ga {{MT A A A A A A A A } 675}
mt {{MT MT MT MT MT MT MT MT MT} 675} mt {{MT MT MT MT MT MT MT MT MT} 675}
lp {{MT MT MT MT MT MT MT MT LP} 675} lp {{MT MT MT MT MT MT MT MT LP} 675}
lens {{MT A A A A A A A L } 675} lens {{MT A A A A A A A L } 675}
p1 {{P A MT MT MT MT MT MT MT} 4621} p1 {{P A MT MT MT MT MT MT MT} 4621}
p1lp {{P A MT MT MT MT MT MT LP} 4621} p1lp {{P A MT MT MT MT MT MT LP} 4621}
p1lens {{P A MT MT MT MT MT MT L } 4621} p1lens {{P A MT MT MT MT MT MT L } 4621}
g1 {{G A A A A A A A A } 4929} g1 {{G A A A A A A A A } 4929}
p2 {{P G A A A A A A A } 6934} p2 {{P G A A A A A A A } 6934}
g2 {{G G A A A A A A A } 6934} g2 {{G G A A A A A A A } 6934}
p3 {{P G G A A A A A A } 8949} p3 {{P G G A A A A A A } 8949}
g3 {{G G G A A A A A A } 8949} g3 {{G G G A A A A A A } 8949}
p4 {{P G G G A A A A A } 10955} p4 {{P G G G A A A A A } 10955}
g4 {{G G G G A A A A A } 10955} g4 {{G G G G A A A A A } 10955}
p5 {{P G G G G A A A A } 12943} p5 {{P G G G G A A A A } 12943}
g5 {{G G G G G A A A A } 12943} g5 {{G G G G G A A A A } 12943}
p6 {{P G G G G G A A A } 14970} p6 {{P G G G G G A A A } 14970}
g6 {{G G G G G G A A A } 14970} g6 {{G G G G G G A A A } 14970}
p7 {{P G G G G G G A A } 16971} p7 {{P G G G G G G A A } 16971}
g7 {{G G G G G G G A A } 16971} g7 {{G G G G G G G A A } 16971}
p8 {{P G G G G G G G A } 18937} p8 {{P G G G G G G G A } 18937}
g8 {{G G G G G G G G A } 18937} g8 {{G G G G G G G G A } 18937}
p9 {{P G G G G G G G G } 19925} p9 {{P G G G G G G G G } 19925}
g9 {{G G G G G G G G G } 19925} g9 {{G G G G G G G G G } 19925}
} }
# This list maps the motor names to columns of the # This list maps the motor names to columns of the
# guide_configuration table. # guide_configuration table.
set guide_configuration_columns { set guide_configuration_columns {
c1 c2 c3 c4 c5 c6 c7 c8 c9 c1 c2 c3 c4 c5 c6 c7 c8 c9
} }
} }

View File

@ -1,5 +1,5 @@
set sim_mode [SplitReply [plc_simulation]] set sim_mode [SplitReply [plc_simulation]]
if {$sim_mode == "false"} { if {$sim_mode == "false"} {
MakeAsyncQueue plc_chan SafetyPLC [dict get $::PLC_HOSTPORT HOST] [dict get $::PLC_HOSTPORT PORT] MakeAsyncQueue plc_chan SafetyPLC [dict get $::PLC_HOSTPORT HOST] [dict get $::PLC_HOSTPORT PORT]
MakeSafetyPLC plc plc_chan 0 MakeSafetyPLC plc plc_chan 0
} }

View File

@ -22,7 +22,7 @@ foreach {bm host port} {
} }
# HISTOGRAM SERVER HOST AND PORT # HISTOGRAM SERVER HOST AND PORT
# TODO HV control # TODO HV control
foreach {key host port} { foreach {key host port} {
HMM das1-bilby.nbi.ansto.gov.au 8080 HMM das1-bilby.nbi.ansto.gov.au 8080
HMSTAT das1-bilby.nbi.ansto.gov.au 8081 HMSTAT das1-bilby.nbi.ansto.gov.au 8081

View File

@ -6,7 +6,7 @@ AntiCollisionInstall
namespace eval anticollider { namespace eval anticollider {
variable veto_region variable veto_region
} }
array unset ::anticollider::veto_region array unset ::anticollider::veto_region
array set ::anticollider::veto_region "" array set ::anticollider::veto_region ""
# Don't show 'acscript' call on error. This is done by the anticollider # 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} { proc ::anticollider::loadscript {args} {
variable veto_rules 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} { while {[gets $fh line] >= 0} {
# Skip empty lines and comments # Skip empty lines and comments
if [regexp {^\s*$|^ *#} $line] { if [regexp {^\s*$|^ *#} $line] {
@ -60,7 +60,7 @@ proc ::anticollider::loadscript {args} {
# for the anticollider script. # for the anticollider script.
# #
# @param veto_rules, an anticollider declaration as a list of quote enclosed lines. # @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 # Example\n
# forbid {160 167} for stth when mtth in {87 88}\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 # forbid {0 10} for samx whenall { samrot in {0 5} samy in {0 15} }\n
proc ::anticollider::genveto {veto_rules} { proc ::anticollider::genveto {veto_rules} {
variable veto_region variable veto_region
array unset veto_region array unset veto_region
set lnum 1 set lnum 1
foreach line $veto_rules { 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 # to override the anticollision detection on some conditions
# #
# @param args list of motorname target pairs # @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. # WARNING: This does not handle sequencing. Only run one motor at a time.
# This script requires that an ::anticollider::veto_region has been generated # This script requires that an ::anticollider::veto_region has been generated
# by the ::anticollider::genveto procedure. # by the ::anticollider::genveto procedure.
# #
# The ::anticollider::veto_region is a hash indexed by the names of the motors # The ::anticollider::veto_region is a hash indexed by the names of the motors
# which have been registered with the anticollision module. # which have been registered with the anticollision module.
proc ::anticollider::veto_region_acscript {args} { proc ::anticollider::veto_region_acscript {args} {

View File

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

View File

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

View File

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

View File

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

View File

@ -575,7 +575,7 @@ proc ExtractValue {response lastQueryCmd} {
# update the node last_error_msg # 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_msg $::scobj::bruker_BEC1::bruker_BEC1_errMsg
hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2 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} { # || $::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) # 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 scobj, name of script context object (path to a node)
# @param par, optional parameter (name of the node variable) # @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 # 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 #::scobj::hinitprops $tempobj/sensor nominal_outp_current
hsetprop $scobj_hpath/pwrctrl/statusByte control false 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 # 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 # @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 # name: name of green magnet controller object
# IP: IP address of RF generator moxa box # IP: IP address of RF generator moxa box
# POT: Port number assigned to the generator on the 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 # 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} { proc ::scobj::green::mkGreen {argList} {
# Generate parameter array from the argument list # Generate parameter array from the argument list
@ -84,12 +84,12 @@ proc ::scobj::green::mkGreen {argList} {
} }
MakeSICSObj $pa(NAME) SCT_OBJECT 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) sicslist setatt $pa(NAME) long_name $pa(NAME)
set scobj_hpath /sics/$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/PSU_Vol plain user float
hfactory $scobj_hpath/ramping_rate plain user text hfactory $scobj_hpath/ramping_rate plain user text
hfactory $scobj_hpath/insTarget plain user float hfactory $scobj_hpath/insTarget plain user float
@ -118,7 +118,7 @@ proc ::scobj::green::mkGreen {argList} {
hsetprop $scobj_hpath type part hsetprop $scobj_hpath type part
hsetprop $scobj_hpath control true hsetprop $scobj_hpath control true
hsetprop $scobj_hpath data true hsetprop $scobj_hpath data true
foreach {hpath klass control data nxsave mutable priv alias} { foreach {hpath klass control data nxsave mutable priv alias} {
output NXenvironment true true true true user green_output output NXenvironment true true true true user green_output
PSU_Vol NXenvironment true true true true user green_PSU_Vol 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" hsetprop $scobj_hpath/pollNode oldval "UNKNOWN"
#if {[SplitReply [environment_simulation]]=="false"} { #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} { proc greenVol {{vol ""} args} {
set NAME "green_magnet" set NAME "green_magnet"
@ -156,7 +156,7 @@ proc greenVol {{vol ""} args} {
} else { } else {
if {$vol<[SplitReply [hgetprop /sample/$NAME/output lowlimit]] || \ if {$vol<[SplitReply [hgetprop /sample/$NAME/output lowlimit]] || \
$vol>[SplitReply [hgetprop /sample/$NAME/output uplimit]]} { $vol>[SplitReply [hgetprop /sample/$NAME/output uplimit]]} {
return -code error "setpoint violates limits" return -code error "setpoint violates limits"
} else { } else {
if {$vol > [hval /sample/$NAME/Bmax]} { if {$vol > [hval /sample/$NAME/Bmax]} {
broadcast "Maximum field limit is [hval /sample/$NAME/Bmax], reset again!" broadcast "Maximum field limit is [hval /sample/$NAME/Bmax], reset again!"
@ -164,7 +164,7 @@ proc greenVol {{vol ""} args} {
} else { } else {
#hset /sample/$NAME/setPoint $vol #hset /sample/$NAME/setPoint $vol
set comm "set $vol\r\n" set comm "set $vol\r\n"
sct_green send $comm sct_green send $comm
#after 2000 #after 2000
#while {[hval /sample/$NAME/status] == "busy"} { #while {[hval /sample/$NAME/status] == "busy"} {
# broadcast "Magnet Ramping at [hval /sample/$NAME/output]" # broadcast "Magnet Ramping at [hval /sample/$NAME/output]"
@ -192,7 +192,7 @@ publish greenVol user
#PORT 22 #PORT 22
::scobj::green::mkGreen { ::scobj::green::mkGreen {
name "green_magnet" name "green_magnet"
IP 137.157.204.57 IP 137.157.204.57
PORT 22 PORT 22
tuning 1 tuning 1
interval 3 interval 3

View File

@ -190,8 +190,8 @@ debug_log "rdState $tc_root state=$my_state"
} elseif {$my_state == "STATE_UNIT"} { } elseif {$my_state == "STATE_UNIT"} {
hsetprop $tc_root/ls460_state my_state "STATE_CHNL_SET" hsetprop $tc_root/ls460_state my_state "STATE_CHNL_SET"
hsetprop [sct] unit [sct result] hsetprop [sct] unit [sct result]
hsetprop $tc_root/Display/$my_chan units [SplitReply [hgetprop [sct] unit]] 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 mult [SplitReply [hgetprop [sct] mult]]
hsetprop $tc_root/Display/$my_chan field [SplitReply [hgetprop [sct] field]] hsetprop $tc_root/Display/$my_chan field [SplitReply [hgetprop [sct] field]]
switch -exact [SplitReply [hgetprop [sct] mult]] { switch -exact [SplitReply [hgetprop [sct] mult]] {
"u" { set multiplier 0.000001 } "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"} { } elseif {$my_state == "STATE_I"} {
if { [hval $tc_root/Display/H] == 1 } { if { [hval $tc_root/Display/H] == 1 } {
set my_cmd "I[hval $tc_root/Display/OutputCurrent]" 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]" set my_cmd "I[hval $tc_root/Display/PstntCurrent]"
} }
} elseif {$my_state == "STATE_J"} { } 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 # 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 { switch -exact $field {
"field" {set comm "setF $fieldVal\r\n" "field" {set comm "setF $fieldVal\r\n"
hset $basePath/fieldSetPoint $fieldVal hset $basePath/fieldSetPoint $fieldVal
} }
"rate" {set comm "setR $fieldVal\r\n" "rate" {set comm "setR $fieldVal\r\n"
hset $basePath/fieldSetRate $fieldVal hset $basePath/fieldSetRate $fieldVal
} }
"DiluxTemp" {set comm "setDilutTemp $fieldVal\r\n" "DiluxTemp" {set comm "setDilutTemp $fieldVal\r\n"
hset $basePath/DilutTempSetPoint $fieldVal hset $basePath/DilutTempSetPoint $fieldVal
} }
"HelioxTemp" {set comm "setHelioxTemp $fieldVal\r\n" "HelioxTemp" {set comm "setHelioxTemp $fieldVal\r\n"
hset $basePath/HelioxTempSetPoint $fieldVal hset $basePath/HelioxTempSetPoint $fieldVal
@ -181,7 +181,7 @@ proc ::scobj::magnetic::rdTempStateFunc {basePath field} {
hset $basePath/Temp_s1 $paraArr(T1) hset $basePath/Temp_s1 $paraArr(T1)
hset $basePath/Temp_s2 $paraArr(T2) hset $basePath/Temp_s2 $paraArr(T2)
hset $basePath/Temp_s3 $paraArr(T3) hset $basePath/Temp_s3 $paraArr(T3)
set logText "Displayed Temp : $paraArr(T1) $paraArr(T2) $paraArr(T3)" set logText "Displayed Temp : $paraArr(T1) $paraArr(T2) $paraArr(T3)"
} }
"Heliox" {set s1 [string trimright $replyStr "\n"] "Heliox" {set s1 [string trimright $replyStr "\n"]
@ -222,14 +222,14 @@ proc ::scobj::magnetic::rdTempStateFunc {basePath field} {
## ##
# @brief Make a Magnetic Controller # @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 # name: name of magnetic controller object
# IP: IP address of RF generator moxa box # IP: IP address of RF generator moxa box
# POT: Port number assigned to the generator on the 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 # 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} { proc ::scobj::magnetic::mkMagnetic {argList} {
# Generate parameter array from the argument list # Generate parameter array from the argument list
@ -244,7 +244,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
set hPath /sics/$pa(NAME) 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/magneticFieldCurrent plain user float
hfactory $hPath/magneticFieldTesla plain user float hfactory $hPath/magneticFieldTesla plain user float
@ -274,10 +274,10 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
hset $hPath/magneticFieldTesla 10 hset $hPath/magneticFieldTesla 10
hset $hPath/fieldSetPoint 0 hset $hPath/fieldSetPoint 0
# Setting Heliox Temperature & initiate # Setting Heliox Temperature & initiate
hfactory $hPath/HelioxTempSetPoint plain user float hfactory $hPath/HelioxTempSetPoint plain user float
# This feature needs to implement the Labview code to get current reading of the Heliox tempterature # 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/HelioxTempSetPoint 0
hset $hPath/HelioxTempReading 0 hset $hPath/HelioxTempReading 0
@ -294,7 +294,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
hsetprop $hPath/field oldval UNKNOWN hsetprop $hPath/field oldval UNKNOWN
hsetprop $hPath/HelioxTempReading oldval UNKNOWN hsetprop $hPath/HelioxTempReading oldval UNKNOWN
hsetprop $hPath/DilutTempReading oldval UNKNOWN hsetprop $hPath/DilutTempReading oldval UNKNOWN
# add HDB file # add HDB file
hsetprop $hPath klass environment hsetprop $hPath klass environment
hsetprop $hPath privilege spy 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 # 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)}" { # proc ::histogram_memory::pre_count "{fPath $pa(NAME)}" {
# hset /sics/$fPath/start_magnetic [hval /sics/$fPath/magneticFieldCurrent] # 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) 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/field rdFieldState ::scobj::magnetic::rdFieldStateFunc $hPath
hsetprop $hPath/Temp read ::scobj::magnetic::rqTempFunc "sample" 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" hsetprop $hPath/DilutTempReading rdTempState ::scobj::magnetic::rdTempStateFunc $hPath "Dilut"
if {[SplitReply [environment_simulation]]=="false"} { 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/Temp $pa(INTERVAL)
sct_magnetic poll $hPath/HelioxTempReading $pa(INTERVAL) sct_magnetic poll $hPath/HelioxTempReading $pa(INTERVAL)
sct_magnetic poll $hPath/DilutTempReading $pa(INTERVAL) sct_magnetic poll $hPath/DilutTempReading $pa(INTERVAL)
} }
hsetprop $hPath tuning $pa(TUNING) hsetprop $hPath tuning $pa(TUNING)
@ -372,25 +372,25 @@ proc ::scobj::magnetic::mkMagnetic {argList} {
hfactory $hPath/set_HeaterSwitch plain user text hfactory $hPath/set_HeaterSwitch plain user text
hsetprop $hPath/set_magneticField write ::scobj::magnetic::setting "field" $hPath 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_DiluxTemp write ::scobj::magnetic::setting "DiluxTemp" $hPath
hsetprop $hPath/set_HelioxTemp write ::scobj::magnetic::setting "HelioxTemp" $hPath hsetprop $hPath/set_HelioxTemp write ::scobj::magnetic::setting "HelioxTemp" $hPath
hsetprop $hPath/set_HeaterSwitch write ::scobj::magnetic::setting "HeaterS" $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"} { if {[SplitReply [environment_simulation]]=="false"} {
sct_magnetic write $hPath/set_rate 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_DiluxTemp
sct_magnetic write $hPath/set_HelioxTemp sct_magnetic write $hPath/set_HelioxTemp
sct_magnetic write $hPath/set_HeaterSwitch sct_magnetic write $hPath/set_HeaterSwitch
} }
} }
} }
# Querying/Setting the magnetic field # Querying/Setting the magnetic field
# command is : OxfordSetField fieldValue P ; where "P" is an optinal parameter and if set will change # command is : OxfordSetField fieldValue P ; where "P" is an optinal parameter and if set will change
# to posistent mode after changig the magnetic field # to posistent mode after changig the magnetic field
proc OxfordSetField {{setPoint ""} {mode ""} args} { proc OxfordSetField {{setPoint ""} {mode ""} args} {
set NAME "magnetic" set NAME "magnetic"
@ -405,10 +405,10 @@ proc OxfordSetField {{setPoint ""} {mode ""} args} {
if {$mode == ""} { if {$mode == ""} {
set comm "setF $setPoint\r\n" set comm "setF $setPoint\r\n"
sct_magnetic send $comm sct_magnetic send $comm
} elseif {$mode == "P"} { } elseif {$mode == "P"} {
set comm "setF $setPoint Pers\r\n" set comm "setF $setPoint Pers\r\n"
sct_magnetic send $comm sct_magnetic send $comm
} else { } else {
broadcast "Wrong parameters being provided, check!" broadcast "Wrong parameters being provided, check!"
return 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]" 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 } { } 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]" set err_msg "Invalid Pallet_Idx: [hval $tc_root/Control/Pallet_Idx]"
} }
if { $err_msg != "" } { if { $err_msg != "" } {
sct print "error:$err_msg" sct print "error:$err_msg"
debug_log "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]}] set data [expr {[sct target]}]
if { $data < 1 || $data > 6 } { if { $data < 1 || $data > 6 } {
set err_msg "Invalid Position: $data" set err_msg "Invalid Position: $data"
} }
if { $err_msg != "" } { if { $err_msg != "" } {
sct print "error:$err_msg" sct print "error:$err_msg"
debug_log "error:$err_msg" debug_log "error:$err_msg"
return -code error "$err_msg" return -code error "$err_msg"
} }
if { [hval $tc_root/Control/Direction] == "cw" } { if { [hval $tc_root/Control/Direction] == "cw" } {
set par "0" set par "0"
} elseif { [hval $tc_root/Control/Direction] == "ccw" } { } elseif { [hval $tc_root/Control/Direction] == "ccw" } {
set par "1" set par "1"
} else { } else {
@ -117,13 +117,13 @@ debug_log "chkWrite new data for $tc_root [sct] result=\"$data\""
sct oldval 1 sct oldval 1
} }
if {($data - [sct oldval]) < -2} { if {($data - [sct oldval]) < -2} {
set par "0" set par "0"
} elseif {($data - [sct oldval]) < 0} { } elseif {($data - [sct oldval]) < 0} {
set par "1" set par "1"
} elseif {($data - [sct oldval]) > 3} { } elseif {($data - [sct oldval]) > 3} {
set par "1" set par "1"
} else { } else {
set par "0" set par "0"
} }
} }
if {$data != [sct oldval]} { if {$data != [sct oldval]} {

View File

@ -33,9 +33,9 @@
# PERCENT2:1/0 dBm2:1/0 # PERCENT2:1/0 dBm2:1/0
# m2:1/0 V2:1/0 A2:1/0 DEGK2: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 # G2:1/0 M2:1/0 k2:1/0 OHM2:1/0 Hz2:1/0
# ROTSWITCH:[0-8] # ROTSWITCH:[0-8]
### The return values for nine bytes is undocumented, ### The return values for nine bytes is undocumented,
### they are labelled as X1 to X9 ### they are labelled as X1 to X9
# X[1-9]:? # 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 sicslist setatt $sobjName long_name $sobjName
hfactory /sics/$soState/state plain user text 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 rdStateRep rdStateRep
hsetprop /sics/$soState/state oldval "UNKNOWN" hsetprop /sics/$soState/state oldval "UNKNOWN"
hsetprop /sics/$sobjName read rqVal "reportVal" 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 # 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. # controller implemented as a scriptcontext object in TCL.
# object in TCL. # object in TCL.
# #
@ -43,7 +43,7 @@ proc ::scobj::ls218::getValue {idx cmd chID nextState} {
if {[ catch { if {[ catch {
if {[hpropexists [sct] geterror]} { if {[hpropexists [sct] geterror]} {
hdelprop [sct] geterror hdelprop [sct] geterror
} }
if {$chID == 1} { if {$chID == 1} {
set comm "$cmd $idx" set comm "$cmd $idx"
@ -57,7 +57,7 @@ proc ::scobj::ls218::getValue {idx cmd chID nextState} {
} }
} else { } else {
return -code error "in getValue: error input Ch ID" return -code error "in getValue: error input Ch ID"
} }
sct send "$comm\r\n" sct send "$comm\r\n"
} message ]} { } message ]} {
return -code error "in getValue: $message" return -code error "in getValue: $message"
@ -79,7 +79,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
if {[string first "ASCERR" $replyData] != -1} { if {[string first "ASCERR" $replyData] != -1} {
sct geterror $replyData sct geterror $replyData
return -code error "Error in LS218 Response: $replyData" return -code error "Error in LS218 Response: $replyData"
} elseif {[string length $replyData] < 1} { } elseif {[string length $replyData] < 1} {
return -code error "Error in LS218: no message returned from device" return -code error "Error in LS218: no message returned from device"
} else { } else {
@ -88,7 +88,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
} }
switch -exact $varName { switch -exact $varName {
"alarm" { if {[lindex $fields 0] == 0} { "alarm" { if {[lindex $fields 0] == 0} {
hset $nodeName/offOn off hset $nodeName/offOn off
} else { } else {
hset $nodeName/offOn on hset $nodeName/offOn on
@ -105,7 +105,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName/deadband [lindex $fields 4] hset $nodeName/deadband [lindex $fields 4]
hset $nodeName/latchEnable [lindex $fields 5] hset $nodeName/latchEnable [lindex $fields 5]
} }
"aStatus" { if {[lindex $fields 0] == 0} { "aStatus" { if {[lindex $fields 0] == 0} {
hset $nodeName/highStatus Unactivated hset $nodeName/highStatus Unactivated
} else { } else {
hset $nodeName/highStatus Activated hset $nodeName/highStatus Activated
@ -116,8 +116,8 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName/lowStatus Activated hset $nodeName/lowStatus Activated
} }
} }
"Celsius" { hset $nodeName [lindex $fields 0] "Celsius" { hset $nodeName [lindex $fields 0]
set curValue [lindex $fields 0] set curValue [lindex $fields 0]
} }
"CurveHd" { hset $nodeName/curve [lindex $fields 0] "CurveHd" { hset $nodeName/curve [lindex $fields 0]
hset $nodeName/name [lindex $fields 1] hset $nodeName/name [lindex $fields 1]
@ -127,7 +127,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
3 {hset $nodeName/format Ohm/K} 3 {hset $nodeName/format Ohm/K}
4 {hset $nodeName/format "log Ohm/K"} 4 {hset $nodeName/format "log Ohm/K"}
default {} default {}
} }
hset $nodeName/limitValue [lindex $fields 4] hset $nodeName/limitValue [lindex $fields 4]
switch -exact [lindex $fields 5] { switch -exact [lindex $fields 5] {
1 {hset $nodeName/coefficient negative} 1 {hset $nodeName/coefficient negative}
@ -165,7 +165,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName UNKNOW} default { hset $nodeName UNKNOW}
} }
} }
"Kelvin" { hset $nodeName $fields "Kelvin" { hset $nodeName $fields
#append $logString " Kelvin - $fields;" #append $logString " Kelvin - $fields;"
set curValue $fields set curValue $fields
} }
@ -178,7 +178,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName/xSource UNKNOW} default { hset $nodeName/xSource UNKNOW}
} }
} }
"LinearEquData" { hset $nodeName $fields "LinearEquData" { hset $nodeName $fields
set curValue $fields set curValue $fields
} }
"mnmxSource" { switch -exact [lindex $fields 0] { "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]"} "mnmxValue" { hset $nodeName "[lindex $fields 0] , [lindex $fields 1]"}
"status" { "status" {
# RDGST? chID Reads input status returns an integer with the following meaning # RDGST? chID Reads input status returns an integer with the following meaning
# Bit Weighting StatusIndicator # Bit Weighting StatusIndicator
# 4 16 temp underrange # 4 16 temp underrange
# 5 32 temp overrange # 5 32 temp overrange
# 6 64 units under range # 6 64 units under range
# 7 128 untis over range # 7 128 untis over range
set field [string trimleft $fields 0] set field [string trimleft $fields 0]
if {[string length $field] == 0} { if {[string length $field] == 0} {
set field 0 set field 0
} }
set str "" set str ""
set i [format %x $field] set i [format %x $field]
@ -219,11 +219,11 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
hset $nodeName $str hset $nodeName $str
} }
"SensorUnitValue" { hset $nodeName $fields "SensorUnitValue" { hset $nodeName $fields
#append $logString " SensorUnitValue - $fields;" #append $logString " SensorUnitValue - $fields;"
set curValue $fields set curValue $fields
} }
"data" { hset $nodeName $fields "data" { hset $nodeName $fields
set curValue $fields set curValue $fields
} }
"aOutput" { switch -exact [lindex $fields 0] { "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/highValue [lindex $fields 4]
hset $nodeName/lowValue [lindex $fields 5] 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] "IDN" { hset $nodeName/manufacturer [lindex $fields 0]
hset $nodeName/model [lindex $fields 1] hset $nodeName/model [lindex $fields 1]
@ -273,7 +273,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
default { hset $nodeName/alarmType UNKNOW } 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]} { if {$curValue != [sct oldval]} {
sct oldval $curValue sct oldval $curValue
@ -310,7 +310,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} {
# @param type attribute for HDB tree # @param type attribute for HDB tree
# @param nxsave attribute for HDB tree # @param nxsave attribute for HDB tree
# @param mutable attribute for HDB tree # @param mutable attribute for HDB tree
# @param nxalias attribute for HDB tree # @param nxalias attribute for HDB tree
# @return OK # @return OK
proc createNode {scobj_hpath idx sct_controller cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} { 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} { 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 rdFuncState ${ns}::rdValue $nodeName $varName $idx
hsetprop $nodeName oldval UNKNOW hsetprop $nodeName oldval UNKNOW
} }
if {$pollEnabled == 1} { if {$pollEnabled == 1} {
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
@ -397,13 +397,13 @@ proc ::scobj::ls218::mkLS218 {argList} {
makesctcontroller sct_$pa(NAME) std $pa(IP):$pa(PORT) 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} { foreach chanType {input output relay} {
switch -exact $chanType { switch -exact $chanType {
"input" {set chanList $pa(INPUTCHAN)} "input" {set chanList $pa(INPUTCHAN)}
"output" {set chanList $pa(OUTPUTCHAN)} "output" {set chanList $pa(OUTPUTCHAN)}
"relay" {set chanList $pa(RELAYCHAN)} "relay" {set chanList $pa(RELAYCHAN)}
} }
if {[string length $chanList] > 0} { if {[string length $chanList] > 0} {
set hPath $scobj_hpath/$chanType set hPath $scobj_hpath/$chanType
hfactory $hPath plain user none 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() # 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 # hdbTree set to 1 if a HDB needs to be created at the node
# klass type of klass of the HDB 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 # data type of data of the HDB node
# priv type of previlige level of the HDB node # priv type of previlige level of the HDB node
# type type of the HDB node # type type of the HDB node
@ -453,35 +453,35 @@ proc ::scobj::ls218::mkLS218 {argList} {
########################################################################################################### ###########################################################################################################
set inputNodes { set inputNodes {
{} alarm 1 1 none user {ALARM?} 1 {rdValue} {} alarm 1 1 none user {ALARM?} 1 {rdValue}
alarm offOn 0 0 text user {} 0 {} alarm offOn 0 0 text user {} 0 {}
alarm source 0 0 text user {} 0 {} alarm source 0 0 text user {} 0 {}
alarm highValue 0 0 float user {} 0 {} alarm highValue 0 0 float user {} 0 {}
alarm lowValue 0 0 float user {} 0 {} alarm lowValue 0 0 float user {} 0 {}
alarm deadband 0 0 float user {} 0 {} alarm deadband 0 0 float user {} 0 {}
alarm latchEnable 0 0 int user {} 0 {} alarm latchEnable 0 0 int user {} 0 {}
{} aStatus 1 1 none user {ALARMST?} 1 {rdValue} {} aStatus 1 1 none user {ALARMST?} 1 {rdValue}
aStatus highStatus 0 0 text user {} 0 {} aStatus highStatus 0 0 text user {} 0 {}
aStatus lowStatus 0 0 text user {} 0 {} aStatus lowStatus 0 0 text user {} 0 {}
{} Celsius 1 1 float user {CRDG?} 1 {rdValue} {} Celsius 1 1 float user {CRDG?} 1 {rdValue}
{} CurveHd 1 1 none user {CRVHDR?} 0 {rdValue} {} CurveHd 1 1 none user {CRVHDR?} 0 {rdValue}
CurveHd curve 0 0 text user {} 0 {} CurveHd curve 0 0 text user {} 0 {}
CurveHd name 0 0 text user {} 0 {} CurveHd name 0 0 text user {} 0 {}
CurveHd SN 0 0 text user {} 0 {} CurveHd SN 0 0 text user {} 0 {}
CurveHd format 0 0 text user {} 0 {} CurveHd format 0 0 text user {} 0 {}
CurveHd limitValue 0 0 float user {} 0 {} CurveHd limitValue 0 0 float user {} 0 {}
CurveHd coefficient 0 0 text user {} 0 {} CurveHd coefficient 0 0 text user {} 0 {}
{} CurveID 1 1 text user {INCRV?} 1 {rdValue} {} CurveID 1 1 text user {INCRV?} 1 {rdValue}
{} control 1 1 text user {INPUT?} 1 {rdValue} {} control 1 1 text user {INPUT?} 1 {rdValue}
{} inputType 1 1 text user {INTYPE?} G {rdValue} {} inputType 1 1 text user {INTYPE?} G {rdValue}
{} Kelvin 1 1 float user {KRDG?} 1 {rdValue} {} Kelvin 1 1 float user {KRDG?} 1 {rdValue}
{} Linear 1 1 none user {LINEAR?} 1 {rdValue} {} Linear 1 1 none user {LINEAR?} 1 {rdValue}
Linear varM 0 0 float user {} 0 {} Linear varM 0 0 float user {} 0 {}
Linear xSource 0 0 text user {} 0 {} Linear xSource 0 0 text user {} 0 {}
Linear varB 0 0 float user {} 0 {} Linear varB 0 0 float user {} 0 {}
{} LinearEquData 1 1 float user {LRDG?} 1 {rdValue} {} LinearEquData 1 1 float user {LRDG?} 1 {rdValue}
{} mnmxSource 1 1 text user {MNMX?} 1 {rdValue} {} mnmxSource 1 1 text user {MNMX?} 1 {rdValue}
{} mnmxValue 1 1 text user {MNMXRDG?} 1 {rdValue} {} mnmxValue 1 1 text user {MNMXRDG?} 1 {rdValue}
{} status 1 1 text user {RDGST?} 1 {rdValue} {} status 1 1 text user {RDGST?} 1 {rdValue}
{} SensorUnitValue 1 1 float user {SRDG?} 1 {rdValue} {} SensorUnitValue 1 1 float user {SRDG?} 1 {rdValue}
} }
@ -489,33 +489,33 @@ proc ::scobj::ls218::mkLS218 {argList} {
set outputNodes { set outputNodes {
{} data 1 1 float user {AOUT?} 1 {rdValue} {} data 1 1 float user {AOUT?} 1 {rdValue}
{} aOutput 1 1 none user {ANALOG?} 1 {rdValue} {} aOutput 1 1 none user {ANALOG?} 1 {rdValue}
aOutput bipolarEnable 0 0 text user {} 0 {} aOutput bipolarEnable 0 0 text user {} 0 {}
aOutput monitorMode 0 0 text user {} 0 {} aOutput monitorMode 0 0 text user {} 0 {}
aOutput inputChID 0 0 int user {} 0 {} aOutput inputChID 0 0 int user {} 0 {}
aOutput source 0 0 text user {} 0 {} aOutput source 0 0 text user {} 0 {}
aOutput highValue 0 0 float user {} 0 {} aOutput highValue 0 0 float user {} 0 {}
aOutput lowValue 0 0 float user {} 0 {} aOutput lowValue 0 0 float user {} 0 {}
aOutput manualValue 0 0 int user {} 0 {} aOutput manualValue 0 0 int user {} 0 {}
} }
set relayNodes { set relayNodes {
{} relay 1 1 none user {RELAY?} 1 {rdValue} {} relay 1 1 none user {RELAY?} 1 {rdValue}
relay mode 0 0 text user {} 0 {} relay mode 0 0 text user {} 0 {}
relay input 0 0 int user {} 0 {} relay input 0 0 int user {} 0 {}
relay alarmType 0 0 text user {} 0 {} relay alarmType 0 0 text user {} 0 {}
} }
set otherNodes { set otherNodes {
{} IDN 1 1 none user {*IDN?} 0 {rdValue} {} IDN 1 1 none user {*IDN?} 0 {rdValue}
IDN manufacturer 0 0 text user {} 0 {} IDN manufacturer 0 0 text user {} 0 {}
IDN model 0 0 text user {} 0 {} IDN model 0 0 text user {} 0 {}
IDN serialNumber 0 0 text user {} 0 {} IDN serialNumber 0 0 text user {} 0 {}
IDN firmwareDate 0 0 text user {} 0 {} IDN firmwareDate 0 0 text user {} 0 {}
{} logStatus 1 1 text user {LOG?} 0 {rdValue} {} logStatus 1 1 text user {LOG?} 0 {rdValue}
} }
# create sub-tree for all 8 input channels # 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 { 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 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 { 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 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} { if {[string length $pa(INPUTCHAN)] > 0} {
foreach idx $pa(INPUTCHAN) { foreach idx $pa(INPUTCHAN) {
foreach {item klass control data nxsave mutable priv alias} { 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 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 set hpath /sics/ls218/input/ch$idx/$item
hsetprop $hpath nxalias ls218-input-ch$idx-$alias 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 set hpath /sics/ls218/output/ch$idx/data
hsetprop $hpath nxalias ls218-output-ch$idx-data hsetprop $hpath nxalias ls218-output-ch$idx-data
hsetprop $hpath klass sensor hsetprop $hpath klass sensor
hsetprop $hpath privilege user hsetprop $hpath privilege user
hsetprop $hpath control true hsetprop $hpath control true
hsetprop $hpath data true hsetprop $hpath data true
hsetprop $hpath nxsave true hsetprop $hpath nxsave true
hsetprop $hpath mutable true hsetprop $hpath mutable true
hsetprop $hpath sdsinfo ::nexus::scobj::sdsinfo 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 # Main process call
# @param name short name for the Lakeshore Temp controller 218 # @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 hfactory $scobj_hpath/sensor plain spy none
# Flags ls340 and ls336 indicate whether this command is support by Lakeshore model ls340 and ls336, respectively # 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 { 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 # 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 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 { 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 # helpNotes4user $scobj_hpath $cmdGroup $varName
} }

View File

@ -228,7 +228,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
return -code error "[sct geterror]" return -code error "[sct geterror]"
} }
if { $ramp_rate < 0.001 || $ramp_rate > 10 } { if { $ramp_rate < 0.001 || $ramp_rate > 10 } {
if { $ramp_enable == 1 } { if { $ramp_enable == 1 } {
sct geterror "RAMP bad rate from [sct result]" sct geterror "RAMP bad rate from [sct result]"
return -code error "[sct geterror]" 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 klass parameter
hsetprop $scobj_hpath sdsinfo ::nexus::scobj::sdsinfo hsetprop $scobj_hpath sdsinfo ::nexus::scobj::sdsinfo
set point 1 set point 1
if {0} { if {0} {
::scobj::hinitprops $the_name Loop1 ::scobj::hinitprops $the_name Loop1
set point 2 set point 2
::scobj::hinitprops $the_name Loop2/setpoint ::scobj::hinitprops $the_name Loop2/setpoint

View File

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

View File

@ -232,7 +232,7 @@ debug_log "setValue $dev:16:$cmd $par"
hset $tc_root/Loop1/setpoint [sct target] hset $tc_root/Loop1/setpoint [sct target]
return idle return idle
} }
proc setPoint {tc_root nextState cmd} { proc setPoint {tc_root nextState cmd} {
set dev "[hval $tc_root/dev_id]" set dev "[hval $tc_root/dev_id]"
set par [sct target] set par [sct target]
@ -417,7 +417,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
set scobj_hpath /sics/$tempobj set scobj_hpath /sics/$tempobj
# #
# These addresses are modbus addresses on the RUI/gateway over two devices # 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 # 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. # 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" hset $tc_root/status "busy"
return idle return idle
} }
# Get the High Limit Point # Get the High Limit Point
proc getLimHi {tc_root nextState cmd} { proc getLimHi {tc_root nextState cmd} {
set d1 [hval $tc_root/Loop1/limit_hi] 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] hset $tc_root/Loop4/limit_hi [sct target]
return idle return idle
} }
# Set the All Set Points # Set the All Set Points
proc setAll {tc_root nextState cmd} { proc setAll {tc_root nextState cmd} {
debug_log "setAll $tc_root $nextState $cmd [sct]=[sct target] [hget [sct]]" 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]] hset $tc_root/device_control/previous_error [expr [sct target] - [hval $tc_root/samplesensor]]
return idle return idle
} }
proc setPoint {tc_root nextState cmd} { proc setPoint {tc_root nextState cmd} {
set dev "[hval $tc_root/dev_id]" set dev "[hval $tc_root/dev_id]"
set par [sct target] 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/Loop2 plain spy none
hfactory $scobj_hpath/Loop3 plain spy none hfactory $scobj_hpath/Loop3 plain spy none
hfactory $scobj_hpath/Loop4 plain spy none hfactory $scobj_hpath/Loop4 plain spy none
foreach {cmdGroup varName readable writable drivable dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand { 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 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 tc1 tolerance 10
} }
sicslist setatt tc1 environment_name tc1 sicslist setatt tc1 environment_name tc1
sicslist setatt tc1 long_name control_sensor_reading sicslist setatt tc1 long_name control_sensor_reading
::environment::mkenvinfo tc1 {ramprate {priv user} powerlimit {priv manager} } ::environment::mkenvinfo tc1 {ramprate {priv user} powerlimit {priv manager} }
#::environment::mkenvinfo tc1 {heateron {priv user} range {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 { set NXaperture_template [subst -novariables {
NXaperture { NXaperture {
$name { $name {
sobjlist {$paramarr(material) $paramarr(description)} sobjlist {$paramarr(material) $paramarr(description)}
[ set NXgeometry_template ] [ 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, # 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. # 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 # 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. # 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 # @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 { foreach var $v {
if {[string index $var 0] == "$"} { if {[string index $var 0] == "$"} {
set vn [string range $var 1 end] set vn [string range $var 1 end]
upvar $level $vn lvar upvar $level $vn lvar
if [info exists lvar] { if [info exists lvar] {
foreach sobj $lvar { foreach sobj $lvar {
lappend [getatt $sobj type]_list $sobj lappend [getatt $sobj type]_list $sobj
@ -244,7 +244,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
array set linkinfo $v array set linkinfo $v
if {[string index $linkinfo(target) 0] == "$"} { if {[string index $linkinfo(target) 0] == "$"} {
set vn [string range $linkinfo(target) 1 end] set vn [string range $linkinfo(target) 1 end]
upvar $level $vn lvar upvar $level $vn lvar
if [info exists lvar] { if [info exists lvar] {
set linktarget $lvar set linktarget $lvar
} }
@ -253,7 +253,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
} }
if {[string index $linkinfo(nxalias) 0] == "$"} { if {[string index $linkinfo(nxalias) 0] == "$"} {
set vn [string range $linkinfo(nxalias) 1 end] set vn [string range $linkinfo(nxalias) 1 end]
upvar $level $vn avar upvar $level $vn avar
if [info exists avar] { if [info exists avar] {
set linkname $avar set linkname $avar
} }
@ -268,7 +268,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
default { default {
if {[string range $n 0 1] == "NX"} { if {[string range $n 0 1] == "NX"} {
set node $n set node $n
} elseif {[string index $n 0] == "$"} { } elseif {[string index $n 0] == "$"} {
set vn [string range $n 1 end] set vn [string range $n 1 end]
upvar $level $vn lvar upvar $level $vn lvar
if [info exists 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 publish $st_name mugger
sicslist setatt $st_name klass $klass sicslist setatt $st_name klass $klass
sicslist setatt $st_name control $control 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 kind "hdb_subtree"
sicslist setatt $st_name long_name "@none" sicslist setatt $st_name long_name "@none"
sicslist setatt $st_name data "true" sicslist setatt $st_name data "true"
sicslist setatt $st_name nxsave "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 hpath, Basepath for subtree
# @param object, SICS object name # @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 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. # @param makenode, type of node to make. Optional, default = @none.
proc ::hdb::add_subtree {hpath subtree {object @none} {type @none} {makenode @none}} { proc ::hdb::add_subtree {hpath subtree {object @none} {type @none} {makenode @none}} {
set ::errorInfo "" set ::errorInfo ""
set SICStypes {sicsvariable macro} set SICStypes {sicsvariable macro}
if [catch { if [catch {
switch $makenode { switch $makenode {
"@none" { "@none" {
foreach {n v} $subtree { foreach {n v} $subtree {
if {[lsearch -exact $::nexus_classes $n] >= 0} { 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} { if {$item==$object} {
error "ERROR: Infinite recursion, cannot add $item as a node to it's own hdb subtree" 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} { if {$type != $objtype} {
error "ERROR: Specified type of '$type' doesn't match actual type, '$objtype', for $item" 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 array unset arg_array
set catch_status [ catch { 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)]} { if {[info exists arg_array(path)] && [info exists arg_array(prop_list)]} {
add_hpath $basePath $arg_array(path) add_hpath $basePath $arg_array(path)
if {$basePath == "/"} { if {$basePath == "/"} {
@ -499,7 +499,7 @@ proc ::hdb::add_node {basePath args} {
array set attribute [::utility::normalattlist $node_name] array set attribute [::utility::normalattlist $node_name]
switch $arg_array(kind) { switch $arg_array(kind) {
command { command {
# A command is a macro, node=macro name # A command is a macro, node=macro name
set command $node_name set command $node_name
set cmd_path [add_command $basePath $command] set cmd_path [add_command $basePath $command]
set node_path $cmd_path set node_path $cmd_path
@ -508,7 +508,7 @@ proc ::hdb::add_node {basePath args} {
if {[string length [info procs ${command}_parameters]] > 0} { if {[string length [info procs ${command}_parameters]] > 0} {
${command}_parameters add_node $cmd_path ${command}_parameters add_node $cmd_path
} else { } 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} { if {[string length [info procs ${command}_feedback]] > 0} {
add_hpath $cmd_path feedback add_hpath $cmd_path feedback
@ -517,7 +517,7 @@ proc ::hdb::add_node {basePath args} {
} else { } else {
add_hpath $cmd_path feedback add_hpath $cmd_path feedback
hsetprop $cmd_path/feedback type part 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 { 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) #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] hsetprop $node_path units [normalgetatt $node_name units]
} }
if {[info exists arg_array(prop_list)]} { if {[info exists arg_array(prop_list)]} {
@ -569,10 +569,10 @@ proc ::hdb::add_node {basePath args} {
hsetprop $node_path $prop $pval hsetprop $node_path $prop $pval
} }
} }
if {[info exists attribute(depends)]} { if {[info exists attribute(depends)]} {
foreach dep [split [normalgetatt $node_name depends] , ] { foreach dep [split [normalgetatt $node_name depends] , ] {
set sobjadd_state(depends) true set sobjadd_state(depends) true
::hdb::sobjadd $node_path $dep ::hdb::sobjadd $node_path $dep
set sobjadd_state(depends) false 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 nxsave $cmd_atts(nxsave)
hsetprop $cmd_path sicsdev $cmd_atts(id) hsetprop $cmd_path sicsdev $cmd_atts(id)
return $cmd_path return $cmd_path
} }
## ##
# @brief Retrieve the list of attributes for the given sics object # @brief Retrieve the list of attributes for the given sics object
@ -624,7 +624,7 @@ proc ::hdb::attlist {sicsobj} {
foreach att [tolower_sicslist $sicsobj] { foreach att [tolower_sicslist $sicsobj] {
lappend atts [split [string range $att 0 end-1] =] lappend atts [split [string range $att 0 end-1] =]
} }
return [join $atts] return [join $atts]
} message ] { } message ] {
if {$::errorCode=="NONE"} {return $message} if {$::errorCode=="NONE"} {return $message}
return -code error $message return -code error $message
@ -722,7 +722,7 @@ proc ::hdb::sobjadd {hpath sobj args} {
if {[info exists sobjatt(group)]} { if {[info exists sobjatt(group)]} {
set hpath [add_hpath $hpath $sobjatt(group)] set hpath [add_hpath $hpath $sobjatt(group)]
if {[catch {hsetprop $hpath type part} err]} {clientput $err error} if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
} }
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} { 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)] 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} 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} if {[catch {hsetprop $node_path privilege $sobjatt(privilege)} err]} {clientput $err error}
} else { } else {
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
} }
} }
node { node {
} }
singlecounter { singlecounter {
# TODO # TODO
todo_msg "$sobjatt(type) case, add $sobj to $hpath" todo_msg "$sobjatt(type) case, add $sobj to $hpath"
} }
histmem { histmem {
if {[info exists sobjatt(group)]} { if {[info exists sobjatt(group)]} {
set hpath [add_hpath $hpath $sobjatt(group)] set hpath [add_hpath $hpath $sobjatt(group)]
if {[catch {hsetprop $hpath type part} err]} {clientput $err error} if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
} }
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} { 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)] 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} 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)]} { if {[info exists sobjatt(group)]} {
set hpath [add_hpath $hpath $sobjatt(group)] set hpath [add_hpath $hpath $sobjatt(group)]
hsetprop $hpath type part hsetprop $hpath type part
} }
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} { 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)] set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)]
hsetprop $node_path sicsdev $sobj hsetprop $node_path sicsdev $sobj
@ -772,18 +772,18 @@ proc ::hdb::sobjadd {hpath sobj args} {
hsetprop $node_path privilege $sobjatt(privilege) hsetprop $node_path privilege $sobjatt(privilege)
} else { } else {
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
} }
} }
nxscript { nxscript {
# TODO # TODO
todo_msg "$sobjatt(type) case, add $sobj to $hpath" todo_msg "$sobjatt(type) case, add $sobj to $hpath"
} }
sicsdata { sicsdata {
# TODO # TODO
todo_msg "$sobjatt(type) case, add $sobj to $hpath" todo_msg "$sobjatt(type) case, add $sobj to $hpath"
} }
scanobject { scanobject {
# TODO # TODO
todo_msg "$sobjatt(type) case, add $sobj to $hpath" todo_msg "$sobjatt(type) case, add $sobj to $hpath"
} }
# TODO Can this be replaced with a sct_* glob? # 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 # @param instdict name of the instrument dictionary structure
# #
@ -853,7 +853,7 @@ proc ::hdb::prune {instdict} {
while {[expr [llength $candidates]] > 0} { while {[expr [llength $candidates]] > 0} {
set new_candidates "" set new_candidates ""
foreach name $candidates { foreach name $candidates {
array unset dictval array unset dictval
array set dictval $dictarr($name) array set dictval $dictarr($name)
if {[lsearch $dictval(property) nxvgroup] >= 0} { if {[lsearch $dictval(property) nxvgroup] >= 0} {
# Link targets are not candidates for pruning # 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 hpath The save state of the nodes below this path will be set
# @param mode true or false # @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 # to set this
proc ::hdb::set_save {hpath mode {top true}} { proc ::hdb::set_save {hpath mode {top true}} {
if [ catch { if [ catch {
@ -956,7 +956,7 @@ if [ catch {
foreach ps [lrange [split [string trim $hnode /] /] 0 end-1] { foreach ps [lrange [split [string trim $hnode /] /] 0 end-1] {
set hp $hp/$ps set hp $hp/$ps
hsetprop $hp nxsave true hsetprop $hp nxsave true
} }
} }
} else { } else {
hsetprop $hnode nxsave $mode hsetprop $hnode nxsave $mode

View File

@ -1,5 +1,5 @@
# The attributes and values for sics objects and instrument dictionaries must comply # The attributes and values for sics objects and instrument dictionaries must comply
# with the following lists. # with the following lists.
set boolean {true false} set boolean {true false}
# INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION # INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION
@ -49,7 +49,7 @@ set chopperadapter_attlist [subst {
sdsinfo {print} sdsinfo {print}
nxalias {text} nxalias {text}
mutable [subst {{$boolean}}] mutable [subst {{$boolean}}]
}] }]
set environment_controller_attlist [subst { set environment_controller_attlist [subst {
$sobj_attlist $sobj_attlist
@ -59,12 +59,12 @@ set environment_controller_attlist [subst {
set histmem_attlist [subst { set histmem_attlist [subst {
$sobj_attlist $sobj_attlist
mutable [subst {{$boolean}}] mutable [subst {{$boolean}}]
}] }]
# A macro can be attached to an hdb node as a command or a script # A macro can be attached to an hdb node as a command or a script
set macro_attlist [subst { set macro_attlist [subst {
$sobj_attlist $sobj_attlist
}] }]
set motor_attlist [subst { set motor_attlist [subst {
$sobj_attlist $sobj_attlist
@ -72,40 +72,40 @@ set motor_attlist [subst {
savecmd {print} savecmd {print}
nxalias {text} nxalias {text}
mutable [subst {{$boolean}}] mutable [subst {{$boolean}}]
}] }]
set configurablevirtualmotor_attlist [subst { set configurablevirtualmotor_attlist [subst {
$motor_attlist $motor_attlist
}] }]
set nxscript_attlist [subst { set nxscript_attlist [subst {
$sobj_attlist $sobj_attlist
}] }]
set scanobject_attlist [subst { set scanobject_attlist [subst {
$sobj_attlist $sobj_attlist
}] }]
set sct_object_attlist [subst { set sct_object_attlist [subst {
$sobj_attlist $sobj_attlist
}] }]
set sicsdata_attlist [subst { set sicsdata_attlist [subst {
$sobj_attlist $sobj_attlist
mutable [subst {{$boolean}}] mutable [subst {{$boolean}}]
}] }]
set sicsvariable_attlist [subst { set sicsvariable_attlist [subst {
$sobj_attlist $sobj_attlist
mutable [subst {{$boolean}}] mutable [subst {{$boolean}}]
}] }]
set singlecounter_attlist [subst { set singlecounter_attlist [subst {
$sobj_attlist $sobj_attlist
mutable [subst {{$boolean}}] mutable [subst {{$boolean}}]
}] }]
# INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION # 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 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 { set dict_privilege_list {
@ -115,7 +115,7 @@ if 1 {
# uniformly. # uniformly.
set dict_datatype_list { @none NX_CHAR NX_FLOAT32 NX_INT32 } 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 { set dict_property_list [subst {
{data control nxsave} {$boolean} {data control nxsave} {$boolean}
klass {@none $nexus_classes} klass {@none $nexus_classes}

View File

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

View File

@ -11,7 +11,7 @@ namespace eval histogram_memory {
variable state variable state
if [ catch { if [ catch {
#set deg_per_radian [SplitReply [deg_per_rad]] #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 max_chan [OAT_TABLE X -getdata MAX_CHAN]
set bb_zero_offset [expr -1*($max_chan-1)] set bb_zero_offset [expr -1*($max_chan-1)]
set det_width_mm [SplitReply [detector_active_width_mm]] 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 # Instrument specific X and Y dimension names
variable INST_NXC variable INST_NXC
variable INST_NYC variable INST_NYC
if [catch { if [catch {
$HMOBJ configure read_data_period_number 0 $HMOBJ configure read_data_period_number 0
@ -49,67 +49,67 @@ proc ::histogram_memory::select_read_type {type} {
$HMOBJ configure rank 2 $HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]] $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" set hmm_ext "_xt"
} }
"HISTOGRAM_YT" - "HISTOPERIOD_YT" { "HISTOGRAM_YT" - "HISTOPERIOD_YT" {
$HMOBJ configure rank 2 $HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]] $HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] $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" set hmm_ext "_ty"
} }
"HISTOGRAM_X" - "HISTOPERIOD_X" { "HISTOGRAM_X" - "HISTOPERIOD_X" {
$HMOBJ configure rank 1 $HMOBJ configure rank 1
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $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" set hmm_ext "_x"
} }
"HISTOGRAM_Y" - "HISTOPERIOD_Y" { "HISTOGRAM_Y" - "HISTOPERIOD_Y" {
$HMOBJ configure rank 1 $HMOBJ configure rank 1
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NYC]] $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" set hmm_ext "_y"
} }
"HISTOGRAM_T" - "HISTOPERIOD_T" { "HISTOGRAM_T" - "HISTOPERIOD_T" {
$HMOBJ configure rank 1 $HMOBJ configure rank 1
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]] $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" set hmm_ext "_t"
} }
"TOTAL_HISTOGRAM_XY" { "TOTAL_HISTOGRAM_XY" {
$HMOBJ configure rank 2 $HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] $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" set hmm_ext "_total_xy"
} }
"TOTAL_HISTOGRAM_XT" { "TOTAL_HISTOGRAM_XT" {
$HMOBJ configure rank 2 $HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]] $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" set hmm_ext "_total_xt"
} }
"TOTAL_HISTOGRAM_YT" { "TOTAL_HISTOGRAM_YT" {
$HMOBJ configure rank 2 $HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]] $HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] $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" set hmm_ext "_total_ty"
} }
"TOTAL_HISTOGRAM_XP" { "TOTAL_HISTOGRAM_XP" {
$HMOBJ configure rank 2 $HMOBJ configure rank 2
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
$HMOBJ configure dim1 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]] $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" set hmm_ext "_total_xp"
} }
"TOTAL_HISTOGRAM_YP" { "TOTAL_HISTOGRAM_YP" {
$HMOBJ configure rank 2 $HMOBJ configure rank 2
$HMOBJ configure dim0 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]] $HMOBJ configure dim0 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] $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" set hmm_ext "_total_py"
} }
"TOTAL_HISTOGRAM_X" { "TOTAL_HISTOGRAM_X" {
@ -149,14 +149,14 @@ publish ::histogram_memory::select_read_type user
## ##
# @brief Instrument specific configurations can redefine this # @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. # common data types for the histogram memory.
proc ::histogram_memory::is_select_read_type {type} { proc ::histogram_memory::is_select_read_type {type} {
variable HMOBJ variable HMOBJ
# Instrument specific X and Y dimension names # Instrument specific X and Y dimension names
variable INST_NXC variable INST_NXC
variable INST_NYC variable INST_NYC
return "notfound" return "notfound"
} }
publish ::histogram_memory::is_select_read_type user 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. # specific type then set a common type.
proc ::histogram_memory::hmm_set_read_type {type} { proc ::histogram_memory::hmm_set_read_type {type} {
variable HMOBJ variable HMOBJ
if [ catch { if [ catch {
set hmm_ext [is_select_read_type $type] set hmm_ext [is_select_read_type $type]
if {$hmm_ext == "notfound"} { if {$hmm_ext == "notfound"} {
@ -205,7 +205,7 @@ proc ::histogram_memory::set_axes {typelist} {
# Instrument specific X and Y dimension names # Instrument specific X and Y dimension names
variable INST_NXC variable INST_NXC
variable INST_NYC variable INST_NYC
if [catch { if [catch {
set signal 1 set signal 1
foreach type $typelist { foreach type $typelist {
@ -555,7 +555,7 @@ hsetprop $HP_HMM data true
hsetprop $HP_HMM klass parameter hsetprop $HP_HMM klass parameter
hsetprop $HP_HMM nxalias hmscobj_hmm hsetprop $HP_HMM nxalias hmscobj_hmm
hsetprop $HP_HMM sicsdev none hsetprop $HP_HMM sicsdev none
#hsetprop /sics/hmscobj/data #hsetprop /sics/hmscobj/data
#sicspoll add /sics/hmscobj/data hdb #sicspoll add /sics/hmscobj/data hdb
sicslist setatt $HMSCOBJ kind scobj 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. # @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 # This controller implements voltage ramping and always reads the current value before
# attempting to set the new voltage. # attempting to set the new voltage.
@ -28,10 +28,10 @@ proc ::scobj::dethvps::rqValue {nextSubState cmd} {
# #
# @param vPath, Hdb node path for the voltage. # @param vPath, Hdb node path for the voltage.
proc ::scobj::dethvps::rdValue {vPath} { proc ::scobj::dethvps::rdValue {vPath} {
variable RAMPIDLE variable RAMPIDLE
variable RAMPSTOP variable RAMPSTOP
variable RAMPSTART variable RAMPSTART
variable RAMPBUSY variable RAMPBUSY
variable MAXPOTVAL variable MAXPOTVAL
variable RAMPINTEREST variable RAMPINTEREST
@ -98,10 +98,10 @@ proc ::scobj::dethvps::rdValue {vPath} {
## ##
# @brief Checks the target voltage and sets the ramping superstate and ramp direction. # @brief Checks the target voltage and sets the ramping superstate and ramp direction.
proc ::scobj::dethvps::setValue {nextSubState} { proc ::scobj::dethvps::setValue {nextSubState} {
variable RAMPIDLE variable RAMPIDLE
variable RAMPSTOP variable RAMPSTOP
variable RAMPSTART variable RAMPSTART
variable RAMPBUSY variable RAMPBUSY
set catch_status [ catch { set catch_status [ catch {
set par [sct target] set par [sct target]
@ -135,10 +135,10 @@ proc ::scobj::dethvps::setValue {nextSubState} {
## ##
# @brief Checks that a command has been acknowledged # @brief Checks that a command has been acknowledged
proc ::scobj::dethvps::getACK {} { proc ::scobj::dethvps::getACK {} {
variable RAMPIDLE variable RAMPIDLE
variable RAMPSTOP variable RAMPSTOP
variable RAMPSTART variable RAMPSTART
variable RAMPBUSY variable RAMPBUSY
set catch_status [ catch { set catch_status [ catch {
set currSuperState [sct ramping] set currSuperState [sct ramping]
@ -173,11 +173,11 @@ proc ::scobj::dethvps::getACK {} {
# #
# @param cmd, The set voltage command # @param cmd, The set voltage command
proc ::scobj::dethvps::ramping {cmd} { proc ::scobj::dethvps::ramping {cmd} {
variable RAMPIDLE variable RAMPIDLE
variable RAMPSTOP variable RAMPSTOP
variable RAMPSTART variable RAMPSTART
variable RAMPBUSY variable RAMPBUSY
variable MINRAMPINTERVAL variable MINRAMPINTERVAL
set catch_status [ catch { set catch_status [ catch {
set rampstep [sct rampstep] set rampstep [sct rampstep]
@ -213,10 +213,10 @@ proc ::scobj::dethvps::ramping {cmd} {
## ##
# @brief Command interface for voltage controller # @brief Command interface for voltage controller
proc ::scobj::dethvps::drvCmd {} { proc ::scobj::dethvps::drvCmd {} {
variable RAMPIDLE variable RAMPIDLE
variable RAMPSTOP variable RAMPSTOP
variable RAMPSTART variable RAMPSTART
variable RAMPBUSY variable RAMPBUSY
variable potValPath variable potValPath
set catch_status [ catch { set catch_status [ catch {

View File

@ -44,9 +44,9 @@ namespace eval ::scobj::jogmotor {
} }
return idle return idle
} }
proc jogCmd {sct_controller axis} { proc jogCmd {sct_controller axis} {
variable cmd_table variable cmd_table
set jcmd [string tolower [lindex [sct target] 0]] set jcmd [string tolower [lindex [sct target] 0]]
switch $jcmd [subst { switch $jcmd [subst {
@ -76,7 +76,7 @@ namespace eval ::scobj::jogmotor {
} }
} }
# TODO Check thread 0 and motion control disabled? # TODO Check thread 0 and motion control disabled?
proc check_motor {} { proc check_motor {} {
set val [sct target] set val [sct target]
@ -171,8 +171,8 @@ proc updatestatus {} {
namespace import ::scobj::jogmotor::* namespace import ::scobj::jogmotor::*
## ##
# Eg # Eg
# hfactory /controllers plain spy none # hfactory /controllers plain spy none
# #
# makesctcontroller /controllers/sct_mc1 std localhost:62034 # makesctcontroller /controllers/sct_mc1 std localhost:62034
# #
# mk_sct_jogmotor sct_mc1 chi index { 1 0 2 15 3 20 } # 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 {} { proc ::scobj::positmotor::noResponse {} {
return idle return idle
} }
## ##
# @brief Creates a controller which can drive motors to discrete labelled positions # @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 lappend ilist $i
} }
sicslist setatt $name values [join $ilist ","] sicslist setatt $name values [join $ilist ","]
sicslist setatt $name klass $klass sicslist setatt $name klass $klass
sicslist setatt $name long_name $name sicslist setatt $name long_name $name
hfactory /sics/$name/precision script "getmotpar $motor precision" "$motor precision " float 1 hfactory /sics/$name/precision script "getmotpar $motor precision" "$motor precision " float 1
hsetprop /sics/$name read ::scobj::positmotor::reqVal report $motor hsetprop /sics/$name read ::scobj::positmotor::reqVal report $motor
@ -137,7 +137,7 @@ proc ::scobj::positmotor::mot2ID {mot precision table} {
namespace import ::scobj::positmotor::* namespace import ::scobj::positmotor::*
## ##
# Eg # Eg
# #
# makesctcontroller sct_mc3 std localhost:62034 # makesctcontroller sct_mc3 std localhost:62034
# #
# mkPosit sct_mc3 diameter float apx sample {2.5 0 5.0 -23 7.5 -47} # 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 {} { proc ::nexus::init {} {
variable state variable state
variable nexusdic variable nexusdic
@ -298,7 +298,7 @@ proc ::nexus::isValidFileType {type} {
# state(file,open) true # state(file,open) true
# /data/currentfiletype == UNKNOWN # /data/currentfiletype == UNKNOWN
proc ::nexus::newfile {type {namestyle data}} { 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. # @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 # This function provides the top level call to the recursive ::nexus::savetree
# function, it should only be called by the ::nexus::save command. # function, it should only be called by the ::nexus::save command.
# #
@ -544,8 +544,8 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} {
} else { } else {
::nexus::CallESProcs ::nexus::CallESProcs
# timestamp force [expr {[clock seconds] - $start_seconds_array($data_label)}] # timestamp force [expr {[clock seconds] - $start_seconds_array($data_label)}]
timestamp force [expr {[clock seconds] - $start_seconds}] timestamp force [expr {[clock seconds] - $start_seconds}]
dataFileName force $currFilename($data_label) dataFileName force $currFilename($data_label)
file_status force $file_states(O) file_status force $file_states(O)
::nexus::nxreopenfile $currFilename($data_label) ::nexus::nxreopenfile $currFilename($data_label)
@ -558,7 +558,7 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} {
} message ] { } message ] {
nxscript puttext data_save_error "([info level 0]) $message" nxscript puttext data_save_error "([info level 0]) $message"
set caught_exception true set caught_exception true
} }
if {[info exists data_label] && [info exists currFilename($data_label)]} { if {[info exists data_label] && [info exists currFilename($data_label)]} {
::nexus::nxclosefile $currFilename($data_label) ::nexus::nxclosefile $currFilename($data_label)
file_status force $file_states(C) file_status force $file_states(C)
@ -601,7 +601,7 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} {
} }
} message ] { } message ] {
return -code error "([info level 0]) $message" return -code error "([info level 0]) $message"
} }
} }
## ##
@ -631,21 +631,21 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} {
} }
} message ] { } message ] {
return -code error "([info level 0]) $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 # @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 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} { proc ::nexus::savetree {hpath pt filestatus} {
set caught_exception false set caught_exception false
foreach child [hlist /$hpath] { foreach child [hlist /$hpath] {
if [ catch { if [ catch {
array unset p_arr 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")} { if {([info exists p_arr(type)] == 0) || ($p_arr(type) != "nxvgroup")} {
set data_type [lindex [split [hinfo /$hpath/$child] , ] 0] set data_type [lindex [split [hinfo /$hpath/$child] , ] 0]
if {[info exists p_arr(data)] && ($p_arr(data) == true) && ($p_arr(nxsave) == true) } { 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 # @brief Recursive portion of gen_nxdict function
# #
# @param hpath hdb subtree path to generate dictionary fragment from, must not be "/" # @param hpath hdb subtree path to generate dictionary fragment from, must not be "/"
# @param dictPath parent path for nexus dictionary fragment. # @param dictPath parent path for nexus dictionary fragment.
# @param name name for child dictionary path # @param name name for child dictionary path
# @param nxc Nexus class name # @param nxc Nexus class name
# #
# If the klass name doesn't begin with NX then construct the SDS name by replacing '/' with '_' in the # 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 # @see gen_nxdict
proc ::nexus::_gen_nxdict {hpath dictPath name nxc} { proc ::nexus::_gen_nxdict {hpath dictPath name nxc} {
@ -707,11 +707,11 @@ proc ::nexus::_gen_nxdict {hpath dictPath name nxc} {
if {$nxc == "NXentry"} { if {$nxc == "NXentry"} {
::nexus::_gen_nxdict $hpath/$child $dictPath $child $nxclass ::nexus::_gen_nxdict $hpath/$child $dictPath $child $nxclass
} else { } 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] set data_type [lindex [split [hinfo /$hpath] , ] 0]
if {$data_type != "none" || $p_arr(type) == "nxvgroup"} { if {$data_type != "none" || $p_arr(type) == "nxvgroup"} {
#XXX Do we need to check data_type here. This would skip NXVGROUP nodes #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 # @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 # 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 baseName The base name of the file without suffix
# @param nexusdic Name of the nexus dictionary that will be created. # @param nexusdic Name of the nexus dictionary that will be created.
# @return Full path to the nexus dictionary. # @return Full path to the nexus dictionary.
@ -780,7 +780,7 @@ proc ::nexus::gen_nxdict {nexusdic} {
variable nxdictionary variable nxdictionary
set catch_status [catch { set catch_status [catch {
set nxdict_path $cfPath(nexus)/$nexusdic set nxdict_path $cfPath(nexus)/$nexusdic
array unset nxdictionary array unset nxdictionary
foreach hp [hlist /] { foreach hp [hlist /] {
if {[hpropexists /$hp data] } { if {[hpropexists /$hp data] } {
if {[hgetpropval /$hp data] == true} { if {[hgetpropval /$hp data] == true} {
@ -825,15 +825,15 @@ proc ::nexus::gen_nxdict {nexusdic} {
sicslist setatt $sobj savecmd ::nexus::motor::save sicslist setatt $sobj savecmd ::nexus::motor::save
sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo 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 savecmd ::nexus::motor::save
sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo 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 savecmd ::nexus::motor::save
sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo 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 savecmd ::nexus::histmem::save
sicslist setatt $sobj sdsinfo ::nexus::histmem::sdsinfo sicslist setatt $sobj sdsinfo ::nexus::histmem::sdsinfo
} }
@ -871,7 +871,7 @@ proc ::nexus::gen_nxdict {nexusdic} {
# #
# @param dtype hdb data type # @param dtype hdb data type
# @return Nexus data type # @return Nexus data type
proc ::nexus::hdb2nx_type {dtype} { proc ::nexus::hdb2nx_type {dtype} {
switch $dtype { switch $dtype {
int {return NX_INT32} int {return NX_INT32}
intar {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 # 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} { proc ::nexus::histmem::save {hm nxalias hpath data_type filestatus args} {
variable HMOBJ variable HMOBJ
@ -1313,7 +1313,7 @@ proc ::nexus::script::sdsinfo {sdsName data_type sobj args} {
if {$param(mutable) == true} { if {$param(mutable) == true} {
set sdsStr "$sdsName -type $dtype $units_att -rank 2 -dim {-1,$size}" set sdsStr "$sdsName -type $dtype $units_att -rank 2 -dim {-1,$size}"
} else { } else {
set sdsStr "$sdsName -type $dtype $units_att -rank 1 -dim {$size}" set sdsStr "$sdsName -type $dtype $units_att -rank 1 -dim {$size}"
} }
} }
} message ] { } message ] {
@ -1326,12 +1326,12 @@ namespace import ::nexus::*
foreach expt $::nexus::exports { foreach expt $::nexus::exports {
publish $expt user publish $expt user
sicslist setatt $expt privilege internal sicslist setatt $expt privilege internal
} }
# TODO Return filename from nxcreatefile and call nxreopen nxclose etc # TODO Return filename from nxcreatefile and call nxreopen nxclose etc
# dictalias is a global hash which records the alias which the value of # 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. # objects name. It is useful for making links to datasets.
# dim0 = vertical axis on detector # dim0 = vertical axis on detector
# dim1 = horizontal 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 { 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]" 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 } { } 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]" set err_msg "Invalid Pallet_Idx: [hval $tc_root/Control/Pallet_Idx]"
} }
if { $err_msg != "" } { if { $err_msg != "" } {
sct print "error:$err_msg" sct print "error:$err_msg"
debug_log "error:$err_msg" debug_log "error:$err_msg"

View File

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

View File

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

View File

@ -18,9 +18,9 @@
# This configuration does not create a GumTree interface or let you # This configuration does not create a GumTree interface or let you
# save nexus data files. # save nexus data files.
# Required by server_config.tcl # Required by server_config.tcl
VarMake Instrument Text Internal VarMake Instrument Text Internal
Instrument bare_dingo Instrument bare_dingo
Instrument lock Instrument lock
#START SERVER CONFIGURATION SECTION #START SERVER CONFIGURATION SECTION
@ -30,24 +30,24 @@ source server_config.tcl
set sicsroot ../ set sicsroot ../
source util/utility.tcl source util/utility.tcl
ServerOption LogFileBaseName $sicsroot/log/serverlog ServerOption LogFileBaseName $sicsroot/log/serverlog
###### installprotocolhandler ###### installprotocolhandler
ServerOption statusfile $sicsroot/log/status.tcl ServerOption statusfile $sicsroot/log/status.tcl
ServerOption RedirectFile $sicsroot/log/stdout ServerOption RedirectFile $sicsroot/log/stdout
ServerOption LogFileDir $sicsroot/log ServerOption LogFileDir $sicsroot/log
ServerOption QuieckPort [get_portnum $quieckport ] ServerOption QuieckPort [get_portnum $quieckport ]
ServerOption ServerPort [get_portnum $serverport ] ServerOption ServerPort [get_portnum $serverport ]
ServerOption InterruptPort [get_portnum $interruptport ] ServerOption InterruptPort [get_portnum $interruptport ]
ServerOption TelWord sicslogin ServerOption TelWord sicslogin
ServerOption TelnetPort [get_portnum $telnetport ] ServerOption TelnetPort [get_portnum $telnetport ]
ServerOption ReadUserPasswdTimeout 600000 ServerOption ReadUserPasswdTimeout 600000
ServerOption AcceptTimeOut 10 ServerOption AcceptTimeOut 10
ServerOption ReadTimeOut 1000 ServerOption ReadTimeOut 1000
SicsUser manager ansto 1 SicsUser manager ansto 1
SicsUser user sydney 2 SicsUser user sydney 2
SicsUser spy 007 3 SicsUser spy 007 3
Motor dummy_motor asim [params \ Motor dummy_motor asim [params \
asyncqueue mc1\ asyncqueue mc1\

View File

@ -1,6 +1,6 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
source $cfPath(anticollider)/anticollider_common.tcl source $cfPath(anticollider)/anticollider_common.tcl
# NOTE: This is called with a list of motorname target pairs # NOTE: This is called with a list of motorname target pairs
proc ::anticollider::enable {args} { proc ::anticollider::enable {args} {

View File

@ -5,7 +5,7 @@ namespace eval counter {
variable isc_numchannels variable isc_numchannels
variable isc_monitor_address variable isc_monitor_address
variable isc_portlist variable isc_portlist
variable isc_beam_monitor_list variable isc_beam_monitor_list
variable isc_cm_address variable isc_cm_address
variable isc_cm_port variable isc_cm_port
@ -18,11 +18,11 @@ proc ::counter::cm_initialize {} {
if [ catch { if [ catch {
variable isc_cm_address variable isc_cm_address
variable isc_cm_port variable isc_cm_port
MakeAsyncQueue cmserver CAMERA $isc_cm_address $isc_cm_port MakeAsyncQueue cmserver CAMERA $isc_cm_address $isc_cm_port
MakeCounter cm1 anstocamera cmserver MakeCounter cm1 anstocamera cmserver
sicslist setatt cm1 privilege internal sicslist setatt cm1 privilege internal
::utility::macro::getset text cm1_mode {} { ::utility::macro::getset text cm1_mode {} {
return [cm1 getmode] return [cm1 getmode]
@ -78,7 +78,7 @@ proc ::counter::isc_initialize {} {
set isc_cm_address [dict get $::CAMERA_HOSTPORT HOST] set isc_cm_address [dict get $::CAMERA_HOSTPORT HOST]
set isc_cm_port [dict get $::CAMERA_HOSTPORT PORT] set isc_cm_port [dict get $::CAMERA_HOSTPORT PORT]
::counter::cm_initialize ::counter::cm_initialize
} message ] { } message ] {
if {$::errorCode=="NONE"} {return $message} if {$::errorCode=="NONE"} {return $message}
return -code error "$message" return -code error "$message"

View File

@ -70,7 +70,7 @@ Motor stth $motor_driver_type [params \
absEncHome $stth_Home\ absEncHome $stth_Home\
cntsPerX 4096] cntsPerX 4096]
stth part sample stth part sample
stth long_name stth stth long_name stth
stth softlowerlim 0 stth softlowerlim 0
stth softupperlim 360 stth softupperlim 360
stth home 0 stth home 0
@ -185,7 +185,7 @@ sz home 0
# #
# mc2: Camera translation axis along beam # mc2: Camera translation axis along beam
# Gearbox ?, Gear ratio ?, # Gearbox ?, Gear ratio ?,
set dy_Home 0 set dy_Home 0
set dyStepRate ? set dyStepRate ?
Motor dy $motor_driver_type [params \ Motor dy $motor_driver_type [params \

View File

@ -24,10 +24,10 @@ set 20sample_table {
6 203.7 6 203.7
7 161.7 7 161.7
8 119.7 8 119.7
9 77.7 9 77.7
10 35.7 10 35.7
11 -46.3 11 -46.3
12 -88.3 12 -88.3
13 -130.3 13 -130.3
14 -172.3 14 -172.3
15 -214.3 15 -214.3

View File

@ -1,5 +1,5 @@
set sim_mode [SplitReply [plc_simulation]] set sim_mode [SplitReply [plc_simulation]]
if {$sim_mode == "false"} { if {$sim_mode == "false"} {
MakeAsyncQueue plc_chan SafetyPLC [dict get $::PLC_HOSTPORT HOST] [dict get $::PLC_HOSTPORT PORT] MakeAsyncQueue plc_chan SafetyPLC [dict get $::PLC_HOSTPORT HOST] [dict get $::PLC_HOSTPORT PORT]
MakeSafetyPLC plc plc_chan 0 MakeSafetyPLC plc plc_chan 0
} }

View File

@ -1,8 +1,8 @@
# Author: Jing Chen (jgn@ansto.gov.au) # Author: Jing Chen (jgn@ansto.gov.au)
# Required by server_config.tcl # Required by server_config.tcl
VarMake Instrument Text Internal VarMake Instrument Text Internal
Instrument dingo Instrument dingo
Instrument lock Instrument lock
#START SERVER CONFIGURATION SECTION #START SERVER CONFIGURATION SECTION
@ -66,7 +66,7 @@ foreach m [sicslist type motor] {
} }
server_init server_init
clientput "serverport [get_portnum $::serverport]" clientput "serverport [get_portnum $::serverport]"
########################################### ###########################################

View File

@ -1,4 +1,4 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
source $cfPath(anticollider)/anticollider_common.tcl source $cfPath(anticollider)/anticollider_common.tcl
::anticollider::loadscript acscript.txt ::anticollider::loadscript acscript.txt

View File

@ -34,7 +34,7 @@ command SimpleRun {
float=0:inf steptime float=0:inf steptime
int=1:inf numsteps int=1:inf numsteps
} { } {
# RadCollOff # RadCollOff
histmem mode time histmem mode time
histmem preset $steptime histmem preset $steptime
@ -68,7 +68,7 @@ command RadCollRun {
int=1:inf oscno int=1:inf oscno
int=1:inf reps int=1:inf reps
} { } {
# RadCollOn $oscno # RadCollOn $oscno
histmem mode unlimited histmem mode unlimited
newfile HISTOGRAM_XY newfile HISTOGRAM_XY
@ -102,7 +102,7 @@ float=0:inf time
} }
RadCollOff RadCollOff
} }
# RadCollScan # RadCollScan
command RadCollScan { command RadCollScan {
text=drivable motor text=drivable motor
float start float start

View File

@ -1,4 +1,4 @@
# Euler cradle scan commands for texture runs # Euler cradle scan commands for texture runs
# AJS Dec 2010 # AJS Dec 2010
@ -8,7 +8,7 @@
proc SetHistoSync {framenum} { proc SetHistoSync {framenum} {
histmem stop histmem stop
bat_table -set NO_BAT_ENTRIES $framenum NO_BAT_PERIODS $framenum bat_table -set NO_BAT_ENTRIES $framenum NO_BAT_PERIODS $framenum
bat_table -set NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 PERIOD_INDICES { 0 1 } bat_table -set NO_REPEAT_ENTRY 1 NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1 PERIOD_INDICES { 0 1 }
fat_table -set NOS_PERIODS $framenum fat_table -set NOS_PERIODS $framenum
oat_table -set T {0 2200000} NTC 1 oat_table -set T {0 2200000} NTC 1
@ -22,7 +22,7 @@ publish SetHistoSync user
proc SetHistoNormal {} { proc SetHistoNormal {} {
histmem stop histmem stop
bat_table -set NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 bat_table -set NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1
bat_table -set NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0 PERIOD_INDICES { 0} bat_table -set NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0 PERIOD_INDICES { 0}
fat_table -set NOS_PERIODS 1 fat_table -set NOS_PERIODS 1
oat_table -set T {0 2200000} NTC 1 oat_table -set T {0 2200000} NTC 1
@ -32,7 +32,7 @@ proc SetHistoNormal {} {
} }
# continous scan for EPHI- the euler cradle phi stage (innermost axis) # continous scan for EPHI- the euler cradle phi stage (innermost axis)
# note make sure controller 2 has the PHISCAN code in it # note make sure controller 2 has the PHISCAN code in it
publish SetHistoNormal user publish SetHistoNormal user
@ -77,7 +77,7 @@ broadcast $scval $stval
# this we needed when it didn't work properly # this we needed when it didn't work properly
# proc ::histogram_memory::pre_count {} {} # proc ::histogram_memory::pre_count {} {}
# ephi send SHC # ephi send SHC
# ephi send SPC=25000 # ephi send SPC=25000
# ephi send BCG # ephi send BCG

View File

@ -5,7 +5,7 @@ namespace eval counter {
variable isc_numchannels variable isc_numchannels
variable isc_monitor_address variable isc_monitor_address
variable isc_portlist variable isc_portlist
variable isc_beam_monitor_list variable isc_beam_monitor_list
proc set_sobj_attributes {} { proc set_sobj_attributes {} {
} }
} }

View File

@ -14,7 +14,7 @@ source $cfPath(environment)/temperature/lakeshore340_common.tcl
# @param settle, settling time in seconds # @param settle, settling time in seconds
# @param range, lakeshore range # @param range, lakeshore range
# @param upperlimit, upper temperature limit Kelvin # @param upperlimit, upper temperature limit Kelvin
# @param lowerlimit, lower temperature limit Kelvin # @param lowerlimit, lower temperature limit Kelvin
proc ::environment::temperature::add_ls340 {tcn tc_dfltURL mport args} { proc ::environment::temperature::add_ls340 {tcn tc_dfltURL mport args} {
variable tc_dfltPar variable tc_dfltPar
variable moxaPortMap variable moxaPortMap
@ -41,7 +41,7 @@ proc ::environment::temperature::add_ls340 {tcn tc_dfltURL mport args} {
} }
} }
sicslist setatt $tcn environment_name ${tcn}_cntrl sicslist setatt $tcn environment_name ${tcn}_cntrl
sicslist setatt $tcn long_name control_sensor_reading sicslist setatt $tcn long_name control_sensor_reading
::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} } ::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} }
} message ] { } message ] {

View File

@ -1,4 +1,4 @@
set hpaths [list experiment detector detector/monitor detector/histmem ] set hpaths [list experiment detector detector/monitor detector/histmem ]
# Maps devices (eg motors) to hipadaba paths. # Maps devices (eg motors) to hipadaba paths.
# obj name path # obj name path

View File

@ -10,7 +10,7 @@ proc ::histogram_memory::init_OAT_TABLE {args} {
} else { } else {
set resolution "hires" set resolution "hires"
} }
# We don't need a MAX_CHAN parameter for time because the time channel # We don't need a MAX_CHAN parameter for time because the time channel
# is scaled by calling the ::histogram_memory::clock_scale function # is scaled by calling the ::histogram_memory::clock_scale function
OAT_TABLE X -setdata MAX_CHAN 3872 OAT_TABLE X -setdata MAX_CHAN 3872
OAT_TABLE X -setdata MAX_CHAN_PERSEG 992 OAT_TABLE X -setdata MAX_CHAN_PERSEG 992
@ -64,7 +64,7 @@ proc ::histogram_memory::oat_bins {axis} {
set bb0 3871.5 set bb0 3871.5
set bb1 [expr $bb0+$bstep] set bb1 [expr $bb0+$bstep]
FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP [expr abs(32.0/$bstep)] FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP [expr abs(32.0/$bstep)]
} }
return [list $bb0 $bb1] return [list $bb0 $bb1]
} else { } else {
return [OAT_TABLE -get $axis] return [OAT_TABLE -get $axis]
@ -78,7 +78,7 @@ proc ::histogram_memory::oat_bins {axis} {
# @brief Returns the current number of channels for a given axis. # @brief Returns the current number of channels for a given axis.
proc ::histogram_memory::number_of_channels {axis} { proc ::histogram_memory::number_of_channels {axis} {
array set channID {X NXC Y NYC T NTC} array set channID {X NXC Y NYC T NTC}
if [ catch { if [ catch {
if {$axis == "X"} { if {$axis == "X"} {
set nch_perseg [OAT_TABLE -get $channID($axis)] set nch_perseg [OAT_TABLE -get $channID($axis)]
set overlap [FAT_TABLE -get MULTI_HOST_HISTO_STITCH_OVERLAP] set overlap [FAT_TABLE -get MULTI_HOST_HISTO_STITCH_OVERLAP]

View File

@ -122,7 +122,7 @@ proc histmem_acquire_period_sequence { Np Nf } {
histmem start histmem start
set dlytime [ expr int( 1000 * $Nf / 50. ) ] set dlytime [ expr int( 1000 * $Nf / 50. ) ]
# clientput "Waiting for" $dlytime "ms..." # clientput "Waiting for" $dlytime "ms..."
after $dlytime after $dlytime
# clientput "tc1 reading is: " [tc1 get] # clientput "tc1 reading is: " [tc1 get]

View File

@ -43,7 +43,7 @@ proc histmem_acquire_period_sequence { Np Nf } {
histmem start histmem start
set dlytime [ expr int( 1000 * $Nf / 50. ) ] set dlytime [ expr int( 1000 * $Nf / 50. ) ]
# clientput "Waiting for" $dlytime "ms..." # clientput "Waiting for" $dlytime "ms..."
# after $dlytime # after $dlytime
# clientput "tc1 reading is: " [tc1 get] # clientput "tc1 reading is: " [tc1 get]

View File

@ -103,7 +103,7 @@ set move_count 10
# Set axis_config as follows to use different axis configurations # Set axis_config as follows to use different axis configurations
# 0: tilt stage configuration # 0: tilt stage configuration
# 1: eulerian cradle # 1: eulerian cradle
# 2: small omega # 2: small omega
# 3: Oxford magnet sample stick # 3: Oxford magnet sample stick
set axis_config 0 set axis_config 0
@ -427,7 +427,7 @@ oct long_name oct
# Monochromator Focusing (Ge) # Monochromator Focusing (Ge)
## ffr 31/7/2012 ## ffr 31/7/2012
## absEncHome was found to be 16777217 on 31/7/2012 when the ## absEncHome was found to be 16777217 on 31/7/2012 when the
## encoder clocked over to 114 counts to give a posn ## encoder clocked over to 114 counts to give a posn
## reading of 4793.458008 ## reading of 4793.458008
## The encoder has a 12bit resolution (ie 12bits/turn 4096) ## The encoder has a 12bit resolution (ie 12bits/turn 4096)

View File

@ -1,5 +1,5 @@
set sim_mode [SplitReply [plc_simulation]] set sim_mode [SplitReply [plc_simulation]]
if {$sim_mode == "false"} { if {$sim_mode == "false"} {
MakeAsyncQueue plc_chan SafetyPLC 137.157.211.21 30001 MakeAsyncQueue plc_chan SafetyPLC 137.157.211.21 30001
MakeSafetyPLC plc plc_chan 0 MakeSafetyPLC plc plc_chan 0
} }

View File

@ -1,6 +1,6 @@
MakeHM hmm SIM MakeHM hmm SIM
#MakeHMControl_ANSTO hmc bm hmm #MakeHMControl_ANSTO hmc bm hmm
source $cfPath(hmm)/hmm_configuration_common_1.tcl source $cfPath(hmm)/hmm_configuration_common_1.tcl
# Beam monitor controlled hmm controller. # Beam monitor controlled hmm controller.
proc ::histogram_memory::hmc {_start _preset _mode _pause} { proc ::histogram_memory::hmc {_start _preset _mode _pause} {

View File

@ -1,9 +1,9 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Required by server_config.tcl # Required by server_config.tcl
VarMake Instrument Text Internal VarMake Instrument Text Internal
Instrument wombat Instrument wombat
Instrument lock Instrument lock
#START SERVER CONFIGURATION SECTION #START SERVER CONFIGURATION SECTION
@ -54,13 +54,13 @@ source gumxml.tcl
# The Alice Thing # The Alice Thing
# Qlink : 9600, 8 data, 1 stop, No Parity, None Flow # Qlink : 9600, 8 data, 1 stop, No Parity, None Flow
# LS340 : 9600, 7 data, 1 stop, Odd Parity, None Flow # LS340 : 9600, 7 data, 1 stop, Odd Parity, None Flow
# Julabo: 9600, 7 data, 1 stop, Even Parity, RTS/CTS Flow # Julabo: 9600, 7 data, 1 stop, Even Parity, RTS/CTS Flow
# add_qlink qlink 137.157.201.86 4004 5 # add_qlink qlink 137.157.201.86 4004 5
# add_sct_ls340 tc1 137.157.201.86 4001 "\r" 5.0 5.0 # add_sct_ls340 tc1 137.157.201.86 4001 "\r" 5.0 5.0
# add_lh45 tc2 137.157.201.86 4003 1 # add_lh45 tc2 137.157.201.86 4003 1
# Eurotherm # Eurotherm
# add_et2000 name IP PORT MODBUS_ADDR TOL # add_et2000 name IP PORT MODBUS_ADDR TOL
# add_et2000 et2000 10.157.205.19 502 1 5 # add_et2000 et2000 10.157.205.19 502 1 5

View File

@ -1,6 +1,6 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Cycle motors # Cycle motors
clientput "drive to zero reference" clientput "drive to zero reference"
drive ss2vg 10 ss2hg 10 ss1vg 10 ss1hg 10 drive ss2vg 10 ss2hg 10 ss1vg 10 ss1hg 10
drive som 0 ss1vo 0 ss2vo 0 ss2vo 0 ss2ho 0 sphi 0 schi 90 sx 0 sz 0 drive som 0 ss1vo 0 ss2vo 0 ss2vo 0 ss2ho 0 sphi 0 schi 90 sx 0 sz 0

View File

@ -1,4 +1,4 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
source $cfPath(anticollider)/anticollider_common.tcl source $cfPath(anticollider)/anticollider_common.tcl
::anticollider::loadscript acscript.txt ::anticollider::loadscript acscript.txt

View File

@ -5,7 +5,7 @@ namespace eval counter {
variable isc_numchannels variable isc_numchannels
variable isc_monitor_address variable isc_monitor_address
variable isc_portlist variable isc_portlist
variable isc_beam_monitor_list variable isc_beam_monitor_list
proc set_sobj_attributes {} { proc set_sobj_attributes {} {
} }
} }

View File

@ -14,7 +14,7 @@ source $cfPath(environment)/temperature/lakeshore340_common.tcl
# @param settle, settling time in seconds # @param settle, settling time in seconds
# @param range, lakeshore range # @param range, lakeshore range
# @param upperlimit, upper temperature limit Kelvin # @param upperlimit, upper temperature limit Kelvin
# @param lowerlimit, lower temperature limit Kelvin # @param lowerlimit, lower temperature limit Kelvin
proc ::environment::temperature::add_ls340 {tcn tc_dfltURL mport args} { proc ::environment::temperature::add_ls340 {tcn tc_dfltURL mport args} {
variable tc_dfltPar variable tc_dfltPar
variable moxaPortMap variable moxaPortMap
@ -41,7 +41,7 @@ proc ::environment::temperature::add_ls340 {tcn tc_dfltURL mport args} {
} }
} }
sicslist setatt $tcn environment_name ${tcn}_cntrl sicslist setatt $tcn environment_name ${tcn}_cntrl
sicslist setatt $tcn long_name control_sensor_reading sicslist setatt $tcn long_name control_sensor_reading
::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} } ::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} }
} message ] { } message ] {

View File

@ -1,5 +1,5 @@
set hpaths [list experiment detector detector/monitor detector/histmem ] set hpaths [list experiment detector detector/monitor detector/histmem ]
#A "motor part" may have a group path which can be appended to the #A "motor part" may have a group path which can be appended to the
#following paths. #following paths.

View File

@ -4,7 +4,7 @@ set sim_mode [SplitReply [hmm_simulation]]
proc ::histogram_memory::init_OAT_TABLE {} { proc ::histogram_memory::init_OAT_TABLE {} {
if [ catch { if [ catch {
# We don't need a MAX_CHAN parameter for time because the time channel # We don't need a MAX_CHAN parameter for time because the time channel
# is scaled by calling the ::histogram_memory::clock_scale function # is scaled by calling the ::histogram_memory::clock_scale function
OAT_TABLE X -setdata MAX_CHAN 128 OAT_TABLE X -setdata MAX_CHAN 128
OAT_TABLE Y -setdata MAX_CHAN 512 OAT_TABLE Y -setdata MAX_CHAN 512
@ -19,7 +19,7 @@ proc ::histogram_memory::init_OAT_TABLE {} {
hmm configure fat_frame_frequency $freq hmm configure fat_frame_frequency $freq
hmm configure fat_frame_source INTERNAL hmm configure fat_frame_source INTERNAL
OAT_TABLE -set X { 127.5 126.5 } NXC 128 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1 OAT_TABLE -set X { 127.5 126.5 } NXC 128 Y { -0.5 3.5 } NYC 128 T { 0 20000 } NTC 1
} message ] { } message ] {
if {$::errorCode=="NONE"} {return $message} if {$::errorCode=="NONE"} {return $message}
return -code error $message return -code error $message

View File

@ -1,6 +1,6 @@
# This must be loaded by motor_configuration.tcl # This must be loaded by motor_configuration.tcl
set ephi_Home 6647698 set ephi_Home 6647698
set echi_Home 8919294 set echi_Home 8919294
set eom_Home 23165482 set eom_Home 23165482

View File

@ -166,7 +166,7 @@ Motor mchi $motor_driver_type [params \
absEncHome $mchi_Home\ absEncHome $mchi_Home\
cntsPerX 4096] cntsPerX 4096]
mchi home -0.2546 mchi home -0.2546
mchi softlowerlim -2 mchi softlowerlim -2
mchi softupperlim 2 mchi softupperlim 2
mchi speed 1 mchi speed 1
mchi movecount $move_count mchi movecount $move_count
@ -393,7 +393,7 @@ Motor stth $motor_driver_type [params \
absEnc 1\ absEnc 1\
absEncHome $stth_Home\ absEncHome $stth_Home\
cntsPerX -93207] cntsPerX -93207]
stth softlowerlim -156.75 stth softlowerlim -156.75
stth softupperlim 5.25 stth softupperlim 5.25
stth home 0 stth home 0
stth speed 0.5 stth speed 0.5

View File

@ -1,5 +1,5 @@
set sim_mode [SplitReply [plc_simulation]] set sim_mode [SplitReply [plc_simulation]]
if {$sim_mode == "false"} { if {$sim_mode == "false"} {
MakeAsyncQueue plc_chan SafetyPLC 137.157.211.21 30002 MakeAsyncQueue plc_chan SafetyPLC 137.157.211.21 30002
MakeSafetyPLC plc plc_chan 0 MakeSafetyPLC plc plc_chan 0
} }

View File

@ -1,9 +1,9 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Required by server_config.tcl # Required by server_config.tcl
VarMake Instrument Text Internal VarMake Instrument Text Internal
Instrument echidna Instrument echidna
Instrument lock Instrument lock
#START SERVER CONFIGURATION SECTION #START SERVER CONFIGURATION SECTION

View File

@ -1,6 +1,6 @@
MakeHM hmm SIM MakeHM hmm SIM
#MakeHMControl_ANSTO hmc bm hmm #MakeHMControl_ANSTO hmc bm hmm
source $cfPath(hmm)/hmm_configuration_common_1.tcl source $cfPath(hmm)/hmm_configuration_common_1.tcl
# Beam monitor controlled hmm controller. # Beam monitor controlled hmm controller.
proc ::histogram_memory::hmc {_start _preset _mode _pause} { proc ::histogram_memory::hmc {_start _preset _mode _pause} {

View File

@ -1,6 +1,6 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
source $cfPath(anticollider)/anticollider_common.tcl source $cfPath(anticollider)/anticollider_common.tcl
# NOTE: This is called with a list of motorname target pairs # NOTE: This is called with a list of motorname target pairs
proc ::anticollider::enable {args} { proc ::anticollider::enable {args} {

View File

@ -185,7 +185,7 @@ set chname ch$chN
hfactory $fermiPath/$chname/intlck_status/$field plain user int hfactory $fermiPath/$chname/intlck_status/$field plain user int
} }
hfactory $chPath/control plain user none hfactory $chPath/control plain user none
hfactory $chPath/control/device_error plain user text hfactory $chPath/control/device_error plain user text
@ -238,7 +238,7 @@ set chname ch$chN
hsetprop $fermiPath "RDGAINPHASE" ${scobjNS}::rdVal $fermiPath {prop_gain int_gain phase_gain} hsetprop $fermiPath "RDGAINPHASE" ${scobjNS}::rdVal $fermiPath {prop_gain int_gain phase_gain}
hsetprop $fermiPath "RDSYNMOTDIR" ${scobjNS}::rdVal $fermiPath {ref_delay ref_period sync_srce motdir} hsetprop $fermiPath "RDSYNMOTDIR" ${scobjNS}::rdVal $fermiPath {ref_delay ref_period sync_srce motdir}
hsetprop $fermiPath "RDIDLE" ${scobjNS}::rdVal $fermiPath idle_toggle hsetprop $fermiPath "RDIDLE" ${scobjNS}::rdVal $fermiPath idle_toggle
if {$sim_mode == "false"} { if {$sim_mode == "false"} {
sct_fermi poll $fermiPath $pollrate sct_fermi poll $fermiPath $pollrate

View File

@ -1,8 +1,8 @@
# Drive the 3 Monochromator blades as a "bunch" # Drive the 3 Monochromator blades as a "bunch"
# #
# Author: Jing Chen, jgn@ansto.gov.au # Author: Jing Chen, jgn@ansto.gov.au
# #
# Date: 11/11/2011 # Date: 11/11/2011
# get a specified parameter value of a motor # get a specified parameter value of a motor
@ -79,25 +79,25 @@ proc DriveMono {mot focus} {
set translateDis [expr $focus - [getSetting $mot position]] set translateDis [expr $focus - [getSetting $mot position]]
# Determine if the movement is within the ranges of the three motors # Determine if the movement is within the ranges of the three motors
if {[expr $mraPosition + $translateDis] > $mraSoftupperlim || if {[expr $mraPosition + $translateDis] > $mraSoftupperlim ||
[expr $mraPosition + $translateDis] < $mraSoftlowerlim} { [expr $mraPosition + $translateDis] < $mraSoftlowerlim} {
broadcast "Error: the movement is out of the range limit of motor mra" broadcast "Error: the movement is out of the range limit of motor mra"
set moveFlag 0 set moveFlag 0
} }
if {[expr $mrbPosition + $translateDis] > $mrbSoftupperlim || if {[expr $mrbPosition + $translateDis] > $mrbSoftupperlim ||
[expr $mrbPosition + $translateDis] < $mrbSoftlowerlim} { [expr $mrbPosition + $translateDis] < $mrbSoftlowerlim} {
broadcast "Error: the movement is out of the range limit of motor mrb" broadcast "Error: the movement is out of the range limit of motor mrb"
set moveFlag 0 set moveFlag 0
} }
if {[expr $mrcPosition + $translateDis] > $mrcSoftupperlim || if {[expr $mrcPosition + $translateDis] > $mrcSoftupperlim ||
[expr $mrcPosition + $translateDis] < $mrcSoftlowerlim} { [expr $mrcPosition + $translateDis] < $mrcSoftlowerlim} {
broadcast "Error: the movement is out of the range limit of motor mrc" broadcast "Error: the movement is out of the range limit of motor mrc"
set moveFlag 0 set moveFlag 0
} }
# move the three motors # move the three motors
if {$moveFlag == 1} { if {$moveFlag == 1} {
# Unlock the three motors # Unlock the three motors
mra fixed -1 mra fixed -1

View File

@ -5,7 +5,7 @@ namespace eval counter {
variable isc_numchannels variable isc_numchannels
variable isc_monitor_address variable isc_monitor_address
variable isc_portlist variable isc_portlist
variable isc_beam_monitor_list variable isc_beam_monitor_list
proc set_sobj_attributes {} { proc set_sobj_attributes {} {
} }
} }

View File

@ -21,7 +21,7 @@ proc ::histogram_memory::init_OAT_TABLE {} {
hmm configure fat_frame_frequency $freq hmm configure fat_frame_frequency $freq
hmm configure fat_frame_source INTERNAL hmm configure fat_frame_source INTERNAL
OAT_TABLE -set X { -0.5 0.5 } NXC 16 Y { -0.5 0.5 } NYC 1024 T { 0 200000 } NTC 1 OAT_TABLE -set X { -0.5 0.5 } NXC 16 Y { -0.5 0.5 } NYC 1024 T { 0 200000 } NTC 1
} message ] { } message ] {
if {$::errorCode=="NONE"} {return $message} if {$::errorCode=="NONE"} {return $message}
return -code error $message return -code error $message
@ -92,7 +92,7 @@ proc ::histogram_memory::isc_initialize {} {
::histogram_memory::set_graphtype "two_theta" "boundaries" ::histogram_memory::set_graphtype "two_theta" "boundaries"
# MJL TODO detector geometry for Kookaburra TBD. Figures need revision during commissioning # MJL TODO detector geometry for Kookaburra TBD. Figures need revision during commissioning
# Width = 25mm spacing * 16 tubes = 5000mm (??? degree coverage) # Width = 25mm spacing * 16 tubes = 5000mm (??? degree coverage)
# Height = 1015mm (tube length) # Height = 1015mm (tube length)
# Radius = 2400mm # Radius = 2400mm
detector_active_height_mm 1015 detector_active_height_mm 1015

View File

@ -90,7 +90,7 @@ bex home 0
# mc1: Premonochromator Crystal Si(111) Tilt # mc1: Premonochromator Crystal Si(111) Tilt
# Gearbox 55:1, 0.5 degree # Gearbox 55:1, 0.5 degree
# Encoder 2P12, # Encoder 2P12,
set pmchi_Home 8410424 set pmchi_Home 8410424
set pmchiStepRate [expr $motorrate*55.0/0.5] set pmchiStepRate [expr $motorrate*55.0/0.5]
Motor pmchi $motor_driver_type [params \ Motor pmchi $motor_driver_type [params \
@ -118,12 +118,12 @@ pmchi home 0
# mc1: Premonochromator Crystal Si(111) Rotate # mc1: Premonochromator Crystal Si(111) Rotate
# Gearbox 50:1, pitch 1 degree # Gearbox 50:1, pitch 1 degree
# Encoder 2P25 # Encoder 2P25
# Crystal B 0, 18889883 # Crystal B 0, 18889883
# Crystal HOPG position 179.603806, 2149592 # Crystal HOPG position 179.603806, 2149592
# Crystal HOPG loading position 49.740612, 14253738 # Crystal HOPG loading position 49.740612, 14253738
set pmom_Home 2102963 set pmom_Home 2102963
set pmomStepRate [expr $motorrate*50.0] set pmomStepRate [expr $motorrate*50.0]
Motor pmom $motor_driver_type [params \ Motor pmom $motor_driver_type [params \
asyncqueue mc1\ asyncqueue mc1\
@ -150,9 +150,9 @@ pmom home 0
# mc1: Main Detector - X Translate # mc1: Main Detector - X Translate
# Gearbox 20:1, pitch 5mm # Gearbox 20:1, pitch 5mm
# Encoder 2p17 # Encoder 2p17
set mdet_Home 521939864 set mdet_Home 521939864
set mdetStepRate [expr $motorrate *20.0/5.0] set mdetStepRate [expr $motorrate *20.0/5.0]
Motor mdet $motor_driver_type [params \ Motor mdet $motor_driver_type [params \
asyncqueue mc1\ asyncqueue mc1\
@ -214,9 +214,9 @@ att home 0
# mc2: CC1 Monochromator Stage Tilt # mc2: CC1 Monochromator Stage Tilt
# Gearbox 20:1, screw pitch 356 # Gearbox 20:1, screw pitch 356
# Encoder 2p17 # Encoder 2p17
# 68.681 # 68.681
set m1chi_Home 15016533 set m1chi_Home 15016533
set m1chiSetRate [expr $motorrate*20*100/68.681] set m1chiSetRate [expr $motorrate*20*100/68.681]
Motor m1chi $motor_driver_type [params \ Motor m1chi $motor_driver_type [params \
asyncqueue mc2\ asyncqueue mc2\
@ -243,7 +243,7 @@ m1chi home 0
# mc2: CC1 Monochromator Stage Rotation # mc2: CC1 Monochromator Stage Rotation
# Gearbox 100:1, screw pitch 356 # Gearbox 100:1, screw pitch 356
# Encoder 2p25 # Encoder 2p25
# m1om_Home 13617081 # m1om_Home 13617081
set m1om_Home 30395150 set m1om_Home 30395150
@ -279,7 +279,7 @@ m1om Creep_Substep 0.04
# mc2: CC1 Monochromator Stage X Translation # mc2: CC1 Monochromator Stage X Translation
# Gearbox 20:1, pitch 5mm # Gearbox 20:1, pitch 5mm
# Encoder 2p17 # Encoder 2p17
set m1x_Home 3754723 set m1x_Home 3754723
set m1xSetRate [expr $motorrate*20.0/5.0] set m1xSetRate [expr $motorrate*20.0/5.0]
@ -299,14 +299,14 @@ Motor m1x $motor_driver_type [params \
absEncHome $m1x_Home\ absEncHome $m1x_Home\
cntsPerX [expr -131072/5.0]] cntsPerX [expr -131072/5.0]]
m1x speed 0.3 m1x speed 0.3
m1x part crystal m1x part crystal
m1x long_name m1x m1x long_name m1x
m1x softlowerlim -82 m1x softlowerlim -82
m1x softupperlim 49 m1x softupperlim 49
m1x home 0 m1x home 0
# mc2: Slit system - 1 TOP Blade # mc2: Slit system - 1 TOP Blade
# Gearbox 55:1, pitch 0.5mm # Gearbox 55:1, pitch 0.5mm
# Encoder 2p13 # Encoder 2p13
set ss1u_Home 918407 set ss1u_Home 918407
set ss1uSetRate [expr $motorrate*55.0/0.5] set ss1uSetRate [expr $motorrate*55.0/0.5]
@ -333,10 +333,10 @@ ss1u softupperlim 37
ss1u home 0 ss1u home 0
# mc2: Slit system - 1 BOTTOM Blade # mc2: Slit system - 1 BOTTOM Blade
# Gearbox 55:1, pitch 0.5mm # Gearbox 55:1, pitch 0.5mm
# Encoder 2p13 # Encoder 2p13
set ss1d_Home 1157895 set ss1d_Home 1157895
set ss1dSetRate [expr $motorrate*55.0/0.5] set ss1dSetRate [expr $motorrate*55.0/0.5]
Motor ss1d $motor_driver_type [params \ Motor ss1d $motor_driver_type [params \
asyncqueue mc2\ asyncqueue mc2\
@ -354,7 +354,7 @@ Motor ss1d $motor_driver_type [params \
absEncHome $ss1d_Home\ absEncHome $ss1d_Home\
cntsPerX 16384] cntsPerX 16384]
ss1d speed 0.1 ss1d speed 0.1
ss1d part slits ss1d part slits
ss1d long_name ss1d ss1d long_name ss1d
ss1d softlowerlim -37.8 ss1d softlowerlim -37.8
ss1d softupperlim 35 ss1d softupperlim 35
@ -392,7 +392,7 @@ ss1l home 0
# mc2: Slit system - 1 RIGHT Blade # mc2: Slit system - 1 RIGHT Blade
# Gearbox 55:1, pitch 0.5mm # Gearbox 55:1, pitch 0.5mm
# Encoder 2p13 # Encoder 2p13
set ss1r_Home 1656697 set ss1r_Home 1656697
set ss1rSetRate [expr $motorrate*55.0/0.5] set ss1rSetRate [expr $motorrate*55.0/0.5]
Motor ss1r $motor_driver_type [params \ Motor ss1r $motor_driver_type [params \
asyncqueue mc2\ asyncqueue mc2\
@ -418,8 +418,8 @@ ss1r home 0
# mc2: Sample Changer (Sample Stage) Z Translation # mc2: Sample Changer (Sample Stage) Z Translation
# Gearbox 1:1 # Gearbox 1:1
#set samz_Home #set samz_Home
#set samzSetRate 25000 #set samzSetRate 25000
#Motor samz $motor_driver_type [params \ #Motor samz $motor_driver_type [params \
asyncqueue mc2\ asyncqueue mc2\
@ -448,7 +448,7 @@ ss1r home 0
# Motor Controller 3 # Motor Controller 3
# Motor Controller 3 # Motor Controller 3
############################ ############################
# #
# mc3: Slit system - 2 TOP Blade # mc3: Slit system - 2 TOP Blade
# Gearbox 55:1, pitch 0.5mm # Gearbox 55:1, pitch 0.5mm
@ -568,7 +568,7 @@ ss2r home 0
# mc3: CC2 Analyser Stage - Tilt # mc3: CC2 Analyser Stage - Tilt
# Gearbox 20:1, screw pitch 356 # Gearbox 20:1, screw pitch 356
# Encoder 2p17 # Encoder 2p17
# 68.681 # 68.681
set m2chi_Home 15512615 set m2chi_Home 15512615
set m2chiSetRate [expr $motorrate*20*100/68.681] set m2chiSetRate [expr $motorrate*20*100/68.681]
@ -598,7 +598,7 @@ m2chi home 0
# set m2om_Home 15776972 # set m2om_Home 15776972
# mc3: CC2 Analyser Stage - Rotation # mc3: CC2 Analyser Stage - Rotation
# Gearbox 100:1, screw pitch 356 # Gearbox 100:1, screw pitch 356
# Encoder 2p25 # Encoder 2p25
set m2om_Home 23155978 set m2om_Home 23155978
set m2omSetRate [expr $motorrate*100.0*356.0/360.0] set m2omSetRate [expr $motorrate*100.0*356.0/360.0]
@ -631,10 +631,10 @@ m2om Creep_Factor 0.5
m2om Creep_Substep 0.04 m2om Creep_Substep 0.04
# mc3: CC2 Analyser Stage - X Translate # mc3: CC2 Analyser Stage - X Translate
# Gearbox 20:1, pitch 5mm # Gearbox 20:1, pitch 5mm
# Encoder 2p17 # Encoder 2p17
set m2x_Home 524680153 set m2x_Home 524680153
set m2xSetRate [expr $motorrate*20.0/5.0] set m2xSetRate [expr $motorrate*20.0/5.0]
Motor m2x $motor_driver_type [params \ Motor m2x $motor_driver_type [params \
asyncqueue mc3\ asyncqueue mc3\
@ -660,9 +660,9 @@ m2x home 0
# mc3: CC2 Analyser Stage - Y Translation # mc3: CC2 Analyser Stage - Y Translation
# Gearbox 20:1, pitch 5mm # Gearbox 20:1, pitch 5mm
# Encoder 2p17 # Encoder 2p17
set m2y_Home 516940434 set m2y_Home 516940434
set m2ySetRate [expr $motorrate*20.0/5.0] set m2ySetRate [expr $motorrate*20.0/5.0]
Motor m2y $motor_driver_type [params \ Motor m2y $motor_driver_type [params \
asyncqueue mc3\ asyncqueue mc3\

View File

@ -28,10 +28,10 @@ set 20sample_table {
6 203.7 6 203.7
7 161.7 7 161.7
8 119.7 8 119.7
9 77.7 9 77.7
10 35.7 10 35.7
11 -46.3 11 -46.3
12 -88.3 12 -88.3
13 -130.3 13 -130.3
14 -172.3 14 -172.3
15 -214.3 15 -214.3

View File

@ -1,4 +1,4 @@
# TODO Make readonly getset macro for AttFactor # TODO Make readonly getset macro for AttFactor
## ##
# @file The velocity selector position is used as the reference for other instrument # @file The velocity selector position is used as the reference for other instrument

View File

@ -1,5 +1,5 @@
set sim_mode [SplitReply [plc_simulation]] set sim_mode [SplitReply [plc_simulation]]
if {$sim_mode == "false"} { if {$sim_mode == "false"} {
# MakeAsyncQueue plc_chan SafetyPLC 137.157.204.79 31001 # MakeAsyncQueue plc_chan SafetyPLC 137.157.204.79 31001
# MakeSafetyPLC plc plc_chan 0 # MakeSafetyPLC plc plc_chan 0
} }

View File

@ -13,17 +13,17 @@ proc filecounts_log {fname txt} {
proc thresholdscan {minVoltage maxVoltage stepVoltage minBMThreshold manBMThreshold stepBMThreshold scantime} { proc thresholdscan {minVoltage maxVoltage stepVoltage minBMThreshold manBMThreshold stepBMThreshold scantime} {
# following is used to obtain an optimal BM threshold # following is used to obtain an optimal BM threshold
set fileCounts ../log/bmcounts.log set fileCounts ../log/bmcounts.log
set fileCountsDiff ../log/bmcountsdiff.log set fileCountsDiff ../log/bmcountsdiff.log
variable curCount variable curCount
set fd [open $fileCounts w] set fd [open $fileCounts w]
close $fd close $fd
set fd [open $fileCountsDiff w] set fd [open $fileCountsDiff w]
close $fd close $fd
set txt "" set txt ""
for {set thres $minBMThreshold} {$thres <= $manBMThreshold} {incr thres $stepBMThreshold} { for {set thres $minBMThreshold} {$thres <= $manBMThreshold} {incr thres $stepBMThreshold} {
lappend txt $thres lappend txt $thres
@ -51,8 +51,8 @@ proc thresholdscan {minVoltage maxVoltage stepVoltage minBMThreshold manBMThresh
lappend diff [expr [lindex $curCount $ind]-[lindex $curCount [expr $ind-1]]] lappend diff [expr [lindex $curCount $ind]-[lindex $curCount [expr $ind-1]]]
} }
set txt "$vol : $diff" set txt "$vol : $diff"
filecounts_log $fileCountsDiff $txt filecounts_log $fileCountsDiff $txt
} }
} }

View File

@ -1,8 +1,8 @@
# Author: Jing Chen (jgn@ansto.gov.au) # Author: Jing Chen (jgn@ansto.gov.au)
# Required by server_config.tcl # Required by server_config.tcl
VarMake Instrument Text Internal VarMake Instrument Text Internal
Instrument kookaburra Instrument kookaburra
Instrument lock Instrument lock
#START SERVER CONFIGURATION SECTION #START SERVER CONFIGURATION SECTION

View File

@ -1,6 +1,6 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
source $cfPath(anticollider)/anticollider_common.tcl source $cfPath(anticollider)/anticollider_common.tcl
# NOTE: This is called with a list of motorname target pairs # NOTE: This is called with a list of motorname target pairs
proc ::anticollider::enable {args} { proc ::anticollider::enable {args} {

Some files were not shown because too many files have changed in this diff Show More