diff --git a/site_ansto/instrument/TEST_SICS/fakeDChopper/SIM_chopperServer.tcl b/site_ansto/instrument/TEST_SICS/fakeDChopper/SIM_chopperServer.tcl index a89c7ace..72c044a7 100644 --- a/site_ansto/instrument/TEST_SICS/fakeDChopper/SIM_chopperServer.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDChopper/SIM_chopperServer.tcl @@ -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 # been defined. proc readLine {who channel} { - global didRead + global didRead global B global validUID global validPWD @@ -191,7 +191,7 @@ proc readLine {who channel} { puts "RECEIVED EOF: $line" close $f return -code error "Got EOF, close channel" - } else { + } else { puts "RECEIVED: $line" switch $serverState { "UID" { diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/cont.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/cont.tcl index bba447b7..dc0a100b 100755 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/cont.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/cont.tcl @@ -2,7 +2,7 @@ # 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. # Usage ./cont.tcl -cont -port # where cnum is the controller number (1,2,3,4) and diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/dmc2280Server.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/dmc2280Server.tcl index 2a98b6d8..47a5e4b3 100644 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/dmc2280Server.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/dmc2280Server.tcl @@ -10,16 +10,16 @@ proc serverOpen {channel addr port} { 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 # been defined. proc readLine {who channel} { - global didRead + global didRead global B if {[gets $channel line]<0} { fileevent $channel readable {} after idle "close $channel;set out 1" - } else { + } else { puts "RECEIVED: $line" foreach cmd [split $line ";"] { diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/dmcParse.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/dmcParse.tcl index ca2795bd..4365bce7 100644 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/dmcParse.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/dmcParse.tcl @@ -7,7 +7,7 @@ #parses CM exp, _CM, {TP,TD}, CM=exp, CM, CM # axis=ABCDEFGH, num=01234567 proc parse {cmdst args} { - # CM exp, handles MG + # CM exp, handles MG if {[string length $args] > 0} {return "$cmdst $args"} # _CM, {TP,TD} get an axis property or position @@ -17,18 +17,18 @@ proc parse {cmdst args} { if {$num == 2 && [string first $cmd "TD TP"] != -1} { return "dmget $cmd $axis"; } - + # CM=exp - # Try + # Try # set line "DPB=(_TPB - 7818915)*(25000/8192) + 0" # parse $line set cmdlst [split $cmdst =]; - if {[llength $cmdlst] == 2} { + if {[llength $cmdlst] == 2} { set num [scan [lindex $cmdlst 0] {%2s%1[ABCDEFGH0-7]} cmd axis]; return "dmset $cmd $axis [lindex $cmdlst 1]"; } - # CM + # CM set num [scan $cmdst {%2s%1[ABCDEFGH0-7]} cmd par]; if {$num == 2} {return "dmcall $cmd $par"} set num [scan $cmdst {_%2s%1[ABCDEFGH0-7]} cmd par]; diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/loadConfig.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/loadConfig.tcl index 8afa8d0e..2343cf37 100644 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/loadConfig.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/loadConfig.tcl @@ -17,7 +17,7 @@ proc loadConfig {fName} { if [info exists ContList] {unset ContList} # Temporarily define unknown proc to skip undefined procs rename ::unknown _unknown - proc ::unknown {args} {} + proc ::unknown {args} {} if [catch {uplevel #0 source $fName} errMsg] { rename ::unknown "" rename _unknown ::unknown diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl index caf3ff58..a85baebf 100755 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl @@ -53,7 +53,7 @@ proc mkSimAxes {instrument} { global IPtoContName motors ContList simConts; puts [array get IPtoContName]; puts $motors; - + foreach c $ContList { set simFile($c) [open ${c}_sim.tcl w]; } diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl index 93d30439..c1cdbcb2 100644 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/simAxis.tcl @@ -151,21 +151,21 @@ proc nextstep {paxis step args} { set currPos [expr ($axis(TP) - $axis(ABSHOME))/abs(double($axis(cntsperx)))] if {$axis(ST) == 1} { 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(SC) 4; # motor stopped by stop command (ST) set axis(ATLIM) false set finished true } elseif {$currPos >= $axis(UPLIM)} { 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(SC) 2; # motor stopped by limit switch set axis(ATLIM) upper set finished true } elseif {$currPos <= $axis(LOLIM)} { 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(SC) 3; # motor stopped by limit switch 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(TD) [expr int($target)]; 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(SC) 1; # motor stopped at commanded position set axis(ATLIM) false diff --git a/site_ansto/instrument/TEST_SICS/fakeRFGen/SIM_RFGen.tcl b/site_ansto/instrument/TEST_SICS/fakeRFGen/SIM_RFGen.tcl index 8564a287..68a6829d 100755 --- a/site_ansto/instrument/TEST_SICS/fakeRFGen/SIM_RFGen.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeRFGen/SIM_RFGen.tcl @@ -129,7 +129,7 @@ proc readLine {channel} { } default { puts stderr "ERROR: Unknown command type $cmdType, should be 'L' or 'S'" - } + } } flush stdout flush stderr diff --git a/site_ansto/instrument/TEST_SICS/fakeTempControl/lakeshore/SIM_LS336.tcl b/site_ansto/instrument/TEST_SICS/fakeTempControl/lakeshore/SIM_LS336.tcl index d5346855..7eadf5c5 100644 --- a/site_ansto/instrument/TEST_SICS/fakeTempControl/lakeshore/SIM_LS336.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeTempControl/lakeshore/SIM_LS336.tcl @@ -90,7 +90,7 @@ global STB } gets $channel data puts "RECEIVED: $data" - switch [llength $data] { + switch [llength $data] { 0 { puts "Oops received nothing" set cmd XXX @@ -208,12 +208,12 @@ global STB } } } - + flush stdout flush stderr flush $channel - + } # startserver -port 1034 diff --git a/site_ansto/instrument/barebones.tcl b/site_ansto/instrument/barebones.tcl index 194ab486..3958c3bf 100644 --- a/site_ansto/instrument/barebones.tcl +++ b/site_ansto/instrument/barebones.tcl @@ -1,15 +1,15 @@ # 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. # # NOTE\n # This configuration does not create a GumTree interface or let you # save nexus data files. -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument bear +Instrument bear Instrument lock #START SERVER CONFIGURATION SECTION @@ -19,24 +19,24 @@ source sics_ports.tcl set sicsroot ../ source util/utility.tcl -ServerOption LogFileBaseName $sicsroot/log/serverlog +ServerOption LogFileBaseName $sicsroot/log/serverlog -###### installprotocolhandler +###### installprotocolhandler -ServerOption statusfile $sicsroot/log/status.tcl -ServerOption RedirectFile $sicsroot/log/stdout -ServerOption LogFileDir $sicsroot/log +ServerOption statusfile $sicsroot/log/status.tcl +ServerOption RedirectFile $sicsroot/log/stdout +ServerOption LogFileDir $sicsroot/log ServerOption QuieckPort [get_portnum $quieckport ] ServerOption ServerPort [get_portnum $serverport ] ServerOption InterruptPort [get_portnum $interruptport ] -ServerOption TelWord sicslogin +ServerOption TelWord sicslogin ServerOption TelnetPort [get_portnum $telnetport ] -ServerOption ReadUserPasswdTimeout 600000 -ServerOption AcceptTimeOut 10 -ServerOption ReadTimeOut 1000 -SicsUser manager ansto 1 -SicsUser user sydney 2 -SicsUser spy 007 3 +ServerOption ReadUserPasswdTimeout 600000 +ServerOption AcceptTimeOut 10 +ServerOption ReadTimeOut 1000 +SicsUser manager ansto 1 +SicsUser user sydney 2 +SicsUser spy 007 3 MakeDrive #InstallHdb diff --git a/site_ansto/instrument/bilby/bilby_configuration.tcl b/site_ansto/instrument/bilby/bilby_configuration.tcl index a96cbd51..e79827c6 100644 --- a/site_ansto/instrument/bilby/bilby_configuration.tcl +++ b/site_ansto/instrument/bilby/bilby_configuration.tcl @@ -1,8 +1,8 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument bilby +Instrument bilby Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl b/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl index aad90bb9..fe520151 100644 --- a/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl @@ -1,6 +1,6 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -fileeval $cfPath(anticollider)/anticollider_common.tcl +fileeval $cfPath(anticollider)/anticollider_common.tcl namespace eval ::anticollider { set guide_posit 1 diff --git a/site_ansto/instrument/bilby/config/chopper/chopper.tcl b/site_ansto/instrument/bilby/config/chopper/chopper.tcl index 54cdfa05..656ed476 100644 --- a/site_ansto/instrument/bilby/config/chopper/chopper.tcl +++ b/site_ansto/instrument/bilby/config/chopper/chopper.tcl @@ -10,7 +10,7 @@ if {$sim_mode == false} { } ::utility::macro::getset int master_chopper_id {args} { variable sim_mode [SplitReply [chopper_simulation]] - + if {$sim_mode == false} { if {$args == ""} { chopsel send {get master chopper} diff --git a/site_ansto/instrument/bilby/config/commands/commands.tcl b/site_ansto/instrument/bilby/config/commands/commands.tcl index f6a0a1cc..a93e217f 100644 --- a/site_ansto/instrument/bilby/config/commands/commands.tcl +++ b/site_ansto/instrument/bilby/config/commands/commands.tcl @@ -22,20 +22,20 @@ namespace eval motor { # (Xbbs, Zbbs) = beam pos in beamstop coords # (Xdf,Zdf) = detector pos in frame coords # (Xbsf,Zbsf) = beamstop pos in frame coords -# +# # (Xbf,Zbf) = (Xdf+Xbd, Zdf+Zbd) = (Xbsf+Xbbs, Zbsf+Zbbs) # Origin of detector coords = frame origin -# +# # Detector and beamstop motor readings with beamstop disk centers # overlapping over detector center mark. # Xdf = 264.542 (7283813) Zdf = 0 # Xbbs = 296.291 (8054270) # Zbbs = 259.641 (13488244) # Xbd = dethw, Zbd = (dethh) -# +# # 264.542+dethw = Xbsf+296.291 # 0+dethh = Zbsf+259.641 -# +# # Xbsf = -31.749 + dethw, Zbsf = -259.641 + dethh proc selbs {bs {bx "UNDEF"} {bz "UNDEF"}} { set bsdriving false @@ -153,7 +153,7 @@ namespace eval optics { VarMake ::optics::select::section text user VarMake ::optics::polarizer::in text user VarMake ::optics::lens::selection text user - + command rotary_attenuator {int=0,15,45,90,180 angle} { drive att $angle } @@ -180,7 +180,7 @@ namespace eval optics { # @param row, selects a row from the guide configuration table # # eg\n -# guide ga +# guide ga command guide " text=[join [array names ::optics::guide_configuration] , ] configuration " { @@ -193,7 +193,7 @@ namespace eval optics { foreach {compselection position} $guide_configuration($configuration) { foreach el $compselection guide $guide_configuration_columns { 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 set msg [eval "drive $to_config"] diff --git a/site_ansto/instrument/bilby/config/counter/counter.tcl b/site_ansto/instrument/bilby/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/bilby/config/counter/counter.tcl +++ b/site_ansto/instrument/bilby/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/bilby/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/bilby/config/hmm/hmm_configuration.tcl index 42d6507e..59733277 100644 --- a/site_ansto/instrument/bilby/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/bilby/config/hmm/hmm_configuration.tcl @@ -4,7 +4,7 @@ set sim_mode [SplitReply [hmm_simulation]] proc ::histogram_memory::init_OAT_TABLE {} { 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 OAT_TABLE X -setdata MAX_CHAN 240 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_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 ] { return -code error $message } diff --git a/site_ansto/instrument/bilby/config/motors/generated_motor_configuration.tcl b/site_ansto/instrument/bilby/config/motors/generated_motor_configuration.tcl index 35737272..4c0bf543 100644 --- a/site_ansto/instrument/bilby/config/motors/generated_motor_configuration.tcl +++ b/site_ansto/instrument/bilby/config/motors/generated_motor_configuration.tcl @@ -45,7 +45,7 @@ if {$sim_mode == false} { } # ap1 configuration -# Aperture Selector (Collimator SEG 1 Start) +# Aperture Selector (Collimator SEG 1 Start) # Axis number 1 Motor ap1 $motor_driver_type [params\ asyncqueue mc1\ diff --git a/site_ansto/instrument/bilby/config/optics/aperture_configuration.tcl b/site_ansto/instrument/bilby/config/optics/aperture_configuration.tcl index d795ba10..024f427d 100644 --- a/site_ansto/instrument/bilby/config/optics/aperture_configuration.tcl +++ b/site_ansto/instrument/bilby/config/optics/aperture_configuration.tcl @@ -1,17 +1,17 @@ namespace eval optics { array set AttRotLookupTable { - 0 { 0.0 1 } - 30 { 1.3 0.498782 } - 60 { 3.3 0.176433 } - 90 { 4.9 0.0761367 } - 120 { 6.4 0.0353985 } - 150 { 8.3 0.0137137 } - 180 { 9.6 0.00614167 } - 210 {11.2 0.00264554 } - 240 {13.1 0.000994504 } - 270 {15.0 0.000358897 } - 300 {18.0 7.2845e-05 } - 330 {25.0 1.67827e-06 } + 0 { 0.0 1 } + 30 { 1.3 0.498782 } + 60 { 3.3 0.176433 } + 90 { 4.9 0.0761367 } + 120 { 6.4 0.0353985 } + 150 { 8.3 0.0137137 } + 180 { 9.6 0.00614167 } + 210 {11.2 0.00264554 } + 240 {13.1 0.000994504 } + 270 {15.0 0.000358897 } + 300 {18.0 7.2845e-05 } + 330 {25.0 1.67827e-06 } } array set EApLookupTable { diff --git a/site_ansto/instrument/bilby/config/optics/guide_configuration.tcl b/site_ansto/instrument/bilby/config/optics/guide_configuration.tcl index a66f2b84..a7796221 100644 --- a/site_ansto/instrument/bilby/config/optics/guide_configuration.tcl +++ b/site_ansto/instrument/bilby/config/optics/guide_configuration.tcl @@ -1,5 +1,5 @@ ## -# @file +# @file # A guide configuration table where each line describes the setup # for a mode of operation. # The table will have a corresponding interpretation list which provides @@ -7,7 +7,7 @@ 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) array set c1_map {G 1 MT 2 P 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} # 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) # 2. The entrance aperature position in mm # 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 { - 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} - lp {{MT MT MT MT MT MT MT MT LP} 675} - lens {{MT A A A A A A A L } 675} - p1 {{P A MT MT MT MT MT MT MT} 4621} - p1lp {{P A MT MT MT MT MT MT LP} 4621} - p1lens {{P A MT MT MT MT MT MT L } 4621} - g1 {{G A A A A A A A A } 4929} - p2 {{P 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} - g3 {{G G G A A A A A A } 8949} - p4 {{P 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} - g5 {{G G G G G A A A A } 12943} - p6 {{P 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} - g7 {{G G G G G G G A A } 16971} - p8 {{P 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} - g9 {{G G G G G G G G G } 19925} + lp {{MT MT MT MT MT MT MT MT LP} 675} + lens {{MT A A A A A A A L } 675} + p1 {{P A MT MT MT MT MT MT MT} 4621} + p1lp {{P A MT MT MT MT MT MT LP} 4621} + p1lens {{P A MT MT MT MT MT MT L } 4621} + g1 {{G A A A A A A A A } 4929} + p2 {{P 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} + g3 {{G G G A A A A A A } 8949} + p4 {{P 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} + g5 {{G G G G G A A A A } 12943} + p6 {{P 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} + g7 {{G G G G G G G A A } 16971} + p8 {{P 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} + g9 {{G G G G G G G G G } 19925} } # This list maps the motor names to columns of the # guide_configuration table. set guide_configuration_columns { c1 c2 c3 c4 c5 c6 c7 c8 c9 -} +} } diff --git a/site_ansto/instrument/bilby/config/plc/plc.tcl b/site_ansto/instrument/bilby/config/plc/plc.tcl index 739abdb7..7ce59e90 100644 --- a/site_ansto/instrument/bilby/config/plc/plc.tcl +++ b/site_ansto/instrument/bilby/config/plc/plc.tcl @@ -1,5 +1,5 @@ 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] MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/bilby/hostport_config.tcl b/site_ansto/instrument/bilby/hostport_config.tcl index cbfb6b23..d8910aa0 100644 --- a/site_ansto/instrument/bilby/hostport_config.tcl +++ b/site_ansto/instrument/bilby/hostport_config.tcl @@ -22,7 +22,7 @@ foreach {bm host port} { } # HISTOGRAM SERVER HOST AND PORT -# TODO HV control +# TODO HV control foreach {key host port} { HMM das1-bilby.nbi.ansto.gov.au 8080 HMSTAT das1-bilby.nbi.ansto.gov.au 8081 diff --git a/site_ansto/instrument/config/anticollider/anticollider_common.tcl b/site_ansto/instrument/config/anticollider/anticollider_common.tcl index 81e08ad0..c9b0ec8a 100644 --- a/site_ansto/instrument/config/anticollider/anticollider_common.tcl +++ b/site_ansto/instrument/config/anticollider/anticollider_common.tcl @@ -6,7 +6,7 @@ AntiCollisionInstall namespace eval anticollider { variable veto_region } -array unset ::anticollider::veto_region +array unset ::anticollider::veto_region array set ::anticollider::veto_region "" # Don't show 'acscript' call on error. This is done by the anticollider @@ -45,7 +45,7 @@ proc handle_acscript_exception {status message args} { proc ::anticollider::loadscript {args} { variable veto_rules - set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ] + set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ] while {[gets $fh line] >= 0} { # Skip empty lines and comments if [regexp {^\s*$|^ *#} $line] { @@ -60,7 +60,7 @@ proc ::anticollider::loadscript {args} { # for the anticollider script. # # @param veto_rules, an anticollider declaration as a list of quote enclosed lines. -# @return Generates the ::anticollider::veto_region lookup table. +# @return Generates the ::anticollider::veto_region lookup table. # # Example\n # forbid {160 167} for stth when mtth in {87 88}\n @@ -72,7 +72,7 @@ proc ::anticollider::loadscript {args} { # forbid {0 10} for samx whenall { samrot in {0 5} samy in {0 15} }\n proc ::anticollider::genveto {veto_rules} { variable veto_region - array unset veto_region + array unset veto_region set lnum 1 foreach line $veto_rules { @@ -98,7 +98,7 @@ proc ::anticollider::genveto {veto_rules} { } ## -# @brief Instrument specific configurations should re-implement this if they want +# @brief Instrument specific configurations should re-implement this if they want # to override the anticollision detection on some conditions # # @param args list of motorname target pairs @@ -113,7 +113,7 @@ proc ::anticollider::enable {args} { # WARNING: This does not handle sequencing. Only run one motor at a time. # This script requires that an ::anticollider::veto_region has been generated # by the ::anticollider::genveto procedure. -# +# # The ::anticollider::veto_region is a hash indexed by the names of the motors # which have been registered with the anticollision module. proc ::anticollider::veto_region_acscript {args} { diff --git a/site_ansto/instrument/config/commands/commands_common.tcl b/site_ansto/instrument/config/commands/commands_common.tcl index 0057f0af..bbd09e98 100644 --- a/site_ansto/instrument/config/commands/commands_common.tcl +++ b/site_ansto/instrument/config/commands/commands_common.tcl @@ -86,7 +86,7 @@ command hdb_bmonscan { text=monitor,timer mode float preset int=0,2 channel -} { +} { bmonscan clear # bmonscan configure script @@ -154,7 +154,7 @@ scriptcallback connect bm COUNTSTART "::monitor::count -set feedback status BUSY scriptcallback connect bm COUNTEND "::monitor::count -set feedback status IDLE" ################################################################################ -# Generate the following commands, +# Generate the following commands, # ::motor::go_home namespace eval ::motor { set NS [uplevel namespace current] @@ -162,8 +162,8 @@ scriptcallback connect bm COUNTEND "::monitor::count -set feedback status IDLE return -code error "ERROR: Instrument specific command config must set ${NS}::is_homing_list\n" } command go_home "text=$is_homing_list motors" { - # Instrument specific command configurations must define - # ::motor::is_homing_list, this is a possibly empty comma separated list + # Instrument specific command configurations must define + # ::motor::is_homing_list, this is a possibly empty comma separated list # of motors which are safe to send to home variable is_homing_list diff --git a/site_ansto/instrument/config/commands/hvcommands.tcl b/site_ansto/instrument/config/commands/hvcommands.tcl index 14b71618..a03c96b3 100644 --- a/site_ansto/instrument/config/commands/hvcommands.tcl +++ b/site_ansto/instrument/config/commands/hvcommands.tcl @@ -4,13 +4,13 @@ set scaleval 1000.0 proc SetVoltScale {newscaleval} { global scaleval set scaleval $newscaleval -} - +} + proc VoltScale {involt} { global scaleval return [expr {($involt*1.0)/$scaleval}] } - + proc SetVolt {volt} { if {$volt== 0} { PulserOff @@ -56,7 +56,7 @@ proc VoltRamp {start step fin oscno} { newfile HISTOGRAM_XY set loopvar 1 - set i 0 + set i 0 while {$loopvar} { set j [expr {$i*$step+$start}] if {$j> $fin && $step > 0} {break} @@ -71,7 +71,7 @@ proc VoltRamp {start step fin oscno} { oscmd start $oscno hmm countblock save $i - incr i + incr i } oscmd stop } @@ -81,7 +81,7 @@ proc VoltTextureRamp {start step fin mot tstart tstep tfin oscno} { set loopvar 1 - set i 0 + set i 0 while {$loopvar} { set j [expr {$i*$step+$start}] if {$j> $fin && $step > 0} {break} @@ -105,7 +105,7 @@ proc VoltTextureRamp {start step fin mot tstart tstep tfin oscno} { oscmd start $oscno hmm countblock save $m - incr m + incr m } oscmd stop incr i @@ -121,14 +121,14 @@ proc SquarePulseTexture {motor start step numsteps volt freq bins oscno} { set pulservolt [VoltScale $volt] PulserSquare $freq $pulservolt PulserOn - + for {set i 0} {$i < $numsteps} {incr i} { drive $motor [expr $i*$step+$start] oscmd start $oscno hmm countblock save $i } - + oscmd stop } @@ -140,14 +140,14 @@ proc UniPulseTexture {motor start step numsteps volt freq bins oscno} { set pulservolt [VoltScale [expr ($volt*1.0/2)]] PulserSquareOffs $freq $pulservolt $pulservolt PulserOn - + for {set i 0} {$i < $numsteps} {incr i} { drive $motor [expr $i*$step+$start] oscmd start $oscno hmm countblock save $i } - + oscmd stop } @@ -167,7 +167,7 @@ proc BehlkePulseTexture {motor start step numsteps freq bins oscno} { } } - + proc SquarePulseVolt {start step fin freq bins oscno} { histmem mode unlimited @@ -175,7 +175,7 @@ proc SquarePulseVolt {start step fin freq bins oscno} { histmem_period_strobo $freq $bins wait 3 set loopvar 1 - set i 0 + set i 0 while {$loopvar} { set j [expr {$i*$step+$start}] if {$j> $fin && $step > 0} {break} @@ -191,7 +191,7 @@ proc SquarePulseVolt {start step fin freq bins oscno} { oscmd start $oscno hmm countblock save $i - incr i + incr i } oscmd stop } @@ -200,7 +200,7 @@ proc SquarePulseFreq {volt freqlist bins oscno} { histmem mode unlimited newfile HISTOGRAM_XYT set loopvar 1 - set i 0 + set i 0 foreach freq $freqlist { set pulservolt [VoltScale $volt] histmem_period_strobo $freq $bins @@ -211,7 +211,7 @@ proc SquarePulseFreq {volt freqlist bins oscno} { oscmd start $oscno hmm countblock save $i - incr i + incr i } oscmd stop } @@ -259,7 +259,7 @@ proc UniPulseFreq {volt freqlist bins oscno} { histmem mode unlimited newfile HISTOGRAM_XYT set loopvar 1 - set i 0 + set i 0 foreach freq $freqlist { set pulservolt [VoltScale [expr ($volt*1.0/2)]] histmem_period_strobo $freq $bins @@ -271,7 +271,7 @@ proc UniPulseFreq {volt freqlist bins oscno} { oscmd start $oscno hmm countblock save $i - incr i + incr i } oscmd stop } @@ -298,7 +298,7 @@ proc UniPulseFatigue {volt freq bins oscno reps runs} { } - + proc PulserBurst {} { @@ -341,7 +341,7 @@ proc VoltPulseRun {vlo vhi freq cycl} { proc VoltPulses {vlo vhi freq cycl} { - PulserOff + PulserOff pulser send "FUNC SQU;:FUNC?" VoltPulseRun $vlo $vhi $freq $cycl } @@ -350,7 +350,7 @@ proc VoltTriPulses {vlo vhi freq cycl} { PulserOff pulser send "FUNC RAMP;:FUNC?" pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?" - VoltPulseRun $vlo $vhi $freq $cycl + VoltPulseRun $vlo $vhi $freq $cycl } proc OneTri {volt period} { @@ -375,7 +375,7 @@ proc OneTri {volt period} { PulserOff } - + publish GetVolt user publish SetDC user diff --git a/site_ansto/instrument/config/commands/pulser.tcl b/site_ansto/instrument/config/commands/pulser.tcl index 0fd84bc4..944c6998 100644 --- a/site_ansto/instrument/config/commands/pulser.tcl +++ b/site_ansto/instrument/config/commands/pulser.tcl @@ -58,7 +58,7 @@ proc PulserDC {Volt} { } - + publish PulserOn user diff --git a/site_ansto/instrument/config/counter/counter_common_1.tcl b/site_ansto/instrument/config/counter/counter_common_1.tcl index a902ca53..9ad2782c 100644 --- a/site_ansto/instrument/config/counter/counter_common_1.tcl +++ b/site_ansto/instrument/config/counter/counter_common_1.tcl @@ -2,7 +2,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list } proc ::counter::transferscript {} { @@ -21,7 +21,7 @@ proc ::counter::ic_initialize {} { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list set sim_mode [SplitReply [counter_simulation]] if {$sim_mode == "true"} { diff --git a/site_ansto/instrument/config/environment/he3/sct_he3.tcl b/site_ansto/instrument/config/environment/he3/sct_he3.tcl index e0ec18d0..29041a64 100644 --- a/site_ansto/instrument/config/environment/he3/sct_he3.tcl +++ b/site_ansto/instrument/config/environment/he3/sct_he3.tcl @@ -1,5 +1,5 @@ ## -# @file He3 controller +# @file He3 controller # # Author: Jing Chen (jgn@ansto.gov.au) June 2010 # @@ -10,7 +10,7 @@ # PORT 6290 # tuning 1 # interval 2 -# } +# } # # NOTE: # If tuning=1 this will generate gom/set_gom, gchi/set_gchi and gphi/set_gphi @@ -20,7 +20,7 @@ namespace eval ::scobj::he3 { } - + ## # @brief Request a state from the He3 controller by sending a get command proc ::scobj::he3::rqStatFunc {} { @@ -44,12 +44,12 @@ proc ::scobj::he3::rdStatFunc {basePath} { hset $basePath/Amplitude $stateArr(amp) hset $basePath/Frequence $stateArr(fre) - hset $basePath/NaN $stateArr(nan) - hset $basePath/T2 $stateArr(t2) + hset $basePath/NaN $stateArr(nan) + hset $basePath/T2 $stateArr(t2) broadcast "Amp:$stateArr(amp); Fre:$stateArr(fre); NaN:$stateArr(nan); T2:$stateArr(t2)\n" } - + if {$replyStr != [sct oldval]} { sct oldval $replyStr sct update $replyStr @@ -81,14 +81,14 @@ proc ::scobj::he3::checkReplyFunc {basePath} { ## # @brief Make a He3 controller -# -# @param argList, {name "he3" IP localhost PORT 62900 tuning 1 interval 2} +# +# @param argList, {name "he3" IP localhost PORT 62900 tuning 1 interval 2} # # name: name of he3 controller object # IP: IP address of RF generator moxa box # PORT: Port number assigned to the generator on the moxa-box # tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions -# interval: polling and ramping interval in seconds. +# interval: polling and ramping interval in seconds. proc ::scobj::he3::mkHe3 {argList} { # Generate parameter array from the argument list foreach {k v} $argList { @@ -136,8 +136,8 @@ proc ::scobj::he3::mkHe3 {argList} { hsetprop $hdbPath mutable $mutable hsetprop $hdbPath sdsinfo ::nexus::scobj::sdsinfo } - - ::scobj::hinitprops $pa(NAME) + + ::scobj::hinitprops $pa(NAME) makesctcontroller sct_he3 std $pa(IP):$pa(PORT) @@ -145,7 +145,7 @@ proc ::scobj::he3::mkHe3 {argList} { hsetprop $hPath rdState ::scobj::he3::rdStatFunc $hPath # Initialise properties required for generating the API for GumTree and to save data - #::scobj::hinitprops $pa(NAME) Amplitude Frequence NaN T2 + #::scobj::hinitprops $pa(NAME) Amplitude Frequence NaN T2 if {[SplitReply [environment_simulation]]=="false"} { sct_he3 poll $hPath $pa(INTERVAL) @@ -158,7 +158,7 @@ proc ::scobj::he3::mkHe3 {argList} { ::scobj::hinitprops $pa(NAME) send_trigger - hsetprop $hPath/send_trigger write ::scobj::he3::sendTrigger + hsetprop $hPath/send_trigger write ::scobj::he3::sendTrigger hsetprop $hPath/send_trigger checkReply ::scobj::he3::checkReplyFunc /sics/$pa(NAME) if {[SplitReply [environment_simulation]]=="false"} { @@ -173,7 +173,7 @@ proc He3Trigger {} { sct_he3 send $cmd } -publish He3Trigger user +publish He3Trigger user # main driver call diff --git a/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl b/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl index a82de6a4..3776ae44 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_bruker_BEC1.tcl @@ -575,7 +575,7 @@ proc ExtractValue {response lastQueryCmd} { # update the node last_error_msg hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg $::scobj::bruker_BEC1::bruker_BEC1_errMsg hset $::scobj::bruker_BEC1::bruker_BEC1_path2nodes/emon/last_error_msg2 $::scobj::bruker_BEC1::bruker_BEC1_errMsg2 - #if { 0 != [string compare -length 4 $lastQueryCmd "POL/"] + #if { 0 != [string compare -length 4 $lastQueryCmd "POL/"] # || $::scobj::bruker_BEC1::bruker_BEC1_polarityUnitAbsent == false} { #} } @@ -1318,7 +1318,7 @@ proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol CID CTYPE} { # for generating the GumTree interface and saving data for script context objects (hdf file) # @param scobj, name of script context object (path to a node) # @param par, optional parameter (name of the node variable) - + # Changed ffr 20100625: do not call hinitprops to avoid a conflict with a change in SICServer vers. 2_5 #::scobj::hinitprops $tempobj/sensor nominal_outp_current hsetprop $scobj_hpath/pwrctrl/statusByte control false diff --git a/site_ansto/instrument/config/environment/magneticField/sct_green_magnet.tcl b/site_ansto/instrument/config/environment/magneticField/sct_green_magnet.tcl index 86241f4e..12bcddfa 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_green_magnet.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_green_magnet.tcl @@ -1,5 +1,5 @@ ## -# @file Green Magnetic Controller +# @file Green Magnetic Controller # # This is a driver for SICS to make following communication with the Labview Green Magnet device # @@ -67,14 +67,14 @@ proc ::scobj::green::rqGreenMagnetFunc {basePath} { ## # @brief Make a Green Magnet Controller -# -# @param argList, {name "magnetic" IP localhost PORT 65123 tuning 1 interval 1} +# +# @param argList, {name "magnetic" IP localhost PORT 65123 tuning 1 interval 1} # # name: name of green magnet controller object # IP: IP address of RF generator moxa box # POT: Port number assigned to the generator on the moxa-box # tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions -# interval: polling and ramping interval in seconds. +# interval: polling and ramping interval in seconds. proc ::scobj::green::mkGreen {argList} { # Generate parameter array from the argument list @@ -84,12 +84,12 @@ proc ::scobj::green::mkGreen {argList} { } MakeSICSObj $pa(NAME) SCT_OBJECT - sicslist setatt $pa(NAME) klass environment + sicslist setatt $pa(NAME) klass environment sicslist setatt $pa(NAME) long_name $pa(NAME) set scobj_hpath /sics/$pa(NAME) - hfactory $scobj_hpath/output plain user float + hfactory $scobj_hpath/output plain user float hfactory $scobj_hpath/PSU_Vol plain user float hfactory $scobj_hpath/ramping_rate plain user text hfactory $scobj_hpath/insTarget plain user float @@ -118,7 +118,7 @@ proc ::scobj::green::mkGreen {argList} { hsetprop $scobj_hpath type part hsetprop $scobj_hpath control true hsetprop $scobj_hpath data true - + foreach {hpath klass control data nxsave mutable priv alias} { output NXenvironment true true true true user green_output PSU_Vol NXenvironment true true true true user green_PSU_Vol @@ -143,11 +143,11 @@ proc ::scobj::green::mkGreen {argList} { hsetprop $scobj_hpath/pollNode oldval "UNKNOWN" #if {[SplitReply [environment_simulation]]=="false"} { - sct_green poll $scobj_hpath/pollNode $pa(INTERVAL) - #} + sct_green poll $scobj_hpath/pollNode $pa(INTERVAL) + #} } -# Set the magnetic voltage field +# Set the magnetic voltage field proc greenVol {{vol ""} args} { set NAME "green_magnet" @@ -156,7 +156,7 @@ proc greenVol {{vol ""} args} { } else { if {$vol<[SplitReply [hgetprop /sample/$NAME/output lowlimit]] || \ $vol>[SplitReply [hgetprop /sample/$NAME/output uplimit]]} { - return -code error "setpoint violates limits" + return -code error "setpoint violates limits" } else { if {$vol > [hval /sample/$NAME/Bmax]} { broadcast "Maximum field limit is [hval /sample/$NAME/Bmax], reset again!" @@ -164,7 +164,7 @@ proc greenVol {{vol ""} args} { } else { #hset /sample/$NAME/setPoint $vol set comm "set $vol\r\n" - sct_green send $comm + sct_green send $comm #after 2000 #while {[hval /sample/$NAME/status] == "busy"} { # broadcast "Magnet Ramping at [hval /sample/$NAME/output]" @@ -192,7 +192,7 @@ publish greenVol user #PORT 22 ::scobj::green::mkGreen { name "green_magnet" - IP 137.157.204.57 + IP 137.157.204.57 PORT 22 tuning 1 interval 3 diff --git a/site_ansto/instrument/config/environment/magneticField/sct_lakeshore_460.tcl b/site_ansto/instrument/config/environment/magneticField/sct_lakeshore_460.tcl index 18701bf2..d7c6e53a 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_lakeshore_460.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_lakeshore_460.tcl @@ -190,8 +190,8 @@ debug_log "rdState $tc_root state=$my_state" } elseif {$my_state == "STATE_UNIT"} { hsetprop $tc_root/ls460_state my_state "STATE_CHNL_SET" hsetprop [sct] unit [sct result] - hsetprop $tc_root/Display/$my_chan units [SplitReply [hgetprop [sct] unit]] - hsetprop $tc_root/Display/$my_chan mult [SplitReply [hgetprop [sct] mult]] + hsetprop $tc_root/Display/$my_chan units [SplitReply [hgetprop [sct] unit]] + hsetprop $tc_root/Display/$my_chan mult [SplitReply [hgetprop [sct] mult]] hsetprop $tc_root/Display/$my_chan field [SplitReply [hgetprop [sct] field]] switch -exact [SplitReply [hgetprop [sct] mult]] { "u" { set multiplier 0.000001 } diff --git a/site_ansto/instrument/config/environment/magneticField/sct_oxford_ips.tcl b/site_ansto/instrument/config/environment/magneticField/sct_oxford_ips.tcl index 048919ac..4bb844f4 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_oxford_ips.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_oxford_ips.tcl @@ -166,7 +166,7 @@ debug_log "getState $tc_root $nextState $cmd sct=[sct]" } elseif {$my_state == "STATE_I"} { if { [hval $tc_root/Display/H] == 1 } { set my_cmd "I[hval $tc_root/Display/OutputCurrent]" - } elseif { ([hval $tc_root/Display/H] == 0 || [hval $tc_root/Display/H] == 2) } { + } elseif { ([hval $tc_root/Display/H] == 0 || [hval $tc_root/Display/H] == 2) } { set my_cmd "I[hval $tc_root/Display/PstntCurrent]" } } elseif {$my_state == "STATE_J"} { diff --git a/site_ansto/instrument/config/environment/magneticField/sct_oxford_labview.tcl b/site_ansto/instrument/config/environment/magneticField/sct_oxford_labview.tcl index de802f25..b952cdba 100644 --- a/site_ansto/instrument/config/environment/magneticField/sct_oxford_labview.tcl +++ b/site_ansto/instrument/config/environment/magneticField/sct_oxford_labview.tcl @@ -1,5 +1,5 @@ ## -# @file Magnetic Controller +# @file Magnetic Controller # # This is a driver for SICS to make following communication with the Labview Oxford device # @@ -37,13 +37,13 @@ proc ::scobj::magnetic::setting {field basePath} { switch -exact $field { "field" {set comm "setF $fieldVal\r\n" - hset $basePath/fieldSetPoint $fieldVal + hset $basePath/fieldSetPoint $fieldVal } "rate" {set comm "setR $fieldVal\r\n" - hset $basePath/fieldSetRate $fieldVal + hset $basePath/fieldSetRate $fieldVal } "DiluxTemp" {set comm "setDilutTemp $fieldVal\r\n" - hset $basePath/DilutTempSetPoint $fieldVal + hset $basePath/DilutTempSetPoint $fieldVal } "HelioxTemp" {set comm "setHelioxTemp $fieldVal\r\n" hset $basePath/HelioxTempSetPoint $fieldVal @@ -181,7 +181,7 @@ proc ::scobj::magnetic::rdTempStateFunc {basePath field} { hset $basePath/Temp_s1 $paraArr(T1) hset $basePath/Temp_s2 $paraArr(T2) hset $basePath/Temp_s3 $paraArr(T3) - + set logText "Displayed Temp : $paraArr(T1) $paraArr(T2) $paraArr(T3)" } "Heliox" {set s1 [string trimright $replyStr "\n"] @@ -222,14 +222,14 @@ proc ::scobj::magnetic::rdTempStateFunc {basePath field} { ## # @brief Make a Magnetic Controller -# -# @param argList, {name "magnetic" IP localhost PORT 65123 tuning 1 interval 1} +# +# @param argList, {name "magnetic" IP localhost PORT 65123 tuning 1 interval 1} # # name: name of magnetic controller object # IP: IP address of RF generator moxa box # POT: Port number assigned to the generator on the moxa-box # tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions -# interval: polling and ramping interval in seconds. +# interval: polling and ramping interval in seconds. proc ::scobj::magnetic::mkMagnetic {argList} { # Generate parameter array from the argument list @@ -244,7 +244,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} { set hPath /sics/$pa(NAME) - hfactory $hPath/field plain user text + hfactory $hPath/field plain user text hfactory $hPath/magneticFieldCurrent plain user float hfactory $hPath/magneticFieldTesla plain user float @@ -274,10 +274,10 @@ proc ::scobj::magnetic::mkMagnetic {argList} { hset $hPath/magneticFieldTesla 10 hset $hPath/fieldSetPoint 0 - # Setting Heliox Temperature & initiate + # Setting Heliox Temperature & initiate hfactory $hPath/HelioxTempSetPoint plain user float # This feature needs to implement the Labview code to get current reading of the Heliox tempterature - hfactory $hPath/HelioxTempReading plain user float + hfactory $hPath/HelioxTempReading plain user float hset $hPath/HelioxTempSetPoint 0 hset $hPath/HelioxTempReading 0 @@ -294,7 +294,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} { hsetprop $hPath/field oldval UNKNOWN hsetprop $hPath/HelioxTempReading oldval UNKNOWN hsetprop $hPath/DilutTempReading oldval UNKNOWN - + # add HDB file hsetprop $hPath klass environment hsetprop $hPath privilege spy @@ -323,7 +323,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} { } # Initialise properties required for generating the API for GumTree and to save data - ::scobj::hinitprops $pa(NAME) + ::scobj::hinitprops $pa(NAME) # proc ::histogram_memory::pre_count "{fPath $pa(NAME)}" { # hset /sics/$fPath/start_magnetic [hval /sics/$fPath/magneticFieldCurrent] @@ -343,7 +343,7 @@ proc ::scobj::magnetic::mkMagnetic {argList} { makesctcontroller sct_magnetic std $pa(IP):$pa(PORT) - hsetprop $hPath/field read ::scobj::magnetic::rqFieldFunc + hsetprop $hPath/field read ::scobj::magnetic::rqFieldFunc hsetprop $hPath/field rdFieldState ::scobj::magnetic::rdFieldStateFunc $hPath hsetprop $hPath/Temp read ::scobj::magnetic::rqTempFunc "sample" @@ -356,11 +356,11 @@ proc ::scobj::magnetic::mkMagnetic {argList} { hsetprop $hPath/DilutTempReading rdTempState ::scobj::magnetic::rdTempStateFunc $hPath "Dilut" if {[SplitReply [environment_simulation]]=="false"} { - sct_magnetic poll $hPath/field $pa(INTERVAL) + sct_magnetic poll $hPath/field $pa(INTERVAL) sct_magnetic poll $hPath/Temp $pa(INTERVAL) sct_magnetic poll $hPath/HelioxTempReading $pa(INTERVAL) sct_magnetic poll $hPath/DilutTempReading $pa(INTERVAL) - } + } hsetprop $hPath tuning $pa(TUNING) @@ -372,25 +372,25 @@ proc ::scobj::magnetic::mkMagnetic {argList} { hfactory $hPath/set_HeaterSwitch plain user text hsetprop $hPath/set_magneticField write ::scobj::magnetic::setting "field" $hPath - hsetprop $hPath/set_rate write ::scobj::magnetic::setting "rate" $hPath + hsetprop $hPath/set_rate write ::scobj::magnetic::setting "rate" $hPath hsetprop $hPath/set_DiluxTemp write ::scobj::magnetic::setting "DiluxTemp" $hPath hsetprop $hPath/set_HelioxTemp write ::scobj::magnetic::setting "HelioxTemp" $hPath hsetprop $hPath/set_HeaterSwitch write ::scobj::magnetic::setting "HeaterS" $hPath - hsetprop $hPath/set_magneticField checkReply ::scobj::magnetic::checkReplyFunc $hPath + hsetprop $hPath/set_magneticField checkReply ::scobj::magnetic::checkReplyFunc $hPath if {[SplitReply [environment_simulation]]=="false"} { sct_magnetic write $hPath/set_rate - sct_magnetic write $hPath/set_magneticField + sct_magnetic write $hPath/set_magneticField sct_magnetic write $hPath/set_DiluxTemp sct_magnetic write $hPath/set_HelioxTemp sct_magnetic write $hPath/set_HeaterSwitch - } + } } } -# Querying/Setting the magnetic field -# command is : OxfordSetField fieldValue P ; where "P" is an optinal parameter and if set will change +# Querying/Setting the magnetic field +# command is : OxfordSetField fieldValue P ; where "P" is an optinal parameter and if set will change # to posistent mode after changig the magnetic field proc OxfordSetField {{setPoint ""} {mode ""} args} { set NAME "magnetic" @@ -405,10 +405,10 @@ proc OxfordSetField {{setPoint ""} {mode ""} args} { if {$mode == ""} { set comm "setF $setPoint\r\n" - sct_magnetic send $comm + sct_magnetic send $comm } elseif {$mode == "P"} { set comm "setF $setPoint Pers\r\n" - sct_magnetic send $comm + sct_magnetic send $comm } else { broadcast "Wrong parameters being provided, check!" return diff --git a/site_ansto/instrument/config/environment/sct_autolab.tcl b/site_ansto/instrument/config/environment/sct_autolab.tcl index 6decbbf4..3c61d662 100755 --- a/site_ansto/instrument/config/environment/sct_autolab.tcl +++ b/site_ansto/instrument/config/environment/sct_autolab.tcl @@ -78,7 +78,7 @@ debug_log "setPoint: sct=[sct] target=[sct target] writestatus=[sct writestatus] set err_msg "Invalid Pallet_ Num: [hval $tc_root/Control/Pallet_Nam]" } elseif { [hval $tc_root/Control/Pallet_Idx] < 1 || [hval $tc_root/Control/Pallet_Idx] > 50 } { set err_msg "Invalid Pallet_Idx: [hval $tc_root/Control/Pallet_Idx]" - } + } if { $err_msg != "" } { sct print "error:$err_msg" debug_log "error:$err_msg" diff --git a/site_ansto/instrument/config/environment/sct_mvp.tcl b/site_ansto/instrument/config/environment/sct_mvp.tcl index 72349cef..9e5d7144 100755 --- a/site_ansto/instrument/config/environment/sct_mvp.tcl +++ b/site_ansto/instrument/config/environment/sct_mvp.tcl @@ -101,14 +101,14 @@ debug_log "chkWrite new data for $tc_root [sct] result=\"$data\"" set data [expr {[sct target]}] if { $data < 1 || $data > 6 } { set err_msg "Invalid Position: $data" - } + } if { $err_msg != "" } { sct print "error:$err_msg" debug_log "error:$err_msg" return -code error "$err_msg" } if { [hval $tc_root/Control/Direction] == "cw" } { - set par "0" + set par "0" } elseif { [hval $tc_root/Control/Direction] == "ccw" } { set par "1" } else { @@ -117,13 +117,13 @@ debug_log "chkWrite new data for $tc_root [sct] result=\"$data\"" sct oldval 1 } if {($data - [sct oldval]) < -2} { - set par "0" + set par "0" } elseif {($data - [sct oldval]) < 0} { - set par "1" + set par "1" } elseif {($data - [sct oldval]) > 3} { - set par "1" + set par "1" } else { - set par "0" + set par "0" } } if {$data != [sct oldval]} { diff --git a/site_ansto/instrument/config/environment/sct_protek_common.tcl b/site_ansto/instrument/config/environment/sct_protek_common.tcl index 03fbaa51..93e6d060 100644 --- a/site_ansto/instrument/config/environment/sct_protek_common.tcl +++ b/site_ansto/instrument/config/environment/sct_protek_common.tcl @@ -33,9 +33,9 @@ # PERCENT2:1/0 dBm2:1/0 # m2:1/0 V2:1/0 A2:1/0 DEGK2:1/0 # G2:1/0 M2:1/0 k2:1/0 OHM2:1/0 Hz2:1/0 - + # ROTSWITCH:[0-8] - + ### The return values for nine bytes is undocumented, ### they are labelled as X1 to X9 # X[1-9]:? @@ -125,7 +125,7 @@ proc MakeProtek {name IP PORT {scale 1.0} {offset 0.0} {interval 0.5} {cbFunc "r sicslist setatt $sobjName long_name $sobjName hfactory /sics/$soState/state plain user text - hsetprop /sics/$soState/state read rqStateRep + hsetprop /sics/$soState/state read rqStateRep hsetprop /sics/$soState/state rdStateRep rdStateRep hsetprop /sics/$soState/state oldval "UNKNOWN" hsetprop /sics/$sobjName read rqVal "reportVal" diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_218.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_218.tcl index 181864ce..a0ee4a12 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_218.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_218.tcl @@ -6,7 +6,7 @@ # /*-------------------------------------------------------------------------- # L A K E S H O R E 3 x x S E R I E S D R I V E R # -# This file contains the implementation of a driver for the Lakeshore 218 +# This file contains the implementation of a driver for the Lakeshore 218 # controller implemented as a scriptcontext object in TCL. # object in TCL. # @@ -43,7 +43,7 @@ proc ::scobj::ls218::getValue {idx cmd chID nextState} { if {[ catch { if {[hpropexists [sct] geterror]} { hdelprop [sct] geterror - } + } if {$chID == 1} { set comm "$cmd $idx" @@ -57,7 +57,7 @@ proc ::scobj::ls218::getValue {idx cmd chID nextState} { } } else { return -code error "in getValue: error input Ch ID" - } + } sct send "$comm\r\n" } message ]} { return -code error "in getValue: $message" @@ -79,7 +79,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { if {[string first "ASCERR" $replyData] != -1} { sct geterror $replyData - return -code error "Error in LS218 Response: $replyData" + return -code error "Error in LS218 Response: $replyData" } elseif {[string length $replyData] < 1} { return -code error "Error in LS218: no message returned from device" } else { @@ -88,7 +88,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { } switch -exact $varName { - "alarm" { if {[lindex $fields 0] == 0} { + "alarm" { if {[lindex $fields 0] == 0} { hset $nodeName/offOn off } else { hset $nodeName/offOn on @@ -105,7 +105,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { hset $nodeName/deadband [lindex $fields 4] hset $nodeName/latchEnable [lindex $fields 5] } - "aStatus" { if {[lindex $fields 0] == 0} { + "aStatus" { if {[lindex $fields 0] == 0} { hset $nodeName/highStatus Unactivated } else { hset $nodeName/highStatus Activated @@ -116,8 +116,8 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { hset $nodeName/lowStatus Activated } } - "Celsius" { hset $nodeName [lindex $fields 0] - set curValue [lindex $fields 0] + "Celsius" { hset $nodeName [lindex $fields 0] + set curValue [lindex $fields 0] } "CurveHd" { hset $nodeName/curve [lindex $fields 0] hset $nodeName/name [lindex $fields 1] @@ -127,7 +127,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { 3 {hset $nodeName/format Ohm/K} 4 {hset $nodeName/format "log Ohm/K"} default {} - } + } hset $nodeName/limitValue [lindex $fields 4] switch -exact [lindex $fields 5] { 1 {hset $nodeName/coefficient negative} @@ -165,7 +165,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { default { hset $nodeName UNKNOW} } } - "Kelvin" { hset $nodeName $fields + "Kelvin" { hset $nodeName $fields #append $logString " Kelvin - $fields;" set curValue $fields } @@ -178,7 +178,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { default { hset $nodeName/xSource UNKNOW} } } - "LinearEquData" { hset $nodeName $fields + "LinearEquData" { hset $nodeName $fields set curValue $fields } "mnmxSource" { switch -exact [lindex $fields 0] { @@ -190,17 +190,17 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { } } "mnmxValue" { hset $nodeName "[lindex $fields 0] , [lindex $fields 1]"} - "status" { + "status" { # RDGST? chID Reads input status returns an integer with the following meaning # Bit Weighting StatusIndicator # 4 16 temp underrange # 5 32 temp overrange - # 6 64 units under range - # 7 128 untis over range + # 6 64 units under range + # 7 128 untis over range set field [string trimleft $fields 0] if {[string length $field] == 0} { set field 0 - } + } set str "" set i [format %x $field] @@ -219,11 +219,11 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { hset $nodeName $str } - "SensorUnitValue" { hset $nodeName $fields + "SensorUnitValue" { hset $nodeName $fields #append $logString " SensorUnitValue - $fields;" set curValue $fields } - "data" { hset $nodeName $fields + "data" { hset $nodeName $fields set curValue $fields } "aOutput" { switch -exact [lindex $fields 0] { @@ -247,7 +247,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { } hset $nodeName/highValue [lindex $fields 4] hset $nodeName/lowValue [lindex $fields 5] - hset $nodeName/manualValue [lindex $fields 6] + hset $nodeName/manualValue [lindex $fields 6] } "IDN" { hset $nodeName/manufacturer [lindex $fields 0] hset $nodeName/model [lindex $fields 1] @@ -273,7 +273,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { default { hset $nodeName/alarmType UNKNOW } } } - default { return -code error "in rdValue: wrong input parameter"} + default { return -code error "in rdValue: wrong input parameter"} } if {$curValue != [sct oldval]} { sct oldval $curValue @@ -310,7 +310,7 @@ proc ::scobj::ls218::rdValue {nodeName varName idx} { # @param type attribute for HDB tree # @param nxsave attribute for HDB tree # @param mutable attribute for HDB tree -# @param nxalias attribute for HDB tree +# @param nxalias attribute for HDB tree # @return OK proc createNode {scobj_hpath idx sct_controller cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} { @@ -341,9 +341,9 @@ proc createNode {scobj_hpath idx sct_controller cmdGroup varName readable pollEn } if {$readable == 1} { - hsetprop $nodeName read ${ns}::getValue $idx $rdCmd $chID rdFuncState + hsetprop $nodeName read ${ns}::getValue $idx $rdCmd $chID rdFuncState hsetprop $nodeName rdFuncState ${ns}::rdValue $nodeName $varName $idx - hsetprop $nodeName oldval UNKNOW + hsetprop $nodeName oldval UNKNOW } if {$pollEnabled == 1} { if {[SplitReply [environment_simulation]]=="false"} { @@ -397,13 +397,13 @@ proc ::scobj::ls218::mkLS218 {argList} { makesctcontroller sct_$pa(NAME) std $pa(IP):$pa(PORT) - # create parent nodes for input, output, and relay + # create parent nodes for input, output, and relay foreach chanType {input output relay} { switch -exact $chanType { "input" {set chanList $pa(INPUTCHAN)} "output" {set chanList $pa(OUTPUTCHAN)} "relay" {set chanList $pa(RELAYCHAN)} - } + } if {[string length $chanList] > 0} { set hPath $scobj_hpath/$chanType hfactory $hPath plain user none @@ -443,7 +443,7 @@ proc ::scobj::ls218::mkLS218 {argList} { # rdFunc nextState Function to be called after the getValue function, typically rdValue() # hdbTree set to 1 if a HDB needs to be created at the node # klass type of klass of the HDB node - # control type of contrl of the HDB node + # control type of contrl of the HDB node # data type of data of the HDB node # priv type of previlige level of the HDB node # type type of the HDB node @@ -453,35 +453,35 @@ proc ::scobj::ls218::mkLS218 {argList} { ########################################################################################################### set inputNodes { - {} alarm 1 1 none user {ALARM?} 1 {rdValue} - alarm offOn 0 0 text user {} 0 {} - alarm source 0 0 text user {} 0 {} - alarm highValue 0 0 float user {} 0 {} - alarm lowValue 0 0 float user {} 0 {} - alarm deadband 0 0 float user {} 0 {} - alarm latchEnable 0 0 int user {} 0 {} - {} aStatus 1 1 none user {ALARMST?} 1 {rdValue} - aStatus highStatus 0 0 text user {} 0 {} - aStatus lowStatus 0 0 text user {} 0 {} + {} alarm 1 1 none user {ALARM?} 1 {rdValue} + alarm offOn 0 0 text user {} 0 {} + alarm source 0 0 text user {} 0 {} + alarm highValue 0 0 float user {} 0 {} + alarm lowValue 0 0 float user {} 0 {} + alarm deadband 0 0 float user {} 0 {} + alarm latchEnable 0 0 int user {} 0 {} + {} aStatus 1 1 none user {ALARMST?} 1 {rdValue} + aStatus highStatus 0 0 text user {} 0 {} + aStatus lowStatus 0 0 text user {} 0 {} {} Celsius 1 1 float user {CRDG?} 1 {rdValue} - {} CurveHd 1 1 none user {CRVHDR?} 0 {rdValue} - CurveHd curve 0 0 text user {} 0 {} - CurveHd name 0 0 text user {} 0 {} - CurveHd SN 0 0 text user {} 0 {} - CurveHd format 0 0 text user {} 0 {} - CurveHd limitValue 0 0 float user {} 0 {} - CurveHd coefficient 0 0 text user {} 0 {} - {} CurveID 1 1 text user {INCRV?} 1 {rdValue} - {} control 1 1 text user {INPUT?} 1 {rdValue} - {} inputType 1 1 text user {INTYPE?} G {rdValue} + {} CurveHd 1 1 none user {CRVHDR?} 0 {rdValue} + CurveHd curve 0 0 text user {} 0 {} + CurveHd name 0 0 text user {} 0 {} + CurveHd SN 0 0 text user {} 0 {} + CurveHd format 0 0 text user {} 0 {} + CurveHd limitValue 0 0 float user {} 0 {} + CurveHd coefficient 0 0 text user {} 0 {} + {} CurveID 1 1 text user {INCRV?} 1 {rdValue} + {} control 1 1 text user {INPUT?} 1 {rdValue} + {} inputType 1 1 text user {INTYPE?} G {rdValue} {} Kelvin 1 1 float user {KRDG?} 1 {rdValue} - {} Linear 1 1 none user {LINEAR?} 1 {rdValue} - Linear varM 0 0 float user {} 0 {} - Linear xSource 0 0 text user {} 0 {} - Linear varB 0 0 float user {} 0 {} - {} LinearEquData 1 1 float user {LRDG?} 1 {rdValue} - {} mnmxSource 1 1 text user {MNMX?} 1 {rdValue} - {} mnmxValue 1 1 text user {MNMXRDG?} 1 {rdValue} + {} Linear 1 1 none user {LINEAR?} 1 {rdValue} + Linear varM 0 0 float user {} 0 {} + Linear xSource 0 0 text user {} 0 {} + Linear varB 0 0 float user {} 0 {} + {} LinearEquData 1 1 float user {LRDG?} 1 {rdValue} + {} mnmxSource 1 1 text user {MNMX?} 1 {rdValue} + {} mnmxValue 1 1 text user {MNMXRDG?} 1 {rdValue} {} status 1 1 text user {RDGST?} 1 {rdValue} {} SensorUnitValue 1 1 float user {SRDG?} 1 {rdValue} } @@ -489,33 +489,33 @@ proc ::scobj::ls218::mkLS218 {argList} { set outputNodes { {} data 1 1 float user {AOUT?} 1 {rdValue} {} aOutput 1 1 none user {ANALOG?} 1 {rdValue} - aOutput bipolarEnable 0 0 text user {} 0 {} - aOutput monitorMode 0 0 text user {} 0 {} - aOutput inputChID 0 0 int user {} 0 {} - aOutput source 0 0 text user {} 0 {} - aOutput highValue 0 0 float user {} 0 {} - aOutput lowValue 0 0 float user {} 0 {} - aOutput manualValue 0 0 int user {} 0 {} + aOutput bipolarEnable 0 0 text user {} 0 {} + aOutput monitorMode 0 0 text user {} 0 {} + aOutput inputChID 0 0 int user {} 0 {} + aOutput source 0 0 text user {} 0 {} + aOutput highValue 0 0 float user {} 0 {} + aOutput lowValue 0 0 float user {} 0 {} + aOutput manualValue 0 0 int user {} 0 {} } set relayNodes { - {} relay 1 1 none user {RELAY?} 1 {rdValue} - relay mode 0 0 text user {} 0 {} - relay input 0 0 int user {} 0 {} - relay alarmType 0 0 text user {} 0 {} + {} relay 1 1 none user {RELAY?} 1 {rdValue} + relay mode 0 0 text user {} 0 {} + relay input 0 0 int user {} 0 {} + relay alarmType 0 0 text user {} 0 {} } set otherNodes { - {} IDN 1 1 none user {*IDN?} 0 {rdValue} - IDN manufacturer 0 0 text user {} 0 {} - IDN model 0 0 text user {} 0 {} - IDN serialNumber 0 0 text user {} 0 {} - IDN firmwareDate 0 0 text user {} 0 {} - {} logStatus 1 1 text user {LOG?} 0 {rdValue} + {} IDN 1 1 none user {*IDN?} 0 {rdValue} + IDN manufacturer 0 0 text user {} 0 {} + IDN model 0 0 text user {} 0 {} + IDN serialNumber 0 0 text user {} 0 {} + IDN firmwareDate 0 0 text user {} 0 {} + {} logStatus 1 1 text user {LOG?} 0 {rdValue} } # create sub-tree for all 8 input channels - foreach idx $pa(INPUTCHAN) { + foreach idx $pa(INPUTCHAN) { foreach {cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} $inputNodes { createNode $scobj_hpath/input $idx sct_$pa(NAME) $cmdGroup $varName $readable $pollEnabled $dataType $permission $rdCmd $chID $rdFunc } @@ -535,7 +535,7 @@ proc ::scobj::ls218::mkLS218 {argList} { } } - # create "other" sub-tree + # create "other" sub-tree foreach {cmdGroup varName readable pollEnabled dataType permission rdCmd chID rdFunc} $otherNodes { createNode $scobj_hpath/other 0 sct_$pa(NAME) $cmdGroup $varName $readable $pollEnabled $dataType $permission $rdCmd $chID $rdFunc } @@ -572,9 +572,9 @@ proc ::scobj::ls218::mkLS218 {argList} { if {[string length $pa(INPUTCHAN)] > 0} { foreach idx $pa(INPUTCHAN) { foreach {item klass control data nxsave mutable priv alias} { - Celsius sensor true true true true user Celsius + Celsius sensor true true true true user Celsius Kelvin sensor true true true true user Kelvin - SensorUnitValue sensor true true true true user SensorUnitValue + SensorUnitValue sensor true true true true user SensorUnitValue } { set hpath /sics/ls218/input/ch$idx/$item hsetprop $hpath nxalias ls218-input-ch$idx-$alias @@ -594,11 +594,11 @@ proc ::scobj::ls218::mkLS218 {argList} { set hpath /sics/ls218/output/ch$idx/data hsetprop $hpath nxalias ls218-output-ch$idx-data hsetprop $hpath klass sensor - hsetprop $hpath privilege user - hsetprop $hpath control true - hsetprop $hpath data true - hsetprop $hpath nxsave true - hsetprop $hpath mutable true + hsetprop $hpath privilege user + hsetprop $hpath control true + hsetprop $hpath data true + hsetprop $hpath nxsave true + hsetprop $hpath mutable true hsetprop $hpath sdsinfo ::nexus::scobj::sdsinfo } } @@ -610,7 +610,7 @@ proc ::scobj::ls218::mkLS218 {argList} { } } -# end of namespace ::scobj::ls218 +# end of namespace ::scobj::ls218 # Main process call # @param name short name for the Lakeshore Temp controller 218 diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl index 8dd8a5c0..873f5428 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_336.tcl @@ -1718,7 +1718,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p hfactory $scobj_hpath/sensor plain spy none # Flags ls340 and ls336 indicate whether this command is support by Lakeshore model ls340 and ls336, respectively foreach {cmdGroup varName readable writable pollEnabled drivable idx ls340 ls336 dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommandToplevel { - createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse + createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse } # create a base node for each commandGroup element - these are all polled @@ -1729,7 +1729,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p hfactory $scobj_hpath/other plain spy none foreach {cmdGroup varName readable writable pollEnabled drivable idx ls340 ls336 dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand { - createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse + createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $pollEnabled $drivable $idx $ls340 $ls336 $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klasse # helpNotes4user $scobj_hpath $cmdGroup $varName } diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl index 8f0be9db..9cfaa5bf 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl @@ -228,7 +228,7 @@ namespace eval ::scobj::[set vendor]_[set device] { return -code error "[sct geterror]" } if { $ramp_rate < 0.001 || $ramp_rate > 10 } { - if { $ramp_enable == 1 } { + if { $ramp_enable == 1 } { sct geterror "RAMP bad rate from [sct result]" return -code error "[sct geterror]" } diff --git a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl index 8ff410de..92a915f3 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl @@ -811,7 +811,7 @@ namespace eval ::scobj::[set vendor]_[set device] { hsetprop $scobj_hpath klass parameter hsetprop $scobj_hpath sdsinfo ::nexus::scobj::sdsinfo set point 1 -if {0} { +if {0} { ::scobj::hinitprops $the_name Loop1 set point 2 ::scobj::hinitprops $the_name Loop2/setpoint diff --git a/site_ansto/instrument/config/environment/temperature/sct_rvasm2.tcl b/site_ansto/instrument/config/environment/temperature/sct_rvasm2.tcl index 5c5021a1..38c3db5c 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_rvasm2.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_rvasm2.tcl @@ -68,7 +68,7 @@ debug_log "rdValue [sct] [sct result]" sct send "$cmd" return $nextState } - + proc rdTemp {tc_root} { debug_log "rdTemp [sct] [sct result]" set data [sct result] @@ -132,7 +132,7 @@ debug_log "rdValue [sct] [sct result]" sct send $cmd return $nextState } - + proc rdSpeed {tc_root} { debug_log "rdSpeed [sct] [sct result]" set data [sct result] @@ -547,12 +547,12 @@ debug_log "setPoint $cmd $par" set the_valu [lindex $parts 2] set the_ramp [lindex $parts 3] if {$the_type == "I"} { - set the_valu [expr {round($the_valu * 20.0)}] - set the_ramp [expr {round($the_ramp * 20.0)}] + set the_valu [expr {round($the_valu * 20.0)}] + set the_ramp [expr {round($the_ramp * 20.0)}] } elseif {$the_type == "S"} { } elseif {$the_type == "T"} { - set the_valu [expr {round($the_valu * 20.0)}] - set the_ramp [expr {round($the_ramp * 20.0 /45 * 32768)}] + set the_valu [expr {round($the_valu * 20.0)}] + set the_ramp [expr {round($the_ramp * 20.0 /45 * 32768)}] } else { sct geterror "Profile error: $line" sct print "Profile error: $line" diff --git a/site_ansto/instrument/config/environment/temperature/sct_watlow_pm.tcl b/site_ansto/instrument/config/environment/temperature/sct_watlow_pm.tcl index 78f8c878..e6826de4 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_watlow_pm.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_watlow_pm.tcl @@ -224,7 +224,7 @@ debug_log "setValue $dev:16:$cmd $par" hset $tc_root/Loop1/setpoint [sct target] return idle } - + proc setPoint {tc_root nextState cmd} { set dev "[hval $tc_root/dev_id]" set par [sct target] diff --git a/site_ansto/instrument/config/environment/temperature/sct_watlow_rm.tcl b/site_ansto/instrument/config/environment/temperature/sct_watlow_rm.tcl index c555871b..9a95429c 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_watlow_rm.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_watlow_rm.tcl @@ -232,7 +232,7 @@ debug_log "setValue $dev:16:$cmd $par" hset $tc_root/Loop1/setpoint [sct target] return idle } - + proc setPoint {tc_root nextState cmd} { set dev "[hval $tc_root/dev_id]" set par [sct target] @@ -417,7 +417,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ set scobj_hpath /sics/$tempobj - # + # # These addresses are modbus addresses on the RUI/gateway over two devices # The RMC is at address 1 and the modbus offset on the RUI for gateway 1 # is zero, so these addresses are as specified in the manual. diff --git a/site_ansto/instrument/config/environment/temperature/sct_watlow_st4.tcl b/site_ansto/instrument/config/environment/temperature/sct_watlow_st4.tcl index 4db147cf..f8945a9c 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_watlow_st4.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_watlow_st4.tcl @@ -376,7 +376,7 @@ debug_log "setValue $dev:16:$cmd $par" hset $tc_root/status "busy" return idle } - + # Get the High Limit Point proc getLimHi {tc_root nextState cmd} { set d1 [hval $tc_root/Loop1/limit_hi] @@ -402,7 +402,7 @@ debug_log "setValue $dev:16:$cmd $par" hset $tc_root/Loop4/limit_hi [sct target] return idle } - + # Set the All Set Points proc setAll {tc_root nextState cmd} { debug_log "setAll $tc_root $nextState $cmd [sct]=[sct target] [hget [sct]]" @@ -413,7 +413,7 @@ debug_log "setValue $dev:16:$cmd $par" hset $tc_root/device_control/previous_error [expr [sct target] - [hval $tc_root/samplesensor]] return idle } - + proc setPoint {tc_root nextState cmd} { set dev "[hval $tc_root/dev_id]" set par [sct target] @@ -645,7 +645,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\ hfactory $scobj_hpath/Loop2 plain spy none hfactory $scobj_hpath/Loop3 plain spy none hfactory $scobj_hpath/Loop4 plain spy none - + foreach {cmdGroup varName readable writable drivable dataType permission rdCmd rdFunc wrCmd wrFunc allowedValues} $deviceCommand { createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $drivable $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klass } diff --git a/site_ansto/instrument/config/environment/temperature/west400.tcl b/site_ansto/instrument/config/environment/temperature/west400.tcl index 310bc043..7d826b2c 100644 --- a/site_ansto/instrument/config/environment/temperature/west400.tcl +++ b/site_ansto/instrument/config/environment/temperature/west400.tcl @@ -42,7 +42,7 @@ proc ::environment::temperature::add_west400 {IP} { tc1 tolerance 10 } - sicslist setatt tc1 environment_name tc1 + sicslist setatt tc1 environment_name tc1 sicslist setatt tc1 long_name control_sensor_reading ::environment::mkenvinfo tc1 {ramprate {priv user} powerlimit {priv manager} } #::environment::mkenvinfo tc1 {heateron {priv user} range {priv manager} } diff --git a/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl b/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl index 3f116246..8e5f4887 100644 --- a/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl +++ b/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl @@ -97,7 +97,7 @@ set NXgeometry_template { set NXaperture_template [subst -novariables { NXaperture { - $name { + $name { sobjlist {$paramarr(material) $paramarr(description)} [ set NXgeometry_template ] } @@ -192,7 +192,7 @@ proc ::hdb::MakeVelocity_Selector {name paramlist} { # A NeXus-class template is a keyed-list which has Tcl variables for some of the nodes, # if the Tcl variables aren't defined for some branch then that branch is removed. # All other variables are expanded in place, also all 'sobjlists' are split up into type -# specific lists. This is intended as a helper function for commands which generate +# specific lists. This is intended as a helper function for commands which generate # NeXus-class keyed lists from a simple set of optional parameters. # # @param NXklist, This is a keyed list representation of the NeXus class which will be augmented @@ -215,7 +215,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} { foreach var $v { if {[string index $var 0] == "$"} { set vn [string range $var 1 end] - upvar $level $vn lvar + upvar $level $vn lvar if [info exists lvar] { foreach sobj $lvar { lappend [getatt $sobj type]_list $sobj @@ -244,7 +244,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} { array set linkinfo $v if {[string index $linkinfo(target) 0] == "$"} { set vn [string range $linkinfo(target) 1 end] - upvar $level $vn lvar + upvar $level $vn lvar if [info exists lvar] { set linktarget $lvar } @@ -253,7 +253,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} { } if {[string index $linkinfo(nxalias) 0] == "$"} { set vn [string range $linkinfo(nxalias) 1 end] - upvar $level $vn avar + upvar $level $vn avar if [info exists avar] { set linkname $avar } @@ -268,7 +268,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} { default { if {[string range $n 0 1] == "NX"} { set node $n - } elseif {[string index $n 0] == "$"} { + } elseif {[string index $n 0] == "$"} { set vn [string range $n 1 end] upvar $level $vn lvar if [info exists lvar] { @@ -316,14 +316,14 @@ proc ::hdb::set_subtree_props {st_name klass {control "true"} {privilege "user"} publish $st_name mugger sicslist setatt $st_name klass $klass sicslist setatt $st_name control $control - sicslist setatt $st_name privilege $privilege + sicslist setatt $st_name privilege $privilege sicslist setatt $st_name kind "hdb_subtree" sicslist setatt $st_name long_name "@none" sicslist setatt $st_name data "true" sicslist setatt $st_name nxsave "true" } -# @brief Add a subtree to a given hipadaba path. +# @brief Add a subtree to a given hipadaba path. # # @param hpath, Basepath for subtree # @param object, SICS object name @@ -331,10 +331,10 @@ proc ::hdb::set_subtree_props {st_name klass {control "true"} {privilege "user"} # @param type, the SICS object type if we are adding SICS object node. Optional, default = @none. # @param makenode, type of node to make. Optional, default = @none. proc ::hdb::add_subtree {hpath subtree {object @none} {type @none} {makenode @none}} { - set ::errorInfo "" + set ::errorInfo "" set SICStypes {sicsvariable macro} if [catch { - switch $makenode { + switch $makenode { "@none" { foreach {n v} $subtree { if {[lsearch -exact $::nexus_classes $n] >= 0} { @@ -360,7 +360,7 @@ proc ::hdb::add_subtree {hpath subtree {object @none} {type @none} {makenode @no if {$item==$object} { error "ERROR: Infinite recursion, cannot add $item as a node to it's own hdb subtree" } - set objtype [getatt $item type] + set objtype [getatt $item type] if {$type != $objtype} { error "ERROR: Specified type of '$type' doesn't match actual type, '$objtype', for $item" } @@ -468,7 +468,7 @@ proc ::hdb::add_node {basePath args} { array unset arg_array set catch_status [ catch { - array set arg_array $args + array set arg_array $args if {[info exists arg_array(path)] && [info exists arg_array(prop_list)]} { add_hpath $basePath $arg_array(path) if {$basePath == "/"} { @@ -499,7 +499,7 @@ proc ::hdb::add_node {basePath args} { array set attribute [::utility::normalattlist $node_name] switch $arg_array(kind) { command { - # A command is a macro, node=macro name + # A command is a macro, node=macro name set command $node_name set cmd_path [add_command $basePath $command] set node_path $cmd_path @@ -508,7 +508,7 @@ proc ::hdb::add_node {basePath args} { if {[string length [info procs ${command}_parameters]] > 0} { ${command}_parameters add_node $cmd_path } else { - $command -map param ::hdb::add_cmd_par $cmd_path + $command -map param ::hdb::add_cmd_par $cmd_path } if {[string length [info procs ${command}_feedback]] > 0} { add_hpath $cmd_path feedback @@ -517,7 +517,7 @@ proc ::hdb::add_node {basePath args} { } else { add_hpath $cmd_path feedback hsetprop $cmd_path/feedback type part - $command -map feedback ::hdb::add_feedback $cmd_path/feedback + $command -map feedback ::hdb::add_feedback $cmd_path/feedback } } hobj { @@ -561,7 +561,7 @@ proc ::hdb::add_node {basePath args} { #hmakescript $node_path $arg_array(rscript) $arg_array(wscript) $arg_array(dtype) $arg_array(dlen) } } - if {[info exists attribute(units)]} { + if {[info exists attribute(units)]} { hsetprop $node_path units [normalgetatt $node_name units] } if {[info exists arg_array(prop_list)]} { @@ -569,10 +569,10 @@ proc ::hdb::add_node {basePath args} { hsetprop $node_path $prop $pval } } - if {[info exists attribute(depends)]} { + if {[info exists attribute(depends)]} { foreach dep [split [normalgetatt $node_name depends] , ] { set sobjadd_state(depends) true - ::hdb::sobjadd $node_path $dep + ::hdb::sobjadd $node_path $dep set sobjadd_state(depends) false } } @@ -612,7 +612,7 @@ proc ::hdb::add_command {basePath command} { hsetprop $cmd_path nxsave $cmd_atts(nxsave) hsetprop $cmd_path sicsdev $cmd_atts(id) return $cmd_path -} +} ## # @brief Retrieve the list of attributes for the given sics object @@ -624,7 +624,7 @@ proc ::hdb::attlist {sicsobj} { foreach att [tolower_sicslist $sicsobj] { lappend atts [split [string range $att 0 end-1] =] } - return [join $atts] + return [join $atts] } message ] { if {$::errorCode=="NONE"} {return $message} return -code error $message @@ -722,7 +722,7 @@ proc ::hdb::sobjadd {hpath sobj args} { if {[info exists sobjatt(group)]} { set hpath [add_hpath $hpath $sobjatt(group)] if {[catch {hsetprop $hpath type part} err]} {clientput $err error} - } + } if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} { set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)] if {[catch {hsetprop $node_path sicsdev $sobj} err]} {clientput $err error} @@ -733,19 +733,19 @@ proc ::hdb::sobjadd {hpath sobj args} { if {[catch {hsetprop $node_path privilege $sobjatt(privilege)} err]} {clientput $err error} } else { clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error - } + } } node { } singlecounter { - # TODO + # TODO todo_msg "$sobjatt(type) case, add $sobj to $hpath" } histmem { if {[info exists sobjatt(group)]} { set hpath [add_hpath $hpath $sobjatt(group)] if {[catch {hsetprop $hpath type part} err]} {clientput $err error} - } + } if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} { set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)] if {[catch {hsetprop $node_path savecmd $sobjatt(savecmd)} err]} {clientput $err error} @@ -761,7 +761,7 @@ proc ::hdb::sobjadd {hpath sobj args} { if {[info exists sobjatt(group)]} { set hpath [add_hpath $hpath $sobjatt(group)] hsetprop $hpath type part - } + } if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} { set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)] hsetprop $node_path sicsdev $sobj @@ -772,18 +772,18 @@ proc ::hdb::sobjadd {hpath sobj args} { hsetprop $node_path privilege $sobjatt(privilege) } else { clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error - } + } } nxscript { - # TODO + # TODO todo_msg "$sobjatt(type) case, add $sobj to $hpath" } sicsdata { - # TODO + # TODO todo_msg "$sobjatt(type) case, add $sobj to $hpath" } scanobject { - # TODO + # TODO todo_msg "$sobjatt(type) case, add $sobj to $hpath" } # TODO Can this be replaced with a sct_* glob? @@ -836,7 +836,7 @@ proc ::hdb::sobjtypeadd {hpath sobjtype given_klass} { ## -# @brief Remove empty instrument dictionary nodes +# @brief Remove empty instrument dictionary nodes # # @param instdict name of the instrument dictionary structure # @@ -853,7 +853,7 @@ proc ::hdb::prune {instdict} { while {[expr [llength $candidates]] > 0} { set new_candidates "" foreach name $candidates { - array unset dictval + array unset dictval array set dictval $dictarr($name) if {[lsearch $dictval(property) nxvgroup] >= 0} { # Link targets are not candidates for pruning @@ -939,7 +939,7 @@ upvar #0 $instDict dictionary # # @param hpath The save state of the nodes below this path will be set # @param mode true or false -# @param top This is just here to make the recursion work from the top level, You don't need +# @param top This is just here to make the recursion work from the top level, You don't need # to set this proc ::hdb::set_save {hpath mode {top true}} { if [ catch { @@ -956,7 +956,7 @@ if [ catch { foreach ps [lrange [split [string trim $hnode /] /] 0 end-1] { set hp $hp/$ps hsetprop $hp nxsave true - } + } } } else { hsetprop $hnode nxsave $mode diff --git a/site_ansto/instrument/config/hipadaba/instdict_specification.tcl b/site_ansto/instrument/config/hipadaba/instdict_specification.tcl index 0eaa8488..9d9d0fe3 100644 --- a/site_ansto/instrument/config/hipadaba/instdict_specification.tcl +++ b/site_ansto/instrument/config/hipadaba/instdict_specification.tcl @@ -1,5 +1,5 @@ # The attributes and values for sics objects and instrument dictionaries must comply -# with the following lists. +# with the following lists. set boolean {true false} # INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION @@ -49,7 +49,7 @@ set chopperadapter_attlist [subst { sdsinfo {print} nxalias {text} mutable [subst {{$boolean}}] -}] +}] set environment_controller_attlist [subst { $sobj_attlist @@ -59,12 +59,12 @@ set environment_controller_attlist [subst { set histmem_attlist [subst { $sobj_attlist mutable [subst {{$boolean}}] -}] +}] # A macro can be attached to an hdb node as a command or a script set macro_attlist [subst { $sobj_attlist -}] +}] set motor_attlist [subst { $sobj_attlist @@ -72,40 +72,40 @@ set motor_attlist [subst { savecmd {print} nxalias {text} mutable [subst {{$boolean}}] -}] +}] set configurablevirtualmotor_attlist [subst { $motor_attlist -}] +}] set nxscript_attlist [subst { $sobj_attlist -}] +}] set scanobject_attlist [subst { $sobj_attlist -}] +}] set sct_object_attlist [subst { $sobj_attlist -}] +}] set sicsdata_attlist [subst { $sobj_attlist mutable [subst {{$boolean}}] -}] +}] set sicsvariable_attlist [subst { $sobj_attlist mutable [subst {{$boolean}}] -}] +}] set singlecounter_attlist [subst { $sobj_attlist mutable [subst {{$boolean}}] -}] +}] # INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION -if 1 { +if 1 { set nexus_classes { NXaperture NXattenuator NXbeam_stop NXbeam NXbending_magnet NXcharacterizations NXcollimator NXcrystal NXdata NXdetector NXdisk_chopper NXentry NXenvironment NXevent_data NXfermi_chopper NXfilter NXflipper NXgeometry NXguide NXinsertion_device NXinstrument NXlog NXmirror NXmoderator NXmonitor NXnote NXorientation NXpositioner NXprocess NXroot NXsample NXsensor NXshape NXsource NXtranslation NXuser NXvelocity_selector} set dict_privilege_list { @@ -115,7 +115,7 @@ if 1 { # uniformly. set dict_datatype_list { @none NX_CHAR NX_FLOAT32 NX_INT32 } -# link = name of an nxalias +# link = name of an nxalias set dict_property_list [subst { {data control nxsave} {$boolean} klass {@none $nexus_classes} diff --git a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl index 113e24c1..5436781f 100644 --- a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl +++ b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl @@ -4,10 +4,10 @@ ## # @file Provides generic code and parameters for configuring the ANSTO histogram memory server -# The instrument specific histogram memory configuration files must define an initialisation -# function with the following signature +# The instrument specific histogram memory configuration files must define an initialisation +# function with the following signature # @code proc ::histogram_memory::initialize {} -# this function should call the generic initalisation function, +# this function should call the generic initalisation function, # ::histogram_memory::ic_initialize # #@see ::histogram_memory::ic_initialize @@ -104,7 +104,7 @@ namespace eval histogram_memory { ::utility::mkVar detector_active_width_mm Float user active_width true detector true true sicslist setatt detector_active_width_mm units mm - ::utility::mkVar hmm_user_configpath Text manager user_configpath false detector false false + ::utility::mkVar hmm_user_configpath Text manager user_configpath false detector false false hmm_user_configpath ../user_config/hmm ::utility::mkVar hmm_mode Text user mode true detector true true ::utility::mkVar hmm_preset Float user preset true detector true true @@ -232,9 +232,9 @@ namespace eval histogram_memory { } message ] { return -code error "([info level 0]) $message" } - } + } + - ## # @brief Returns the histogram memory server clock scale. # @@ -454,7 +454,7 @@ namespace eval histogram_memory { sicslist setatt $script_name long_name x_pixel_offset sicslist setatt $script_name units "mm" unset script_name - + sicsdatafactory new ::histogram_memory::time_channel_array proc time_channel {args} { variable state @@ -502,7 +502,7 @@ proc ::histogram_memory::calc_boundaries {values channels} { if {$bbnum > $maxbblen} { error "ERROR: The number of bin boundaries must be less than or equal to $maxbblen" } - set BOUNDARIES "" + set BOUNDARIES "" if {$bbnum > 2} { set BOUNDARIES $values } elseif {$bbnum == 2} { @@ -517,7 +517,7 @@ proc ::histogram_memory::calc_boundaries {values channels} { # error "ERROR: $leftbb and $rightbb must bound a channel >= 0 or <= $maxchan" # } for {set bb $leftbb; set i 0} {$i < $maxbblen} {incr i; set bb [expr {$bb + $bstep}]} { - lappend BOUNDARIES $bb + lappend BOUNDARIES $bb } } else { error "ERROR: You must specify at least two bin boundaries" @@ -534,7 +534,7 @@ set hmm_xml "" # @brief Provides a standard set of subcommands for the histogram server table # configuration commands. # -# @param tag Table identifier, one of BAT CAT FAT NAT OAT SAT SRV +# @param tag Table identifier, one of BAT CAT FAT NAT OAT SAT SRV # @param attributes Defines the list of attributes which you will be allowed to set. # @param element_list Defines the list of elements which you will be allowed to set. # Use "" if your table doesn't contain any elements. @@ -546,15 +546,15 @@ set hmm_xml "" # -clear clears the table\n # -init A list of name value pairs. If you use attribute or element names then # the corresponding table entries will be initilised to the given values, any -# attributes or elements which aren't specified will be cleared. You can also -# specify extra parameters to store in the table which might be required to +# attributes or elements which aren't specified will be cleared. You can also +# specify extra parameters to store in the table which might be required to # specify limits or constants which may be necessary for deriving configuration # parameters.\n # -get return the value for the named attribute or element\n # -attlist list all of the attributes with their values.\n # TODO Maintain "proposed" and "current" tables. Provide a setcurrent command which can # only be called by the upload_config command to set the proposed tables as current -# TODO Allow for top level content in tables and attributes in sub-elements +# TODO Allow for top level content in tables and attributes in sub-elements proc HISTMEM_TABLE {tpath args} { global hmm_xml @@ -564,25 +564,25 @@ proc HISTMEM_TABLE {tpath args} { foreach {opt arglist} [::utility::get_opt_arglist $args] {} switch -- $opt { "-dump" { - foreach {k v} $hmm_xml {clientput $k; foreach {name val} $v {clientput "$name: $val"}} + foreach {k v} $hmm_xml {clientput $k; foreach {name val} $v {clientput "$name: $val"}} } "-allowed_attributes" { if {[llength $arglist] == 0} { set retVal [::utility::tabget hmm_xml $tpath/_ALLOWED_ATTRIBUTES_] - } else { + } else { ::utility::tabset hmm_xml $tpath/_ALLOWED_ATTRIBUTES_ [lindex $arglist 0] } } "-allowed_elements" { if {[llength $arglist] == 0} { set retVal [::utility::tabget hmm_xml $tpath/_ALLOWED_ELEMENTS_] - } else { + } else { ::utility::tabset hmm_xml $tpath/_ALLOWED_ELEMENTS_ [lindex $arglist 0] ::utility::tabset hmm_xml $tpath/_ELEMENTS_ [lindex $arglist 0] } } "-setel" { - set element [lindex $arglist 0] + set element [lindex $arglist 0] set value [lindex $arglist 1] if {[lsearch [::utility::tabget hmm_xml $tpath/_ALLOWED_ELEMENTS_] $element] >= 0} { ::utility::tabset hmm_xml $tpath/$element/_CONTENT_ $value @@ -591,7 +591,7 @@ proc HISTMEM_TABLE {tpath args} { } } "-setatt" { - set attname [lindex $arglist 0] + set attname [lindex $arglist 0] set value [lindex $arglist 1] if {[lsearch [::utility::tabget hmm_xml $tpath/_ALLOWED_ATTRIBUTES_] $attname] >= 0} { ::utility::tabset hmm_xml $tpath/_ATTLIST_/$attname $value @@ -600,19 +600,19 @@ proc HISTMEM_TABLE {tpath args} { } } "-getel" { - set element [lindex $arglist 0] + set element [lindex $arglist 0] set retVal [::utility::tabget hmm_xml $tpath/$element/_CONTENT_] } "-getatt" { - set attribute [lindex $arglist 0] + set attribute [lindex $arglist 0] set retVal [::utility::tabget hmm_xml $tpath/_ATTLIST_/$attribute] } "-delel" { - set element [lindex $arglist 0] + set element [lindex $arglist 0] ::utility::tabdel hmm_xml $tpath/$element } "-delatt" { - set attribute [lindex $arglist 0] + set attribute [lindex $arglist 0] ::utility::tabdel hmm_xml $tpath/_ATTLIST_/$attribute } "-clear" { @@ -657,7 +657,7 @@ proc HISTMEM_TABLE {tpath args} { } } -## +## # @brief Base Address Table configuration parameters as maintained by SICS # proc BAT_TABLE {args} { @@ -665,7 +665,7 @@ proc BAT_TABLE {args} { set attributes { NO_BAT_ENTRIES NO_BAT_PERIODS NO_REPEAT_ENTRY NO_REPEAT_TABLE NO_EXECUTE_TABLE } set elements {{PERIOD_INDICES }} - set tag BAT + set tag BAT foreach {opt arglist} [::utility::get_opt_arglist $args] {} switch -- $opt { "" { @@ -745,7 +745,7 @@ proc BAT_TABLE {args} { } } -## +## # @brief CAlibration Table configuration parameters as maintained by SICS # proc CAT_TABLE {args} { @@ -753,7 +753,7 @@ proc CAT_TABLE {args} { set attributes { FRAME_FREQUENCY SIZE_PERIOD COUNT_METHOD COUNT_SIZE READ_DATA_TYPE } set elements {{MESYTEC_MPSD8_CHANNEL_GAINS MESYTEC_MPSD8_THRESHOLDS MESYTEC_TUBE_PAIR_RESISTANCE_RATIOS MESYTEC_TUBE_MAGNIFICATIONS MESYTEC_TUBE_OFFSETS MESYTEC_TUBE_HISTOGRAM_WEIGHTS }} - set tag CAT + set tag CAT foreach {opt arglist} [::utility::get_opt_arglist $args] {} switch -- $opt { "" { @@ -833,7 +833,7 @@ proc CAT_TABLE {args} { } } -## +## # @brief Frequency Address Table configuration parameters as maintained by SICS # proc FAT_TABLE {args} { @@ -842,7 +842,7 @@ proc FAT_TABLE {args} { set elements {{ }} - set tag FAT + set tag FAT foreach {opt arglist} [::utility::get_opt_arglist $args] {} switch -- $opt { "" { @@ -1052,7 +1052,7 @@ proc OAT_TABLE {args} { } } -# @brief Spatial Allocation Table configuration parameters as maintained by SICS +# @brief Spatial Allocation Table configuration parameters as maintained by SICS # # Only one element, ie SPLIT with no content just attributes. proc SAT_TABLE {args} { @@ -1198,7 +1198,7 @@ proc ::histogram_memory::max_chan_num {axis} { } ## # @brief When called without arguments this returns the name of the filler defaults file -# for the histogram server. When called with an argument it sets the current name of the +# for the histogram server. When called with an argument it sets the current name of the # filler defaults file. # # When anstohm_linked.xml is uploaded to the histogram server it calls this via @@ -1245,7 +1245,7 @@ proc ::histogram_memory::number_of_channels {axis} { # TODO Set current oat table after uploading proposed oat_table proc ::histogram_memory::upload_config {filler_defaults} { if [ catch { - ::histogram_memory::synch_tables + ::histogram_memory::synch_tables ::histogram_memory::filler_defaults $filler_defaults hmm astop hmm configure init 1 @@ -1325,7 +1325,7 @@ proc ::histogram_memory::get_frame_source {} { proc ::histogram_memory::set_frame_source {srce} { variable ic_fsrce_values - if [ catch { + if [ catch { if {[lsearch $ic_fsrce_values $srce] == -1} { error "ERROR: $srce is invalid, valid values are \"$ic_fsrce_values\"" } @@ -1359,7 +1359,7 @@ proc ::histogram_memory::get_frame_freq {} { # @param freq Frequency in Hz.\n # @param frame_source INTERNAL or EXTERNAL(default) # -# If freq=0 then it sets the frequency to 50Hz with an internal frame source. This is useful +# If freq=0 then it sets the frequency to 50Hz with an internal frame source. This is useful # if you are setting the frequency from a chopper which is stopped. proc ::histogram_memory::set_frame_freq {freq {frame_source EXTERNAL}} { variable state @@ -1521,7 +1521,7 @@ proc ::histogram_memory::ic_initialize {} { ::histogram_memory::clear_tables # FAT_TABLE -set VIEW_MAG_X -1 VIEW_MAG_Y -1 - foreach hm_obj [sicslist type histmem] { + foreach hm_obj [sicslist type histmem] { set host [dict get $::HISTMEM_HOSTPORT HMM HOST] set port [dict get $::HISTMEM_HOSTPORT HMM PORT] $hm_obj configure hmaddress http://$host:$port @@ -1578,7 +1578,7 @@ Publish SAT_TABLE user # if {$monitor_controlled == "true"} { # set hm_start {hmm count} # } else { -# bm setmode timer +# bm setmode timer # bm setpreset 32000000 # } if {$blocking == "block"} { @@ -1607,7 +1607,7 @@ Publish SAT_TABLE user } } } - + proc ::histogram_memory::veto {action} { switch $action { "on" { @@ -1671,7 +1671,7 @@ Publish SAT_TABLE user return [SplitReply [hmm_mode]] } if [ catch { - set modes $ic_count_methods + set modes $ic_count_methods if {[lsearch $modes $method] == -1} { error "ERROR: Count mode, $method, must be one of $modes" } @@ -1744,7 +1744,7 @@ Publish SAT_TABLE user proc ::histogram_memory::stop_condition {condition} { variable state if [ catch { - array set count_stop {immediate IMMEDIATE period AT_END_OF_PERIOD} + array set count_stop {immediate IMMEDIATE period AT_END_OF_PERIOD} if {$condition == ""} { return $state(stop_cond) } else { @@ -1843,7 +1843,7 @@ namespace eval ::histogram_memory { # @brief Set stop condition for histogram memory # # @param condition - #command stop_condition {text:immediate,period condition} + #command stop_condition {text:immediate,period condition} } @@ -1855,7 +1855,7 @@ namespace eval ::histogram_memory { proc _histmem {cmd args} { #TODO Add "continue" set reply "" - if [ catch { + if [ catch { switch $cmd { "start" { eval "::histogram_memory::start $args" diff --git a/site_ansto/instrument/config/hmm/hmm_cylindrical_detector_configuration.tcl b/site_ansto/instrument/config/hmm/hmm_cylindrical_detector_configuration.tcl index cff430be..dec413a9 100644 --- a/site_ansto/instrument/config/hmm/hmm_cylindrical_detector_configuration.tcl +++ b/site_ansto/instrument/config/hmm/hmm_cylindrical_detector_configuration.tcl @@ -11,7 +11,7 @@ namespace eval histogram_memory { variable state if [ catch { #set deg_per_radian [SplitReply [deg_per_rad]] - set deg_per_radian 57.29577951308232 + set deg_per_radian 57.29577951308232 set max_chan [OAT_TABLE X -getdata MAX_CHAN] set bb_zero_offset [expr -1*($max_chan-1)] set det_width_mm [SplitReply [detector_active_width_mm]] diff --git a/site_ansto/instrument/config/hmm/hmm_object.tcl b/site_ansto/instrument/config/hmm/hmm_object.tcl index e418df35..30fd187f 100644 --- a/site_ansto/instrument/config/hmm/hmm_object.tcl +++ b/site_ansto/instrument/config/hmm/hmm_object.tcl @@ -25,7 +25,7 @@ proc ::histogram_memory::select_read_type {type} { # Instrument specific X and Y dimension names variable INST_NXC variable INST_NYC - + if [catch { $HMOBJ configure read_data_period_number 0 @@ -49,67 +49,67 @@ proc ::histogram_memory::select_read_type {type} { $HMOBJ configure rank 2 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]] - $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_XT" + $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_XT" set hmm_ext "_xt" } "HISTOGRAM_YT" - "HISTOPERIOD_YT" { $HMOBJ configure rank 2 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]] $HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] - $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_YT" + $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_YT" set hmm_ext "_ty" } "HISTOGRAM_X" - "HISTOPERIOD_X" { $HMOBJ configure rank 1 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] - $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_X" + $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_X" set hmm_ext "_x" } "HISTOGRAM_Y" - "HISTOPERIOD_Y" { $HMOBJ configure rank 1 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NYC]] - $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_Y" + $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_Y" set hmm_ext "_y" } "HISTOGRAM_T" - "HISTOPERIOD_T" { $HMOBJ configure rank 1 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]] - $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_T" + $HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_T" set hmm_ext "_t" } "TOTAL_HISTOGRAM_XY" { $HMOBJ configure rank 2 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] - $HMOBJ configure READ_DATA_TYPE $type + $HMOBJ configure READ_DATA_TYPE $type set hmm_ext "_total_xy" } "TOTAL_HISTOGRAM_XT" { $HMOBJ configure rank 2 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]] - $HMOBJ configure READ_DATA_TYPE $type + $HMOBJ configure READ_DATA_TYPE $type set hmm_ext "_total_xt" } "TOTAL_HISTOGRAM_YT" { $HMOBJ configure rank 2 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]] $HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] - $HMOBJ configure READ_DATA_TYPE $type + $HMOBJ configure READ_DATA_TYPE $type set hmm_ext "_total_ty" } "TOTAL_HISTOGRAM_XP" { $HMOBJ configure rank 2 $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim1 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]] - $HMOBJ configure READ_DATA_TYPE $type + $HMOBJ configure READ_DATA_TYPE $type set hmm_ext "_total_xp" } "TOTAL_HISTOGRAM_YP" { $HMOBJ configure rank 2 $HMOBJ configure dim0 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]] $HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] - $HMOBJ configure READ_DATA_TYPE $type + $HMOBJ configure READ_DATA_TYPE $type set hmm_ext "_total_py" } "TOTAL_HISTOGRAM_X" { @@ -149,14 +149,14 @@ publish ::histogram_memory::select_read_type user ## # @brief Instrument specific configurations can redefine this -# to select extra read data types or override one of the +# to select extra read data types or override one of the # common data types for the histogram memory. proc ::histogram_memory::is_select_read_type {type} { variable HMOBJ # Instrument specific X and Y dimension names variable INST_NXC variable INST_NYC - + return "notfound" } publish ::histogram_memory::is_select_read_type user @@ -166,7 +166,7 @@ publish ::histogram_memory::is_select_read_type user # specific type then set a common type. proc ::histogram_memory::hmm_set_read_type {type} { variable HMOBJ - + if [ catch { set hmm_ext [is_select_read_type $type] if {$hmm_ext == "notfound"} { @@ -205,7 +205,7 @@ proc ::histogram_memory::set_axes {typelist} { # Instrument specific X and Y dimension names variable INST_NXC variable INST_NYC - + if [catch { set signal 1 foreach type $typelist { @@ -555,7 +555,7 @@ hsetprop $HP_HMM data true hsetprop $HP_HMM klass parameter hsetprop $HP_HMM nxalias hmscobj_hmm hsetprop $HP_HMM sicsdev none -#hsetprop /sics/hmscobj/data +#hsetprop /sics/hmscobj/data #sicspoll add /sics/hmscobj/data hdb sicslist setatt $HMSCOBJ kind scobj diff --git a/site_ansto/instrument/config/hmm/sct_orhvps_common.tcl b/site_ansto/instrument/config/hmm/sct_orhvps_common.tcl index 7e73af61..e7b9903d 100755 --- a/site_ansto/instrument/config/hmm/sct_orhvps_common.tcl +++ b/site_ansto/instrument/config/hmm/sct_orhvps_common.tcl @@ -1,6 +1,6 @@ ## # @file Implements control for the Ordela high voltage power supply using the odrhvps protocol handler. -# +# # This controller implements voltage ramping and always reads the current value before # attempting to set the new voltage. @@ -28,10 +28,10 @@ proc ::scobj::dethvps::rqValue {nextSubState cmd} { # # @param vPath, Hdb node path for the voltage. proc ::scobj::dethvps::rdValue {vPath} { - variable RAMPIDLE - variable RAMPSTOP + variable RAMPIDLE + variable RAMPSTOP variable RAMPSTART - variable RAMPBUSY + variable RAMPBUSY variable MAXPOTVAL variable RAMPINTEREST @@ -98,10 +98,10 @@ proc ::scobj::dethvps::rdValue {vPath} { ## # @brief Checks the target voltage and sets the ramping superstate and ramp direction. proc ::scobj::dethvps::setValue {nextSubState} { - variable RAMPIDLE - variable RAMPSTOP + variable RAMPIDLE + variable RAMPSTOP variable RAMPSTART - variable RAMPBUSY + variable RAMPBUSY set catch_status [ catch { set par [sct target] @@ -135,10 +135,10 @@ proc ::scobj::dethvps::setValue {nextSubState} { ## # @brief Checks that a command has been acknowledged proc ::scobj::dethvps::getACK {} { - variable RAMPIDLE - variable RAMPSTOP + variable RAMPIDLE + variable RAMPSTOP variable RAMPSTART - variable RAMPBUSY + variable RAMPBUSY set catch_status [ catch { set currSuperState [sct ramping] @@ -173,11 +173,11 @@ proc ::scobj::dethvps::getACK {} { # # @param cmd, The set voltage command proc ::scobj::dethvps::ramping {cmd} { - variable RAMPIDLE - variable RAMPSTOP + variable RAMPIDLE + variable RAMPSTOP variable RAMPSTART - variable RAMPBUSY - variable MINRAMPINTERVAL + variable RAMPBUSY + variable MINRAMPINTERVAL set catch_status [ catch { set rampstep [sct rampstep] @@ -213,10 +213,10 @@ proc ::scobj::dethvps::ramping {cmd} { ## # @brief Command interface for voltage controller proc ::scobj::dethvps::drvCmd {} { - variable RAMPIDLE - variable RAMPSTOP + variable RAMPIDLE + variable RAMPSTOP variable RAMPSTART - variable RAMPBUSY + variable RAMPBUSY variable potValPath set catch_status [ catch { diff --git a/site_ansto/instrument/config/motors/sct_jogmotor_common.tcl b/site_ansto/instrument/config/motors/sct_jogmotor_common.tcl index eea43fe4..fa40c7cb 100644 --- a/site_ansto/instrument/config/motors/sct_jogmotor_common.tcl +++ b/site_ansto/instrument/config/motors/sct_jogmotor_common.tcl @@ -44,9 +44,9 @@ namespace eval ::scobj::jogmotor { } return idle } - + proc jogCmd {sct_controller axis} { - variable cmd_table + variable cmd_table set jcmd [string tolower [lindex [sct target] 0]] switch $jcmd [subst { @@ -76,7 +76,7 @@ namespace eval ::scobj::jogmotor { } } - + # TODO Check thread 0 and motion control disabled? proc check_motor {} { set val [sct target] @@ -171,8 +171,8 @@ proc updatestatus {} { namespace import ::scobj::jogmotor::* ## # Eg -# hfactory /controllers plain spy none -# +# hfactory /controllers plain spy none +# # makesctcontroller /controllers/sct_mc1 std localhost:62034 # # mk_sct_jogmotor sct_mc1 chi index { 1 0 2 15 3 20 } diff --git a/site_ansto/instrument/config/motors/sct_positmotor_common.tcl b/site_ansto/instrument/config/motors/sct_positmotor_common.tcl index afbea929..deddbb7b 100644 --- a/site_ansto/instrument/config/motors/sct_positmotor_common.tcl +++ b/site_ansto/instrument/config/motors/sct_positmotor_common.tcl @@ -51,7 +51,7 @@ proc ::scobj::positmotor::setVal {ID2valXfn motor table} { proc ::scobj::positmotor::noResponse {} { return idle } - + ## # @brief Creates a controller which can drive motors to discrete labelled positions # @@ -69,7 +69,7 @@ proc mkPosit {sct_controller name type motor klass table} { lappend ilist $i } sicslist setatt $name values [join $ilist ","] - sicslist setatt $name klass $klass + sicslist setatt $name klass $klass sicslist setatt $name long_name $name hfactory /sics/$name/precision script "getmotpar $motor precision" "$motor precision " float 1 hsetprop /sics/$name read ::scobj::positmotor::reqVal report $motor @@ -137,7 +137,7 @@ proc ::scobj::positmotor::mot2ID {mot precision table} { namespace import ::scobj::positmotor::* ## # Eg -# +# # makesctcontroller sct_mc3 std localhost:62034 # # mkPosit sct_mc3 diameter float apx sample {2.5 0 5.0 -23 7.5 -47} diff --git a/site_ansto/instrument/config/nexus/nxscripts_common_1.tcl b/site_ansto/instrument/config/nexus/nxscripts_common_1.tcl index 34b59969..a7ec3dff 100644 --- a/site_ansto/instrument/config/nexus/nxscripts_common_1.tcl +++ b/site_ansto/instrument/config/nexus/nxscripts_common_1.tcl @@ -203,7 +203,7 @@ proc ::nexus::link {args} { ## - # @brief Initialise state variables + # @brief Initialise state variables proc ::nexus::init {} { variable state variable nexusdic @@ -298,7 +298,7 @@ proc ::nexus::isValidFileType {type} { # state(file,open) true # /data/currentfiletype == UNKNOWN proc ::nexus::newfile {type {namestyle data}} { - ::nexus::newfile_collection -filetype $type -savetype $namestyle + ::nexus::newfile_collection -filetype $type -savetype $namestyle } ## @@ -428,8 +428,8 @@ proc ::nexus::newfile_collection {args} { ## # @brief Save data to the currently open file and then close it. # -# @param point This is the array index for mutable data elements -# +# @param point This is the array index for mutable data elements +# # This function provides the top level call to the recursive ::nexus::savetree # function, it should only be called by the ::nexus::save command. # @@ -544,8 +544,8 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} { } else { ::nexus::CallESProcs -# timestamp force [expr {[clock seconds] - $start_seconds_array($data_label)}] - timestamp force [expr {[clock seconds] - $start_seconds}] +# timestamp force [expr {[clock seconds] - $start_seconds_array($data_label)}] + timestamp force [expr {[clock seconds] - $start_seconds}] dataFileName force $currFilename($data_label) file_status force $file_states(O) ::nexus::nxreopenfile $currFilename($data_label) @@ -558,7 +558,7 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} { } message ] { nxscript puttext data_save_error "([info level 0]) $message" set caught_exception true - } + } if {[info exists data_label] && [info exists currFilename($data_label)]} { ::nexus::nxclosefile $currFilename($data_label) file_status force $file_states(C) @@ -601,7 +601,7 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} { } } message ] { return -code error "([info level 0]) $message" - } + } } ## @@ -631,21 +631,21 @@ proc ::nexus::save {{point 0} {callType "normalsave"}} { } } message ] { return -code error "([info level 0]) $message" - } + } } ## # @brief Traverse the hdb subtree from the given path and save the data in the currently open file # # @param hpath path of subtree to save, must not be "/" - # @param pt Current array index for mutable data (optional default=0) + # @param pt Current array index for mutable data (optional default=0) proc ::nexus::savetree {hpath pt filestatus} { set caught_exception false foreach child [hlist /$hpath] { if [ catch { array unset p_arr - array set p_arr [hlistprop /$hpath/$child tcllist] + array set p_arr [hlistprop /$hpath/$child tcllist] if {([info exists p_arr(type)] == 0) || ($p_arr(type) != "nxvgroup")} { set data_type [lindex [split [hinfo /$hpath/$child] , ] 0] if {[info exists p_arr(data)] && ($p_arr(data) == true) && ($p_arr(nxsave) == true) } { @@ -687,14 +687,14 @@ proc ::nexus::savetree {hpath pt filestatus} { ## # @brief Recursive portion of gen_nxdict function -# +# # @param hpath hdb subtree path to generate dictionary fragment from, must not be "/" # @param dictPath parent path for nexus dictionary fragment. # @param name name for child dictionary path # @param nxc Nexus class name -# +# # If the klass name doesn't begin with NX then construct the SDS name by replacing '/' with '_' in the -# hdb path +# hdb path # # @see gen_nxdict proc ::nexus::_gen_nxdict {hpath dictPath name nxc} { @@ -707,11 +707,11 @@ proc ::nexus::_gen_nxdict {hpath dictPath name nxc} { if {$nxc == "NXentry"} { ::nexus::_gen_nxdict $hpath/$child $dictPath $child $nxclass } else { - ::nexus::_gen_nxdict $hpath/$child $dictPath/$name,$nxc $child $nxclass + ::nexus::_gen_nxdict $hpath/$child $dictPath/$name,$nxc $child $nxclass } } } - array set p_arr [hlistprop /$hpath tcllist] + array set p_arr [hlistprop /$hpath tcllist] set data_type [lindex [split [hinfo /$hpath] , ] 0] if {$data_type != "none" || $p_arr(type) == "nxvgroup"} { #XXX Do we need to check data_type here. This would skip NXVGROUP nodes @@ -769,9 +769,9 @@ proc ::nexus::gen_NXentry_name {baseName} { ## # @brief Generate a nexus dictionary file from the hdb tree # - # An entry in the nexus dictionary is generated for each node in the + # An entry in the nexus dictionary is generated for each node in the # hdb tree which has the following properties and values, data=true and nxsave=true - # + # # @param baseName The base name of the file without suffix # @param nexusdic Name of the nexus dictionary that will be created. # @return Full path to the nexus dictionary. @@ -780,7 +780,7 @@ proc ::nexus::gen_nxdict {nexusdic} { variable nxdictionary set catch_status [catch { set nxdict_path $cfPath(nexus)/$nexusdic - array unset nxdictionary + array unset nxdictionary foreach hp [hlist /] { if {[hpropexists /$hp data] } { if {[hgetpropval /$hp data] == true} { @@ -825,15 +825,15 @@ proc ::nexus::gen_nxdict {nexusdic} { sicslist setatt $sobj savecmd ::nexus::motor::save sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo } - foreach sobj [sicslist type configurablevirtualmotor] { + foreach sobj [sicslist type configurablevirtualmotor] { sicslist setatt $sobj savecmd ::nexus::motor::save sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo } - foreach sobj [sicslist type TasMot] { + foreach sobj [sicslist type TasMot] { sicslist setatt $sobj savecmd ::nexus::motor::save sicslist setatt $sobj sdsinfo ::nexus::motor::sdsinfo } - foreach sobj [sicslist type histmem] { + foreach sobj [sicslist type histmem] { sicslist setatt $sobj savecmd ::nexus::histmem::save sicslist setatt $sobj sdsinfo ::nexus::histmem::sdsinfo } @@ -871,7 +871,7 @@ proc ::nexus::gen_nxdict {nexusdic} { # # @param dtype hdb data type # @return Nexus data type -proc ::nexus::hdb2nx_type {dtype} { +proc ::nexus::hdb2nx_type {dtype} { switch $dtype { int {return NX_INT32} intar {return NX_INT32} @@ -889,7 +889,7 @@ proc ::nexus::hdb2nx_type {dtype} { # # The savecmd attribute of any histogram memory objects should be set to this function # -# @see set_sobj_attributes +# @see set_sobj_attributes proc ::nexus::histmem::save {hm nxalias hpath data_type filestatus args} { variable HMOBJ @@ -1313,7 +1313,7 @@ proc ::nexus::script::sdsinfo {sdsName data_type sobj args} { if {$param(mutable) == true} { set sdsStr "$sdsName -type $dtype $units_att -rank 2 -dim {-1,$size}" } else { - set sdsStr "$sdsName -type $dtype $units_att -rank 1 -dim {$size}" + set sdsStr "$sdsName -type $dtype $units_att -rank 1 -dim {$size}" } } } message ] { @@ -1326,12 +1326,12 @@ namespace import ::nexus::* foreach expt $::nexus::exports { publish $expt user sicslist setatt $expt privilege internal -} +} # TODO Return filename from nxcreatefile and call nxreopen nxclose etc # dictalias is a global hash which records the alias which the value of -# a sics object (eg motors) is written to. The has is indexed by the +# a sics object (eg motors) is written to. The has is indexed by the # objects name. It is useful for making links to datasets. # dim0 = vertical axis on detector # dim1 = horizontal axis on detector diff --git a/site_ansto/instrument/config/plc/plc_common_1.tcl b/site_ansto/instrument/config/plc/plc_common_1.tcl index 5f2f88e9..ea484b08 100644 --- a/site_ansto/instrument/config/plc/plc_common_1.tcl +++ b/site_ansto/instrument/config/plc/plc_common_1.tcl @@ -1,4 +1,4 @@ -set sim_mode [SplitReply [plc_simulation]] +set sim_mode [SplitReply [plc_simulation]] namespace eval plc { } diff --git a/site_ansto/instrument/config/robots/sct_pickandplace.tcl b/site_ansto/instrument/config/robots/sct_pickandplace.tcl index 043bc723..5e59c3c6 100644 --- a/site_ansto/instrument/config/robots/sct_pickandplace.tcl +++ b/site_ansto/instrument/config/robots/sct_pickandplace.tcl @@ -93,7 +93,7 @@ debug_log "setPoint: sct=[sct] target=[sct target] writestatus=[sct writestatus] set err_msg "Invalid Pallet_ Num: [hval $tc_root/Control/Pallet_Nam]" } elseif { [hval $tc_root/Control/Pallet_Idx] < 1 || [hval $tc_root/Control/Pallet_Idx] > 50 } { set err_msg "Invalid Pallet_Idx: [hval $tc_root/Control/Pallet_Idx]" - } + } if { $err_msg != "" } { sct print "error:$err_msg" debug_log "error:$err_msg" diff --git a/site_ansto/instrument/config/scan/scan_common_1.tcl b/site_ansto/instrument/config/scan/scan_common_1.tcl index 0c65f560..b4685f44 100644 --- a/site_ansto/instrument/config/scan/scan_common_1.tcl +++ b/site_ansto/instrument/config/scan/scan_common_1.tcl @@ -13,7 +13,7 @@ #TODO Get rid of duplication in bmonscan and hmscan code namespace eval scan { -variable ic_runscanpar +variable ic_runscanpar variable ic_hmm_datatype variable save_filetype @@ -132,7 +132,7 @@ proc ::scan::ic_initialize {} { hmscan function prepare ::scan::hmm_scan_prepare hmscan function finish ::scan::hmm_scan_finish - # TODO Use ic_runscanpar to create the ::scan::runscan command and + # TODO Use ic_runscanpar to create the ::scan::runscan command and # to validate the "runscan" proc parameters. array set ic_runscanpar [subst { scanvar text=drivable @@ -143,7 +143,7 @@ proc ::scan::ic_initialize {} { preset float=0,inf datatype text=[join [array names ::nexus::histmem_filetype_spec] , ] savetype text=save,nosave - force boolean + force boolean }] scriptcallback connect hmscan SCANEND ::scan::hmscanend_event scriptcallback connect bmonscan SCANEND ::scan::bmonscanend_event @@ -178,7 +178,7 @@ proc ::scan::check_limit {scan_variable limit_name target} { # # NOTE: The sics scan object alread checks if a variable is drivable # so we don't have to. -# TODO We can't check limits of virtual motors yet because the +# TODO We can't check limits of virtual motors yet because the # configurablevirtualmotor doesn't set a checklimits function. proc ::scan::check_scanvar {sobj uobj} { variable check_thread0 @@ -216,7 +216,7 @@ proc ::scan::check_scanvar {sobj uobj} { # Returning an error will cause the scan to abort before it starts\n # eg\n # return -code error "error message" -proc ::scan::pre_hmm_scan_prepare {} {} +proc ::scan::pre_hmm_scan_prepare {} {} ## # @brief Do some pre-scan checks and prime the DAE @@ -294,7 +294,7 @@ proc ::scan::hmm_scan_finish {sobj uobj} { # and clear any data links ::nexus::newfile clear data if {$reset_position == "true"} { -# set reset_position "false" +# set reset_position "false" foreach svar $scanvarlist initpos $scaninitposlist { set svtype [getatt $svar type] if {$svtype == "motor" || $svtype == "configurablevirtualmotor"} { @@ -339,7 +339,7 @@ proc ::scan::bm_writepoint {sobj uobj pt} { #TODO Feedback for Histogram memory scan proc ::scan::hmm_writepoint {sobj uobj pt} { - variable save_filetype + variable save_filetype # Write hdb tree ::nexus::save $pt } @@ -348,10 +348,10 @@ proc ::scan::donothing {args} {} proc ::scan::bm_count {sobj uobj point mode preset} { ::scan::hdb_bmonscan -set mode $mode - ::scan::hdb_bmonscan -set preset $preset - ::scan::hdb_bmonscan -set feedback scanpoint $point; - ::scan::hdb_bmonscan -set feedback mode $mode; - ::scan::hdb_bmonscan -set feedback preset $preset; + ::scan::hdb_bmonscan -set preset $preset + ::scan::hdb_bmonscan -set feedback scanpoint $point; + ::scan::hdb_bmonscan -set feedback mode $mode; + ::scan::hdb_bmonscan -set feedback preset $preset; ::scan::hdb_bmonscan -set feedback scan_variable_value [SplitReply [[lindex $::scan::scanvarlist 0]]] ::monitor::count $mode $preset } @@ -396,7 +396,7 @@ proc ::scan::bm_scan_prepare {sobj uobj} { ::scan::hdb_bmonscan -set feedback status BUSY run_mode "bmonscan" - + array set bm_fb [::scan::hdb_bmonscan -list feedback] set ::histogram_memory::histmem_axes(SVAR) [SplitReply [sicslist [lindex $::scan::scanvarlist 0] hdb_path] ] ::nexus::newfile BEAM_MONITOR $save_filetype @@ -480,7 +480,7 @@ namespace eval scan { switch $arg { "force" { if [string is boolean $val] { - set force_scan $val + set force_scan $val } else { error "ERROR: force must be true or false" } @@ -512,7 +512,7 @@ namespace eval scan { # hmscan ignores mode and preset, we use FAT_COUNT_METHOD and FAT_COUNT_STOP ::histogram_memory::count_method $mode ::histogram_memory::count_size $preset - hmscan clear + hmscan clear foreach scanvar $scanvarlist start $startlist step $steplist { hmscan add $scanvar $start $step } @@ -523,7 +523,7 @@ namespace eval scan { "monitor" { set bms_mode "monitor" } default {return -code error "ERROR: mode should be 'time' or 'monitor' not $mode"} } - bmonscan clear + bmonscan clear foreach scanvar $scanvarlist start $startlist step $steplist { bmonscan add $scanvar $start $step } @@ -560,7 +560,7 @@ namespace eval scan { # Default filetype for histogram memory scans set ic_hmm_datatype "HISTOGRAM_XYT" # Default save uniquely numbered files - set savetype "save" + set savetype "save" set reset_position [SplitReply [::scan::runscan_reset_position]] checkarg $scanvar varname "Expecting a scan variable name, not $scanvar" @@ -568,7 +568,7 @@ namespace eval scan { checkarg $step double "Expecing a float for $scanvar step value, not $step" lappend scanvarlist $scanvar lappend startlist $start - lappend steplist $step + lappend steplist $step for {set argindex 0} {1} {incr argindex 3} { set par [lindex $args $argindex] if {[string length $par] == 0} { @@ -613,7 +613,7 @@ namespace eval scan { return $message } } - + #TODO Add counter (monitor_1 monitor_2 ... histmem) and filetype BEAM_MONITOR HISTMEM_? ## # @brief Run a histogram memory scan @@ -639,11 +639,11 @@ namespace eval scan { set force_scan false set hm_ft_names [array names ::nexus::histmem_filetype_spec] - + # Default filetype for histogram memory scans set ic_hmm_datatype "HISTOGRAM_XYT" # Default save uniquely numbered files - set savetype "save" + set savetype "save" set reset_position [SplitReply [::scan::runscan_reset_position]] if {[is_drivable $scanvar] == 0} { error "The scan variable <$scanvar> must be drivable" @@ -673,7 +673,7 @@ namespace eval scan { switch $arg { "force" { if [string is boolean $val] { - set force_scan $val + set force_scan $val } else { error "ERROR: force must be true or false" } @@ -705,7 +705,7 @@ namespace eval scan { # hmscan ignores mode and preset, we use FAT_COUNT_METHOD and FAT_COUNT_STOP ::histogram_memory::count_method $mode ::histogram_memory::count_size $preset - hmscan clear + hmscan clear hmscan add $scanvar $start $step } elseif {$det_type == "bmon"} { set mode [string tolower $mode] @@ -714,7 +714,7 @@ namespace eval scan { "monitor" { set bms_mode "monitor" } default {return -code error "ERROR: mode should be 'time' or 'monitor' not $mode"} } - bmonscan clear + bmonscan clear bmonscan add $scanvar $start $step } else { return -code error "ERROR: detector type should be 'histmem' or 'bmon' not $det_type" @@ -744,6 +744,6 @@ namespace eval scan { } namespace import ::scan::runscan namespace import ::scan::mscan -publish runscan user +publish runscan user publish mscan user sicslist setatt runscan privilege internal diff --git a/site_ansto/instrument/config/source/source_common.tcl b/site_ansto/instrument/config/source/source_common.tcl index abf63dee..7e23d3d7 100644 --- a/site_ansto/instrument/config/source/source_common.tcl +++ b/site_ansto/instrument/config/source/source_common.tcl @@ -12,7 +12,7 @@ if {$sim_mode == "true"} { switch $status { "CALIBRATED REACTOR POWER" { return [lindex $opal_status 0] - } + } "CNS HELIUM INLET TEMPERATURE" { return [lindex $opal_status 1] } @@ -32,7 +32,7 @@ if {$sim_mode == "true"} { } publish opal user } else { - MakeAsyncQueue lss_chan LSS 137.157.204.67 31250 + MakeAsyncQueue lss_chan LSS 137.157.204.67 31250 MakeLSSMonitor opal lss_chan 0 } ::utility::macro::getset float reactor_power {} { @@ -41,7 +41,7 @@ if {$sim_mode == "true"} { if [string is double $value] { return "reactor_power = $value" } else { - return "reactor_power = -1" + return "reactor_power = -1" } } sicslist setatt reactor_power klass source @@ -57,9 +57,9 @@ proc ::source::ic_initialize {guide} { set str [opal "CNS HELIUM INLET TEMPERATURE"] set value [lindex [lindex [split $str =] 1] 0] if [string is double $value] { - return "cns_inlet_temp = $value" + return "cns_inlet_temp = $value" } else { - return "cns_inlet_temp = -1" + return "cns_inlet_temp = -1" } } sicslist setatt cns_inlet_temp klass source @@ -73,7 +73,7 @@ proc ::source::ic_initialize {guide} { if [string is double $value] { return "cns_outlet_temp = $value" } else { - return "cns_outlet_temp = -1" + return "cns_outlet_temp = -1" } } sicslist setatt cns_outlet_temp klass source @@ -87,7 +87,7 @@ proc ::source::ic_initialize {guide} { if [string is double $value] { return "cns_flow = $value" } else { - return "cns_flow = -1" + return "cns_flow = -1" } } sicslist setatt cns_flow klass source diff --git a/site_ansto/instrument/dingo/camtest_configuration.tcl b/site_ansto/instrument/dingo/camtest_configuration.tcl index c365b455..b7107507 100644 --- a/site_ansto/instrument/dingo/camtest_configuration.tcl +++ b/site_ansto/instrument/dingo/camtest_configuration.tcl @@ -18,9 +18,9 @@ # This configuration does not create a GumTree interface or let you # save nexus data files. -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument bare_dingo +Instrument bare_dingo Instrument lock #START SERVER CONFIGURATION SECTION @@ -30,24 +30,24 @@ source server_config.tcl set sicsroot ../ source util/utility.tcl -ServerOption LogFileBaseName $sicsroot/log/serverlog +ServerOption LogFileBaseName $sicsroot/log/serverlog -###### installprotocolhandler +###### installprotocolhandler -ServerOption statusfile $sicsroot/log/status.tcl -ServerOption RedirectFile $sicsroot/log/stdout -ServerOption LogFileDir $sicsroot/log +ServerOption statusfile $sicsroot/log/status.tcl +ServerOption RedirectFile $sicsroot/log/stdout +ServerOption LogFileDir $sicsroot/log ServerOption QuieckPort [get_portnum $quieckport ] ServerOption ServerPort [get_portnum $serverport ] ServerOption InterruptPort [get_portnum $interruptport ] -ServerOption TelWord sicslogin +ServerOption TelWord sicslogin ServerOption TelnetPort [get_portnum $telnetport ] -ServerOption ReadUserPasswdTimeout 600000 -ServerOption AcceptTimeOut 10 -ServerOption ReadTimeOut 1000 -SicsUser manager ansto 1 -SicsUser user sydney 2 -SicsUser spy 007 3 +ServerOption ReadUserPasswdTimeout 600000 +ServerOption AcceptTimeOut 10 +ServerOption ReadTimeOut 1000 +SicsUser manager ansto 1 +SicsUser user sydney 2 +SicsUser spy 007 3 Motor dummy_motor asim [params \ asyncqueue mc1\ diff --git a/site_ansto/instrument/dingo/config/anticollider/anticollider.tcl b/site_ansto/instrument/dingo/config/anticollider/anticollider.tcl index db8cb21a..85a5de00 100644 --- a/site_ansto/instrument/dingo/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/dingo/config/anticollider/anticollider.tcl @@ -1,6 +1,6 @@ # 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 proc ::anticollider::enable {args} { diff --git a/site_ansto/instrument/dingo/config/counter/counter.tcl b/site_ansto/instrument/dingo/config/counter/counter.tcl index d65fe689..c03244a1 100644 --- a/site_ansto/instrument/dingo/config/counter/counter.tcl +++ b/site_ansto/instrument/dingo/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list variable isc_cm_address variable isc_cm_port @@ -18,11 +18,11 @@ proc ::counter::cm_initialize {} { if [ catch { variable isc_cm_address variable isc_cm_port - + MakeAsyncQueue cmserver CAMERA $isc_cm_address $isc_cm_port MakeCounter cm1 anstocamera cmserver - + sicslist setatt cm1 privilege internal ::utility::macro::getset text cm1_mode {} { return [cm1 getmode] @@ -78,7 +78,7 @@ proc ::counter::isc_initialize {} { set isc_cm_address [dict get $::CAMERA_HOSTPORT HOST] set isc_cm_port [dict get $::CAMERA_HOSTPORT PORT] - ::counter::cm_initialize + ::counter::cm_initialize } message ] { if {$::errorCode=="NONE"} {return $message} return -code error "$message" diff --git a/site_ansto/instrument/dingo/config/motors/motor_configuration.tcl b/site_ansto/instrument/dingo/config/motors/motor_configuration.tcl index bcbc58a0..59d85d99 100644 --- a/site_ansto/instrument/dingo/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/dingo/config/motors/motor_configuration.tcl @@ -70,7 +70,7 @@ Motor stth $motor_driver_type [params \ absEncHome $stth_Home\ cntsPerX 4096] stth part sample -stth long_name stth +stth long_name stth stth softlowerlim 0 stth softupperlim 360 stth home 0 @@ -185,7 +185,7 @@ sz home 0 # # mc2: Camera translation axis along beam -# Gearbox ?, Gear ratio ?, +# Gearbox ?, Gear ratio ?, set dy_Home 0 set dyStepRate ? Motor dy $motor_driver_type [params \ diff --git a/site_ansto/instrument/dingo/config/motors/positmotor_configuration.tcl b/site_ansto/instrument/dingo/config/motors/positmotor_configuration.tcl index d0676f12..c34b442a 100644 --- a/site_ansto/instrument/dingo/config/motors/positmotor_configuration.tcl +++ b/site_ansto/instrument/dingo/config/motors/positmotor_configuration.tcl @@ -24,10 +24,10 @@ set 20sample_table { 6 203.7 7 161.7 8 119.7 - 9 77.7 - 10 35.7 - 11 -46.3 - 12 -88.3 + 9 77.7 + 10 35.7 + 11 -46.3 + 12 -88.3 13 -130.3 14 -172.3 15 -214.3 diff --git a/site_ansto/instrument/dingo/config/plc/plc.tcl b/site_ansto/instrument/dingo/config/plc/plc.tcl index 2e281f38..cc5b9296 100644 --- a/site_ansto/instrument/dingo/config/plc/plc.tcl +++ b/site_ansto/instrument/dingo/config/plc/plc.tcl @@ -1,5 +1,5 @@ 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] MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/dingo/dingo_configuration.tcl b/site_ansto/instrument/dingo/dingo_configuration.tcl index d8c6464c..29eb0d3e 100644 --- a/site_ansto/instrument/dingo/dingo_configuration.tcl +++ b/site_ansto/instrument/dingo/dingo_configuration.tcl @@ -1,8 +1,8 @@ # Author: Jing Chen (jgn@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument dingo +Instrument dingo Instrument lock #START SERVER CONFIGURATION SECTION @@ -66,7 +66,7 @@ foreach m [sicslist type motor] { } server_init - + clientput "serverport [get_portnum $::serverport]" ########################################### diff --git a/site_ansto/instrument/hipd/config/anticollider/anticollider.tcl b/site_ansto/instrument/hipd/config/anticollider/anticollider.tcl index a0b86dc2..23ccb5ac 100644 --- a/site_ansto/instrument/hipd/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/hipd/config/anticollider/anticollider.tcl @@ -1,4 +1,4 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -source $cfPath(anticollider)/anticollider_common.tcl +source $cfPath(anticollider)/anticollider_common.tcl ::anticollider::loadscript acscript.txt diff --git a/site_ansto/instrument/hipd/config/commands/commands.tcl b/site_ansto/instrument/hipd/config/commands/commands.tcl index 60696b7b..4c198c7d 100644 --- a/site_ansto/instrument/hipd/config/commands/commands.tcl +++ b/site_ansto/instrument/hipd/config/commands/commands.tcl @@ -34,7 +34,7 @@ command SimpleRun { float=0:inf steptime int=1:inf numsteps } { - + # RadCollOff histmem mode time histmem preset $steptime @@ -68,7 +68,7 @@ command RadCollRun { int=1:inf oscno int=1:inf reps } { - + # RadCollOn $oscno histmem mode unlimited newfile HISTOGRAM_XY @@ -102,7 +102,7 @@ float=0:inf time } RadCollOff } -# RadCollScan +# RadCollScan command RadCollScan { text=drivable motor float start diff --git a/site_ansto/instrument/hipd/config/commands/eulerscan.tcl b/site_ansto/instrument/hipd/config/commands/eulerscan.tcl index cf65f137..9a07c365 100644 --- a/site_ansto/instrument/hipd/config/commands/eulerscan.tcl +++ b/site_ansto/instrument/hipd/config/commands/eulerscan.tcl @@ -1,4 +1,4 @@ - + # Euler cradle scan commands for texture runs # AJS Dec 2010 @@ -8,7 +8,7 @@ proc SetHistoSync {framenum} { 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 } fat_table -set NOS_PERIODS $framenum oat_table -set T {0 2200000} NTC 1 @@ -22,7 +22,7 @@ publish SetHistoSync user proc SetHistoNormal {} { 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} fat_table -set NOS_PERIODS 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) -# 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 @@ -77,7 +77,7 @@ broadcast $scval $stval # this we needed when it didn't work properly -# proc ::histogram_memory::pre_count {} {} +# proc ::histogram_memory::pre_count {} {} # ephi send SHC # ephi send SPC=25000 # ephi send BCG diff --git a/site_ansto/instrument/hipd/config/counter/counter.tcl b/site_ansto/instrument/hipd/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/hipd/config/counter/counter.tcl +++ b/site_ansto/instrument/hipd/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/hipd/config/environment/temperature/lakeshore340.tcl b/site_ansto/instrument/hipd/config/environment/temperature/lakeshore340.tcl index 31c49bbd..c1a0f367 100644 --- a/site_ansto/instrument/hipd/config/environment/temperature/lakeshore340.tcl +++ b/site_ansto/instrument/hipd/config/environment/temperature/lakeshore340.tcl @@ -14,7 +14,7 @@ source $cfPath(environment)/temperature/lakeshore340_common.tcl # @param settle, settling time in seconds # @param range, lakeshore range # @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} { variable tc_dfltPar 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 ::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} } } message ] { diff --git a/site_ansto/instrument/hipd/config/hipadaba/hpaths.tcl b/site_ansto/instrument/hipd/config/hipadaba/hpaths.tcl index 24a55468..a70a7a4d 100644 --- a/site_ansto/instrument/hipd/config/hipadaba/hpaths.tcl +++ b/site_ansto/instrument/hipd/config/hipadaba/hpaths.tcl @@ -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. # obj name path diff --git a/site_ansto/instrument/hipd/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/hipd/config/hmm/hmm_configuration.tcl index c34e9710..1b36b4cc 100644 --- a/site_ansto/instrument/hipd/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/hipd/config/hmm/hmm_configuration.tcl @@ -10,7 +10,7 @@ proc ::histogram_memory::init_OAT_TABLE {args} { } else { 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 OAT_TABLE X -setdata MAX_CHAN 3872 OAT_TABLE X -setdata MAX_CHAN_PERSEG 992 @@ -64,7 +64,7 @@ proc ::histogram_memory::oat_bins {axis} { set bb0 3871.5 set bb1 [expr $bb0+$bstep] FAT_TABLE -set MULTI_HOST_HISTO_STITCH_OVERLAP [expr abs(32.0/$bstep)] - } + } return [list $bb0 $bb1] } else { 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. proc ::histogram_memory::number_of_channels {axis} { array set channID {X NXC Y NYC T NTC} - if [ catch { + if [ catch { if {$axis == "X"} { set nch_perseg [OAT_TABLE -get $channID($axis)] set overlap [FAT_TABLE -get MULTI_HOST_HISTO_STITCH_OVERLAP] diff --git a/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl b/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl index 802e67fb..b8a8ab47 100644 --- a/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl +++ b/site_ansto/instrument/hipd/config/hmm/hmm_rapid.tcl @@ -122,7 +122,7 @@ proc histmem_acquire_period_sequence { Np Nf } { histmem start set dlytime [ expr int( 1000 * $Nf / 50. ) ] -# clientput "Waiting for" $dlytime "ms..." +# clientput "Waiting for" $dlytime "ms..." after $dlytime # clientput "tc1 reading is: " [tc1 get] diff --git a/site_ansto/instrument/hipd/config/hmm/hmm_temp.tcl b/site_ansto/instrument/hipd/config/hmm/hmm_temp.tcl index 32d8c3fb..388c5f92 100644 --- a/site_ansto/instrument/hipd/config/hmm/hmm_temp.tcl +++ b/site_ansto/instrument/hipd/config/hmm/hmm_temp.tcl @@ -43,7 +43,7 @@ proc histmem_acquire_period_sequence { Np Nf } { histmem start set dlytime [ expr int( 1000 * $Nf / 50. ) ] -# clientput "Waiting for" $dlytime "ms..." +# clientput "Waiting for" $dlytime "ms..." # after $dlytime # clientput "tc1 reading is: " [tc1 get] diff --git a/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl index 8a84cea7..78077583 100644 --- a/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl @@ -103,7 +103,7 @@ set move_count 10 # Set axis_config as follows to use different axis configurations # 0: tilt stage configuration # 1: eulerian cradle -# 2: small omega +# 2: small omega # 3: Oxford magnet sample stick set axis_config 0 @@ -427,7 +427,7 @@ oct long_name oct # Monochromator Focusing (Ge) ## 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 ## reading of 4793.458008 ## The encoder has a 12bit resolution (ie 12bits/turn 4096) diff --git a/site_ansto/instrument/hipd/config/plc/plc.tcl b/site_ansto/instrument/hipd/config/plc/plc.tcl index 8ce177f6..b13f938b 100644 --- a/site_ansto/instrument/hipd/config/plc/plc.tcl +++ b/site_ansto/instrument/hipd/config/plc/plc.tcl @@ -1,5 +1,5 @@ set sim_mode [SplitReply [plc_simulation]] -if {$sim_mode == "false"} { +if {$sim_mode == "false"} { MakeAsyncQueue plc_chan SafetyPLC 137.157.211.21 30001 MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/hipd/script_validator/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/hipd/script_validator/config/hmm/hmm_configuration.tcl index 08a89883..8852628a 100644 --- a/site_ansto/instrument/hipd/script_validator/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/hipd/script_validator/config/hmm/hmm_configuration.tcl @@ -1,6 +1,6 @@ MakeHM hmm SIM #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. proc ::histogram_memory::hmc {_start _preset _mode _pause} { diff --git a/site_ansto/instrument/hipd/wombat_configuration.tcl b/site_ansto/instrument/hipd/wombat_configuration.tcl index bea0534b..13aab103 100644 --- a/site_ansto/instrument/hipd/wombat_configuration.tcl +++ b/site_ansto/instrument/hipd/wombat_configuration.tcl @@ -1,9 +1,9 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument wombat +Instrument wombat Instrument lock #START SERVER CONFIGURATION SECTION @@ -54,13 +54,13 @@ source gumxml.tcl # The Alice Thing # 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 # add_qlink qlink 137.157.201.86 4004 5 # add_sct_ls340 tc1 137.157.201.86 4001 "\r" 5.0 5.0 # add_lh45 tc2 137.157.201.86 4003 1 -# Eurotherm +# Eurotherm # add_et2000 name IP PORT MODBUS_ADDR TOL # add_et2000 et2000 10.157.205.19 502 1 5 diff --git a/site_ansto/instrument/hrpd/Test/cyclebatch.tcl b/site_ansto/instrument/hrpd/Test/cyclebatch.tcl index d7300dca..67750df0 100644 --- a/site_ansto/instrument/hrpd/Test/cyclebatch.tcl +++ b/site_ansto/instrument/hrpd/Test/cyclebatch.tcl @@ -1,6 +1,6 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Cycle motors +# Cycle motors clientput "drive to zero reference" 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 diff --git a/site_ansto/instrument/hrpd/config/anticollider/anticollider.tcl b/site_ansto/instrument/hrpd/config/anticollider/anticollider.tcl index a0b86dc2..23ccb5ac 100644 --- a/site_ansto/instrument/hrpd/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/hrpd/config/anticollider/anticollider.tcl @@ -1,4 +1,4 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -source $cfPath(anticollider)/anticollider_common.tcl +source $cfPath(anticollider)/anticollider_common.tcl ::anticollider::loadscript acscript.txt diff --git a/site_ansto/instrument/hrpd/config/counter/counter.tcl b/site_ansto/instrument/hrpd/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/hrpd/config/counter/counter.tcl +++ b/site_ansto/instrument/hrpd/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/hrpd/config/environment/temperature/lakeshore340.tcl b/site_ansto/instrument/hrpd/config/environment/temperature/lakeshore340.tcl index 31c49bbd..c1a0f367 100644 --- a/site_ansto/instrument/hrpd/config/environment/temperature/lakeshore340.tcl +++ b/site_ansto/instrument/hrpd/config/environment/temperature/lakeshore340.tcl @@ -14,7 +14,7 @@ source $cfPath(environment)/temperature/lakeshore340_common.tcl # @param settle, settling time in seconds # @param range, lakeshore range # @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} { variable tc_dfltPar 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 ::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} } } message ] { diff --git a/site_ansto/instrument/hrpd/config/hipadaba/hpaths.tcl b/site_ansto/instrument/hrpd/config/hipadaba/hpaths.tcl index 8ef2ffaa..77cc5f94 100644 --- a/site_ansto/instrument/hrpd/config/hipadaba/hpaths.tcl +++ b/site_ansto/instrument/hrpd/config/hipadaba/hpaths.tcl @@ -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 #following paths. diff --git a/site_ansto/instrument/hrpd/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/hrpd/config/hmm/hmm_configuration.tcl index e1968d51..2b243b74 100644 --- a/site_ansto/instrument/hrpd/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/hrpd/config/hmm/hmm_configuration.tcl @@ -4,7 +4,7 @@ set sim_mode [SplitReply [hmm_simulation]] proc ::histogram_memory::init_OAT_TABLE {} { 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 OAT_TABLE X -setdata MAX_CHAN 128 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_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 ] { if {$::errorCode=="NONE"} {return $message} return -code error $message diff --git a/site_ansto/instrument/hrpd/config/motors/euler_configuration.tcl b/site_ansto/instrument/hrpd/config/motors/euler_configuration.tcl index ff2010ce..7986d6a5 100644 --- a/site_ansto/instrument/hrpd/config/motors/euler_configuration.tcl +++ b/site_ansto/instrument/hrpd/config/motors/euler_configuration.tcl @@ -1,6 +1,6 @@ # This must be loaded by motor_configuration.tcl -set ephi_Home 6647698 +set ephi_Home 6647698 set echi_Home 8919294 set eom_Home 23165482 diff --git a/site_ansto/instrument/hrpd/config/motors/motor_configuration.tcl b/site_ansto/instrument/hrpd/config/motors/motor_configuration.tcl index fef1aec0..fb7a9521 100644 --- a/site_ansto/instrument/hrpd/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/hrpd/config/motors/motor_configuration.tcl @@ -166,7 +166,7 @@ Motor mchi $motor_driver_type [params \ absEncHome $mchi_Home\ cntsPerX 4096] mchi home -0.2546 -mchi softlowerlim -2 +mchi softlowerlim -2 mchi softupperlim 2 mchi speed 1 mchi movecount $move_count @@ -393,7 +393,7 @@ Motor stth $motor_driver_type [params \ absEnc 1\ absEncHome $stth_Home\ cntsPerX -93207] -stth softlowerlim -156.75 +stth softlowerlim -156.75 stth softupperlim 5.25 stth home 0 stth speed 0.5 diff --git a/site_ansto/instrument/hrpd/config/plc/plc.tcl b/site_ansto/instrument/hrpd/config/plc/plc.tcl index 0507a01b..306c62fa 100644 --- a/site_ansto/instrument/hrpd/config/plc/plc.tcl +++ b/site_ansto/instrument/hrpd/config/plc/plc.tcl @@ -1,5 +1,5 @@ set sim_mode [SplitReply [plc_simulation]] -if {$sim_mode == "false"} { +if {$sim_mode == "false"} { MakeAsyncQueue plc_chan SafetyPLC 137.157.211.21 30002 MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/hrpd/echidna_configuration.tcl b/site_ansto/instrument/hrpd/echidna_configuration.tcl index 2013c5e9..145f7e13 100644 --- a/site_ansto/instrument/hrpd/echidna_configuration.tcl +++ b/site_ansto/instrument/hrpd/echidna_configuration.tcl @@ -1,9 +1,9 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument echidna +Instrument echidna Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/hrpd/script_validator/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/hrpd/script_validator/config/hmm/hmm_configuration.tcl index d77b473a..14ec5557 100644 --- a/site_ansto/instrument/hrpd/script_validator/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/hrpd/script_validator/config/hmm/hmm_configuration.tcl @@ -1,6 +1,6 @@ MakeHM hmm SIM #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. proc ::histogram_memory::hmc {_start _preset _mode _pause} { diff --git a/site_ansto/instrument/kookaburra/config/anticollider/anticollider.tcl b/site_ansto/instrument/kookaburra/config/anticollider/anticollider.tcl index db8cb21a..85a5de00 100644 --- a/site_ansto/instrument/kookaburra/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/kookaburra/config/anticollider/anticollider.tcl @@ -1,6 +1,6 @@ # 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 proc ::anticollider::enable {args} { diff --git a/site_ansto/instrument/kookaburra/config/chopper/sct_fermichopper.tcl b/site_ansto/instrument/kookaburra/config/chopper/sct_fermichopper.tcl index 4a46d647..c9db535a 100644 --- a/site_ansto/instrument/kookaburra/config/chopper/sct_fermichopper.tcl +++ b/site_ansto/instrument/kookaburra/config/chopper/sct_fermichopper.tcl @@ -185,7 +185,7 @@ set chname ch$chN hfactory $fermiPath/$chname/intlck_status/$field plain user int } - + hfactory $chPath/control plain user none 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 "RDSYNMOTDIR" ${scobjNS}::rdVal $fermiPath {ref_delay ref_period sync_srce motdir} hsetprop $fermiPath "RDIDLE" ${scobjNS}::rdVal $fermiPath idle_toggle - + if {$sim_mode == "false"} { sct_fermi poll $fermiPath $pollrate diff --git a/site_ansto/instrument/kookaburra/config/commands/monodrive.tcl b/site_ansto/instrument/kookaburra/config/commands/monodrive.tcl index ebcac051..0d7e4e5c 100644 --- a/site_ansto/instrument/kookaburra/config/commands/monodrive.tcl +++ b/site_ansto/instrument/kookaburra/config/commands/monodrive.tcl @@ -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 -# +# # Date: 11/11/2011 # get a specified parameter value of a motor @@ -79,25 +79,25 @@ proc DriveMono {mot focus} { set translateDis [expr $focus - [getSetting $mot position]] # Determine if the movement is within the ranges of the three motors - if {[expr $mraPosition + $translateDis] > $mraSoftupperlim || - [expr $mraPosition + $translateDis] < $mraSoftlowerlim} { + if {[expr $mraPosition + $translateDis] > $mraSoftupperlim || + [expr $mraPosition + $translateDis] < $mraSoftlowerlim} { broadcast "Error: the movement is out of the range limit of motor mra" set moveFlag 0 } - if {[expr $mrbPosition + $translateDis] > $mrbSoftupperlim || + if {[expr $mrbPosition + $translateDis] > $mrbSoftupperlim || [expr $mrbPosition + $translateDis] < $mrbSoftlowerlim} { broadcast "Error: the movement is out of the range limit of motor mrb" set moveFlag 0 } - if {[expr $mrcPosition + $translateDis] > $mrcSoftupperlim || + if {[expr $mrcPosition + $translateDis] > $mrcSoftupperlim || [expr $mrcPosition + $translateDis] < $mrcSoftlowerlim} { broadcast "Error: the movement is out of the range limit of motor mrc" set moveFlag 0 } - # move the three motors + # move the three motors if {$moveFlag == 1} { # Unlock the three motors mra fixed -1 diff --git a/site_ansto/instrument/kookaburra/config/counter/counter.tcl b/site_ansto/instrument/kookaburra/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/kookaburra/config/counter/counter.tcl +++ b/site_ansto/instrument/kookaburra/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/kookaburra/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/kookaburra/config/hmm/hmm_configuration.tcl index 5a13e190..cc1819ae 100644 --- a/site_ansto/instrument/kookaburra/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/kookaburra/config/hmm/hmm_configuration.tcl @@ -21,7 +21,7 @@ proc ::histogram_memory::init_OAT_TABLE {} { hmm configure fat_frame_frequency $freq 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 ] { if {$::errorCode=="NONE"} {return $message} return -code error $message @@ -92,7 +92,7 @@ proc ::histogram_memory::isc_initialize {} { ::histogram_memory::set_graphtype "two_theta" "boundaries" # 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) # Radius = 2400mm detector_active_height_mm 1015 diff --git a/site_ansto/instrument/kookaburra/config/motors/motor_configuration.tcl b/site_ansto/instrument/kookaburra/config/motors/motor_configuration.tcl index 44c7f618..4ff27efa 100644 --- a/site_ansto/instrument/kookaburra/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/kookaburra/config/motors/motor_configuration.tcl @@ -90,7 +90,7 @@ bex home 0 # mc1: Premonochromator Crystal Si(111) Tilt # Gearbox 55:1, 0.5 degree -# Encoder 2P12, +# Encoder 2P12, set pmchi_Home 8410424 set pmchiStepRate [expr $motorrate*55.0/0.5] Motor pmchi $motor_driver_type [params \ @@ -118,12 +118,12 @@ pmchi home 0 # mc1: Premonochromator Crystal Si(111) Rotate -# Gearbox 50:1, pitch 1 degree +# Gearbox 50:1, pitch 1 degree # Encoder 2P25 # Crystal B 0, 18889883 -# Crystal HOPG position 179.603806, 2149592 +# Crystal HOPG position 179.603806, 2149592 # Crystal HOPG loading position 49.740612, 14253738 -set pmom_Home 2102963 +set pmom_Home 2102963 set pmomStepRate [expr $motorrate*50.0] Motor pmom $motor_driver_type [params \ asyncqueue mc1\ @@ -150,9 +150,9 @@ pmom home 0 # mc1: Main Detector - X Translate -# Gearbox 20:1, pitch 5mm +# Gearbox 20:1, pitch 5mm # Encoder 2p17 -set mdet_Home 521939864 +set mdet_Home 521939864 set mdetStepRate [expr $motorrate *20.0/5.0] Motor mdet $motor_driver_type [params \ asyncqueue mc1\ @@ -214,9 +214,9 @@ att home 0 # mc2: CC1 Monochromator Stage Tilt # Gearbox 20:1, screw pitch 356 -# Encoder 2p17 +# Encoder 2p17 # 68.681 -set m1chi_Home 15016533 +set m1chi_Home 15016533 set m1chiSetRate [expr $motorrate*20*100/68.681] Motor m1chi $motor_driver_type [params \ asyncqueue mc2\ @@ -243,7 +243,7 @@ m1chi home 0 # mc2: CC1 Monochromator Stage Rotation -# Gearbox 100:1, screw pitch 356 +# Gearbox 100:1, screw pitch 356 # Encoder 2p25 # m1om_Home 13617081 set m1om_Home 30395150 @@ -279,7 +279,7 @@ m1om Creep_Substep 0.04 # mc2: CC1 Monochromator Stage X Translation -# Gearbox 20:1, pitch 5mm +# Gearbox 20:1, pitch 5mm # Encoder 2p17 set m1x_Home 3754723 set m1xSetRate [expr $motorrate*20.0/5.0] @@ -299,14 +299,14 @@ Motor m1x $motor_driver_type [params \ absEncHome $m1x_Home\ cntsPerX [expr -131072/5.0]] m1x speed 0.3 -m1x part crystal +m1x part crystal m1x long_name m1x -m1x softlowerlim -82 -m1x softupperlim 49 +m1x softlowerlim -82 +m1x softupperlim 49 m1x home 0 # mc2: Slit system - 1 TOP Blade -# Gearbox 55:1, pitch 0.5mm +# Gearbox 55:1, pitch 0.5mm # Encoder 2p13 set ss1u_Home 918407 set ss1uSetRate [expr $motorrate*55.0/0.5] @@ -333,10 +333,10 @@ ss1u softupperlim 37 ss1u home 0 -# mc2: Slit system - 1 BOTTOM Blade +# mc2: Slit system - 1 BOTTOM Blade # Gearbox 55:1, pitch 0.5mm # Encoder 2p13 -set ss1d_Home 1157895 +set ss1d_Home 1157895 set ss1dSetRate [expr $motorrate*55.0/0.5] Motor ss1d $motor_driver_type [params \ asyncqueue mc2\ @@ -354,7 +354,7 @@ Motor ss1d $motor_driver_type [params \ absEncHome $ss1d_Home\ cntsPerX 16384] ss1d speed 0.1 -ss1d part slits +ss1d part slits ss1d long_name ss1d ss1d softlowerlim -37.8 ss1d softupperlim 35 @@ -392,7 +392,7 @@ ss1l home 0 # mc2: Slit system - 1 RIGHT Blade # Gearbox 55:1, pitch 0.5mm # Encoder 2p13 -set ss1r_Home 1656697 +set ss1r_Home 1656697 set ss1rSetRate [expr $motorrate*55.0/0.5] Motor ss1r $motor_driver_type [params \ asyncqueue mc2\ @@ -418,8 +418,8 @@ ss1r home 0 # mc2: Sample Changer (Sample Stage) Z Translation -# Gearbox 1:1 -#set samz_Home +# Gearbox 1:1 +#set samz_Home #set samzSetRate 25000 #Motor samz $motor_driver_type [params \ asyncqueue mc2\ @@ -448,7 +448,7 @@ ss1r home 0 # Motor Controller 3 # Motor Controller 3 ############################ -# +# # mc3: Slit system - 2 TOP Blade # Gearbox 55:1, pitch 0.5mm @@ -568,7 +568,7 @@ ss2r home 0 # mc3: CC2 Analyser Stage - Tilt # Gearbox 20:1, screw pitch 356 -# Encoder 2p17 +# Encoder 2p17 # 68.681 set m2chi_Home 15512615 set m2chiSetRate [expr $motorrate*20*100/68.681] @@ -598,7 +598,7 @@ m2chi home 0 # set m2om_Home 15776972 # mc3: CC2 Analyser Stage - Rotation -# Gearbox 100:1, screw pitch 356 +# Gearbox 100:1, screw pitch 356 # Encoder 2p25 set m2om_Home 23155978 set m2omSetRate [expr $motorrate*100.0*356.0/360.0] @@ -631,10 +631,10 @@ m2om Creep_Factor 0.5 m2om Creep_Substep 0.04 -# mc3: CC2 Analyser Stage - X Translate -# Gearbox 20:1, pitch 5mm +# mc3: CC2 Analyser Stage - X Translate +# Gearbox 20:1, pitch 5mm # Encoder 2p17 -set m2x_Home 524680153 +set m2x_Home 524680153 set m2xSetRate [expr $motorrate*20.0/5.0] Motor m2x $motor_driver_type [params \ asyncqueue mc3\ @@ -660,9 +660,9 @@ m2x home 0 # mc3: CC2 Analyser Stage - Y Translation -# Gearbox 20:1, pitch 5mm +# Gearbox 20:1, pitch 5mm # Encoder 2p17 -set m2y_Home 516940434 +set m2y_Home 516940434 set m2ySetRate [expr $motorrate*20.0/5.0] Motor m2y $motor_driver_type [params \ asyncqueue mc3\ diff --git a/site_ansto/instrument/kookaburra/config/motors/positmotor_configuration.tcl b/site_ansto/instrument/kookaburra/config/motors/positmotor_configuration.tcl index e7f8574a..93064de8 100644 --- a/site_ansto/instrument/kookaburra/config/motors/positmotor_configuration.tcl +++ b/site_ansto/instrument/kookaburra/config/motors/positmotor_configuration.tcl @@ -28,10 +28,10 @@ set 20sample_table { 6 203.7 7 161.7 8 119.7 - 9 77.7 - 10 35.7 - 11 -46.3 - 12 -88.3 + 9 77.7 + 10 35.7 + 11 -46.3 + 12 -88.3 13 -130.3 14 -172.3 15 -214.3 diff --git a/site_ansto/instrument/kookaburra/config/parameters/parameters.tcl b/site_ansto/instrument/kookaburra/config/parameters/parameters.tcl index 518daa80..4c0ba7f2 100644 --- a/site_ansto/instrument/kookaburra/config/parameters/parameters.tcl +++ b/site_ansto/instrument/kookaburra/config/parameters/parameters.tcl @@ -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 diff --git a/site_ansto/instrument/kookaburra/config/plc/plc.tcl b/site_ansto/instrument/kookaburra/config/plc/plc.tcl index b3d685ba..10635f3f 100644 --- a/site_ansto/instrument/kookaburra/config/plc/plc.tcl +++ b/site_ansto/instrument/kookaburra/config/plc/plc.tcl @@ -1,5 +1,5 @@ set sim_mode [SplitReply [plc_simulation]] -if {$sim_mode == "false"} { +if {$sim_mode == "false"} { # MakeAsyncQueue plc_chan SafetyPLC 137.157.204.79 31001 # MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/kookaburra/config/scan/scan.tcl b/site_ansto/instrument/kookaburra/config/scan/scan.tcl index 7eaef1f8..d2dadee7 100644 --- a/site_ansto/instrument/kookaburra/config/scan/scan.tcl +++ b/site_ansto/instrument/kookaburra/config/scan/scan.tcl @@ -13,17 +13,17 @@ proc filecounts_log {fname txt} { 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 fileCountsDiff ../log/bmcountsdiff.log variable curCount - + set fd [open $fileCounts w] close $fd set fd [open $fileCountsDiff w] close $fd - + set txt "" for {set thres $minBMThreshold} {$thres <= $manBMThreshold} {incr thres $stepBMThreshold} { 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]]] } set txt "$vol : $diff" - filecounts_log $fileCountsDiff $txt - + filecounts_log $fileCountsDiff $txt + } } diff --git a/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl b/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl index dd68e0e2..40d330f1 100644 --- a/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl +++ b/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl @@ -1,8 +1,8 @@ # Author: Jing Chen (jgn@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument kookaburra +Instrument kookaburra Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/lyrebird/config/anticollider/anticollider.tcl b/site_ansto/instrument/lyrebird/config/anticollider/anticollider.tcl index db8cb21a..85a5de00 100644 --- a/site_ansto/instrument/lyrebird/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/lyrebird/config/anticollider/anticollider.tcl @@ -1,6 +1,6 @@ # 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 proc ::anticollider::enable {args} { diff --git a/site_ansto/instrument/lyrebird/config/counter/counter.tcl b/site_ansto/instrument/lyrebird/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/lyrebird/config/counter/counter.tcl +++ b/site_ansto/instrument/lyrebird/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/lyrebird/config/goniometer/sct_goniometer.tcl b/site_ansto/instrument/lyrebird/config/goniometer/sct_goniometer.tcl index a7162f14..0266fa63 100644 --- a/site_ansto/instrument/lyrebird/config/goniometer/sct_goniometer.tcl +++ b/site_ansto/instrument/lyrebird/config/goniometer/sct_goniometer.tcl @@ -1,5 +1,5 @@ ## -# @file Goniometer controller +# @file Goniometer controller # # Author: Jing Chen (jgn@ansto.gov.au) June 2010 # @@ -10,7 +10,7 @@ # PORT 62944 # tuning 1 # interval 1 -# } +# } # # NOTE: # If tuning=1 this will generate gom/set_gom, gchi/set_gchi and gphi/set_gphi @@ -25,14 +25,14 @@ proc ::scobj::goniometer::set_gom {basePath} { set newGOM [sct target] hsetprop $basePath targetGom $newGOM return idle -} - +} + proc ::scobj::goniometer::set_gchi {basePath} { set newGCHI [sct target] hsetprop $basePath targetGchi $newGCHI return idle -} - +} + proc ::scobj::goniometer::set_gphi {basePath} { set newGPHI [sct target] hsetprop $basePath targetGphi $newGPHI @@ -63,12 +63,12 @@ proc ::scobj::goniometer::rdStatFunc {basePath} { hset $basePath/gom $stateArr(gom) hset $basePath/gchi $stateArr(gchi) - hset $basePath/gphi $stateArr(gphi) + hset $basePath/gphi $stateArr(gphi) hsetprop $basePath currGom $stateArr(gom) hsetprop $basePath currGchi $stateArr(gchi) hsetprop $basePath currGphi $stateArr(gphi) - + #sct update $s3 sct utime readtime } @@ -110,21 +110,21 @@ proc ::scobj::goniometer::checkReplyFunc {} { broadcast "ERROR: PLC cannot write new values for variable due to internal reason!" } else { sct utime readtime - } - + } + return idle } ## # @brief Make a Goniometer controller -# -# @param argList, {name "goniometer" IP localhost PORT 62944 tuning 1 interval 1} +# +# @param argList, {name "goniometer" IP localhost PORT 62944 tuning 1 interval 1} # # name: name of goniometer controller object # IP: IP address of RF generator moxa box # PORT: Port number assigned to the generator on the moxa-box # tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions -# interval: polling and ramping interval in seconds. +# interval: polling and ramping interval in seconds. proc ::scobj::goniometer::mkGoniometer {argList} { # Generate parameter array from the argument list foreach {k v} $argList { diff --git a/site_ansto/instrument/lyrebird/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/lyrebird/config/hmm/hmm_configuration.tcl index c0a95646..08647221 100644 --- a/site_ansto/instrument/lyrebird/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/lyrebird/config/hmm/hmm_configuration.tcl @@ -21,7 +21,7 @@ proc ::histogram_memory::init_OAT_TABLE {} { hmm configure fat_frame_frequency $freq hmm configure fat_frame_source INTERNAL - OAT_TABLE -set X { 29.5 28.5 } NXC 30 Y { -0.5 0.5 } NYC 1024 T { 0 200000 } NTC 1 + OAT_TABLE -set X { 29.5 28.5 } NXC 30 Y { -0.5 0.5 } NYC 1024 T { 0 200000 } NTC 1 } message ] { if {$::errorCode=="NONE"} {return $message} return -code error $message @@ -65,9 +65,9 @@ proc ::histogram_memory::init_CAT_TABLE {} { 1. 1. 1. 1. 1. 1. } CAT_TABLE -set MESYTEC_TUBE_OFFSETS { - 0. 0. 0. 0. 0. 0. 0. 0. - 0. 0. 0. 0. 0. 0. 0. 0. - 0. 0. 0. 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. } CAT_TABLE -set MESYTEC_TUBE_HISTOGRAM_WEIGHTS { @@ -107,7 +107,7 @@ proc ::histogram_memory::isc_initialize {} { ::histogram_memory::set_graphtype "two_theta" "boundaries" # MJL TODO detector geometry for Lyrebird TBD. Figures need revision during commissioning - # Width = 25mm spacing * 30 tubes = 5000mm (??? degree coverage) + # Width = 25mm spacing * 30 tubes = 5000mm (??? degree coverage) # Height = 1015mm (tube length) # Radius = 2400mm detector_active_height_mm 1015 diff --git a/site_ansto/instrument/lyrebird/config/motors/motor_configuration.tcl b/site_ansto/instrument/lyrebird/config/motors/motor_configuration.tcl index 1818a4dd..b743490e 100644 --- a/site_ansto/instrument/lyrebird/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/lyrebird/config/motors/motor_configuration.tcl @@ -735,7 +735,7 @@ Motor pa_top $motor_driver_type [params \ pa_left part slits pa_left long_name pa_top pa_left softlowerlim -200 -pa_left softupperlim 0 +pa_left softupperlim 0 pa_left home 0 # mc6: Pre-sample bottom aperture -- Slit s2 bottom Blade @@ -757,7 +757,7 @@ Motor pa_bottom $motor_driver_type [params \ pa_bottom part slits pa_bottom long_name pa_bottom pa_bottom softlowerlim -200 -pa_bottom softupperlim 0 +pa_bottom softupperlim 0 pa_bottom home 0 proc motor_set_sobj_attributes {} { diff --git a/site_ansto/instrument/lyrebird/config/motors/positmotor_configuration.tcl b/site_ansto/instrument/lyrebird/config/motors/positmotor_configuration.tcl index 3c017394..0cdd1373 100644 --- a/site_ansto/instrument/lyrebird/config/motors/positmotor_configuration.tcl +++ b/site_ansto/instrument/lyrebird/config/motors/positmotor_configuration.tcl @@ -27,10 +27,10 @@ set 20sample_table { 6 203.7 7 161.7 8 119.7 - 9 77.7 - 10 35.7 - 11 -46.3 - 12 -88.3 + 9 77.7 + 10 35.7 + 11 -46.3 + 12 -88.3 13 -130.3 14 -172.3 15 -214.3 diff --git a/site_ansto/instrument/lyrebird/config/motors/sct_flightTube.tcl b/site_ansto/instrument/lyrebird/config/motors/sct_flightTube.tcl index 013fbf7a..9568733a 100644 --- a/site_ansto/instrument/lyrebird/config/motors/sct_flightTube.tcl +++ b/site_ansto/instrument/lyrebird/config/motors/sct_flightTube.tcl @@ -30,7 +30,7 @@ namespace eval ::scobj::galil { ## # @brief Read Angle value from Gumtree client and then send the command to the Motor - # @return The next state + # @return The next state proc ::scobj::galil::getValue {nextState} { set tmpAngle [sct target] set comm "ANGLE=$tmpAngle" @@ -40,7 +40,7 @@ namespace eval ::scobj::galil { ## # @brief Get ACK from the Motor after sending an ANGLE command to the Motor - # @return IDLE + # @return IDLE proc ::scobj::galil::rdStatusFunc {} { set ack [sct result] if {$ack == -1} { @@ -49,7 +49,7 @@ namespace eval ::scobj::galil { broadcast "Error $ack: Angle is not set correctly, check the error code $ack!" } return idle -} +} proc ::scobj::galil::mkGalil {argList} { @@ -59,7 +59,7 @@ proc ::scobj::galil::mkGalil {argList} { } set NS ::scobj::$pa(NAME) - set internal $pa(INTERVAL) + set internal $pa(INTERVAL) set batObjName $pa(NAME) set batpath /sics/$batObjName @@ -74,9 +74,9 @@ proc ::scobj::galil::mkGalil {argList} { #sicslist setatt $pa(NAME) klass instrument #sicslist setatt $pa(NAME) long_name $pa(NAME) hsetprop $batpath klass NXaperture - + hfactory /sics/$pa(NAME)/Angle plain user float - hfactory /sics/$pa(NAME)/setAngle plain user float + hfactory /sics/$pa(NAME)/setAngle plain user float makesctcontroller sct_ft galil $pa(IP):$pa(PORT) #makesctcontroller sct_ft std $pa(IP):$pa(PORT) @@ -84,14 +84,14 @@ proc ::scobj::galil::mkGalil {argList} { # Get the TPF value from the Motor, then convert to current ANGLE position hsetprop $batpath read ${NS}::getTPF hsetprop $batpath ackCmd ${NS}::ackCmd $batpath - + # Read the ANGLE value from the Gumtree client, then send roate command to Motor and get ACK from Motor. hsetprop $batpath write ${NS}::getValue rdStatus hsetprop $batpath rdStatus ${NS}::rdStatusFunc ::scobj::hinitprops $batObjName setAngle Angle - sct_ft poll $batpath $internal + sct_ft poll $batpath $internal sct_ft write $batpath } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/andorhm.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/andorhm.tcl index 17b4e743..6cde25c9 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/andorhm.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/andorhm.tcl @@ -1,6 +1,6 @@ #-------------------------------------------------------------- # This is the initialisation code for the ANDOR iKon-M -# camera and the CDDWWW WWW-server. It got separated into +# camera and the CDDWWW WWW-server. It got separated into # a separate file in order to support moving that camera around. # # Mark Koennecke, November 2010 @@ -61,7 +61,7 @@ proc tempreply {} { return idle } #------------------------------------------------------------- -proc MakeAndorHM {name host } { +proc MakeAndorHM {name host } { ccdwww::MakeCCDWWW $name $host "ccdwww::initscript $name" hfactory /sics/$name/daqmode plain mugger text hset /sics/$name/daqmode single diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/astrium.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/astrium.tcl index b6230a59..05a36e79 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/astrium.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/astrium.tcl @@ -1,7 +1,7 @@ #-------------------------------------------------------------- # This is a new style driver for the Astrium chopper systems in # the new sicsobj/scriptcontext based system. Please note that -# actual implementations may differ in the number of choppers +# actual implementations may differ in the number of choppers # and the address of the chopper on the network. # # copyright: see file COPYRIGHT @@ -10,23 +10,23 @@ # - reading parameters: # astchopread - readastriumchopperpar - readastriumchopperpar - ... # - writing -# astchopwrite - astchopwritereply +# astchopwrite - astchopwritereply # # Another remark: -# In order for chosta to work properly, the chopperparlist and +# In order for chosta to work properly, the chopperparlist and # chopperlonglist must be aligned. # # Mark Koennecke, February 2009 # -# If something goes wrong with this, the following things ought +# If something goes wrong with this, the following things ought # to be checked: # - Is the standard Tcl scan command been properly renamed to stscan? # - Is a communication possible with the chopper via telnet? -# This may not be the case because of other SICS servers blocking +# This may not be the case because of other SICS servers blocking # things or the old driver being active and capturing the terminal # server port in SerPortServer. Scriptcontext then fails silently. -# But may be we will fix the latter. -# - The other thing which happens is that the parameter list of +# But may be we will fix the latter. +# - The other thing which happens is that the parameter list of # the chopper differs in little ways between instances. # # Mark Koennecke, April 2009 @@ -43,7 +43,7 @@ proc astriumchopperputerror {txt} { } } #-------------------------------------------------------------- -# Paramamters look like: name value, entries for parameters are +# Paramamters look like: name value, entries for parameters are # separated by ; #--------------------------------------------------------------- proc astriumsplitreply {chopper reply} { @@ -62,20 +62,20 @@ proc astriumsplitreply {chopper reply} { if {$val > 360} { set val [expr $val -360.] } - hupdate /sics/choco/${chopper}/dphas $val + hupdate /sics/choco/${chopper}/dphas $val hdelprop /sics/choco/${chopper}/dphas geterror } if {[string first averl $par] >= 0} { set val [string range $par 5 end] - hupdate /sics/choco/${chopper}/averl $val + hupdate /sics/choco/${chopper}/averl $val hdelprop /sics/choco/${chopper}/averl geterror } } } } #------------------------------------------------------------- -# update those parameters which are dependent on the chopper -# status just read. Some of them may or may not be there, this +# update those parameters which are dependent on the chopper +# status just read. Some of them may or may not be there, this # is why this is protected by catch'es. #------------------------------------------------------------- proc astcopydependentpar {} { @@ -91,7 +91,7 @@ proc astcopydependentpar {} { } #-------------------------------------------------------------- proc readastriumchopperpar {} { - global choppers + global choppers set reply [sct result] if {[string first ERR $reply] >= 0} { astriumchopperputerror $reply @@ -106,7 +106,7 @@ proc readastriumchopperpar {} { sct send @@NOSEND@@ sct replycount 0 hupdate /sics/choco/asyst "" - hdelprop /sics/choco/asyst geterror + hdelprop /sics/choco/asyst geterror return astchoppar } else { set oldval [hval /sics/choco/asyst] @@ -157,7 +157,7 @@ proc astchopwrite {prefix} { return astchopwritereply } #---------------------------------------------------------------- -# Make sure to send a status request immediatly after a reply in +# Make sure to send a status request immediatly after a reply in # order to avoid timing problems #---------------------------------------------------------------- proc astchopwritereply {} { @@ -393,7 +393,7 @@ proc astMakeChopperRatio {var} { chocosct write $path hsetprop $path checklimits astchopratiolimit hsetprop $path halt astchopstop - hsetprop $path checkstatus astchopcheckratio + hsetprop $path checkstatus astchopcheckratio makesctdriveobj $var $path DriveAdapter chocosct } #------------------------------------------------------------------------ @@ -466,7 +466,7 @@ if {$poldi == 1} { return idle } } - return [astchopwrite "nspee 1 "] + return [astchopwrite "nspee 1 "] } #----------- set choppers [list chopper] @@ -520,5 +520,5 @@ if {$focus == 1} { astMakeChopperSpeed2 diskspeed astMakeChopperRatio ratio astMakeChopperPhase2 phase - Publish chosta Spy + Publish chosta Spy } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/backup.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/backup.tcl index 483df21a..6e9260d2 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/backup.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/backup.tcl @@ -10,7 +10,7 @@ proc backupCron {path {minutes 10} {days 1}} { set minutes [expr $minutes * 60] set days [expr $days * 24*3600] if {! [info exists next_backup]} { - set next_backup(min) [nextBackupTime $now $minutes last] + set next_backup(min) [nextBackupTime $now $minutes last] set next_backup(day) [nextBackupTime $now $days last] set file [clock format $now -format "$path/backupd-%m-%d.tcl"] if {![file exists $file]} { @@ -18,7 +18,7 @@ proc backupCron {path {minutes 10} {days 1}} { } } if {$now > $next_backup(min)} { - set next_backup(min) [nextBackupTime $now $minutes last] + set next_backup(min) [nextBackupTime $now $minutes last] set file [clock format $last -format "$path/backup-%Hh%M.tcl"] } else { return 1 diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/batch.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/batch.tcl index 795a77f6..64f6c65f 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/batch.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/batch.tcl @@ -6,7 +6,7 @@ if { [info exists batchinit] == 0 } { set batchinit 1 Publish batchroot Spy - Publish batchrun User + Publish batchrun User } proc SplitReply { text } { diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/ccdwww.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/ccdwww.tcl index b882c42d..a0797584 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/ccdwww.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/ccdwww.tcl @@ -1,20 +1,20 @@ #------------------------------------------------------ # This is SICS HM driver code for the CCDWWW CCD camera -# WWW server as used at SINQ. It uses, of course, the +# WWW server as used at SINQ. It uses, of course, the # scriptcontext asynchronous I/O system # # Mark Koennecke, September 2010 #------------------------------------------------------- - + namespace eval ccdwww {} #------------------------------------------------------- -# This is a default init script. The user has to initialise +# This is a default init script. The user has to initialise # a list of nodes to send to the CCD in XML format as # variable ccdwww::initnodes #-------------------------------------------------------- proc ccdwww::initscript {name} { global ccdwww::initnodes - + append confdata "\n" foreach var $ccdwww::initnodes { set val [hval /sics/${name}/${var}] @@ -68,8 +68,8 @@ proc ccdwww::httpstartreply {} { return idle } #--------------------------------------------------------- -# A CCD works like a camera. When exposing, it cannot be stopped, -# paused or anything. This is why the appropriate methods +# A CCD works like a camera. When exposing, it cannot be stopped, +# paused or anything. This is why the appropriate methods # here have no implementation #---------------------------------------------------------- proc ccdwww::httpcontrol {} { @@ -111,7 +111,7 @@ proc ccdwww::httpdatareply {} { set status [catch {httpreply} txt] if {$status == 0} { set path [file dirname [sct]] - hdelprop $path/data geterror + hdelprop $path/data geterror } return idle } @@ -135,13 +135,13 @@ proc ccdwww::httpevalstatus {name} { clientput $data sct update error return idle - } + } hdelprop [sct] geterror if {$data == 0} { httpdata $name return httpstatusdata } else { - sct update run + sct update run [sct controller] queue [sct] progress read return idle } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/deltatau.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/deltatau.tcl index 10bba7d7..05577800 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/deltatau.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/deltatau.tcl @@ -1,5 +1,5 @@ #--------------------------------------------------------------- -# These are the scripts for the delta-tau PMAC motor +# These are the scripts for the delta-tau PMAC motor # controller. # # !!!!!!!!! Script Chains !!!!!!!!!!! @@ -12,11 +12,11 @@ # -- For reading the status # pmacsendaxer --- pmacrcvaxerr -- pmacrcvpos -- pmacrcvstat # This means we check for an axis error first, then update the position, -# then check the axis status itself. +# then check the axis status itself. # -- For setting the position # pmacsendhardpos -- pmacrcvhardpos -- pmacrcvhardax -# This means, we send the positioning command, read the reply and read the -# axisstatus until the axis has started +# This means, we send the positioning command, read the reply and read the +# axisstatus until the axis has started # # copyright: see file COPYRIGHT # @@ -66,7 +66,7 @@ proc translateAxisError {key} { } #--------------------------------------------------------------------- proc evaluateAxisStatus {key} { -#----- Tcl does not like negative numbers as keys. +#----- Tcl does not like negative numbers as keys. if {$key < 0} { set key [expr 50 + abs($key)] } @@ -181,7 +181,7 @@ proc pmacrcvaxerr {motname num} { sct update error sct geterror $data return idle - } + } hupdate /sics/$motname/axiserror $data if {$data != 0 } { set err [translateAxisError $data] @@ -206,7 +206,7 @@ proc pmacrcvpos {motname num} { sct geterror $data sct update error return idle - } + } hupdate /sics/$motname/hardposition $data sct send "P${num}00" return rcvstat @@ -218,7 +218,7 @@ proc pmacrcvstat {motname num sct} { clientput "ERROR: $motname : $data" sct update error return idle - } + } set status [catch {evaluateAxisStatus $data} msg] if {$status != 0} { sct update error @@ -260,7 +260,7 @@ proc pmacrcvhardpos {num} { clientput "ERROR: $data" sct seterror $data return idle - } + } sct send "P${num}00" return rcvhardax } @@ -271,7 +271,7 @@ proc pmacrcvhardax {motname num sct} { clientput "ERROR: $motname : $data" sct seterror $data return idle - } + } set status [catch {evaluateAxisStatus $data} msg] if {$status != 0} { clientput "ERROR: $motname : $msg" @@ -284,7 +284,7 @@ proc pmacrcvhardax {motname num sct} { return rcvhardax } run { - $sct queue /sics/$motname/status progress read + $sct queue /sics/$motname/status progress read return idle } } @@ -353,5 +353,5 @@ proc MakeDeltaTau {name sct num} { # $sct send [format "M%2.2d14=1" $num] foreach par $parlist { $sct queue /sics/$name/$par progress read - } + } } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el734.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el734.tcl index ca717cba..90192838 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el734.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el734.tcl @@ -1,13 +1,13 @@ #-------------------------------------------------------- # This is a scriptcontext based driver for the EL734 -# motor controller. This is part of an ongoing effort to -# expire older drivers and to consolidate on the new +# motor controller. This is part of an ongoing effort to +# expire older drivers and to consolidate on the new # scriptcontext system. # # Scriptchains: -# Rather then having long script chains many of the -# intricacies of the EL734 are handled via a command -# processing state machine. See the docs below for +# Rather then having long script chains many of the +# intricacies of the EL734 are handled via a command +# processing state machine. See the docs below for # details # # copyright: see file COPYRIGHT @@ -19,24 +19,24 @@ namespace eval el734 {} #--------------------------------------------------------- # The EL734 is a a tricky thing. Some special conditions -# apply: -# - On emergency stop an *ES is sent. But only the second -# response of this kind is valid because there can be -# spurious *ES on the line even when the emergency stop +# apply: +# - On emergency stop an *ES is sent. But only the second +# response of this kind is valid because there can be +# spurious *ES on the line even when the emergency stop # has been released. -# - If someone fingers the EL734 or after startup it is in +# - If someone fingers the EL734 or after startup it is in # local mode. Then two commands have to be sent in order to -# make it go into remote mode before retrying the command. -# - In some echo modes of the controller it sends a echo +# make it go into remote mode before retrying the command. +# - In some echo modes of the controller it sends a echo # of the command. This has to be ignored in order to get at # the real problem # -# In order to deal with all this, el734::command is implemented -# as a state machine which calls another script when a valid +# In order to deal with all this, el734::command is implemented +# as a state machine which calls another script when a valid # reponse has actually been found. # The state of the current command processing # is saved in a node property comstate. The actual command to send -# is in the property comstring. The script to call if we actually +# is in the property comstring. The script to call if we actually # have a valid response is stored in the property comresponse #--------------------------------------------------------------- proc el734::setcommand {command responsescript {motno 0}} { @@ -45,10 +45,10 @@ proc el734::setcommand {command responsescript {motno 0}} { sct comstring $command sct commotno $motno return command -} +} #--------------------------------------------------------------- # As implemented now this can go in an endless loop if switching -# to local fails repeatedly. TODO: test if this happens with the +# to local fails repeatedly. TODO: test if this happens with the # real device #--------------------------------------------------------------- proc el734::command {} { @@ -132,7 +132,7 @@ proc el734::checkerror {} { } } return $reply -} +} #========================== Position =============================== proc el734::readpos {num} { set com [format "u %d" $num] @@ -214,7 +214,7 @@ proc el734::decodemsr {name msr} { set msrdata(0x40) "Bad step" set msrdata(0x100) posfault set msrdata(0x400) posfault - + set oredmsr [hval /sics/${name}/oredmsr] if {$msr == 0} { #-------- FINISHED @@ -223,7 +223,7 @@ proc el734::decodemsr {name msr} { if {$pos > 0 || $run > 0} { return posfault } - + set orlist [array names oredata] foreach code $orlist { if {$oredmsr & $code} { @@ -402,7 +402,7 @@ proc el734::refrun {controller name num} { wait 2 set ss [hval /sics/${name}/ss] if { [string first ?BSY $ss] < 0} { - break + break } set rupt [getint] if { [string compare $rupt continue] != 0} { @@ -426,7 +426,7 @@ proc el734::reset {name} { #========================= Make ================================== proc el734::make {name no controller} { MakeSecMotor $name - + hfactory /sics/${name}/oredmsr plain internal int hfactory /sics/${name}/runfault plain internal int hfactory /sics/${name}/posfault plain internal int @@ -442,7 +442,7 @@ proc el734::make {name no controller} { hsetprop /sics/${name}/hardlowerlim read el734::getlim $name $no hsetprop /sics/${name}/hardlowerlim command el734::command $controller poll /sics/${name}/hardlowerlim 120 - + hsetprop /sics/${name}/status read el734::readstatus $no $name hsetprop /sics/${name}/status command el734::command $controller poll /sics/${name}/status 40 @@ -472,7 +472,7 @@ proc el734::addrefstuff {name no controller} { hfactory /sics/${name}/refnull plain user int hsetprop /sics/${name}/refnull read el734::readref $no hsetprop /sics/${name}/refnull command el734::command - $controller poll /sics/${name}/refnull 300 + $controller poll /sics/${name}/refnull 300 hsetprop /sics/${name}/refnull write el734::setref $name $no hsetprop /sics/${name}/refnull command el734::command @@ -481,8 +481,8 @@ proc el734::addrefstuff {name no controller} { hfactory /sics/${name}/ss plain internal text hsetprop /sics/${name}/ss read el734::readss $no hsetprop /sics/${name}/ss ssread el734::ssread - $controller poll /sics/${name}/ss 300 + $controller poll /sics/${name}/ss 300 $name makescriptfunc refrun "el734::refrun $controller $name $no" user - + } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el737sec.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el737sec.tcl index be77890a..e3d93071 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el737sec.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el737sec.tcl @@ -1,5 +1,5 @@ #----------------------------------------------------- -# This is a second generation counter driver for +# This is a second generation counter driver for # the PSI EL737 counter boxes using scriptcontext # communication. # @@ -11,8 +11,8 @@ # status: el737readstatus - el737status # \ el737statval - el737statread # values: el737readvalues - el737val -# threshold write: el737threshsend - el737threshrcv - el737cmdreply -# +# threshold write: el737threshsend - el737threshrcv - el737cmdreply +# # Mark Koennecke, February 2009 #----------------------------------------------------- proc el737error {reply} { @@ -107,7 +107,7 @@ proc el737control {} { return idle } } - + } #---------------------------------------------------- proc el737readstatus {} { @@ -187,7 +187,7 @@ proc swapFirst {l} { } #--------------------------------------------------- # There are two types of reponses to the RA command: -# the old form with 5 values and the new one +# the old form with 5 values and the new one # with 9 values #--------------------------------------------------- proc el737val {} { @@ -315,7 +315,7 @@ proc MakeSecEL737 {name netaddr} { hfactory /sics/${name}/RS plain internal int hfactory /sics/${name}/RA plain internal intvarar 8 - + $conname debug -1 } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el755.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el755.tcl index 0eddccf5..d29ee85e 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el755.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/el755.tcl @@ -1,7 +1,7 @@ #------------------------------------------------------------- -# This is a scriptcontext driver for the PSI EL755 magnet +# This is a scriptcontext driver for the PSI EL755 magnet # controller. -# +# # scriptchains: # read - readreply # write - writereply - writereadback @@ -57,7 +57,7 @@ proc el755::writereply {num} { error $reply } sct send [format "I %d" $num] - return writereadback + return writereadback } #-------------------------------------------------------------------- proc el755::writereadback {num} { diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/fourcircle.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/fourcircle.tcl index 513eec3b..769ec71c 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/fourcircle.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/fourcircle.tcl @@ -1,7 +1,7 @@ #---------------------------------------------------------- -# This is a file full of support functions for four -# circle diffraction in the new four circle system. This -# is the common, shared stuff. There should be another +# This is a file full of support functions for four +# circle diffraction in the new four circle system. This +# is the common, shared stuff. There should be another # file which contains the instrument specific adaptions. # # Mark Koennecke, August 2008, November 2008, February 2009 @@ -10,7 +10,7 @@ if { [info exists __singlexinit] == 0 } { set __singlexinit 1 MakeSingleX Publish projectdir Spy - Publish cell Spy + Publish cell Spy Publish ub Spy Publish spgrp Spy Publish calcang Spy @@ -18,7 +18,7 @@ if { [info exists __singlexinit] == 0 } { Publish calctth Spy Publish refclear User Publish reflist Spy -# Publish refang User +# Publish refang User Publish refdel User Publish refhkl User Publish refang User @@ -38,7 +38,7 @@ if { [info exists __singlexinit] == 0 } { Publish tabload user Publish loadx User Publish testx User - Publish collconf User + Publish collconf User Publish hkllimit Spy Publish hklgen User Publish indw User @@ -79,14 +79,14 @@ if { [info exists __singlexinit] == 0 } { } #--------------------------------------------------------- # support function for handling ranges in measuring -# reflections. This is tricky: When calculating if a -# reflection is scannable one has to take the range of +# reflections. This is tricky: When calculating if a +# reflection is scannable one has to take the range of # the scan into account. SICS goes to great pain to calculate -# reflections in spite of restrictions. It tweaks ome, searches -# psi etc. In order to arrive at a scannable position for +# reflections in spite of restrictions. It tweaks ome, searches +# psi etc. In order to arrive at a scannable position for # calculations and initial driving, the ranges in om and stt # have to be corrected to include the scan range. These support -# functions take care of this. +# functions take care of this. #---------------------------------------------------------- set __fmessomup 0 set __fmessomlow 0 @@ -209,7 +209,7 @@ proc getsetangles {} { proc calchkl args { set mo [string trim [SplitReply [singlex mode]]] switch $mo { - bi { + bi { if {[llength $args] < 4} { set stt [singlex motval stt] set om [singlex motval om] @@ -333,7 +333,7 @@ proc refdel {id} { } #-------------------------------------------------------------- proc refhkl {id h k l } { - return [ref setx $id $h $k $l] + return [ref setx $id $h $k $l] } #------------------------------------------------------------- proc refang args { @@ -427,7 +427,7 @@ proc centerlist {preset {mode monitor} {skip 0} } { set h [lindex $val 2] set k [lindex $val 3] set l [lindex $val 4] - clientput "Processing reflection $refid = $h $k $l" + clientput "Processing reflection $refid = $h $k $l" set stt [lindex $val 5] if {$stt > .0} { set mo [string trim [SplitReply [singlex mode]]] @@ -519,7 +519,7 @@ proc tablist {} { } #--------------------------------------------------------------------------- proc tabclear {} { - return [fmess table clear] + return [fmess table clear] } #--------------------------------------------------------------------------- proc tabadd {sttend scanvar step np preset } { @@ -742,8 +742,8 @@ proc testx args { proc collconf args { set modelist [list monitor timer] if {[llength $args] < 4} { - append res [SplitReply [fmess mode]] - append res [SplitReply [fmess fast]] + append res [SplitReply [fmess mode]] + append res [SplitReply [fmess fast]] append res " " [SplitReply [fmess weak]] append res " " [SplitReply [fmess weakthreshold]] return $res @@ -808,7 +808,7 @@ proc scanref {ref} { xxxscan add $ommot $start $step if {[string first o2t $scanvar] >= 0} { set start [expr $stt - 2*$range] - xxxscan add $sttmot $start [expr $step * 2.] + xxxscan add $sttmot $start [expr $step * 2.] } set mode [string trim [SplitReply [fmess mode]]] xxxscan run $np $mode $preset @@ -859,7 +859,7 @@ proc hklgen { {sup no} } { } #---------------------------------------------------------------- proc indw {hw kw lw} { - return [fmess genw $hw $kw $lw] + return [fmess genw $hw $kw $lw] } #---------------------------------------------------------------- proc indsave {filename} { @@ -873,7 +873,7 @@ proc indsave {filename} { set idxlist [split [messref show $ref]] puts $out [format " %12.6f %12.6f %12.6f" [lindex $idxlist 2] \ [lindex $idxlist 3] [lindex $idxlist 4]] - + } close $out return "Done" @@ -890,8 +890,8 @@ proc indlist {} { proc indexconf args { if {[llength $args] < 2} { append res "simidxconf = " - append res [SplitReply [simidx sttlim]] ", " - append res [SplitReply [simidx anglim]] " " + append res [SplitReply [simidx sttlim]] ", " + append res [SplitReply [simidx anglim]] " " return $res } else { simidx sttlim [lindex $args 0] @@ -997,7 +997,7 @@ proc writerafinfile {filename cell} { puts $out "" puts $out "-1" close $out - catch {file attributes $filename -permissions 00664} + catch {file attributes $filename -permissions 00664} } #----------------------------------------------------------- proc writerafnbfile {filename cell} { @@ -1014,7 +1014,7 @@ proc writerafnbfile {filename cell} { puts $out "" puts $out "-1" close $out - catch {file attributes $filename -permissions 00664} + catch {file attributes $filename -permissions 00664} } #--------------------------------------------------------- proc checkResult {filename} { @@ -1093,7 +1093,7 @@ proc refshow {} { } if {[string first 0RESULTS $line] >= 0} { set dataappend 1 - } + } if {$dataappend == 1} { append res $line "\n" } @@ -1127,7 +1127,7 @@ proc loadub {} { gets $in line stscan $line "%f %f %f" u31 u32 u33 singlex ub $u11 $u12 $u13 $u21 $u22 $u23 $u31 $u32 $u33 - } + } if {[string first "0DIRECT CELL" $line] >= 0} { stscan $line "%s %s %f %f %f %f %f %f" junk junk2 a b c alpha beta gamma singlex cell $a $b $c $alpha $beta $gamma @@ -1201,7 +1201,7 @@ proc removeduplicatesold {peaklist} { foreach fp $final { if {abs($fp - $peak) < 2.} { set valid 0 - } + } } if {$valid == 1} { lappend final $peak @@ -1240,7 +1240,7 @@ proc removeduplicates {peaklist countlist} { return $final } #-------------------------------------------------------------------- -# Do not be confused by the use of phi. This is also used for finding +# Do not be confused by the use of phi. This is also used for finding # peaks in omega in NB #-------------------------------------------------------------------- proc findpeaksinscan {} { @@ -1321,7 +1321,7 @@ proc searchbi {preset mode maxpeak} { if {$status != 0} { clientput "WARNING: Cannot reach chi $chipos, skipping" continue - } + } clientput "Searching at chi: $chipos" success switch $detmode { @@ -1354,14 +1354,14 @@ proc searchbi {preset mode maxpeak} { if {[string first continue $interrupt] < 0} { error $msg } -#--------- Do I need to extract peaks from the area detector data or is this to be -# left to anatric? +#--------- Do I need to extract peaks from the area detector data or is this to be +# left to anatric? } default { error "Reflection search not supported for this detector mode" } } - } + } } } #----------------------------------------------------------------------- @@ -1447,7 +1447,7 @@ proc searchnb {preset mode maxpeak} { error "Reflection search not supported for this detector mode" } } - } + } } } #-------------------------------------------------------------------------------------- @@ -1598,7 +1598,7 @@ proc psiscan {h k l step stepom omnp preset {countmode NULL}} { break } } - } + } clientput "Scanning at $psi" set ompos [string trim [SplitReply [om]]] set status [catch {cscan om $ompos $stepom $omnp $preset} msg] @@ -1610,7 +1610,7 @@ proc psiscan {h k l step stepom omnp preset {countmode NULL}} { } else { clientput "ERROR: $msg while scanning" } - } + } set stt [SplitReply [stt]] set chi [SplitReply [chi]] set phi [SplitReply [phi]] @@ -1679,7 +1679,7 @@ proc savexxx {filename} { return "Done" } #====================================================================================== -# Stuff to support Hipadaba +# Stuff to support Hipadaba #====================================================================================== proc ubrefinehdb args { set path /instrument/reflection_list/ubrefresult diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/hdbutil.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/hdbutil.tcl index 580fedf6..f239237d 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/hdbutil.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/hdbutil.tcl @@ -1,6 +1,6 @@ #----------------------------------------------------------------------- -# This is a collection of utility procedures to help with Hipadaba and -# Gumtree Swiss Edition. This file is supposed to be sourced by any +# This is a collection of utility procedures to help with Hipadaba and +# Gumtree Swiss Edition. This file is supposed to be sourced by any # instrument using Hipadaba. # # Copyright: see file COPYRIGHT @@ -10,14 +10,14 @@ # Requirements: # * the internal scan command xxxscan # * scan data to live /graphics/scan_data -# +# # Many updates, till November 2008, Mark Koennecke #---------------------------------------------------------------------- if { [info exists hdbinit] == 0 } { set hdbinit 1 MakeStateMon Publish getgumtreexml Spy - if {[string first tmp $home] < 0} { + if {[string first tmp $home] < 0} { set tmppath $home/tmp } else { set tmppath $home @@ -30,7 +30,7 @@ if { [info exists hdbinit] == 0 } { Publish hdbcollect User Publish listbatchfiles Spy Publish makemumopos User - Publish dropmumo User + Publish dropmumo User Publish hdbbatchpath User Publish cscan User Publish sscan User @@ -39,7 +39,7 @@ if { [info exists hdbinit] == 0 } { Publish hmakescript Mugger Publish hlink Mugger Publish hcommand Mugger - Publish hdbstorenexus User + Publish hdbstorenexus User Publish scaninfo Spy } #=================================================================== @@ -52,7 +52,7 @@ if { [info exists hdbinit] == 0 } { # makeQuickPar name path # makeslit path left right upper lower # configures a slit. Missing motors can be indicated with NONE -# makestdadmin +# makestdadmin # makecount path # makerepeat path # makekillfile path @@ -60,8 +60,8 @@ if { [info exists hdbinit] == 0 } { # makestdgui # makewait path # makeevproxy rootpath hdbname devicename -# makemumo rootpath mumoname -# makeexe +# makemumo rootpath mumoname +# makeexe # confnxhdb path alias pass # makestddrive path #===================== hfactory adapters ========================== @@ -71,7 +71,7 @@ proc hmake {path priv type {len 1}} { #-------------------------------------------------------------------- proc hmakescript {path readscript writescript type {len 1}} { hfactory $path script $readscript $writescript $type $len -} +} #------------------------------------------------------------------- proc hlink {path obj {treename NONE} } { if {[string equal $treename NONE]} { @@ -133,7 +133,7 @@ proc property_elements_old {path indent} { # foreach v [split $value ,] { # lappend proplist "$prefix$prefix$v\n" # } - lappend proplist "$prefix$prefix$value\n" + lappend proplist "$prefix$prefix$value\n" lappend proplist "$prefix\n" } if [info exists proplist] {return $proplist} @@ -151,7 +151,7 @@ proc property_elements {path indent} { continue } lappend proplist "$prefix\n" - lappend proplist "$prefix$prefix$value\n" + lappend proplist "$prefix$prefix$value\n" lappend proplist "$prefix\n" } if [info exists proplist] {return $proplist} @@ -193,7 +193,7 @@ proc searchPathForDrivable {name} { } } return NONE -} +} #---------------------------------------------------------------- proc searchForCommand {name} { return [string trim [hmatchprop / sicscommand $name]] @@ -305,7 +305,7 @@ proc mgbatch {filename} { gets $f line close $f if {[string first MOUNTAINBATCH $line] > 0} { -#--------- This is a mountaingum batch file which does not need +#--------- This is a mountaingum batch file which does not need # to be massaged return $filename } @@ -313,7 +313,7 @@ proc mgbatch {filename} { set realfilename [file tail $filename] set out [open $tmppath/$realfilename w] puts $out \#MOUNTAINBATCH - while {[gets $f line] >= 0} { + while {[gets $f line] >= 0} { append buffer $line if {[info complete $buffer] == 1} { translateCommand $buffer $out @@ -377,7 +377,7 @@ proc hdbcollect {obj userobj np} { #----------------------------------------------------------------------------- proc gethdbscanvardata {no} { set np [string trim [SplitReply [xxxscan np]]] - if {$np == 0} { + if {$np == 0} { return ".0 .0 .0" } set status [catch {SplitReply [xxxscan getvardata $no]} txt] @@ -390,7 +390,7 @@ proc gethdbscanvardata {no} { #---------------------------------------------------------------------------- proc gethdbscancounts {} { set np [string trim [SplitReply [xxxscan np]]] - if {$np == 0} { + if {$np == 0} { return "0 0 0" } set status [catch {SplitReply [xxxscan getcounts]} txt] @@ -398,7 +398,7 @@ proc gethdbscancounts {} { return [join $txt] } else { return "0 0 0" - } + } } #================= helper to get the list of batch files ================= proc listbatchfiles {} { @@ -460,7 +460,7 @@ proc hsearchprop {root prop val} { #============ various utility routines ===================================== proc hdbReadOnly args { error "Parameter is READ ONLY" -} +} #--------------------------------------------------------------------------- proc makesampleenv {path} { hfactory $path plain spy none @@ -512,7 +512,7 @@ proc makestdscangraphics {path} { hsetprop $path/scan_variable dim 0 hsetprop $path/scan_variable transfer zip hsetprop $path/scan_variable priv internal - hfactory $path/scan_variable/name plain user text + hfactory $path/scan_variable/name plain user text hfactory $path/counts script "gethdbscancounts" hdbReadOnly intvarar 1 hsetprop $path/counts type data hsetprop $path/counts transfer zip @@ -626,7 +626,7 @@ proc makeevproxy {rootpath hdbname devicename} { hlink $rootpath p${devicename} $hdbname hsetprop $rootpath/$hdbname sicsdev $devicename hsetprop $rootpath/$hdbname type drivable - sicspoll add $rootpath/$hdbname hdb 30 + sicspoll add $rootpath/$hdbname hdb 30 } #================== multi motor stuff ======================= proc getNamposList {mumo} { @@ -660,7 +660,7 @@ proc updateNamePosValues {rootpath} { proc makemumopos {mumo rootpath name} { $mumo pos $name updateNamePosValues $rootpath -} +} #----------------------------------------------------------- proc dropmumo {mumo rootpath name} { $mumo drop $name @@ -676,11 +676,11 @@ proc getDropList {mumo} { proc makemumo {rootpath mumoname} { hfactory $rootpath/namedposition script "getNamPos $mumoname" \ $mumoname text - hsetprop $rootpath/namedposition priv user + hsetprop $rootpath/namedposition priv user hfactory $rootpath/namedposition/values script \ "getNamposList $mumoname" hdbReadOnly text hsetprop $rootpath/namedposition/values visible false - hupdate $rootpath/namedposition/values + hupdate $rootpath/namedposition/values hfactory $rootpath/assignname2current command \ "makemumopos $mumoname $rootpath" hsetprop $rootpath/assignname2current priv user @@ -688,14 +688,14 @@ proc makemumo {rootpath mumoname} { hfactory $rootpath/assignname2current/name plain user text hset $rootpath/assignname2current/name "Undefined" hfactory $rootpath/dropnamedposition command \ - "dropmumo $mumoname $rootpath" + "dropmumo $mumoname $rootpath" hsetprop $rootpath/dropnamedposition priv user hsetprop $rootpath/dropnamedposition type command hfactory $rootpath/dropnamedposition/name plain user text hfactory $rootpath/dropnamedposition/name/values script \ "getDropList $mumoname" hdbReadOnly text hsetprop $rootpath/dropnamedposition/name/values visible false - hupdate $rootpath/dropnamedposition/name/values + hupdate $rootpath/dropnamedposition/name/values } #----------------------------------------------------------------- proc hdbbatchpath {pathstring} { @@ -713,7 +713,7 @@ proc makeexe {} { hfactory $path/batchpath script "exe batchpath" hdbbatchpath text hsetprop $path/batchpath priv user hfactory $path/execute command exe - hsetprop $path/execute type command + hsetprop $path/execute type command hsetprop $path/execute priv user hfactory $path/execute/file plain user text hfactory $path/execute/file/values script listbatchfiles hdbReadOnly text @@ -753,13 +753,13 @@ proc hdbstorenexus args { } } #===================== Syntactical sugar around hdbscan =================== -# center scan. A convenience scan for the one and only Daniel Clemens -# at TOPSI. Scans around a given center point. Requires the scan command +# center scan. A convenience scan for the one and only Daniel Clemens +# at TOPSI. Scans around a given center point. Requires the scan command # for TOPSI to work. # # another convenience scan: -# sscan var1 start end var1 start end .... np preset -# scans var1, var2 from start to end with np steps and a preset of preset +# sscan var1 start end var1 start end .... np preset +# scans var1, var2 from start to end with np steps and a preset of preset # # Mark Koennecke, August 1997 # @@ -771,7 +771,7 @@ proc cscan { var center delta np preset } { if { [string compare $t DRIV] != 0 } { ClientPut [format "ERROR: %s is NOT drivable!" $var] return - } + } set t [SICSType $center] if { [string compare $t NUM] != 0 } { ClientPut [format "ERROR: %s is no number!" $center] @@ -807,7 +807,7 @@ proc cscan { var center delta np preset } { } } #--------------------------------------------------------------------------- -proc sscan args { +proc sscan args { scan clear #------- check arguments: the last two must be preset and np! set l [llength $args] @@ -940,5 +940,5 @@ proc makestddrive {path} { hsetprop $path priv user hfactory $path/motor plain user text hsetprop $path/motor argtype drivable - hfactory $path/value plain user float + hfactory $path/value plain user float } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/motorhp.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/motorhp.tcl index e2027e69..d24f0039 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/motorhp.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/motorhp.tcl @@ -57,7 +57,7 @@ proc motorload {filename} { #------------------------------------------------------------------------ proc loadmotordir {dirname} { set l [glob $dirname/*.par] - foreach e $l { + foreach e $l { set ret [catch {motorload $e} msg] if { $ret != 0} { clientput "ERROR: failed to load $e with $msg" diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl index 04e6f0d9..1e61618b 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl @@ -10,7 +10,7 @@ proc makeFileName args { set p [string trim [SplitReply [sicsdatapath]]] set pre [string trim [SplitReply [sicsdataprefix]]] set po [string trim [SplitReply [sicsdatapostfix]]] - return [format "%s%s%5.5d2003%s" $p $pre $num $po] + return [format "%s%s%5.5d2003%s" $p $pre $num $po] } #========================================================================== # new version, attending to the new 1000 grouping logic @@ -98,17 +98,17 @@ proc writeStandardAttributes {fileName} { proc appendMotor {np motor alias} { set val [SplitReply [$motor]] __transfer putfloat 0 $val - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } #--------------------------------------------------------------------- proc appendFloat {np alias val} { __transfer putfloat 0 $val - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } #--------------------------------------------------------------------- proc appendCount {np value alias} { __transfer putint 0 $value - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } #-------------------------------------------------------------------- proc appendSampleEnv {np device alias} { diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/phytron.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/phytron.tcl index f37bc9d2..b326479b 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/phytron.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/phytron.tcl @@ -1,24 +1,24 @@ #------------------------------------------------------------------ -# This is driver for the combination Phytron MCC-2 Motor Controller -# and SICS using the scriptcontext asynchronous I/O system. The -# MCC-2 has a funny protocl as that messages are enclosed into -# data sequences. This protocol is handled by the -# C-language phytron protocol handler. Per default, the MCC-2 is +# This is driver for the combination Phytron MCC-2 Motor Controller +# and SICS using the scriptcontext asynchronous I/O system. The +# MCC-2 has a funny protocl as that messages are enclosed into +# data sequences. This protocol is handled by the +# C-language phytron protocol handler. Per default, the MCC-2 is # configured to use 57600 baud. I have configured it to use 9600 -# baud and it ought to remember this. The command to change this -# 0IC1S9600, the command to read this is 0IC1R. +# baud and it ought to remember this. The command to change this +# 0IC1S9600, the command to read this is 0IC1R. # -# So, if this thing does not work on a serial port then the solution is +# So, if this thing does not work on a serial port then the solution is # to set the terminal server to 57600 and try again. And set the baud rate # or leave it. # -# There are surely many ways to use the MCC-2. It supports two axes, X and Y. +# There are surely many ways to use the MCC-2. It supports two axes, X and Y. # All examples below are given for X only. This driver uses it in -# this way: -# -# Nothing works properly without a reference run. The reference run is done +# this way: +# +# Nothing works properly without a reference run. The reference run is done # in the following way: -# 1) Send it into the negative limit switch with 0X0- +# 1) Send it into the negative limit switch with 0X0- # 2) Set the mechanical position with 0XP20Swert to the negative limit # 3) Set the encoder position with 0XP22Swert to the negative limit # @@ -46,7 +46,7 @@ # # - setting speed: # writespeed - rcvwspeed - rcvspeed -# +# # Mark Koennecke, June 2009 # # Added code to switch a brake on for schneider_m2 @@ -54,10 +54,10 @@ # Mark Koennecke, September 2009 # # Added code to support the speed parameter -# +# # Mark Koennecke, December 2009 # -# Added more code to configure non encoder phytron motors which need to +# Added more code to configure non encoder phytron motors which need to # read another parameter for position # # Mark Koennecke, January 2011 @@ -234,21 +234,21 @@ proc phytron::make {name axis controller lowlim upperlim {enc 1}} { $name softlowerlim $lowlim $name hardupperlim $upperlim $name softupperlim $upperlim - + hsetprop /sics/${name}/hardposition read phytron::readpos $axis $enc - hsetprop /sics/${name}/hardposition posrcv phytron::posrcv + hsetprop /sics/${name}/hardposition posrcv phytron::posrcv $controller poll /sics/${name}/hardposition 60 hsetprop /sics/${name}/hardposition write phytron::setpos $axis $name hsetprop /sics/${name}/hardposition setrcv phytron::setrcv $controller $name $controller write /sics/${name}/hardposition - + hsetprop /sics/${name}/status read phytron::sendstatus $axis hsetprop /sics/${name}/status rcvstatus phytron::rcvstatus $axis $controller $enc hsetprop /sics/${name}/status posrcv phytron::statpos $axis $name - hsetprop /sics/${name}/status statposlim phytron::statposlim $axis - hsetprop /sics/${name}/status statneglim phytron::statneglim $axis - hsetprop /sics/${name}/status statend phytron::statend $axis + hsetprop /sics/${name}/status statposlim phytron::statposlim $axis + hsetprop /sics/${name}/status statneglim phytron::statneglim $axis + hsetprop /sics/${name}/status statend phytron::statend $axis $controller poll /sics/${name}/status 60 hfactory /sics/${name}/speed plain user float @@ -269,9 +269,9 @@ proc phytron::make {name axis controller lowlim upperlim {enc 1}} { hupdate /sics/${name}/status idle $controller queue /sics/${name}/hardposition progress read $controller queue /sics/${name}/speed progress read -} +} #=============================================================================================== -# At MORPHEUS there is a special table where one motor needs a brake. This requires a digital I/O +# At MORPHEUS there is a special table where one motor needs a brake. This requires a digital I/O # to be disabled before driving and enabled after driving. The code below adds this feature to # a phytron motor #----------------------------------------------------------------------------------------------- @@ -306,6 +306,6 @@ proc phytron::configureM2 {motor axis out} { hsetprop $path/hardposition write phytron::openset $out hsetprop $path/hardposition openans phytron::openans $axis $motor - hsetprop $path/status statend phytron::outsend $axis $out + hsetprop $path/status statend phytron::outsend $axis $out hsetprop $path/status outend phytron::outend } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/pimotor.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/pimotor.tcl index 37bfee85..702f4da7 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/pimotor.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/pimotor.tcl @@ -1,6 +1,6 @@ #---------------------------------------------------- -# This is a scriptcontext motor driver for the -# prehistoric Physik Instrumente DC-406, C-804 DC +# This is a scriptcontext motor driver for the +# prehistoric Physik Instrumente DC-406, C-804 DC # motor controller. # # copyright: see file COPYRIGHT @@ -13,9 +13,9 @@ # - writespeed - speedreply # - writenull - speedreply # -# Mark Koennecke, November 2009, after the +# Mark Koennecke, November 2009, after the # C original from 1998 -# Made to work, Mark Koennecke, January 2011 +# Made to work, Mark Koennecke, January 2011 #----------------------------------------------------- namespace eval pimotor {} @@ -82,7 +82,7 @@ proc pimotor::statusreply {num} { clientput "Value = $val, length = $len" if {abs($val) > 0} { sct update run - [sct controller] queue [sct] progress read + [sct controller] queue [sct] progress read return idle } } @@ -145,20 +145,20 @@ proc pimotor::makepimotor {name num sct lowlim upperlim} { $name softlowerlim $lowlim $name hardupperlim $upperlim $name softupperlim $upperlim - + hsetprop /sics/${name}/hardposition read pimotor::read $num - hsetprop /sics/${name}/hardposition readreply pimotor::readreply + hsetprop /sics/${name}/hardposition readreply pimotor::readreply $sct poll /sics/${name}/hardposition 60 - + hsetprop /sics/${name}/hardposition write pimotor::write $num $name hsetprop /sics/${name}/hardposition writereply pimotor::writereply $name $sct write /sics/${name}/hardposition - + hsetprop /sics/${name}/status read pimotor::sendstatus $num hsetprop /sics/${name}/status statusreply pimotor::statusreply $num hsetprop /sics/${name}/status statuspos pimotor::statuspos $name $sct poll /sics/${name}/status 60 - + hfactory /sics/${name}/speed plain user int hsetprop /sics/${name}/speed read pimotor::readspeed $num hsetprop /sics/${name}/speed readreply pimotor::readreply @@ -167,11 +167,11 @@ proc pimotor::makepimotor {name num sct lowlim upperlim} { hsetprop /sics/${name}/speed write pimotor::writespeed $num hsetprop /sics/${name}/speed speedreply pimotor::speedreply $num $sct write /sics/${name}/speed - + $name makescriptfunc halt "pimotor::halt $sct $num" user $name makescriptfunc on "pimotor::writeon $sct $num" user $name makescriptfunc home "pimotor::writenull $sct $num" user - + hupdate /sics/${name}/status idle - $sct queue /sics/${name}/hardposition progress read + $sct queue /sics/${name}/hardposition progress read } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/secsim.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/secsim.tcl index e418a23a..b7a5a592 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/secsim.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/secsim.tcl @@ -1,5 +1,5 @@ #--------------------------------------------------------------- -# This is a second generation simulation motor. +# This is a second generation simulation motor. # # copyright: see file COPYRIGHT # @@ -39,7 +39,7 @@ proc simstatusget {motname} { } #------------------------------------------------------------- proc simstatusfault {motname } { - clientput "ERROR: I am feeling faulty!" + clientput "ERROR: I am feeling faulty!" return error } #-------------------------------------------------------------- @@ -53,11 +53,11 @@ proc MakeSecSim {name lower upper delay} { hfactory /sics/$name/starttime plain user int hset /sics/$name/delay $delay hdel /sics/$name/hardposition - hfactory /sics/$name/hardposition script "simhardget $name" "simhardset $name" float -# hfactory /sics/$name/hardposition script "simhardfaultget $name" "simhardset $name" float + hfactory /sics/$name/hardposition script "simhardget $name" "simhardset $name" float +# hfactory /sics/$name/hardposition script "simhardfaultget $name" "simhardset $name" float hdel /sics/$name/status - hfactory /sics/$name/status script "simstatusget $name" "hdbReadOnly b" text -# hfactory /sics/$name/status script "simstatusfault $name" "hdbReadOnly b" text + hfactory /sics/$name/status script "simstatusget $name" "hdbReadOnly b" text +# hfactory /sics/$name/status script "simstatusfault $name" "hdbReadOnly b" text $name makescriptfunc halt "simhalt $name" user hupdate /sics/$name/hardupperlim $upper hupdate /sics/$name/softupperlim $upper diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/simhm.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/simhm.tcl index 8785d093..1990eaae 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/simhm.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/simhm.tcl @@ -1,13 +1,13 @@ #----------------------------------------------------- -# This is a simulation driver for the second -# generation histogram memory. It provides +# This is a simulation driver for the second +# generation histogram memory. It provides # for a fill value which is used to initialize -# data. +# data. # # copyright: see file COPYRIGHT # # Mark Koennecke, January 2010 -#----------------------------------------------------- +#----------------------------------------------------- namespace eval simhm {} #----------------------------------------------------- proc simhm::getcontrol {name} { @@ -74,7 +74,7 @@ proc simhm::MakeSimHM {name rank {tof NULL} } { hfactory /sics/${name}/control script \ "simhm::getcontrol $name" "simhm::setcontrol $name" float hsetprop /sics/${name}/control priv user - + hdel /sics/${name}/status hfactory /sics/${name}/status script \ "simhm::getstatus $name" hdbReadOnly text diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/sinqhttp.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/sinqhttp.tcl index 1eff587c..8e42d3b7 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/sinqhttp.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/sinqhttp.tcl @@ -1,6 +1,6 @@ #-------------------------------------------------------- -# This is an asynchronous scriptcontext driven driver for -# the SINQ style http based histogram memory. +# This is an asynchronous scriptcontext driven driver for +# the SINQ style http based histogram memory. # # script chains: # -- control @@ -17,7 +17,7 @@ # You will need to override hmhttpevalstatus to implement # an update of the detector data # -# Mark Koennecke, April 2010 +# Mark Koennecke, April 2010 #--------------------------------------------------------- proc hmhttpsend {url} { sct send $url @@ -83,7 +83,7 @@ proc hmhttpdatareply {} { set status [catch {hmhttpreply} txt] if {$status == 0} { set path [file dirname [sct]] - hdelprop $path/data geterror + hdelprop $path/data geterror } return idle } @@ -107,13 +107,13 @@ proc hmhttpevalstatus {name} { clientput $data sct update error return idle - } + } hdelprop [sct] geterror set lines [split $data \n] foreach line $lines { set ld [split $line :] sct [string trim [lindex $ld 0]] [string trim [lindex $ld 1]] - } + } set daq [sct DAQ] set old [hval [sct]] if {$daq == 1} { diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/stddrive.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/stddrive.tcl index 2df85a96..97541a40 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/stddrive.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/stddrive.tcl @@ -1,13 +1,13 @@ #------------------------------------------------------ # This is some code for a standard drivable object in # the scriptcontext system. It implements an empty -# object which throws errors when accessed. Users -# of such an object can override it to do -# something more acceptable. This object also -# provides for basic limit checking and status +# object which throws errors when accessed. Users +# of such an object can override it to do +# something more acceptable. This object also +# provides for basic limit checking and status # checking. It can serve as a basis for creating # new drivable objects, for instance environment -# control devices. A possible user has as the +# control devices. A possible user has as the # first thing in a write script to set the target # node to the desired value. # @@ -61,7 +61,7 @@ proc stddrive::deread {} { proc stddrive::dewrite {name} { # hset /sics/${name}/stop 1 error "$name is not configured, cannot drive" -} +} #-------------------------------------------------------- proc stddrive::deconfigure {name} { set allowed [list upperlimit lowerlimit tolerance stop] @@ -89,12 +89,12 @@ proc stddrive::makestddrive {name sicsclass sct} { hset /sics/${name}/lowerlimit 10 hfactory /sics/${name}/stop plain user int hset /sics/${name}/stop 0 - + hsetprop /sics/${name} checklimits stddrive::stdcheck $name hsetprop /sics/${name} checkstatus stddrive::stdstatus $name hsetprop /sics/${name} halt stddrive::stop $name deconfigure $name $sct write /sics/${name} - $sct poll /sics/${name} 60 + $sct poll /sics/${name} 60 hupdate /sics/${name} -9999.99 } diff --git a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/table.tcl b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/table.tcl index dba5878a..d275c8f5 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/table.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/sicscommon/table.tcl @@ -14,11 +14,11 @@ if { [info exists __tableheader] == 0 } { } #===================================================================== # Csv tcl package version 2.0 -# A tcl library to deal with CSV (comma separated value) +# A tcl library to deal with CSV (comma separated value) # files, generated and readable by some DOS/Windows programs # Contain two functions: # csv2list string ?separator? -# and +# and # list2csv list ?separator? # which converts line from CSV file to list and vice versa. # @@ -52,9 +52,9 @@ proc csv2list {str {separator ","}} { junk2 str]} { if {[string length $quoted]||$unquoted=="\"\""} { regsub -all {""} $quoted \" unquoted - } + } lappend list $unquoted - } + } if {[regexp $regexp2 $str junk unquoted quoted]} { if {[string length $quoted]||$unquoted=="\"\""} { regsub -all {""} $quoted \" unquoted @@ -62,7 +62,7 @@ proc csv2list {str {separator ","}} { lappend list $unquoted if {[uplevel info exist csvtail]} { uplevel set csvtail {""} - } + } } else { if {[uplevel info exist csvtail]} { uplevel [list set csvtail $str] @@ -72,18 +72,18 @@ proc csv2list {str {separator ","}} { } } return $list -} +} proc list2csv {list {separator ","}} { - set l {} + set l {} foreach elem $list { if {[string match {} $elem]|| [regexp {^[+-]?([0-9]+|([0-9]+\.?[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?)$}\ $elem]} { - lappend l $elem + lappend l $elem } else { regsub -all {"} $elem {""} selem - lappend l "\"$selem\"" + lappend l "\"$selem\"" } } return [join $l $separator] @@ -99,21 +99,21 @@ proc csvfile {f {separator ","}} { } elseif {![string length $line]} { lappend list {} continue - } + } set rec [csv2list $line $separator] set buffer [concat $buffer $rec] if {![ string length $csvtail]} { - lappend list $buffer + lappend list $buffer set buffer {} } - } + } if {[string length $csvtail]} { return -code error -errorcode {CSV 2 "Multiline parse error"}\ "CSV file parse error" } return $list -} - +} + proc csvstring {str {separator ","}} { set csvtail "" set list {} @@ -124,30 +124,30 @@ proc csvstring {str {separator ","}} { } elseif {![string length $line]} { lappend list {} continue - } + } set rec [csv2list $line $separator] set buffer [concat $buffer $rec] if {![ string length $csvtail]} { - lappend list $buffer + lappend list $buffer set buffer {} } - } + } if {[string length $cvstail]} { return -code error -errorcode {CSV 2 "Multiline parse error"}\ "CSV string parse error" } return $list -} +} package provide Csv 2.1 #======================================================================== -# The plan here is such: operations which happen fast or immediatly are -# done at once. Count commands or anything given as command is appended -# to a list for later execution. The idea is that this contains the +# The plan here is such: operations which happen fast or immediatly are +# done at once. Count commands or anything given as command is appended +# to a list for later execution. The idea is that this contains the # actual measuring payload of the row. # Drivables are immediatly started. # After processing the rows, there is a success to wait for motors to arrive -# Then the commands for later execution are run. This frees the user of the +# Then the commands for later execution are run. This frees the user of the # the necessity to have the count or whatever command as the last thing in the row #-------------------------------------------------------------------------------- proc testinterrupt {} { @@ -155,7 +155,7 @@ proc testinterrupt {} { if {[string first continue $int] < 0} { error "Interrupted" } -} +} #-------------------------------------------------------------------------------- proc processtablerow {line} { global __tableheader @@ -225,7 +225,7 @@ proc processtablerow {line} { } #------------------------------------------------------------------------ proc tableexe {tablefile} { - global __tableheader + global __tableheader if {[string first NULL $__tableheader] < 0} { error "Tableexe already running, terminated" } @@ -253,7 +253,7 @@ proc loop args { clientput $args if {[llength $args] < 2} { error \ -"Usage: loop \n\t number of repetions\n\t any SICS command" +"Usage: loop \n\t number of repetions\n\t any SICS command" } set len [lindex $args 0] set command [lrange $args 1 end] diff --git a/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/nxtas.tcl b/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/nxtas.tcl index 4aa6eb1b..5dc0e661 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/nxtas.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/nxtas.tcl @@ -1,18 +1,18 @@ #------------------------------------------------------------------------- -# Functions for writing NeXus files for a triple axis spectrometer and +# Functions for writing NeXus files for a triple axis spectrometer and # configuration of the internal scan object to support this. # # Mark Koennecke, May 2005 # reworked to new NeXus standards, Mark Koennecke, February 2007 #----------------------------------------------------------------------- -catch {sicsdatafactory new __transfer} +catch {sicsdatafactory new __transfer} set __tasdata(out) "" #---------------------------------------------------------------------- proc appendMotor {np motor alias} { set val [tasSplit [$motor]] if { [string length $val] > 0} { __transfer putfloat 0 $val - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } else { clientput "WARNING: failed to read $motor" } @@ -33,22 +33,22 @@ proc appendIfPresent {np obj alias} { proc appendFloat {np alias val} { if {[string length $val] > 0} { __transfer putfloat 0 $val - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } else { - clientput "WARNING: failed to read $alias" + clientput "WARNING: failed to read $alias" } } #------------------------------------------------------------------- proc appendCount {np value alias} { __transfer putint 0 $value - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } -#-------------------------------------------------------------------- +#-------------------------------------------------------------------- proc donothing {obj userobj} { } #--------------------------------------------------------------------- proc xmlprepare {obj userobj} { - global __tasdata + global __tasdata #------- normal prepare tasscan prepare $obj $userobj @@ -92,24 +92,24 @@ proc xmlprepare {obj userobj} { #-------------------------------------------------------------------- proc xmlwritepoint {obj userobj np} { global __tasdata scripthome - + nxscript reopen $__tasdata(file) $scripthome/tasub.dic - + append line [format " %3d" $np] set scanvars [split [tasSplit [iscan getscanvars]]] foreach var $scanvars { if { [string length $var] > 1} { set val [tasSplit [eval $var]] - append line [format "%9.4f " [tasSplit [$var]]] - appendMotor $np $var sc_$var + append line [format "%9.4f " [tasSplit [$var]]] + appendMotor $np $var sc_$var lappend storedvars $var } } foreach var $__tasdata(out) { append line [format "%9.4f " [tasSplit [eval $var]]] - appendMotor $np $var sc_$var + appendMotor $np $var sc_$var lappend storedvars $var - + } @@ -118,12 +118,12 @@ proc xmlwritepoint {obj userobj np} { append line [format "%8.2f " [tasSplit [counter gettime]]] append line [format "%8d " [tasSplit [counter getcounts]]] clientput $line - + appendCount $np [tasSplit [counter getcounts]] counts appendCount $np [tasSplit [counter getmonitor 1]] cter_01 appendCount $np [tasSplit [counter getcounts]] cter_02 - appendFloat $np motime [tasSplit [counter gettime]] - + appendFloat $np motime [tasSplit [counter gettime]] + set varlist [list qh qk ql qm en ei ef a1 a2 a3 a4 a5 a6 sgu sgl] foreach var $varlist { @@ -131,11 +131,11 @@ proc xmlwritepoint {obj userobj np} { appendMotor $np $var sc_${var} } } - + if {$np == 0} { makeTASLinks } - + nxscript close } #====================== actual XML stuff ============================ @@ -144,7 +144,7 @@ proc writeUserData {} { writeTextVar usaff affiliation writeTextVar usadd address writeTextVar usmail email - writeTextVar lonam local + writeTextVar lonam local } #------------------------------------------------------------------- proc writeMonochromator {} { @@ -249,19 +249,19 @@ proc makeScanLinks {} { if {$testalias == 1} { nxscript putattribute $alias axis 1 set axis 1 - } - } + } + } } } -# if axis = 0 there is no alias; so we create something in here from the -# scan data in iscan +# if axis = 0 there is no alias; so we create something in here from the +# scan data in iscan if {$axis == 0} { set data [tasSplit [iscan getvardata 0]] set count 0 foreach e $data { set ar($count) [string trim $e] incr count - } + } nxscript putarray danascanvar ar [llength $data] } } @@ -293,7 +293,7 @@ proc xmltaswrite {obj userobj} { writeAnalyzer - writeDetector + writeDetector nxscript close @@ -326,7 +326,7 @@ proc xmlpowderwrite {obj userobj} { writeAnalyzer - writeDetector + writeDetector makePowderLinks diff --git a/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasp.tcl b/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasp.tcl index 997712df..13c0f6eb 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasp.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasp.tcl @@ -7,7 +7,7 @@ # O P T I O N S #-------------------------------------------------------------------------- # simMode -# - 0 real instrument +# - 0 real instrument # - 1 development simulation # - 2 simserver at instrument #-------------------------------------------------------------------------- @@ -16,7 +16,7 @@ set simMode 1 set ts psts230.psi.ch set mupad 0 -#---------- Enable this for more startup debugging +#---------- Enable this for more startup debugging protocol set all #--------------- define home @@ -40,7 +40,7 @@ ServerOption ReadTimeOut 10 ServerOption AcceptTimeOut 10 -ServerOption ReadUserPasswdTimeout 500000 +ServerOption ReadUserPasswdTimeout 500000 ServerOption LogFileBaseName $loghome/tasplog @@ -70,7 +70,7 @@ SicsUser lnsmanager lnsSICSlns 1 SicsUser user 10lns1 2 SicsUser taspuser 10lns1 2 #--------------------------------------------------------------------------- -# M O T O R S +# M O T O R S if {$simMode == 0} { @@ -95,7 +95,7 @@ Motor MCV el734hp mota 3 # Monochromator curvature vertical Motor SRO el734hp mota 12 # Sample table second ring Motor MTL el734hp mota 4 # Monochromator translation lower Motor MTU el734hp mota 5 # Monochromator Translation upper -Motor MGL el734hp mota 7 # Monochromator lower goniometer +Motor MGL el734hp mota 7 # Monochromator lower goniometer MakeRS232Controller motb $ts 3003 @@ -115,14 +115,14 @@ Motor STL el734hp motb 1 # Sample lower translation Motor STU el734hp motb 2 # Sample upper translation Motor ATL el734hp motb 7 # Analyzer lower translation Motor ATU el734hp motb 8 # Analyzer upper translation -#Motor SGL SIM -17 17 -1 .0 # Monochromator upper goniometer -#Motor SGU SIM -17 17 -1 .0 # Monochromator upper goniometer -Motor SGL el734hp motb 3 # Sample lower goniometer -Motor SGU el734hp motb 4 # Sample upper goniometer -Motor AGL el734hp motb 11 # Analyzer lower goniometer -#Motor AGU SIM -30. 30. -.1 2. # Analyzer upper goniometer -#Motor MSC SIM -30. 30. -.1 2. # Monochromator changer -#Motor ASC SIM -30. 30. -.1 2. # Analyzer changer +#Motor SGL SIM -17 17 -1 .0 # Monochromator upper goniometer +#Motor SGU SIM -17 17 -1 .0 # Monochromator upper goniometer +Motor SGL el734hp motb 3 # Sample lower goniometer +Motor SGU el734hp motb 4 # Sample upper goniometer +Motor AGL el734hp motb 11 # Analyzer lower goniometer +#Motor AGU SIM -30. 30. -.1 2. # Analyzer upper goniometer +#Motor MSC SIM -30. 30. -.1 2. # Monochromator changer +#Motor ASC SIM -30. 30. -.1 2. # Analyzer changer #Motor CSC SIM -30. 30. -.1 2. # Collimator changer mcv precision .1 } else { @@ -141,10 +141,10 @@ Motor SGL sim -19 19 -1. 0 # Sample lower translation Motor SGU SIM -30. 30. -.1 2. # Sample upper translation Motor ATL sim -17 17 -.1 .1 # Analyzer lower translation Motor ATU sim -17 17 -.1 .1 # Analyzer upper translation -Motor MGL sim -10 10 -.1 .1 # Monochromator lower goniometer -Motor SGL sim -16 16 -.1 .1 # Sample lower goniometer -Motor SGU sim -16 16 -.1 .1 # Sample upper goniometer -Motor AGL sim -10 10 -.1 .1 # Analyzer lower goniometer +Motor MGL sim -10 10 -.1 .1 # Monochromator lower goniometer +Motor SGL sim -16 16 -.1 .1 # Sample lower goniometer +Motor SGU sim -16 16 -.1 .1 # Sample upper goniometer +Motor AGL sim -10 10 -.1 .1 # Analyzer lower goniometer #-------------------------------------------------------------------------- # C U R R E N T S @@ -180,7 +180,7 @@ MakeCounter counter sim -1. #-------------------------------------------------------------------------- VarMake instrument Text Mugger instrument TASPUB -instrument lock +instrument lock VarMake title Text User VarMake user Text User @@ -203,12 +203,12 @@ source $scripthome/stddrive.tcl source $scripthome/slsecho.tcl if {$simMode == 0} { makesctcontroller slssct slsecho taspmagnet:5001 -slsecho::makeslsecho i1 0 slssct -slsecho::makeslsecho i2 1 slssct -slsecho::makeslsecho i3 2 slssct -slsecho::makeslsecho i4 3 slssct -slsecho::makeslsecho i5 4 slssct -slsecho::makeslsecho i6 5 slssct +slsecho::makeslsecho i1 0 slssct +slsecho::makeslsecho i2 1 slssct +slsecho::makeslsecho i3 2 slssct +slsecho::makeslsecho i4 3 slssct +slsecho::makeslsecho i5 4 slssct +slsecho::makeslsecho i6 5 slssct } } @@ -255,7 +255,7 @@ MakeTasUB tasub MakeScanCommand iscan counter tas.hdd recover.bin MakePeakCenter iscan MakeTasScan iscan tasub -#-------------------------- new exe manager +#-------------------------- new exe manager definealias do exe alias batchroot exe batchpath #-------------------------- normal drive command diff --git a/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/taspubcom.tcl b/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/taspubcom.tcl index 71101b08..f8a5a60f 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/taspubcom.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/taspubcom.tcl @@ -1,6 +1,6 @@ #--------------------------------------------------------------------------- -# The triple axis people love to have the command set emulate the command -# set of TASMAD as closely as possible. This is implemented through +# The triple axis people love to have the command set emulate the command +# set of TASMAD as closely as possible. This is implemented through # some scripting. This version is for the new syntax to be used with the # new UB matrix calculaus for triple axis. # diff --git a/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl b/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl index 7119ffb9..c6e74886 100644 --- a/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl +++ b/site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl @@ -1,18 +1,18 @@ #----------------------------------------------------------------------------- # This file contains all the scripted commands to make a SICS-TAS look -# almost like a MAD-TAS. +# almost like a MAD-TAS. # # This version is special to RITA-2!! # # Mark Koennecke, September 2005 # -# The specialities for RITA have been separated and this is controlled -# by testing the instrument name. This way I can use the same version for +# The specialities for RITA have been separated and this is controlled +# by testing the instrument name. This way I can use the same version for # TASP, RITA-2 and EIGER -# +# # Mark Koennecke, November 2010 #------------------------------------------------------------------------ -# quite often we need to split a SICS answer of the form x = y and +# quite often we need to split a SICS answer of the form x = y and # extract the y. This is done here. #----------------------------------------------------------------------- proc tasSplit {text} { @@ -152,7 +152,7 @@ if { [info exists tasubinit] == 0 } { } #------------------------------------------------------------------------ # TASMAD relies on the order of variables in memory in order to interpret -# scan or drive commands. In the new syntax motor order is only preserved +# scan or drive commands. In the new syntax motor order is only preserved # for the QE motors, not for real motors. This list configures the order. #------------------------------------------------------------------------ set tasOrderList [list qh qk ql en] @@ -166,7 +166,7 @@ for {set i 0} {$i < [llength $tasmot]} { incr i } { set tasmap(l$mot) [format "%s softlowerlim " $mot] set tasmap(z$mot) [format "madZero %s " $mot] set tasmap(u$mot) [format "%s softupperlim " $mot] -} +} set tasmap(ss) "scatSense ss " set tasmap(sa) "scatSense sa " set tasmap(sm) "scatSense sm " @@ -186,7 +186,7 @@ for {set i 0} { $i < 8} { incr i} { # clientput [format " %s = %s" $e $tasmap($e)] #} #---------------------------------------------------------------------- -# put an angle into 360 +# put an angle into 360 proc circlify {val} { set p $val while {$p > 360.0} { @@ -207,12 +207,12 @@ proc madZero args { set length [llength $args] if { $length < 1} { error "ERROR: expected at least motor name as a parameter to madZero" - } + } set mot [lindex $args 0] if {$length == 1 } { #inquiry case set zero [tasSplit [$mot softzero]] - return [format "madZero = %f " [expr -$zero]] + return [format "madZero = %f " [expr -$zero]] } else { # a new value has been given. set val [lindex $args 1] @@ -225,14 +225,14 @@ proc madZero args { $mot softupperlim [circlify [expr $high - $displacement]] $mot softlowerlim [circlify [expr $low - $displacement]] } -} +} #-------------------------------------------------------------------------- # This routine throws an error if a bad value for fx is given #-------------------------------------------------------------------------- proc fxi { {val UNKNOWN} } { if {[string compare $val UNKNOWN] ==0} { return [format " fx = %2s " [tasSplit [tasub const]] ] - } + } return [tasub const $val] } #------------------------------------------------------------------------- @@ -258,17 +258,17 @@ proc scatSense {par {val -1000} } { error "ERROR: unknown scattering sense $par" } } -#-------- inquiry case +#-------- inquiry case if { $val == -1000 } { switch $par { sm { - return [format "sm = %d" [tasSplit [tasub mono ss]]] + return [format "sm = %d" [tasSplit [tasub mono ss]]] } ss { - return [format "ss = %d" [tasSplit [tasub ss]]] + return [format "ss = %d" [tasSplit [tasub ss]]] } sa { - return [format "sa = %d" [tasSplit [tasub ana ss]]] + return [format "sa = %d" [tasSplit [tasub ana ss]]] } default { error "Unknown scattering sense requested" @@ -325,9 +325,9 @@ proc scatSense {par {val -1000} } { madZero $mot $newzero $mot softupperlim $newupper $mot softlowerlim $newlower - } - } -} + } + } +} #------------------------------------------------------------------------- # The output command #------------------------------------------------------------------------- @@ -350,11 +350,11 @@ proc ou args { # typeATokenizer extracts tokens from a command string. Tokens can be # either variable names or - indicating a series of variables. # Returns the token value or END if the end of the string text is -# reached. Uses and updates a variable pos which indicates the current +# reached. Uses and updates a variable pos which indicates the current # position in the string. #--------------------------------------------------------------------------- proc typeATokenizer {text pos} { - upvar pos p + upvar pos p set l [string length $text] #------- check for end if {$p >= $l} { @@ -408,7 +408,7 @@ proc cl args { } } return - } + } #------ trying to clear individual fixed motors set command [join $args] set command [string tolower $command] @@ -438,10 +438,10 @@ proc cl args { error [format "ERROR: %s is no motor" $e] } else { clientput [format "%s unfixed" $e] - } + } if {[string compare $e $stop] == 0 } { break - } + } } } else { #------ should be a single motor here @@ -451,7 +451,7 @@ proc cl args { error [format "ERROR: %s is no motor" $token] } else { clientput [format "%s unfixed" $token] - } + } } #------- do not forget to proceed set token [typeATokenizer $command $pos] @@ -478,7 +478,7 @@ proc fi args { } } return - } + } #------ parse motors to fix set command [join $args] set command [string tolower $command] @@ -508,10 +508,10 @@ proc fi args { error [format "ERROR: %s is no motor" $e] } else { clientput [format "%s fixed" $e] - } + } if {[string compare $e $stop] == 0 } { break - } + } } } else { #------ should be a single motor here @@ -521,7 +521,7 @@ proc fi args { error [format "ERROR: %s is no motor" $token] } else { clientput [format "%s fixed" $token] - } + } } #------- do not forget to proceed set token [typeATokenizer $command $pos] @@ -532,7 +532,7 @@ proc fi args { # handles pos as in type A syntax above. #-------------------------------------------------------------------------- proc varToken {text pos} { - upvar pos p + upvar pos p set l [string length $text] #------- check for end if {$p >= $l} { @@ -565,7 +565,7 @@ proc varToken {text pos} { # varSet parses a string containing MAD variable statements and sets the # variables. Thereby it has to take care of mappings and special variables # which have to be set by special functions. The only format allowed here -# are name value pairs. +# are name value pairs. #-------------------------------------------------------------------------- proc varSet { command } { global tasmap @@ -580,7 +580,7 @@ proc varSet { command } { [string compare $token local] == 0 } { eval $command return - } + } if { [string compare $token out] == 0 || \ [string compare $token ou] == 0 } { append txt $token " " [string range $command $pos end] @@ -597,37 +597,37 @@ proc varSet { command } { if { [info exists tasmap($token)] == 1} { set ret [catch {eval $tasmap($token) $value} msg] if { $ret != 0} { - error [format "ERROR: > %s < while setting %s" $msg $token] + error [format "ERROR: > %s < while setting %s" $msg $token] } else { clientput [format " %s = %s" $token $value] } - } else { + } else { set ret [catch {eval $token $value} msg] if { $ret != 0 } { - error [format "ERROR: error %s while setting %s" $msg $token] + error [format "ERROR: error %s while setting %s" $msg $token] } else { clientput [format " %s = %s" $token $value] } - } + } set token [varToken $command $pos] set value [varToken $command $pos] } catch {tasub update} msg } #-------------------------------------------------------------------------- -# co for count is the funny MAD count procedure. Please note, that the +# co for count is the funny MAD count procedure. Please note, that the # count mode is automatically set through the last MN or TI variable. #-------------------------------------------------------------------------- proc coritacount {mode preset nloop} { - set rmode [ritamode] + set rmode [ritamode] hm countmode $mode hm preset $preset for { set i 0} {$i < $nloop} {incr i} { - set ret [catch {eval hm countblock} msg] + set ret [catch {eval hm countblock} msg] if {$ret != 0} { error $msg } - #----- format output + #----- format output set cts [tasSplit [hm sum 0 127 0 127]] set m1 [tasSplit [counter getmonitor 1]] set m2 [tasSplit [counter getmonitor 2]] @@ -642,18 +642,18 @@ proc coritacount {mode preset nloop} { append txt [format " %s = %d" $win [sumPSDWindow $i]] } clientput $txt - } + } } } #------------------------------------------------------------------------ proc conormalcount {mode preset nloop} { counter setmode $mode for { set i 0} {$i < $nloop} {incr i} { - set ret [catch {eval counter count $preset } msg] + set ret [catch {eval counter count $preset } msg] if {$ret != 0} { error $msg } - #----- format output + #----- format output set cts [tasSplit [counter getcounts]] set m1 [tasSplit [counter getmonitor 1]] set m2 [tasSplit [counter getmonitor 2]] @@ -664,7 +664,7 @@ proc conormalcount {mode preset nloop} { " Counts = %8d, M1 = %8d, M2 = %8d, M3 = %8d, Time = %8.2f" \ $cts $m1 $m2 $m3 $time] } -} +} #------------------------------------------------------------------------- proc co args { global ritaspecial @@ -712,17 +712,17 @@ proc co args { #---------------------------------------------------------------------------- proc fm args { #------ do the scan first - append com "sc " [ join $args] + append com "sc " [ join $args] set ret [catch {eval $com} msg] if { $ret != 0 } { error $msg - } + } # iscan simscan 15 .3 1000 #----- calculate the center set ret [catch {eval peak value} msg] if { $ret != 0 } { error $msg - } + } if { [string first "WARN" $msg ] >= 0 } { error [format "ERROR: failed to find peak: %s" $msg] } @@ -737,7 +737,7 @@ proc fm args { set ret [catch {eval dr $var $val} msg] if { $ret != 0 } { error $msg - } + } } #------------------------------------------------------------------------ # fz does almost the same as fm, but also sets the current position to be @@ -745,17 +745,17 @@ proc fm args { #------------------------------------------------------------------------ proc fz args { #------ do the scan first - append com "sc " [ join $args] + append com "sc " [ join $args] set ret [catch {eval $com} msg] if { $ret != 0 } { error $msg - } + } iscan simscan 15 .3 1000 #----- calculate the center set ret [catch {eval peak value} msg] if { $ret != 0 } { error $msg - } + } if { [string first "WARN" $msg ] >= 0 } { error [format "ERROR: failed to find peak: %s" $msg] } @@ -770,7 +770,7 @@ proc fz args { set ret [catch {eval dr $var $val} msg] if { $ret != 0 } { error $msg - } + } #------- now do zero point set temp [eval $var hardposition] set newZero [tasSplit $temp] @@ -785,16 +785,16 @@ proc pr args { set line [join $args] set line [string tolower $line] set pos 0 - set token [varToken $line $pos] + set token [varToken $line $pos] while { [string compare $token -end] } { #-------- check for mapped values first if { [info exists tasmap($token)] == 1 } { set val [tasSplit [eval $tasmap($token)]] - clientput [format " %s = %s" $token $val] + clientput [format " %s = %s" $token $val] } else { #------ simple variables go here set val [tasSplit [$token] ] - clientput [format " %s = %s" $token $val] + clientput [format " %s = %s" $token $val] } set token [varToken $line $pos] } @@ -858,7 +858,7 @@ proc lz args { incr count if { $count == 6 } { append outPut " \n" - } + } } return $outPut } @@ -962,7 +962,7 @@ proc le args { append output [format "POSN: %s" $val] append output [format "TARG: %s" $val2] - return $output + return $output } #----------------------------------------------------------------------- # fmtMot formats a motors parameters in order to fit the format for @@ -980,7 +980,7 @@ proc fmtMot mot { set txt [format "%-7s%1s %7.2f %7.2f %7.2f" $mot $fix $pos $target \ $zero] return $txt -} +} #------------------------------------------------------------------------- # lt --> list targets #------------------------------------------------------------------------- @@ -1011,7 +1011,7 @@ proc lt args { [fmtMot MTL] " " ] append output [format "%s | %s\n" \ [fmtMot MTU] " " ] - return $output + return $output } #-------------------------------------------------------------------- # li --> list everything @@ -1044,9 +1044,9 @@ proc log args { if { [ llength $args] == 0 } { if { [string compare $madlog disabled] == 0 } { return "Logging is disabled" - } else { + } else { return [format "Logging to %s" $madlog] - } + } } #------args, action according to keyword set key [string tolower [lindex $args 0]] @@ -1070,7 +1070,7 @@ proc log args { append output "\tLog close : stop logging\n" return $output } - } + } } #-------------------------------------------------------------------------- @@ -1080,7 +1080,7 @@ proc sz args { global tasmot set usage "\n Usage: \n\t sz motor newval \n" set line [string tolower [join $args]] - set pos 0 + set pos 0 set mot [varToken $line $pos] set val [varToken $line $pos] if { [lsearch $tasmot $mot] < 0 } { @@ -1091,7 +1091,7 @@ proc sz args { } #-------- output, output, output......... append output [format "Values : Lo(hard) Lo(soft) Posn%s" \ - " Target Hi(soft) Hi(hard) Zero\n"] + " Target Hi(soft) Hi(hard) Zero\n"] set zero [tasSplit [madZero $mot]] set loh [tasSplit [eval $mot hardlowerlim]] set loh [expr $loh + $zero] @@ -1134,7 +1134,7 @@ proc pa args { set fil $fil.pal } polfile $fil -} +} #-------------------------------------------------------------------------- # on and off for switching spin flippers #------------------------------------------------------------------------- @@ -1148,7 +1148,7 @@ proc checkarg args { return $flipper } else { error [format "%s not a recognized flipper" $flipper] - } + } } #------------------------------------------------------------------------ proc on args { @@ -1198,7 +1198,7 @@ proc syncdrive {mot pos} { } } #-------------------------------------------------------------------------- -# "set posttion" sp to reset the zero-position. +# "set posttion" sp to reset the zero-position. # syntax: "SP " to set the softzero value of # in a way that the targetposition is set to . # J. Stahn, 10. 2001 @@ -1255,7 +1255,7 @@ proc scan {name} { info { set scanvar [findscanvar] append result [tasSplit [iscan np]] ",1," $scanvar - append result , + append result , append result [string trim [tasSplit [iscan getfile]]] return $result } @@ -1291,7 +1291,7 @@ proc dr args { error "ERROR: do not know what to drive to $token" } } else { - set lastVar $token + set lastVar $token lappend motors $lastVar } set token [varToken $command $pos] @@ -1340,7 +1340,7 @@ proc sc args { set lastVar quarkPhaser set pos 0 set state 0 -# states: +# states: # 0 = expectToken, 1 = expectPosition, 2 = continuePosition # 3 = expectIncrement, 4 = continueIncrement @@ -1423,7 +1423,7 @@ proc sc args { error "ERROR: nothing to scan" } set __tasdata(qe) 0 - set qeVars [list qh qk ql ei ef en qm ki kf] + set qeVars [list qh qk ql ei ef en qm ki kf] foreach var $scanvars { if {[lsearch -exact $qeVars [string tolower $var]] >= 0} { set __tasdata(qe) 1 @@ -1445,7 +1445,7 @@ proc sc args { set start [expr $scanpos($var) - $inc($var) * ($np - 1)/2.] iscan add $var $start $inc($var) } - return [iscan run $np $mode $preset] + return [iscan run $np $mode $preset] } #--------------------------------------------------------------------- proc cell args { @@ -1454,7 +1454,7 @@ proc cell args { #-------------------------------------------------------------------- proc ref args { if { [llength $args] == 0} { - return [tasub listref] + return [tasub listref] } set key [string trim [lindex $args 0]] if { [string compare $key clear] == 0} { @@ -1470,13 +1470,13 @@ proc ref args { } elseif {[string compare $key aux] == 0} { set qpos [lrange $args 1 end] append cmd "tasub addauxref " [join $qpos] - return [eval $cmd] + return [eval $cmd] } else { return [eval tasub addref $args] } } #-------------------------------------------------------------------- -proc makeub args { +proc makeub args { if { [llength $args] >= 2} { tasub makeub [lindex $args 0] [lindex $args 1] return OK @@ -1485,7 +1485,7 @@ proc makeub args { } } #-------------------------------------------------------------------- -proc makeauxub {qh qk ql} { +proc makeauxub {qh qk ql} { tasub makeauxub $qh $qk $ql } #------------------------------------------------------------------- @@ -1493,18 +1493,18 @@ proc addauxref {qh qk ql} { tasub addauxref $qh $qk $ql } #-------------------------------------------------------------------- -proc makeubfromcell args { +proc makeubfromcell args { return [tasub makeubfromcell] } #--------------------------------------------------------------------- -proc listub args { +proc listub args { append output [tasSplit [tasub cell]] append output "\n" append output [tasub listub] append output [tasub listref] return $output } -#---------------------------------------------------------------------- +#---------------------------------------------------------------------- proc sf args { tasscan fast 1 set ret [catch {eval sc $args} msg] diff --git a/site_ansto/instrument/lyrebird/lyrebird_configuration.tcl b/site_ansto/instrument/lyrebird/lyrebird_configuration.tcl index 2fe183b6..abf311f1 100644 --- a/site_ansto/instrument/lyrebird/lyrebird_configuration.tcl +++ b/site_ansto/instrument/lyrebird/lyrebird_configuration.tcl @@ -1,8 +1,8 @@ # Author: Jing Chen (jgn@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument lyrebird +Instrument lyrebird Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/mksim_config.tcl b/site_ansto/instrument/mksim_config.tcl index 82ddfd46..ed4be2ec 100755 --- a/site_ansto/instrument/mksim_config.tcl +++ b/site_ansto/instrument/mksim_config.tcl @@ -5,7 +5,7 @@ puts "# !!- AUTOGENERATED FROM $args(-f) -!!" puts "# !!- DO NOT MODIFY -!!" puts "# [clock format [clock seconds] -format %c]\n" -# Use 'unknown' to suppress commands which refer to ansto specfic +# Use 'unknown' to suppress commands which refer to ansto specfic # motor parameters. proc unknown {args} { set param [lindex $args 1]; diff --git a/site_ansto/instrument/pas/pelican_configuration.tcl b/site_ansto/instrument/pas/pelican_configuration.tcl index c47428d9..972fdc91 100644 --- a/site_ansto/instrument/pas/pelican_configuration.tcl +++ b/site_ansto/instrument/pas/pelican_configuration.tcl @@ -1,8 +1,8 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument pelican +Instrument pelican Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/pelican/config/anticollider/anticollider.tcl b/site_ansto/instrument/pelican/config/anticollider/anticollider.tcl index db8cb21a..85a5de00 100644 --- a/site_ansto/instrument/pelican/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/pelican/config/anticollider/anticollider.tcl @@ -1,6 +1,6 @@ # 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 proc ::anticollider::enable {args} { diff --git a/site_ansto/instrument/pelican/config/beamline/sct_power.tcl b/site_ansto/instrument/pelican/config/beamline/sct_power.tcl index 02472022..aa500991 100644 --- a/site_ansto/instrument/pelican/config/beamline/sct_power.tcl +++ b/site_ansto/instrument/pelican/config/beamline/sct_power.tcl @@ -11,7 +11,7 @@ # LF Amplifier/Generator # # @author: Jing Chen, ANSTO, 2012-06-26 -# @brief: SICS driver for LF AG 1010 LF Amplifier/Generator +# @brief: SICS driver for LF AG 1010 LF Amplifier/Generator # # ----------------------------------------------------------------------------*/ @@ -26,14 +26,14 @@ namespace eval ::scobj::ag1010 { variable CtrlSetBurstPar [format %02x 8] variable CtrlSetSweepPar [format %02x 9] - variable CtrlGetLIMITS [format %02x 17] - variable CtrlGetPAGC [format %02x 19] - variable CtrlGetPMGC [format %02x 20] - variable CtrlGetFREQ [format %02x 21] - variable CtrlGetSKEY [format %02x 23] + variable CtrlGetLIMITS [format %02x 17] + variable CtrlGetPAGC [format %02x 19] + variable CtrlGetPMGC [format %02x 20] + variable CtrlGetFREQ [format %02x 21] + variable CtrlGetSKEY [format %02x 23] variable CtrlGetBurstPar [format %02x 24] variable CtrlGetSweepPar [format %02x 25] - variable CtrlGetSVER [format %02x 29] + variable CtrlGetSVER [format %02x 29] variable CtrlGetMEAS [format %02x 30] variable CtrlGetSTA [format %02x 31] @@ -58,14 +58,14 @@ namespace eval ::scobj::ag1010 { proc ::scobj::ag1010::getValue {tc_root nextState rdPara} { if {[ catch { set HEAD 0x96 - set LEN [lindex $rdPara 0] + set LEN [lindex $rdPara 0] set CTRL [lindex $rdPara 1] set DATA 0 set CRC 0 - + if {[hpropexists [sct] geterror]} { hdelprop [sct] geterror - } + } if {$LEN < 2} { return -code error "Error in LF AG1010 Setting: wrong data length provided." } elseif {$LEN > 2} { @@ -92,10 +92,10 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { # tc_root and idx are not being used - however, don't remove so we can use the # same calling mask as for setPoint() or other $wrFunc - variable ForPowerLimit - variable RefPowerLimit - variable FreqUpLimit - variable FreqDownLimit + variable ForPowerLimit + variable RefPowerLimit + variable FreqUpLimit + variable FreqDownLimit set ns /sics/ag1010 #set ns [sct] @@ -142,7 +142,7 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { set data [format %04x%04x $Freq $FreqHz] } } - "SoftOn" { + "SoftOn" { if {$newPara > 1 || $newPara < 0} { return -code error "Error in setValue: only allowed input values for SoftKey are {0,1}." } else { @@ -266,13 +266,13 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { "BurstMode" { if {$newPara<0 || $newPara>3} { return -code error "Error in setValue: only allowed input values for BurstMode are {0,1,2,3}" } else { - set BurstMode $newPara + set BurstMode $newPara } set BRepTime [hval $ns/BurstPar/BRepTime] - set TimeOfPower [hval $ns/BurstPar/TimeOfPower] + set TimeOfPower [hval $ns/BurstPar/TimeOfPower] set data [format %02x%04x%04x $BurstMode $BRepTime $TimeOfPower] } - "BRepTime" { + "BRepTime" { #set BurstMode [hval $ns/BurstPar/BurstMode] #if {[string match -nocase $BurstMode "Mode OFF"]} { # set BurstMode 0 @@ -287,7 +287,7 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { #} # set mode to Changing Burst Parameters without Chanigng Burst Mode -- 2 - set BurstMode 2 + set BurstMode 2 set TimeOfPower [hval $ns/BurstPar/TimeOfPower] set data [format %02x%04x%04x $BurstMode $newPara $TimeOfPower] } @@ -326,15 +326,15 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { set SStp [expr [hval $ns/SweepPar/StepFreq] / 1000] set SStpHz [expr [hval $ns/SweepPar/StepFreq] % 1000] set SCyc [hval $ns/SweepPar/SCyc] - set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] - } + set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] + } "SSteF" { set SweepMode 2 set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000] set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000] set SStp [expr $newPara / 1000] set SStpHz [expr $newPara % 1000] set SCyc [hval $ns/SweepPar/SCyc] - set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] + set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] } "SSCyc" { set SweepMode 2 set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000] @@ -350,7 +350,7 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { sct send "$cmd" } message ]} { return -code error "Error in setValue: $message. While sending command" - } + } return $nextState } @@ -397,7 +397,7 @@ proc ::scobj::ag1010::rdValue {} { set ctrlCode [format %d 0x[string range $data 4 5]] switch -glob $ctrlCode { - 42 { return -code error "Error in rdValue()" + 42 { return -code error "Error in rdValue()" } 2 { set FPLH [string range $data 6 7] set FPLL [string range $data 8 9] @@ -428,9 +428,9 @@ proc ::scobj::ag1010::rdValue {} { } 7 { set softKey 0x[string range $data 6 7] if {[expr $softKey & 0x80] == 0} { - hset $ns/SKEY/SoftOn "Controller takes over the keyboard of controller" + hset $ns/SKEY/SoftOn "Controller takes over the keyboard of controller" } else { - hset $ns/SKEY/SoftOn "Host takes over the keyboard of controller" + hset $ns/SKEY/SoftOn "Host takes over the keyboard of controller" } if {[expr $softKey & 0x08] == 0} { hset $ns/SKEY/Key1 "Off" @@ -463,11 +463,11 @@ proc ::scobj::ag1010::rdValue {} { } elseif {$SCode == 3} { hset $ns/BurstPar/BurstMode "External Burst Mode ON" } - + set BRepTH [string range $data 8 9] set BRepTL [string range $data 10 11] hset $ns/BurstPar/BRepTime [format %d [expr 0x$BRepTH$BRepTL]] - + set BOnTH [string range $data 12 13] set BOnTL [string range $data 14 15] hset $ns/BurstPar/TimeOfPower [format %d [expr 0x$BOnTH$BOnTL]] @@ -484,13 +484,13 @@ proc ::scobj::ag1010::rdValue {} { set SStr [format %d 0x[string range $data 8 9]] set SStrHz [format %d 0x[string range $data 14 15]] hset $ns/SweepPar/StartFreq [expr $SStr * 1000 + $SStrHz] - + set SStp [format %d 0x[string range $data 10 11]] set SStpHz [format %d 0x[string range $data 16 17]] hset $ns/SweepPar/StepFreq [expr $SStp * 1000 + $SStpHz] set SCyc [format %d 0x[string range $data 12 13]] - hset $ns/SweepPar/SCyc $SCyc + hset $ns/SweepPar/SCyc $SCyc } 13 { set SNH [string range $data 6 7] set SNL [string range $data 8 9] @@ -650,7 +650,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p } } if {$writable == 1} { - hsetprop $nodeName write ${ns}::setValue $scobj_hpath $rdFunc $rdPara $wrPara + hsetprop $nodeName write ${ns}::setValue $scobj_hpath $rdFunc $rdPara $wrPara hsetprop $nodeName $rdFunc ${ns}::$rdFunc if {$pollEnabled == 1} { if {[SplitReply [environment_simulation]]=="false"} { @@ -691,7 +691,7 @@ proc ::scobj::ag1010::mkAG {argList} { } MakeSICSObj $pa(NAME) SCT_OBJECT - sicslist setatt $pa(NAME) klass environment + sicslist setatt $pa(NAME) klass environment sicslist setatt $pa(NAME) long_name $pa(NAME) # Create a base node for all the state machines of this sics object @@ -708,8 +708,8 @@ proc ::scobj::ag1010::mkAG {argList} { # Nodes appear in gumtree in the order in which they are created here. # # Initialise the model-dependent list of supported device commands - # - # cmdGroup subdirectory in which the node is to be created, "P" means under top-parent node + # + # cmdGroup subdirectory in which the node is to be created, "P" means under top-parent node # varName name of the actual node typically representing one device command # readable set to 1 if the node represents a query command, 0 if it is not # writable set to 1 if the node represents a request for a change in settings sent to the device @@ -759,7 +759,7 @@ proc ::scobj::ag1010::mkAG {argList} { MEAS ReversePower 0 0 0 1 float {W} user {} {} {} {} MEAS Temperature 0 0 0 1 float {0C} user {} {} {} {} P STA 1 0 1 1 none {} spy {2 31} {rdValue} {} {} - STA MainState 0 0 0 1 text {} user {} {} {} {} + STA MainState 0 0 0 1 text {} user {} {} {} {} STA State 0 0 0 1 int {} user {} {} {} {} STA/State FstRemote 0 0 0 1 text {} user {} {} {} {} STA/State FStExtBurst 0 0 0 1 text {} user {} {} {} {} @@ -783,7 +783,7 @@ proc ::scobj::ag1010::mkAG {argList} { P SetPMGC 0 1 1 1 float {%} user {4 4} {rdValue} {PMGC} {} P SetFREQ 0 1 1 1 int {Hz} user {6 5} {rdValue} {FREQ} {} P SetSoftOn 0 1 1 1 int {} user {3 7} {rdValue} {SoftOn} {1,0} - P SetKey1 0 1 1 1 int {} user {3 7} {rdValue} {Key1} {1,0} + P SetKey1 0 1 1 1 int {} user {3 7} {rdValue} {Key1} {1,0} P SetKey0 0 1 1 1 int {} user {3 7} {rdValue} {Key0} {1,0} P SetKey2 0 1 1 1 int {} user {3 7} {rdValue} {Key2} {1,0} P SetKey3 0 1 1 1 int {} user {3 7} {rdValue} {Key3} {1,0} @@ -792,20 +792,20 @@ proc ::scobj::ag1010::mkAG {argList} { P SetBTimeOfPower 0 1 1 1 int {us} user {7 8} {rdValue} {BTofP} {} P SetSweepMode 0 1 1 1 int {} user {13 9} {rdValue} {SweepMode} {0,1,2} P SetSStartFreq 0 1 1 1 int {Hz} user {13 9} {rdValue} {SStrF} {} - P SetSStepFreq 0 1 1 1 int {Hz} user {13 9} {rdValue} {SSteF} {} + P SetSStepFreq 0 1 1 1 int {Hz} user {13 9} {rdValue} {SSteF} {} P SetSSCyc 0 1 1 1 int {} user {13 9} {rdValue} {SSCyc} {} } foreach {cmdGroup varName readable writable pollEnabled displayable dataType unit permission rdPara rdFunc wrPara allowedValues} \ $deviceCommandToplevel { - createNode $scobj_hpath sct_$pa(NAME) $cmdGroup $varName $readable $writable $pollEnabled $displayable $dataType $unit $permission $rdPara $rdFunc $wrPara $allowedValues + createNode $scobj_hpath sct_$pa(NAME) $cmdGroup $varName $readable $writable $pollEnabled $displayable $dataType $unit $permission $rdPara $rdFunc $wrPara $allowedValues } # add HDB structure here ::scobj::set_required_props $ns - foreach {hpath klass control data priv type} { + foreach {hpath klass control data priv type} { /sics/ag1010 environment true true spy part /sics/ag1010/MEAS NXsensor true true user NXsensor /sics/ag1010/FRE NXsample true true user NXsample @@ -856,13 +856,13 @@ proc lf_pagc {{para ""} args} { set ns /sample/ag1010 set newPara [string trim $para " "] - + # scale W to dW set newPara [expr $newPara * 10] set data [format %04x $newPara] set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] - broadcast "Set Power Level for AGC mode to $newPara dW" + broadcast "Set Power Level for AGC mode to $newPara dW" sct_ag1010 send "$cmd" } } @@ -962,7 +962,7 @@ proc lf_limits {args} { set RPL [expr $val * 10] } } - default { error "ERROR: $arg should be 'FPL' or 'RPL'" + default { error "ERROR: $arg should be 'FPL' or 'RPL'" return idle } } @@ -1016,7 +1016,7 @@ proc lf_burst {args} { "rtime" { set BRepTime $val broadcast "Set Repetition Period Burst Cycle to $val ms" } - "top" { set TimeOfPower $val + "top" { set TimeOfPower $val broadcast "Set Time of Power in Burst Cycle to $val us" } default { error "ERROR: $arg should be 'mode', 'rtime' or 'top'" } @@ -1042,7 +1042,7 @@ proc lf_sweep {args} { set CRC 0 set ns /sample/ag1010 - + set SweepMode 2 set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000] set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000] @@ -1073,12 +1073,12 @@ proc lf_sweep {args} { broadcast "Set Start Frequency in Sweep Mode to $val Hz" } - "stepF" { set SStp [expr $val / 1000] + "stepF" { set SStp [expr $val / 1000] set SStpHz [expr $val % 1000] broadcast "Set Step Frequency in Sweep Mode to $val Hz" } - "np" { set np $val + "np" { set np $val broadcast "Set Number of Steps in Full Sweep Cycle to $val" } @@ -1113,13 +1113,13 @@ publish lf_sweep user # @param IP IP address of the device (e.g. IP of moxabox that hooks up to the AG1010) # @param port port number on the moxabox (typ. 4001, 4002, 4003, or 4004) # @param turning if the parameter is turnable and can be set from the Gumtree -# @internal time internal in polling the nodes +# @internal time internal in polling the nodes # IP 137.157.202.219 ::scobj::ag1010::mkAG { name "ag1010" - IP 137.157.202.214 - PORT 4003 + IP 137.157.202.214 + PORT 4003 tuning 1 interval 5 } diff --git a/site_ansto/instrument/pelican/config/chopper/fermimot.tcl b/site_ansto/instrument/pelican/config/chopper/fermimot.tcl index 7307eb51..be3d6648 100644 --- a/site_ansto/instrument/pelican/config/chopper/fermimot.tcl +++ b/site_ansto/instrument/pelican/config/chopper/fermimot.tcl @@ -112,7 +112,7 @@ namespace eval ::chopper { 21 22 23 24 25 26 27 28 29 30 } { - set speedMult($i) [expr double($mult)] + set speedMult($i) [expr double($mult)] incr i } @@ -324,7 +324,7 @@ namespace eval ::chopper { set propGain [lindex $row 1 1 $dir] set intGain [lindex $row 1 2 $dir] set phGain [lindex $row 1 3 $dir] - + hset $hpath/$node/control/set_motor_dir $dir hset $hpath/$node/control/set_vetowin50 [expr $vetowin/50.0] hset $hpath/$node/control/set_prop_gain $propGain @@ -497,7 +497,7 @@ namespace eval ::chopper { proc imot_PhRun {hpath node addr name target} { global SCode - + hset $hpath/$node/control/set_ref_delay $target hsetprop $hpath/$node/control timecheck -1 set readtime [hgetpropval $hpath read_time] @@ -510,7 +510,7 @@ namespace eval ::chopper { return $SCode(MOTFAIL) } - + proc get_phase_acc {ch} { variable chPath diff --git a/site_ansto/instrument/pelican/config/chopper/sct_fermichopper.tcl b/site_ansto/instrument/pelican/config/chopper/sct_fermichopper.tcl index baa6458d..00095cd4 100644 --- a/site_ansto/instrument/pelican/config/chopper/sct_fermichopper.tcl +++ b/site_ansto/instrument/pelican/config/chopper/sct_fermichopper.tcl @@ -194,7 +194,7 @@ namespace eval ::scobj::chopper { hfactory $fermiPath/$chname/intlck_status/$field plain user int } - + hfactory $chPath/control plain user none hfactory $chPath/control/device_error plain user text @@ -251,7 +251,7 @@ namespace eval ::scobj::chopper { 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 "RDVETOINF" ${scobjNS}::rdVal $fermiPath {phase_veto_count phase_nonveto_count} - + if {$sim_mode == "false"} { sct_fermi poll $fermiPath $pollrate diff --git a/site_ansto/instrument/pelican/config/commands/monodrive.tcl b/site_ansto/instrument/pelican/config/commands/monodrive.tcl index ebcac051..0d7e4e5c 100644 --- a/site_ansto/instrument/pelican/config/commands/monodrive.tcl +++ b/site_ansto/instrument/pelican/config/commands/monodrive.tcl @@ -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 -# +# # Date: 11/11/2011 # get a specified parameter value of a motor @@ -79,25 +79,25 @@ proc DriveMono {mot focus} { set translateDis [expr $focus - [getSetting $mot position]] # Determine if the movement is within the ranges of the three motors - if {[expr $mraPosition + $translateDis] > $mraSoftupperlim || - [expr $mraPosition + $translateDis] < $mraSoftlowerlim} { + if {[expr $mraPosition + $translateDis] > $mraSoftupperlim || + [expr $mraPosition + $translateDis] < $mraSoftlowerlim} { broadcast "Error: the movement is out of the range limit of motor mra" set moveFlag 0 } - if {[expr $mrbPosition + $translateDis] > $mrbSoftupperlim || + if {[expr $mrbPosition + $translateDis] > $mrbSoftupperlim || [expr $mrbPosition + $translateDis] < $mrbSoftlowerlim} { broadcast "Error: the movement is out of the range limit of motor mrb" set moveFlag 0 } - if {[expr $mrcPosition + $translateDis] > $mrcSoftupperlim || + if {[expr $mrcPosition + $translateDis] > $mrcSoftupperlim || [expr $mrcPosition + $translateDis] < $mrcSoftlowerlim} { broadcast "Error: the movement is out of the range limit of motor mrc" set moveFlag 0 } - # move the three motors + # move the three motors if {$moveFlag == 1} { # Unlock the three motors mra fixed -1 diff --git a/site_ansto/instrument/pelican/config/counter/counter.tcl b/site_ansto/instrument/pelican/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/pelican/config/counter/counter.tcl +++ b/site_ansto/instrument/pelican/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/pelican/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/pelican/config/hmm/hmm_configuration.tcl index a85737c6..36485cfd 100644 --- a/site_ansto/instrument/pelican/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/pelican/config/hmm/hmm_configuration.tcl @@ -40,7 +40,7 @@ proc ::histogram_memory::init_OAT_TABLE {} { set tbb1 [expr $tbb0 + $tbinwidth_ns / $clock_scale] OAT_TABLE -set X { 199.5 198.5 } NXC $xbins Y { -0.5 15.5 } NYC $ybins T "$tbb0 $tbb1" NTC $tbins - # Use the ::histogram_memory::clock_scale function to make sure that the value in the + # Use the ::histogram_memory::clock_scale function to make sure that the value in the # time of flight channel width is consistent with its units sicslist setatt tofw units [::histogram_memory::clock_scale units] tofw [expr ($tbb1 - $tbb0) * [::histogram_memory::clock_scale]] @@ -65,7 +65,7 @@ return { 30 30 30 30 30 30 30 30 - 30 30 30 30 30 30 30 30 + 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 20 10 10 10 10 10 10 @@ -178,7 +178,7 @@ proc ::histogram_memory::isc_initialize {} { ::histogram_memory::ic_initialize ::histogram_memory::set_graphtype "two_theta" "boundaries" - # Width = 25mm spacing * 200 tubes = 5000mm (120 degree coverage) + # Width = 25mm spacing * 200 tubes = 5000mm (120 degree coverage) # Height = 1015mm (tube length) # Radius = 2400mm detector_active_height_mm 1015 diff --git a/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl b/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl index d312bad7..2aa761c7 100644 --- a/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl +++ b/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl @@ -1,17 +1,17 @@ ########################################################################################################################### -# @file Proptocols between SICS and High Voltage Controller +# @file Proptocols between SICS and High Voltage Controller # # This is a driver for SICS to make following communication with the High Voltage Controller # # -# 1. SICS uses TCP/IP protocol to interact with the HV component who shall provide an IP address +# 1. SICS uses TCP/IP protocol to interact with the HV component who shall provide an IP address # together with an port number. # -# 2. Commands From SICS to HV component, +# 2. Commands From SICS to HV component, # 1. HV_START hv1=xxx, i1=xxx, hv2=xxx, i2=xxx # :: Responses from HV component back to SICS are either # OK (if the system start correctly), or -# Error Message (if the system does not start normally, the error message shall indicate +# Error Message (if the system does not start normally, the error message shall indicate # type of the errors) # # 2. HV_STOP (This will stop/shutdown the HV component totally) @@ -22,10 +22,10 @@ # Error Message (if the system does not start normally, the error message will indicate type of the errors) # # 4. HV_STATUS (This command will send to HV component automatically and regularly, i.e. every 1 sec) -# :: Responses from HV component back to SICS is "hv1=xxx, i1=xxx, hv2=xxx, i2=xxx, system=rampingup;\n", +# :: Responses from HV component back to SICS is "hv1=xxx, i1=xxx, hv2=xxx, i2=xxx, system=rampingup;\n", # SICS uses this information to update their values in the SICS system and on the Gumtree client as well. # -# 3. HV parameters to be dsiaplyed on the Gumtree GUI are, hv1, i1, hv2, i2, system +# 3. HV parameters to be dsiaplyed on the Gumtree GUI are, hv1, i1, hv2, i2, system # # Author: Jing Chen (jgn@ansto.gov.au) July 2011 # @@ -33,7 +33,7 @@ # ::scobj::hv::mkHV { # name "hv" # IP localhost -# PORT 55010 +# PORT 55010 # tuning 1 # interval 1 # @@ -92,7 +92,7 @@ proc ::scobj::hv:setting {field basePath} { } default {error "ERROR: illegal input command, type help for more info" return idle - } + } } sct send $comm @@ -115,7 +115,7 @@ proc ::scobj::hv::getHVStatusFunc {mode} { "config" {set comm "get config\r\n"} default {error "ERROR: illegal input command, type help for more info" return idle - } + } } sct send $comm @@ -153,7 +153,7 @@ proc ::scobj::hv::rdHVStatusFunc {basePath mode} { hsetprop $basePath/status/DetectorLowPressure units [lindex $replyText 17] hset $basePath/status/SampleLowPressure [lindex $replyText 19] - hsetprop $basePath/status/SampleLowPressure units [lindex $replyText 20] + hsetprop $basePath/status/SampleLowPressure units [lindex $replyText 20] hset $basePath/status/pressure5 [lindex $replyText 22] hsetprop $basePath/status/pressure5 units [lindex $replyText 23] @@ -174,7 +174,7 @@ proc ::scobj::hv::rdHVStatusFunc {basePath mode} { [lindex $replyText 4] [lindex $replyText 3]" if {[string equal [hval $basePath/dataRecording] "ON"] == 1} { - debug_log $logdata + debug_log $logdata } } elseif {$mode == "config"} { @@ -202,14 +202,14 @@ proc ::scobj::hv::rdHVStatusFunc {basePath mode} { ## # @brief Make a HV Controller -# -# @param argList, {name "hv" IP localhost PORT 65123 tuning 1 interval 1} +# +# @param argList, {name "hv" IP localhost PORT 65123 tuning 1 interval 1} # # name: name of hv controller object # IP: IP address of RF generator moxa box # PORT: Port number assigned to the generator on the moxa-box # tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions -# interval: polling and ramping interval in seconds. +# interval: polling and ramping interval in seconds. proc ::scobj::hv::mkHV {argList} { # Generate parameter array from the argument list @@ -222,7 +222,7 @@ proc ::scobj::hv::mkHV {argList} { sicslist setatt $pa(NAME) klass instrument sicslist setatt $pa(NAME) long_name $pa(NAME) - set hvPath /sics/$pa(NAME) + set hvPath /sics/$pa(NAME) foreach {hPath type priv datatype init } { msg plain user text UNKNOW @@ -236,7 +236,7 @@ proc ::scobj::hv::mkHV {argList} { status/SampleLowPressure plain user float 0 status/pressure5 plain user float 0 status/pressure6 plain user float 0 - + status/state plain user text UNKNOW status/PLC-S plain user text UNKNOW status/PLC-H plain user text UNKNOW @@ -254,9 +254,9 @@ proc ::scobj::hv::mkHV {argList} { hset $hvPath/$hPath $init } - hsetprop $hvPath/status oldval UNKNOWN + hsetprop $hvPath/status oldval UNKNOWN hsetprop $hvPath/config oldval UNKNOWN - + #makesctcontroller sct_hv rfamp $pa(IP):$pa(PORT) makesctcontroller sct_hv std $pa(IP):$pa(PORT) @@ -400,7 +400,7 @@ proc set_data_record {args} { "on" {hset /instrument/hv/dataRecording "ON"} "OFF" {hset /instrument/hv/dataRecording "OFF"} "off" {hset /instrument/hv/dataRecording "OFF"} - default {error "ERROR: please enter 'on' or 'off' to set the switch"} + default {error "ERROR: please enter 'on' or 'off' to set the switch"} } } diff --git a/site_ansto/instrument/pelican/config/motors/motor_configuration.tcl b/site_ansto/instrument/pelican/config/motors/motor_configuration.tcl index f67d0848..c41d600d 100644 --- a/site_ansto/instrument/pelican/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/pelican/config/motors/motor_configuration.tcl @@ -49,7 +49,7 @@ set momc_Home 2302 set mphi_Home 8389950 set mchi_Home 8383096 set mx_Home 8390604 -set my_Home 8391084 +set my_Home 8391084 set mom_Home 8389414 set rco_Home 33531098 @@ -256,7 +256,7 @@ mtth Creep_Precision 0.005000 # Motor Controller 2 # Motor Controller 2 ############################ -# +# # mc2: Slits Set AB1- (After Beryllium Filter) (2 blades and 1 Motor & Encoder set) set sv1StepRate [expr { 25000 / 0.635 / 2.0 }] @@ -411,7 +411,7 @@ scor home 180 # Motor Controller 3 # Motor Controller 3 ############################ -# +# # ROTATION STAGES 120:1 PLUS GEARBOX 8:1 # ROTATION STAGE RESOLVER 360:55 @@ -423,7 +423,7 @@ scor home 180 # 1 unit here is 1 degree set monoRotateStepsPerUnit [expr 25000.0*8.0*120.0/360.0] -# Encode reading at the roation, 1 unit here is 1 degree +# Encode reading at the roation, 1 unit here is 1 degree set MonoRotateCntsPerUnit [expr 4096.0*360.0/55.0/360.0] # Setup Focus range as min = 0 and max = 1, working range = 0 to 1 (310 degrees) @@ -442,7 +442,7 @@ set monoFocusMaxSpeed 0.083 # Precision setting turn/move, or 310*turn/move (degrees) set monoFocusprecision 0.001 -# mc3: Monochromator Focusing 1 - Focus +# mc3: Monochromator Focusing 1 - Focus Motor mra $motor_driver_type [params \ asyncqueue mc3\ host mc3-pelican\ @@ -463,7 +463,7 @@ Motor mra $motor_driver_type [params \ mra speed $monoFocusSpeed mra accel $monoFocusSpeed mra decel $monoFocusSpeed -mra part crystal +mra part crystal mra long_name mra mra softlowerlim 0 mra softupperlim 1 @@ -598,7 +598,7 @@ momc home -45 # Motor Controller 4 # Motor Controller 4 ############################ -# +# # mc4: Monochromator crystal stages tilt stage - G270 set mphiStepRate -25000 @@ -618,7 +618,7 @@ Motor mphi $motor_driver_type [params \ absEnc 1\ absEncHome $mphi_Home\ cntsPerX -4096] -mphi part crystal +mphi part crystal mphi long_name mphi mphi softlowerlim -2 mphi softupperlim 2 @@ -702,7 +702,7 @@ my softupperlim 10 my home 0 my speed 1.0 -# mc4: Monochromator crystal stages Rotation stage - R275 +# mc4: Monochromator crystal stages Rotation stage - R275 set momStepRate 12500 Motor mom $motor_driver_type [params \ @@ -733,7 +733,7 @@ mom home 0 # Motor Controller 6 # Motor Controller 6 ############################ -# +# # mc6: Radial Collimator -- Oscillator set rcoStepRate [expr { (1200.26 / 60.0) * (25000.0 / 360.0) * 49.0 }] diff --git a/site_ansto/instrument/pelican/config/plc/plc.tcl b/site_ansto/instrument/pelican/config/plc/plc.tcl index b3d685ba..10635f3f 100644 --- a/site_ansto/instrument/pelican/config/plc/plc.tcl +++ b/site_ansto/instrument/pelican/config/plc/plc.tcl @@ -1,5 +1,5 @@ set sim_mode [SplitReply [plc_simulation]] -if {$sim_mode == "false"} { +if {$sim_mode == "false"} { # MakeAsyncQueue plc_chan SafetyPLC 137.157.204.79 31001 # MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/pelican/pelican_configuration.tcl b/site_ansto/instrument/pelican/pelican_configuration.tcl index 917e4aff..35a66031 100644 --- a/site_ansto/instrument/pelican/pelican_configuration.tcl +++ b/site_ansto/instrument/pelican/pelican_configuration.tcl @@ -4,9 +4,9 @@ # Added run and drive wrappers which set the target speed to an allowed speed # for fermi motors. -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument pelican +Instrument pelican Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/qld/hpaths.tcl b/site_ansto/instrument/qld/hpaths.tcl index e3d3ba27..54179df1 100644 --- a/site_ansto/instrument/qld/hpaths.tcl +++ b/site_ansto/instrument/qld/hpaths.tcl @@ -1,5 +1,5 @@ set hpaths [list \ -/slits /slits/1 /slits/2] +/slits /slits/1 /slits/2] # Maps devices (eg motors) to hipadaba paths. array set motor_hpath [list \ diff --git a/site_ansto/instrument/qld/koala_configuration.tcl b/site_ansto/instrument/qld/koala_configuration.tcl index 476a6bc9..9a71ad81 100644 --- a/site_ansto/instrument/qld/koala_configuration.tcl +++ b/site_ansto/instrument/qld/koala_configuration.tcl @@ -11,8 +11,8 @@ source server_config.tcl ######################################## # INSTRUMENT SPECIFIC CONFIGURATION -VarMake Instrument Text Internal -Instrument Koala +VarMake Instrument Text Internal +Instrument Koala Instrument lock diff --git a/site_ansto/instrument/reflectometer/config/anticollider/anticollider.tcl b/site_ansto/instrument/reflectometer/config/anticollider/anticollider.tcl index db8cb21a..85a5de00 100644 --- a/site_ansto/instrument/reflectometer/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/reflectometer/config/anticollider/anticollider.tcl @@ -1,6 +1,6 @@ # 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 proc ::anticollider::enable {args} { diff --git a/site_ansto/instrument/reflectometer/config/beamline/sct_RFGen.tcl b/site_ansto/instrument/reflectometer/config/beamline/sct_RFGen.tcl index dc29bcef..a2603048 100644 --- a/site_ansto/instrument/reflectometer/config/beamline/sct_RFGen.tcl +++ b/site_ansto/instrument/reflectometer/config/beamline/sct_RFGen.tcl @@ -14,7 +14,7 @@ # tuning 1 # currtol 1 # interval 2 -# } +# } # # NOTE: # If tuning=1 this will generate xxx/set_current and xxx/set_frequency @@ -31,7 +31,7 @@ # voltage increases to 34 Vem and the current decreases; # " switch off the RF output; # " decrease current setting by rotating the potentiometer 10 turns counter-clockwise; -# " verify the vacuum level in the tank and restart the flipper operation only if it is below 0.01 mbar. +# " verify the vacuum level in the tank and restart the flipper operation only if it is below 0.01 mbar. namespace eval ::scobj::rfgen { # Control states @@ -118,7 +118,7 @@ proc ::scobj::rfgen::set_current {basePath} { variable RAMPSTART set newCurr [sct target] - + set current [expr {round(10.0 * $newCurr)}] hsetprop $basePath targetCurr $current hsetprop $basePath opCurr $current @@ -135,7 +135,7 @@ proc ::scobj::rfgen::set_frequency {basePath} { variable RAMPSTART set newFreq [sct target] - + hsetprop $basePath targetFreq $newFreq hsetprop $basePath opFreq $newFreq hsetprop $basePath ramping $RAMPSTART @@ -186,11 +186,11 @@ proc ::scobj::rfgen::rdStatFunc {} { set statList [join $temp] mkStatArr stateArr $statList - if {$statList != [sct oldStateRep]} { + if {$statList != [sct oldStateRep]} { hset $basePath/flip_current [expr {$stateArr(curr) / 10.0}] - hset $basePath/flip_frequency $stateArr(freq) - hset $basePath/flip_voltage $stateArr(voltage) - hset $basePath/flip_on $stateArr(O) + hset $basePath/flip_frequency $stateArr(freq) + hset $basePath/flip_voltage $stateArr(voltage) + hset $basePath/flip_on $stateArr(O) hset $basePath/state_report $statList sct update $statList sct utime updatetime @@ -209,10 +209,10 @@ proc ::scobj::rfgen::rdStatFunc {} { ## # @brief State transition function proc ::scobj::rfgen::stateFunc {} { - variable RAMPIDLE - variable RAMPSTOP + variable RAMPIDLE + variable RAMPSTOP variable RAMPSTART - variable RAMPBUSY + variable RAMPBUSY variable RAMPTOZERO variable FLIPOFF variable MAXVOLTAGE @@ -223,7 +223,7 @@ proc ::scobj::rfgen::stateFunc {} { mkStatArr stateArr [hval $basePath/state_report] set currControlStatus [sct status] - + switch $currSuperState [ subst -nocommands { $RAMPSTART { # broadcast RAMPSTART @@ -328,8 +328,8 @@ proc ::scobj::rfgen::rampFunc {} { ## # @brief Make an RF generator control object -# -# @param argList, {name "analyser" address "1" opCurr 68 opFreq 241 IP localhost PORT 65123 tuning 0 interval 1} +# +# @param argList, {name "analyser" address "1" opCurr 68 opFreq 241 IP localhost PORT 65123 tuning 0 interval 1} # # name: name of RF generator object # address: address assigned to RF generator 1-9 @@ -360,7 +360,7 @@ proc ::scobj::rfgen::mkRFGen {argList} { hfactory /sics/$pa(NAME)/flip_voltage plain internal int hfactory /sics/$pa(NAME)/flip_on plain internal int - hsetprop /sics/$pa(NAME) read ::scobj::rfgen::rqStatFunc + hsetprop /sics/$pa(NAME) read ::scobj::rfgen::rqStatFunc hsetprop /sics/$pa(NAME) rdState ::scobj::rfgen::rdStatFunc hsetprop /sics/$pa(NAME) stateChange ::scobj::rfgen::stateFunc hsetprop /sics/$pa(NAME) ramp ::scobj::rfgen::rampFunc @@ -404,9 +404,9 @@ proc ::scobj::rfgen::mkRFGen {argList} { makesctcontroller $SCT_RFGEN rfamp $pa(IP):$pa(PORT) hsetprop /sics/$pa(NAME) contname $SCT_RFGEN # mkStatArr stateArr [split [$SCT_RFGEN transact "L:$pa(ADDRESS)"] "|="] - + hset /sics/$pa(NAME)/flip_current 0 - hset /sics/$pa(NAME)/flip_frequency $pa(OPFREQ) + hset /sics/$pa(NAME)/flip_frequency $pa(OPFREQ) hset /sics/$pa(NAME)/flip_voltage 0 hset /sics/$pa(NAME)/flip_on 0 hsetprop /sics/$pa(NAME) targetFreq $pa(OPFREQ) diff --git a/site_ansto/instrument/reflectometer/config/chopper/sct_chopper.tcl b/site_ansto/instrument/reflectometer/config/chopper/sct_chopper.tcl index f1758ef0..f20aa422 100644 --- a/site_ansto/instrument/reflectometer/config/chopper/sct_chopper.tcl +++ b/site_ansto/instrument/reflectometer/config/chopper/sct_chopper.tcl @@ -154,7 +154,7 @@ proc rdPwdAck {} { return NXTCHOPPER } } message ] - handle_exception $catch_status $message + handle_exception $catch_status $message } # Create chopper control @@ -175,7 +175,7 @@ proc rdPwdAck {} { hfactory $chopperPath/device_error plain spy text hset $chopperPath/device_error "" - + # Must be set by user hfactory $chopperPath/geometry plain spy none hfactory $chopperPath/geometry/position plain spy none @@ -186,7 +186,7 @@ proc rdPwdAck {} { hfactory $chopperPath/geometry/position/ChopperPosZ plain user float hsetprop $chopperPath/geometry/position/ChopperPosZ units "mm" hfactory $chopperPath/geometry/position/ChopperCoordScheme plain user text - + # Setup nodes for state report parameters foreach ch {"ch1" "ch2" "ch3" "ch4"} { hfactory $chopperPath/$ch plain spy none diff --git a/site_ansto/instrument/reflectometer/config/commands/commands.tcl b/site_ansto/instrument/reflectometer/config/commands/commands.tcl index 4d2684e8..2342f8b4 100644 --- a/site_ansto/instrument/reflectometer/config/commands/commands.tcl +++ b/site_ansto/instrument/reflectometer/config/commands/commands.tcl @@ -26,7 +26,7 @@ namespace eval beam { ::beam::attenuator -addfb text BeamAttenuator namespace eval exp_mode { - variable valid_modes + variable valid_modes variable guide_for_mode ;#guide element for a specific mode variable c1ht_pos #0=polarisation @@ -37,9 +37,9 @@ namespace eval exp_mode { variable c1ht_pos set valid_modes [list SB DB FOC MT POL POLANAL] set c1ht_pos [list 1057 806.7 557.1 320 68.9 68.9] - + command set_mode "text=[join $valid_modes ,] arg " { ;#need to change all softzero's - global ::exp_mode::valid_modes + global ::exp_mode::valid_modes if {[lsearch $::exp_mode::valid_modes $arg] == -1} { Clientput "Mode is: $::exp_mode::valid_modes - (POL, POLANAL, MT, FOC, DB, SB)" return -code error "Mode is: $::exp_mode::valid_modes - (polarisation, polarisation and analysis, mt,focussing,DB,single)" @@ -54,17 +54,17 @@ namespace eval exp_mode { twotheta -1 return -code ok } - - + + proc ::exp_mode::omega_2theta { arg1 arg2 {s1vg 0} {s2vg 0} {s3vg 0} {s4vg 0}} { #need to set omega first. This is because #for Single bounce the twotheta positions depend on the angle of incidence # whenever omega_2theta is called, or the mode is changed, the slits should close # this is to save the detector from being overloaded. -# the following line does the job. However, it is duplicated when the mode is set in +# the following line does the job. However, it is duplicated when the mode is set in # set_omega, so it is commented out for now. -# drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0 +# drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0 # if {[catch {::exp_mode::set_omega $arg1} errMsg]} {return -code error $errMsg} # if {[catch {::exp_mode::set_two_theta $arg2} errMsg]} {return -code error $errMsg} @@ -72,21 +72,21 @@ proc ::exp_mode::omega_2theta { arg1 arg2 {s1vg 0} {s2vg 0} {s3vg 0} {s4vg 0}} { twotheta $arg2 if {![string is double $arg1] || ![string is double $arg2]} { return -code error "omega and two theta should be a proper number" - } + } statemon start om2th if {[catch { ::exp_mode::set_omega $arg1 ::exp_mode::set_two_theta $arg2 } errMsg ] } { omega -1 - twotheta -1 + twotheta -1 broadcast ERROR: omega_2theta command did not complete correctly - broadcast $errMsg + broadcast $errMsg return -code error $errMsg } if {![string is double $s1vg] || ![string is double $s2vg] || ![string is double $s3vg] || ![string is double $s4vg]} { return -code error "ERROR: all the slit openings need to be numbers" - } + } drive ss1u [expr 0.5 * $s1vg] ss1d [expr -0.5 * $s1vg] ss2u [expr 0.5 * $s2vg] ss2d [expr -0.5 * $s2vg] ss3u [expr 0.5 * $s3vg] ss3d [expr -0.5 * $s3vg] ss4u [expr 0.5 * $s4vg] ss4d [expr -0.5*$s4vg] statemon stop om2th return -code ok @@ -102,7 +102,7 @@ proc ::exp_mode::set_guide_element { arg } { global ::exp_mode::c1ht_pos global ::exp_mode::valid_modes - drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0 + drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0 if {[lsearch $::exp_mode::valid_modes $arg] == -1} { Clientput "Mode is: $::exp_mode::valid_modes - (polarisation, polarisation and analysis, mt, focussing, DB, single)" return -code error "Mode is: $::exp_mode::valid_modes - (polarisation,polarisation and analysis, mt, focussing, DB, single)" @@ -112,9 +112,9 @@ proc ::exp_mode::set_guide_element { arg } { return -code error $errMsg } else { guide_element $arg - return -code ok + return -code ok } -} +} proc ::exp_mode::set_omega { arg } { set expmode [SplitReply [mode]] @@ -154,17 +154,17 @@ proc ::exp_mode::set_omega { arg } { ;#offset is the vertical drop from the beam centre onto the middle of the second compound mirror ;# each compound mirror is 600mm long ;# therefore the distance between the place where the beam hits the centre of both mirrors is - ;# 2 * 300 * cos(1.2) = 599.868 - + ;# 2 * 300 * cos(1.2) = 599.868 + ;# guide2_distance is therefore the distance from the midpoint of the second compound mirror to chopper disc 1. ;# i.e. sample-> midpoint of compound mirror2 = 1546 + 300*cos3.6 = 1845.4 - - set offset [expr 599.868*sin($temp)] + + set offset [expr 599.868*sin($temp)] set arg 4.8 ;#fixed angle - + set d1 [expr [SplitReply [slit3_distance]] - [SplitReply [guide2_distance]]] set d2 [expr [SplitReply [sample_distance]] - [SplitReply [guide2_distance]]] - set h1 [expr -1. * $d1 * tan($argrad) - $offset] + set h1 [expr -1. * $d1 * tan($argrad) - $offset] set h2 [expr -1. * $d2 * tan($argrad) - $offset] if { [catch {checkMotionAndDrive st3vt $h1} errMsg]} {return -code error $errMsg} @@ -208,20 +208,20 @@ proc ::exp_mode::set_omega { arg } { drive sth $arg st3vt 0 } default { - return -code error "omega driving not specified for that mode" + return -code error "omega driving not specified for that mode" } } return -code ok } publish ::exp_mode::set_omega user - + proc ::exp_mode::set_two_theta { arg } { set expmode [SplitReply [mode]] set expomega [SplitReply [omega]] if {[lsearch $::exp_mode::valid_modes $expmode] == -1} { - return -code error "please set the mode and omega first" + return -code error "please set the mode and omega first" } if {$expomega == "NaN"} { return -code error "please set omega first" @@ -248,14 +248,14 @@ proc ::exp_mode::set_two_theta { arg } { set h3 [expr -1. * $d4 * tan($omegarad)] set b [expr $d3 / cos($omegarad)] set c [expr $d3 / cos($argrad-$omegarad)] - set h4 [expr sqrt(pow($b,2) + pow($c,2) - 2*$b*$c*cos($argrad))] + set h4 [expr sqrt(pow($b,2) + pow($c,2) - 2*$b*$c*cos($argrad))] if { [catch {isszst4vtsafe st4vt [expr $h2 + $h1]} errMsg]} {return -code error $errMsg} if { [catch {checkMotionAndDrive st4vt [expr $h2 + $h1]} errMsg]} {return -code error $errMsg} if { [catch {checkMotionAndDrive dz [expr $h3 + $h4]} errMsg]} {return -code error $errMsg} } DB { ;#checked ARJN 081231 set temp [deg2rad 2.4] - set offset [expr 599.868*sin($temp)] + set offset [expr 599.868*sin($temp)] set expomega 4.8 set omegarad [deg2rad $expomega] @@ -272,7 +272,7 @@ proc ::exp_mode::set_two_theta { arg } { set h3 [expr -1. * $d4 * tan($omegarad) - $offset] set b [expr $d3 / cos($omegarad)] set c [expr $d3 / cos($argrad-$omegarad)] - set h4 [expr sqrt(pow($b,2) + pow($c,2) - 2*$b*$c*cos($argrad))] + set h4 [expr sqrt(pow($b,2) + pow($c,2) - 2*$b*$c*cos($argrad))] if { [catch {isszst4vtsafe st4vt [expr $h2 + $h1]} errMsg]} {return -code error $errMsg} if { [catch {checkMotionAndDrive st4vt [expr $h2 + $h1]} errMsg]} {return -code error $errMsg} if { [catch {checkMotionAndDrive dz [expr $h3 + $h4]} errMsg]} {return -code error $errMsg} @@ -288,7 +288,7 @@ proc ::exp_mode::set_two_theta { arg } { checkMotion dz $h1 } errMsg]} { return -code error $errMsg - } + } drive st4vt $h2 dz $h1 } MT { @@ -302,7 +302,7 @@ proc ::exp_mode::set_two_theta { arg } { checkMotion dz $h1 } errMsg ] } { return -code error $errMsg - } + } drive st4vt $h2 dz $h1 } POL { @@ -316,7 +316,7 @@ proc ::exp_mode::set_two_theta { arg } { checkMotion dz $h1 } errMsg ] } { return -code error $errMsg - } + } drive st4vt $h2 dz $h1 analz -200 analtilt 0 } POLANAL { @@ -335,7 +335,7 @@ proc ::exp_mode::set_two_theta { arg } { checkMotion analtilt $ang1 } errMsg ] } { return -code error $errMsg - } + } drive st4vt $h2 dz $h1 analz $h3 analtilt $ang1 } default { @@ -350,14 +350,14 @@ proc ::exp_mode::checkMotion { scan_variable target } { set motor_list [sicslist type motor] if {[lsearch $motor_list $scan_variable]==-1} { - return -code error "you tried to drive a motor that doesn't exist" + return -code error "you tried to drive a motor that doesn't exist" } set softzero [SplitReply [$scan_variable softzero]] set absoluteTarget [expr $softzero+$target] if { [catch {isszst4vtsafe $scan_variable $target} errMsg]} {return -code error $errMsg} - if {[catch { + if {[catch { ::scan::check_limit $scan_variable hardlowerlim $absoluteTarget ::scan::check_limit $scan_variable hardupperlim $absoluteTarget ::scan::check_limit $scan_variable softlowerlim $target @@ -373,22 +373,22 @@ proc ::exp_mode::checkMotionAndDrive { scan_variable target } { set motor_list [sicslist type motor] #lappend motorlist [sicslist type configurablevirtualmotor] - set precision [SplitReply [$scan_variable precision]] + set precision [SplitReply [$scan_variable precision]] - if {[catch { + if {[catch { ::exp_mode::checkMotion $scan_variable $target }]} { return -code error $::errorInfo } else { drive $scan_variable $target - set position [SplitReply [$scan_variable]] + set position [SplitReply [$scan_variable]] if {[expr [expr $position-$target] > abs($precision)]} { return -code error "move of: $scan_variable did not reach required precision" } else { Clientput "New $scan_variable Position: $position" Clientput "Driving finished successfully" } - return -code ok + return -code ok } } publish ::exp_mode::checkMotionAndDrive user @@ -409,7 +409,7 @@ proc ::exp_mode::isszst4vtsafe { scan_variable target } { st4vt { set st4vtPosition [expr $target + $st4vtsoftzero] } - } + } set distance [expr $szHardUpperLim - $szPosition + $st4vtPosition ] if { $distance < 98. } { return -code error "You would have a collision between st4vt and sz if you tried to move $scan_variable to $target" diff --git a/site_ansto/instrument/reflectometer/config/counter/counter.tcl b/site_ansto/instrument/reflectometer/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/reflectometer/config/counter/counter.tcl +++ b/site_ansto/instrument/reflectometer/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/reflectometer/config/hipadaba/hpaths.tcl b/site_ansto/instrument/reflectometer/config/hipadaba/hpaths.tcl index 142374a0..70d7f6e1 100644 --- a/site_ansto/instrument/reflectometer/config/hipadaba/hpaths.tcl +++ b/site_ansto/instrument/reflectometer/config/hipadaba/hpaths.tcl @@ -1,4 +1,4 @@ -set hpaths [list experiment ] +set hpaths [list experiment ] # Maps devices (eg motors) to hipadaba paths. # obj name path diff --git a/site_ansto/instrument/reflectometer/config/hmm/detector.tcl b/site_ansto/instrument/reflectometer/config/hmm/detector.tcl index 17bcf370..d9d29c41 100644 --- a/site_ansto/instrument/reflectometer/config/hmm/detector.tcl +++ b/site_ansto/instrument/reflectometer/config/hmm/detector.tcl @@ -18,6 +18,6 @@ dhv1 upper 3000 evfactory new dhv2 nhq200 acq 2 dhv2 tolerance 5 dhv2 rate 25 -dhv2 upper 1500 +dhv2 upper 1500 #dhv2 lock } diff --git a/site_ansto/instrument/reflectometer/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/reflectometer/config/hmm/hmm_configuration.tcl index 10943be0..5de69c51 100644 --- a/site_ansto/instrument/reflectometer/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/reflectometer/config/hmm/hmm_configuration.tcl @@ -3,7 +3,7 @@ set sim_mode [SplitReply [hmm_simulation]] proc ::histogram_memory::init_OAT_TABLE {} { 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 OAT_TABLE X -setdata MAX_CHAN 421 OAT_TABLE Y -setdata MAX_CHAN 221 @@ -18,7 +18,7 @@ proc ::histogram_memory::init_OAT_TABLE {} { hmm configure fat_frame_frequency $freq hmm configure fat_frame_source EXTERNAL - OAT_TABLE -set X { -210.5 -209.5 } NXC 421 Y { -110.5 -109.5 } NYC 221 T { 0 40 } NTC 1000 + OAT_TABLE -set X { -210.5 -209.5 } NXC 421 Y { -110.5 -109.5 } NYC 221 T { 0 40 } NTC 1000 } message ] { if {$::errorCode=="NONE"} {return $message} return -code error $message @@ -86,7 +86,7 @@ proc ::histogram_memory::tochfreq {} { # @param tochfreq updates chopper status and then sets histmem frame frequency to match # the chopper frequency. # -# NOTE: If the chopper is stopped (ie freq=0) then the histogram frequency will be set to +# NOTE: If the chopper is stopped (ie freq=0) then the histogram frequency will be set to # 50Hz with an internal frame_source.\n # @see ::histogram_memory::set_frame_freq proc histmem {cmd args} { diff --git a/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl b/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl index 29863956..f313d300 100644 --- a/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/reflectometer/config/motors/motor_configuration.tcl @@ -27,15 +27,15 @@ set m1ro_home 134658 set bat_home 8308518 set st3vt_home 5250496 #set st3vt_home 8742250 - victim of the encoder rearrangement -set st4vt_home 6560460 +set st4vt_home 6560460 set sth_home 23541737 #set sphi_home 7548440 - victim of the NaN set sphi_home 7450470 set sx_home 8574000 set sy_home 7500000 set sz_home 8927484 -set dy_home 8694183 -set dz_home 7788617 +set dy_home 8694183 +set dz_home 7788617 #Measured or computed step rate for sz (Sample Raise) # Motor:25000/turn, gear:1/25, screw:5mm/turn @@ -325,7 +325,7 @@ Motor st4vt $motor_driver_type [params \ cntsPerX 8192] st4vt part slits.$slit4VGroup st4vt long_name st4vt -st4vt softlowerlim 1 +st4vt softlowerlim 1 st4vt softupperlim 247 st4vt home 0 st4vt backlash_offset -0.1 @@ -468,7 +468,7 @@ Motor sz $motor_driver_type [params \ absEncHome $sz_home\ cntsPerX $szCountRate] sz part sample -sz long_name translate_z +sz long_name translate_z sz softlowerlim 0 sz softupperlim 280.0 sz home 0 diff --git a/site_ansto/instrument/reflectometer/config/motors/sct_batmotor.tcl b/site_ansto/instrument/reflectometer/config/motors/sct_batmotor.tcl index cb881710..dea6cd1e 100644 --- a/site_ansto/instrument/reflectometer/config/motors/sct_batmotor.tcl +++ b/site_ansto/instrument/reflectometer/config/motors/sct_batmotor.tcl @@ -164,13 +164,13 @@ namespace eval ::scobj::galil { # Report the abstract status to GumTree hfactory $batpath/status plain user text - hsetprop $batpath/status read ${NS}::getStatus + hsetprop $batpath/status read ${NS}::getStatus hsetprop $batpath/status rdStatus ${NS}::rdStatus $batObjName hsetprop $batpath/status values busy,idle hsetprop $batpath/status oldval UNKNOWN hsetprop $batpath/status oldStatus UNKNOWN hset $batpath/status idle - + # Report the current position in encoder counts # Useful as an activity monitor and troubleshooting. hfactory $batpath/pos plain user int @@ -179,10 +179,10 @@ namespace eval ::scobj::galil { hsetprop $batpath/pos oldval UNKNOWN if {$sim_mode == "false"} { - sct_mc1 poll $batpath/pos - sct_mc1 poll $batpath/action - sct_mc1 poll $batpath/status - sct_mc1 write $batpath/action + sct_mc1 poll $batpath/pos + sct_mc1 poll $batpath/action + sct_mc1 poll $batpath/status + sct_mc1 write $batpath/action } # Set hipadaba properties for GumTree interface diff --git a/site_ansto/instrument/reflectometer/config/parameters/parameters.tcl b/site_ansto/instrument/reflectometer/config/parameters/parameters.tcl index fb53f515..33dd80bb 100644 --- a/site_ansto/instrument/reflectometer/config/parameters/parameters.tcl +++ b/site_ansto/instrument/reflectometer/config/parameters/parameters.tcl @@ -51,7 +51,7 @@ foreach vn { } foreach vn { - mode + mode guide_element } { ::utility::mkVar $vn Text manager $vn true parameter true true @@ -60,7 +60,7 @@ foreach vn { detector_distance 10000 detector_base 300 -anal_distance 6894.94 +anal_distance 6894.94 anal_base 20 slit4_distance 5331.15 slit4_base 20 @@ -69,14 +69,14 @@ sample_base 50 slit3_distance 4744.4 slit3_base 20 guide1_distance 2900.4 ;# distance measured to axis of rotation -guide1_base +guide1_base guide2_distance 3200 ;# distance measured to midpoint of the 2nd compound mirror (i.e. closest to the sample) guide2_base slit2_distance 1909.9 slit2_base 20 chopper4_distance 808 chopper4_base 20 -chopper4_phase_offset 14.465 +chopper4_phase_offset 14.465 chopper3_distance 359 chopper3_base 20 chopper3_phase_offset 14.59 diff --git a/site_ansto/instrument/reflectometer/config/plc/plc.tcl b/site_ansto/instrument/reflectometer/config/plc/plc.tcl index 8b462b08..bb464445 100644 --- a/site_ansto/instrument/reflectometer/config/plc/plc.tcl +++ b/site_ansto/instrument/reflectometer/config/plc/plc.tcl @@ -1,5 +1,5 @@ set sim_mode [SplitReply [plc_simulation]] -if {$sim_mode == "false"} { +if {$sim_mode == "false"} { MakeAsyncQueue plc_chan SafetyPLC 137.157.211.22 31001 MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/reflectometer/config/scan/scan.tcl b/site_ansto/instrument/reflectometer/config/scan/scan.tcl index 2d556950..5d51730f 100644 --- a/site_ansto/instrument/reflectometer/config/scan/scan.tcl +++ b/site_ansto/instrument/reflectometer/config/scan/scan.tcl @@ -1,4 +1,4 @@ -source $cfPath(scan)/scan_common_1.tcl +source $cfPath(scan)/scan_common_1.tcl ::scan::runscan_reset_position true ## # @brief Make sure that the chopper is ready before starting a scan. @@ -6,7 +6,7 @@ source $cfPath(scan)/scan_common_1.tcl #proc ::scan::pre_hmm_scan_prepare {} { # if [catch {::histogram_memory::tochfreq} errmsg] { # return -code error $errmsg -# } +# } #} proc ::scan::isc_initialize {} { diff --git a/site_ansto/instrument/reflectometer/platypus_configuration.tcl b/site_ansto/instrument/reflectometer/platypus_configuration.tcl index f58a53aa..a43b0c8d 100644 --- a/site_ansto/instrument/reflectometer/platypus_configuration.tcl +++ b/site_ansto/instrument/reflectometer/platypus_configuration.tcl @@ -1,8 +1,8 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument platypus +Instrument platypus Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/rsd/config/anticollider/anticollider.tcl b/site_ansto/instrument/rsd/config/anticollider/anticollider.tcl index a0b86dc2..23ccb5ac 100644 --- a/site_ansto/instrument/rsd/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/rsd/config/anticollider/anticollider.tcl @@ -1,4 +1,4 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -source $cfPath(anticollider)/anticollider_common.tcl +source $cfPath(anticollider)/anticollider_common.tcl ::anticollider::loadscript acscript.txt diff --git a/site_ansto/instrument/rsd/config/counter/counter.tcl b/site_ansto/instrument/rsd/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/rsd/config/counter/counter.tcl +++ b/site_ansto/instrument/rsd/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/rsd/config/hipadaba/hpaths.tcl b/site_ansto/instrument/rsd/config/hipadaba/hpaths.tcl index 24a55468..a70a7a4d 100644 --- a/site_ansto/instrument/rsd/config/hipadaba/hpaths.tcl +++ b/site_ansto/instrument/rsd/config/hipadaba/hpaths.tcl @@ -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. # obj name path diff --git a/site_ansto/instrument/rsd/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/rsd/config/hmm/hmm_configuration.tcl index 7b0bbc12..8264301f 100644 --- a/site_ansto/instrument/rsd/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/rsd/config/hmm/hmm_configuration.tcl @@ -5,7 +5,7 @@ set sim_mode [SplitReply [hmm_simulation]] sicslist setatt sample_to_detector_distance units mm proc ::histogram_memory::init_OAT_TABLE {} { - # 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 OAT_TABLE X -setdata MAX_CHAN 421 OAT_TABLE Y -setdata MAX_CHAN 421 @@ -20,7 +20,7 @@ proc ::histogram_memory::init_OAT_TABLE {} { hmm configure fat_frame_frequency $freq hmm configure fat_frame_source EXTERNAL - OAT_TABLE -set X { -210.5 -209.5 } NXC 421 Y { -210.5 -209.5 } NYC 421 T { 0 20000 } NTC 1 + OAT_TABLE -set X { -210.5 -209.5 } NXC 421 Y { -210.5 -209.5 } NYC 421 T { 0 20000 } NTC 1 } proc ::histogram_memory::pre_count {} {} @@ -33,7 +33,7 @@ proc ::histogram_memory::is_select_read_type {type} { # Instrument specific X and Y dimension names variable INST_NXC variable INST_NYC - + if [catch { $HMOBJ configure read_data_period_number 0 @@ -50,7 +50,7 @@ proc ::histogram_memory::is_select_read_type {type} { $HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]] $HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]] $HMOBJ configure READ_DATA_UNCAL_CAL CALIBRATED - $HMOBJ configure READ_DATA_TYPE TOTAL_HISTOGRAM_XY + $HMOBJ configure READ_DATA_TYPE TOTAL_HISTOGRAM_XY set hmm_ext "_total_xy" } default { diff --git a/site_ansto/instrument/rsd/config/motors/euler_configuration.tcl b/site_ansto/instrument/rsd/config/motors/euler_configuration.tcl index d436e9ea..fdd8cbb5 100644 --- a/site_ansto/instrument/rsd/config/motors/euler_configuration.tcl +++ b/site_ansto/instrument/rsd/config/motors/euler_configuration.tcl @@ -11,13 +11,13 @@ set ephi_Home 26573867 set echi_Home 24224404 set eom_stepsPerX [expr -25000.0] -set eom_cntsPerX [expr 8192.0] +set eom_cntsPerX [expr 8192.0] set ephi_stepsPerX [expr 25000.0/2.0] -set ephi_cntsPerX [expr 8192.0/2.0] +set ephi_cntsPerX [expr 8192.0/2.0] set echi_stepsPerX [expr -25000.0/1.0] -set echi_cntsPerX [expr 8192.0/1.0] +set echi_cntsPerX [expr 8192.0/1.0] Motor eom $motor_driver_type [params \ asyncqueue mc4\ diff --git a/site_ansto/instrument/rsd/config/motors/motor_configuration.tcl b/site_ansto/instrument/rsd/config/motors/motor_configuration.tcl index 4105edf8..7fa6194b 100644 --- a/site_ansto/instrument/rsd/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/rsd/config/motors/motor_configuration.tcl @@ -382,7 +382,7 @@ Motor sx $motor_driver_type [params \ absEnc 1\ absEncHome $sx_Home\ cntsPerX [expr -8192.0/$sx_pitch]] -setHomeandRange -motor sx -home 0 -lowrange 250 -uprange 250 +setHomeandRange -motor sx -home 0 -lowrange 250 -uprange 250 sx speed 1.0 sx accel 1.0 sx decel 1.0 @@ -403,7 +403,7 @@ sx creep_offset 0.5 # to 4.999444939 after improved statistics # to 4.99930 after some headscratching # to 4.999610818 -# best accuracies so far with 4.999444939 +# best accuracies so far with 4.999444939 # set pitch to 4.9995324 (...24 added by ok for no good reason :-) # # change hw limits temporarily from -250...250 to -215...285, 4.1.2007 @@ -422,7 +422,7 @@ Motor sy $motor_driver_type [params \ absEnc 1\ absEncHome $sy_Home\ cntsPerX [expr -8192.0/$sy_pitch]] -setHomeandRange -motor sy -home 0 -lowrange 250 -uprange 250 +setHomeandRange -motor sy -home 0 -lowrange 250 -uprange 250 sy speed 1.0 sy accel 1.0 sy decel 1.0 @@ -563,11 +563,11 @@ Motor psho $motor_driver_type [params \ absenc 1\ absenchome $psho_home\ cntsPerX 8192] -psho speed 4 +psho speed 4 psho Backlash_offset -0.3 psho part slits psho long_name primary_psho -setHomeandRange -motor psho -home 0 -lowrange 0 -uprange 30 +setHomeandRange -motor psho -home 0 -lowrange 0 -uprange 30 # Primary Slit, position 0-150mm (Y-axis) Motor psp $motor_driver_type [params \ @@ -583,7 +583,7 @@ Motor psp $motor_driver_type [params \ absenc 1\ absenchome $psp_home\ cntsPerX -8192] -psp speed 4 +psp speed 4 psp Backlash_offset -0.3 psp part slits psp long_name primary_psp @@ -603,11 +603,11 @@ Motor psw $motor_driver_type [params \ absenc 1\ absenchome $psw_home\ cntsPerX -8192] -psw speed 4 -psw Backlash_offset 0.3 +psw speed 4 +psw Backlash_offset 0.3 psw part slits psw long_name primary_psw -setHomeandRange -motor psw -home 0 -lowrange 0 -uprange 30 +setHomeandRange -motor psw -home 0 -lowrange 0 -uprange 30 #-------------------------------------------------------- @@ -626,11 +626,11 @@ Motor ssho $motor_driver_type [params \ absenc 1\ absenchome $ssho_home\ cntsPerX 8192] -ssho speed 4 -ssho Backlash_offset -0.3 +ssho speed 4 +ssho Backlash_offset -0.3 ssho part slits ssho long_name secondary_ssho -setHomeandRange -motor ssho -home 0 -lowrange 0 -uprange 30 +setHomeandRange -motor ssho -home 0 -lowrange 0 -uprange 30 # Secondary Slit, position Motor ssp $motor_driver_type [params \ @@ -646,8 +646,8 @@ Motor ssp $motor_driver_type [params \ absenc 1\ absenchome $ssp_home\ cntsPerX -8192] -ssp speed 4 -ssp Backlash_offset -0.3 +ssp speed 4 +ssp Backlash_offset -0.3 ssp part slits ssp long_name secondary_ssp setHomeandRange -motor ssp -home 0 -lowrange 0 -uprange 220 @@ -668,7 +668,7 @@ setHomeandRange -motor ssp -home 0 -lowrange 0 -uprange 220 # cntsPerX 8192] #psh part slits #psh long_name primary_psh -#setHomeandRange -motor psh -home 0 -lowrange 0 -uprange 30 +#setHomeandRange -motor psh -home 0 -lowrange 0 -uprange 30 ## Secondary Slit, height #Motor ssh $motor_driver_type [params \ @@ -686,7 +686,7 @@ setHomeandRange -motor ssp -home 0 -lowrange 0 -uprange 220 # cntsPerX 8192] #ssh part slits #ssh long_name secondary_ssh -#setHomeandRange -motor ssh -home 0 -lowrange 0 -uprange 30 +#setHomeandRange -motor ssh -home 0 -lowrange 0 -uprange 30 #-------------------------------------------------------- diff --git a/site_ansto/instrument/rsd/config/motors/secondary_slit_configuration.tcl b/site_ansto/instrument/rsd/config/motors/secondary_slit_configuration.tcl index 955e283b..4e3b5492 100644 --- a/site_ansto/instrument/rsd/config/motors/secondary_slit_configuration.tcl +++ b/site_ansto/instrument/rsd/config/motors/secondary_slit_configuration.tcl @@ -14,8 +14,8 @@ Motor ssw $motor_driver_type [params \ absenc 1\ absenchome $ssw_home\ cntsPerX -8192] -ssw speed 4 -ssw Backlash_offset 0.3 +ssw speed 4 +ssw Backlash_offset 0.3 ssw part slits ssw long_name secondary_ssw setHomeandRange -motor ssw -home 0 -lowrange 0 -uprange 30 diff --git a/site_ansto/instrument/rsd/config/motors/tiny_black_euler_configuration.tcl b/site_ansto/instrument/rsd/config/motors/tiny_black_euler_configuration.tcl index ee097fd1..a592a4e5 100644 --- a/site_ansto/instrument/rsd/config/motors/tiny_black_euler_configuration.tcl +++ b/site_ansto/instrument/rsd/config/motors/tiny_black_euler_configuration.tcl @@ -12,23 +12,23 @@ set echi_Home 26192788 set eom_stepsPerX [expr -25000.0] -set eom_cntsPerX [expr 8192.0] +set eom_cntsPerX [expr 8192.0] set ephi_stepsPerX [expr -25000.0] set ephi_cntsPerX [expr 8192.0] set echi_stepsPerX [expr -25000.0] -set echi_cntsPerX [expr 8192.0] +set echi_cntsPerX [expr 8192.0] #set eom_stepsPerX [expr -25000.0] -#set eom_cntsPerX [expr 8192.0] +#set eom_cntsPerX [expr 8192.0] #set ephi_stepsPerX [expr 12500.0] #set ephi_cntsPerX [expr 4096.0] - + #set echi_stepsPerX [expr 25000.0] -#set echi_cntsPerX [expr -8192.0] +#set echi_cntsPerX [expr -8192.0] Motor eom $motor_driver_type [params \ diff --git a/site_ansto/instrument/rsd/config/plc/plc.tcl b/site_ansto/instrument/rsd/config/plc/plc.tcl index 3e8b4ad3..d12f39e9 100644 --- a/site_ansto/instrument/rsd/config/plc/plc.tcl +++ b/site_ansto/instrument/rsd/config/plc/plc.tcl @@ -1,5 +1,5 @@ set sim_mode [SplitReply [plc_simulation]] -if {$sim_mode == "false"} { +if {$sim_mode == "false"} { MakeAsyncQueue plc_chan SafetyPLC 137.157.211.21 31001 MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/rsd/hpaths.tcl b/site_ansto/instrument/rsd/hpaths.tcl index d9ca5031..9635c16a 100644 --- a/site_ansto/instrument/rsd/hpaths.tcl +++ b/site_ansto/instrument/rsd/hpaths.tcl @@ -1,6 +1,6 @@ set hpaths [list \ /sample /monochromator /slits \ -/slits/1 /slits/2 /detector ] +/slits/1 /slits/2 /detector ] # Maps devices (eg motors) to hipadaba paths. array set motor_hpath [list \ diff --git a/site_ansto/instrument/rsd/kowari_configuration.tcl b/site_ansto/instrument/rsd/kowari_configuration.tcl index e3c9ceca..dd71e99f 100644 --- a/site_ansto/instrument/rsd/kowari_configuration.tcl +++ b/site_ansto/instrument/rsd/kowari_configuration.tcl @@ -1,8 +1,8 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument kowari +Instrument kowari Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/sans/config/anticollider/anticollider.tcl b/site_ansto/instrument/sans/config/anticollider/anticollider.tcl index db8cb21a..85a5de00 100644 --- a/site_ansto/instrument/sans/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/sans/config/anticollider/anticollider.tcl @@ -1,6 +1,6 @@ # 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 proc ::anticollider::enable {args} { diff --git a/site_ansto/instrument/sans/config/beamline/sct_flipper.tcl b/site_ansto/instrument/sans/config/beamline/sct_flipper.tcl index 60d014e3..e9144e80 100644 --- a/site_ansto/instrument/sans/config/beamline/sct_flipper.tcl +++ b/site_ansto/instrument/sans/config/beamline/sct_flipper.tcl @@ -14,7 +14,7 @@ # tuning 1 # currtol 1 # interval 2 -# } +# } # # NOTE: # If tuning=1 this will generate flipper/set_current and flipper/set_frequency @@ -31,7 +31,7 @@ # voltage increases to 34 Vem and the current decreases; # " switch off the RF output; # " decrease current setting by rotating the potentiometer 10 turns counter-clockwise; -# " verify the vacuum level in the tank and restart the flipper operation only if it is below 0.01 mbar. +# " verify the vacuum level in the tank and restart the flipper operation only if it is below 0.01 mbar. namespace eval ::scobj::rfgen { # Control states @@ -118,7 +118,7 @@ proc ::scobj::rfgen::set_current {basePath} { variable RAMPSTART set newCurr [sct target] - + set current [expr {round(10.0 * $newCurr)}] hsetprop $basePath targetCurr $current hsetprop $basePath opCurr $current @@ -135,7 +135,7 @@ proc ::scobj::rfgen::set_frequency {basePath} { variable RAMPSTART set newFreq [sct target] - + hsetprop $basePath targetFreq $newFreq hsetprop $basePath opFreq $newFreq hsetprop $basePath ramping $RAMPSTART @@ -185,11 +185,11 @@ proc ::scobj::rfgen::rdStatFunc {} { set statList [join $temp] mkStatArr stateArr $statList - if {$statList != [sct oldStateRep]} { + if {$statList != [sct oldStateRep]} { hset $basePath/flip_current [expr {$stateArr(curr) / 10.0}] - hset $basePath/flip_frequency $stateArr(freq) - hset $basePath/flip_voltage $stateArr(voltage) - hset $basePath/flip_on $stateArr(O) + hset $basePath/flip_frequency $stateArr(freq) + hset $basePath/flip_voltage $stateArr(voltage) + hset $basePath/flip_on $stateArr(O) hset $basePath/state_report $statList sct update $statList sct utime readtime @@ -208,10 +208,10 @@ proc ::scobj::rfgen::rdStatFunc {} { ## # @brief State transition function proc ::scobj::rfgen::stateFunc {} { - variable RAMPIDLE - variable RAMPSTOP + variable RAMPIDLE + variable RAMPSTOP variable RAMPSTART - variable RAMPBUSY + variable RAMPBUSY variable RAMPTOZERO variable FLIPOFF variable MAXVOLTAGE @@ -222,7 +222,7 @@ proc ::scobj::rfgen::stateFunc {} { mkStatArr stateArr [hval $basePath/state_report] set currControlStatus [sct status] - + switch $currSuperState [ subst -nocommands { $RAMPSTART { # broadcast RAMPSTART @@ -320,8 +320,8 @@ proc ::scobj::rfgen::rampFunc {} { ## # @brief Make a spin flipper control object -# -# @param argList, {name "flipper" address "1" opCurr 68 opFreq 241 IP localhost PORT 65123 tuning 0 interval 1} +# +# @param argList, {name "flipper" address "1" opCurr 68 opFreq 241 IP localhost PORT 65123 tuning 0 interval 1} # # name: name of spin flipper object # address: address assigned to RF generator 1-9 @@ -352,7 +352,7 @@ proc ::scobj::rfgen::mkFlipper {argList} { hfactory /sics/$pa(NAME)/flip_voltage plain internal int hfactory /sics/$pa(NAME)/flip_on plain internal int - hsetprop /sics/$pa(NAME) read ::scobj::rfgen::rqStatFunc + hsetprop /sics/$pa(NAME) read ::scobj::rfgen::rqStatFunc hsetprop /sics/$pa(NAME) rdState ::scobj::rfgen::rdStatFunc hsetprop /sics/$pa(NAME) stateChange ::scobj::rfgen::stateFunc hsetprop /sics/$pa(NAME) ramp ::scobj::rfgen::rampFunc @@ -391,12 +391,12 @@ proc ::scobj::rfgen::mkFlipper {argList} { if {[SplitReply [rfgen_simulation]] == "false"} { makesctcontroller sct_rfgen rfamp $pa(IP):$pa(PORT) mkStatArr stateArr [split [sct_rfgen transact "L:$pa(ADDRESS)"] "|="] - + hset /sics/$pa(NAME)/flip_current [expr {$stateArr(curr) / 10.0}] - hset /sics/$pa(NAME)/flip_frequency $stateArr(freq) - hset /sics/$pa(NAME)/flip_voltage $stateArr(voltage) + hset /sics/$pa(NAME)/flip_frequency $stateArr(freq) + hset /sics/$pa(NAME)/flip_voltage $stateArr(voltage) hset /sics/$pa(NAME)/flip_on $stateArr(O) - hsetprop /sics/$pa(NAME) targetFreq $stateArr(freq) + hsetprop /sics/$pa(NAME) targetFreq $stateArr(freq) hsetprop /sics/$pa(NAME) targetCurr [expr {$stateArr(curr) / 10.0}] sct_rfgen poll /sics/$pa(NAME) $pa(INTERVAL) diff --git a/site_ansto/instrument/sans/config/commands/commands.tcl b/site_ansto/instrument/sans/config/commands/commands.tcl index f6a0a1cc..a93e217f 100644 --- a/site_ansto/instrument/sans/config/commands/commands.tcl +++ b/site_ansto/instrument/sans/config/commands/commands.tcl @@ -22,20 +22,20 @@ namespace eval motor { # (Xbbs, Zbbs) = beam pos in beamstop coords # (Xdf,Zdf) = detector pos in frame coords # (Xbsf,Zbsf) = beamstop pos in frame coords -# +# # (Xbf,Zbf) = (Xdf+Xbd, Zdf+Zbd) = (Xbsf+Xbbs, Zbsf+Zbbs) # Origin of detector coords = frame origin -# +# # Detector and beamstop motor readings with beamstop disk centers # overlapping over detector center mark. # Xdf = 264.542 (7283813) Zdf = 0 # Xbbs = 296.291 (8054270) # Zbbs = 259.641 (13488244) # Xbd = dethw, Zbd = (dethh) -# +# # 264.542+dethw = Xbsf+296.291 # 0+dethh = Zbsf+259.641 -# +# # Xbsf = -31.749 + dethw, Zbsf = -259.641 + dethh proc selbs {bs {bx "UNDEF"} {bz "UNDEF"}} { set bsdriving false @@ -153,7 +153,7 @@ namespace eval optics { VarMake ::optics::select::section text user VarMake ::optics::polarizer::in text user VarMake ::optics::lens::selection text user - + command rotary_attenuator {int=0,15,45,90,180 angle} { drive att $angle } @@ -180,7 +180,7 @@ namespace eval optics { # @param row, selects a row from the guide configuration table # # eg\n -# guide ga +# guide ga command guide " text=[join [array names ::optics::guide_configuration] , ] configuration " { @@ -193,7 +193,7 @@ namespace eval optics { foreach {compselection position} $guide_configuration($configuration) { foreach el $compselection guide $guide_configuration_columns { 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 set msg [eval "drive $to_config"] diff --git a/site_ansto/instrument/sans/config/counter/counter.tcl b/site_ansto/instrument/sans/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/sans/config/counter/counter.tcl +++ b/site_ansto/instrument/sans/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/sans/config/environment/environment.tcl b/site_ansto/instrument/sans/config/environment/environment.tcl index 34adedc4..d7d80329 100644 --- a/site_ansto/instrument/sans/config/environment/environment.tcl +++ b/site_ansto/instrument/sans/config/environment/environment.tcl @@ -35,14 +35,14 @@ switch [string tolower $envtemp] { puts "Configuring RHQC" # 9600 8 1 None None Enable add_sct_ls340 tc1 137.157.202.78 4001 "\r" 0.5 5.0 -# TODO Set controlsensor +# TODO Set controlsensor # if { [SplitReply [environment_simulation]] == "false"} { # tc1 controlsensor sensorB # } # puts "Added tc1 with [tc1 controlsensor]" # 9600 8 1 None None Enable add_sct_ls340 tc2 137.157.202.78 4002 "\r" 0.5 5.0 -# TODO Set controlsensor +# TODO Set controlsensor # if { [SplitReply [environment_simulation]] == "false"} { # tc2 controlsensor sensorD # } @@ -58,7 +58,7 @@ switch [string tolower $envtemp] { sicslist setatt temperature long_name temperature sicslist setatt temperature klass sample sicslist setatt temperature units K -# TODO Set controlsensor +# TODO Set controlsensor # tc1 controlsensor sensorA } #add_ips120 ips120 137.157.202.78 4004 0.001 @@ -125,7 +125,7 @@ switch [string tolower $envtemp] { sicslist setatt temperature long_name temperature sicslist setatt temperature klass sample sicslist setatt temperature units K -# TODO Set controlsensor +# TODO Set controlsensor # tc1 controlsensor sensorA } add_ips120 ips120 137.157.202.78 4004 0.001 diff --git a/site_ansto/instrument/sans/config/environment/temperature/lakeshore340.tcl b/site_ansto/instrument/sans/config/environment/temperature/lakeshore340.tcl index 31c49bbd..c1a0f367 100644 --- a/site_ansto/instrument/sans/config/environment/temperature/lakeshore340.tcl +++ b/site_ansto/instrument/sans/config/environment/temperature/lakeshore340.tcl @@ -14,7 +14,7 @@ source $cfPath(environment)/temperature/lakeshore340_common.tcl # @param settle, settling time in seconds # @param range, lakeshore range # @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} { variable tc_dfltPar 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 ::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} } } message ] { diff --git a/site_ansto/instrument/sans/config/goniometer/sct_goniometer.tcl b/site_ansto/instrument/sans/config/goniometer/sct_goniometer.tcl index a7162f14..0266fa63 100644 --- a/site_ansto/instrument/sans/config/goniometer/sct_goniometer.tcl +++ b/site_ansto/instrument/sans/config/goniometer/sct_goniometer.tcl @@ -1,5 +1,5 @@ ## -# @file Goniometer controller +# @file Goniometer controller # # Author: Jing Chen (jgn@ansto.gov.au) June 2010 # @@ -10,7 +10,7 @@ # PORT 62944 # tuning 1 # interval 1 -# } +# } # # NOTE: # If tuning=1 this will generate gom/set_gom, gchi/set_gchi and gphi/set_gphi @@ -25,14 +25,14 @@ proc ::scobj::goniometer::set_gom {basePath} { set newGOM [sct target] hsetprop $basePath targetGom $newGOM return idle -} - +} + proc ::scobj::goniometer::set_gchi {basePath} { set newGCHI [sct target] hsetprop $basePath targetGchi $newGCHI return idle -} - +} + proc ::scobj::goniometer::set_gphi {basePath} { set newGPHI [sct target] hsetprop $basePath targetGphi $newGPHI @@ -63,12 +63,12 @@ proc ::scobj::goniometer::rdStatFunc {basePath} { hset $basePath/gom $stateArr(gom) hset $basePath/gchi $stateArr(gchi) - hset $basePath/gphi $stateArr(gphi) + hset $basePath/gphi $stateArr(gphi) hsetprop $basePath currGom $stateArr(gom) hsetprop $basePath currGchi $stateArr(gchi) hsetprop $basePath currGphi $stateArr(gphi) - + #sct update $s3 sct utime readtime } @@ -110,21 +110,21 @@ proc ::scobj::goniometer::checkReplyFunc {} { broadcast "ERROR: PLC cannot write new values for variable due to internal reason!" } else { sct utime readtime - } - + } + return idle } ## # @brief Make a Goniometer controller -# -# @param argList, {name "goniometer" IP localhost PORT 62944 tuning 1 interval 1} +# +# @param argList, {name "goniometer" IP localhost PORT 62944 tuning 1 interval 1} # # name: name of goniometer controller object # IP: IP address of RF generator moxa box # PORT: Port number assigned to the generator on the moxa-box # tuning: boolean, set tuning=1 to allow instrument scientists to set the axe positions -# interval: polling and ramping interval in seconds. +# interval: polling and ramping interval in seconds. proc ::scobj::goniometer::mkGoniometer {argList} { # Generate parameter array from the argument list foreach {k v} $argList { diff --git a/site_ansto/instrument/sans/config/hipadaba/hpaths.tcl b/site_ansto/instrument/sans/config/hipadaba/hpaths.tcl index 142374a0..70d7f6e1 100644 --- a/site_ansto/instrument/sans/config/hipadaba/hpaths.tcl +++ b/site_ansto/instrument/sans/config/hipadaba/hpaths.tcl @@ -1,4 +1,4 @@ -set hpaths [list experiment ] +set hpaths [list experiment ] # Maps devices (eg motors) to hipadaba paths. # obj name path diff --git a/site_ansto/instrument/sans/config/hmm/detector_ordela.tcl b/site_ansto/instrument/sans/config/hmm/detector_ordela.tcl index 0fc20428..d9b45e66 100644 --- a/site_ansto/instrument/sans/config/hmm/detector_ordela.tcl +++ b/site_ansto/instrument/sans/config/hmm/detector_ordela.tcl @@ -38,7 +38,7 @@ proc ord_set_pot { potxy potnumber potvalue } { set rsp [ sct_dhv transact "p $potname $potvalue" ] # MJL sometimes the driver returns absolute bollocks, looks like strings from inside the TCL interpreter. # Under this condition, assume the write failed, although we can't really tell without reading back value, but don't bother. -# Just flag anything that's not 'ACK' as 'Bad' i.e. do retries. +# Just flag anything that's not 'ACK' as 'Bad' i.e. do retries. # clientput "Response:" $rsp if { $rsp != "ACK" } { set rsp "Bad" } } @@ -401,7 +401,7 @@ proc ord_calc_hist_mmm_xy { } { set span_y 190 set histogram_mean_x [expr double($histogram_mean_x) / double($span_x) ] set histogram_mean_y [expr double($histogram_mean_y) / double($span_y) ] - clientput "Calculated histogram means: mx =" $histogram_mean_x "and my =" $histogram_mean_y "(should be + clientput "Calculated histogram means: mx =" $histogram_mean_x "and my =" $histogram_mean_y "(should be roughly equal if bs window is square)." } Publish ord_calc_hist_mmm_xy User diff --git a/site_ansto/instrument/sans/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/sans/config/hmm/hmm_configuration.tcl index f13b11d2..8a619d2e 100644 --- a/site_ansto/instrument/sans/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/sans/config/hmm/hmm_configuration.tcl @@ -4,7 +4,7 @@ set sim_mode [SplitReply [hmm_simulation]] proc ::histogram_memory::init_OAT_TABLE {} { 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 OAT_TABLE X -setdata MAX_CHAN 192 OAT_TABLE Y -setdata MAX_CHAN 192 @@ -19,7 +19,7 @@ proc ::histogram_memory::init_OAT_TABLE {} { hmm configure fat_frame_frequency $freq hmm configure fat_frame_source INTERNAL - OAT_TABLE -set X { 191.5 190.5 } NXC 192 Y { -0.5 0.5 } NYC 192 T { 0 20000 } NTC 1 + OAT_TABLE -set X { 191.5 190.5 } NXC 192 Y { -0.5 0.5 } NYC 192 T { 0 20000 } NTC 1 } message ] { return -code error $message } diff --git a/site_ansto/instrument/sans/config/motors/positmotor_configuration.tcl b/site_ansto/instrument/sans/config/motors/positmotor_configuration.tcl index 9d6e2b69..2d4ac271 100644 --- a/site_ansto/instrument/sans/config/motors/positmotor_configuration.tcl +++ b/site_ansto/instrument/sans/config/motors/positmotor_configuration.tcl @@ -20,10 +20,10 @@ set 20sample_table { 6 203.7 7 161.7 8 119.7 - 9 77.7 - 10 35.7 - 11 -46.3 - 12 -88.3 + 9 77.7 + 10 35.7 + 11 -46.3 + 12 -88.3 13 -130.3 14 -172.3 15 -214.3 diff --git a/site_ansto/instrument/sans/config/optics/aperture_configuration.tcl b/site_ansto/instrument/sans/config/optics/aperture_configuration.tcl index d795ba10..024f427d 100644 --- a/site_ansto/instrument/sans/config/optics/aperture_configuration.tcl +++ b/site_ansto/instrument/sans/config/optics/aperture_configuration.tcl @@ -1,17 +1,17 @@ namespace eval optics { array set AttRotLookupTable { - 0 { 0.0 1 } - 30 { 1.3 0.498782 } - 60 { 3.3 0.176433 } - 90 { 4.9 0.0761367 } - 120 { 6.4 0.0353985 } - 150 { 8.3 0.0137137 } - 180 { 9.6 0.00614167 } - 210 {11.2 0.00264554 } - 240 {13.1 0.000994504 } - 270 {15.0 0.000358897 } - 300 {18.0 7.2845e-05 } - 330 {25.0 1.67827e-06 } + 0 { 0.0 1 } + 30 { 1.3 0.498782 } + 60 { 3.3 0.176433 } + 90 { 4.9 0.0761367 } + 120 { 6.4 0.0353985 } + 150 { 8.3 0.0137137 } + 180 { 9.6 0.00614167 } + 210 {11.2 0.00264554 } + 240 {13.1 0.000994504 } + 270 {15.0 0.000358897 } + 300 {18.0 7.2845e-05 } + 330 {25.0 1.67827e-06 } } array set EApLookupTable { diff --git a/site_ansto/instrument/sans/config/optics/guide_configuration.tcl b/site_ansto/instrument/sans/config/optics/guide_configuration.tcl index a66f2b84..a7796221 100644 --- a/site_ansto/instrument/sans/config/optics/guide_configuration.tcl +++ b/site_ansto/instrument/sans/config/optics/guide_configuration.tcl @@ -1,5 +1,5 @@ ## -# @file +# @file # A guide configuration table where each line describes the setup # for a mode of operation. # The table will have a corresponding interpretation list which provides @@ -7,7 +7,7 @@ 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) array set c1_map {G 1 MT 2 P 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} # 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) # 2. The entrance aperature position in mm # 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 { - 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} - lp {{MT MT MT MT MT MT MT MT LP} 675} - lens {{MT A A A A A A A L } 675} - p1 {{P A MT MT MT MT MT MT MT} 4621} - p1lp {{P A MT MT MT MT MT MT LP} 4621} - p1lens {{P A MT MT MT MT MT MT L } 4621} - g1 {{G A A A A A A A A } 4929} - p2 {{P 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} - g3 {{G G G A A A A A A } 8949} - p4 {{P 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} - g5 {{G G G G G A A A A } 12943} - p6 {{P 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} - g7 {{G G G G G G G A A } 16971} - p8 {{P 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} - g9 {{G G G G G G G G G } 19925} + lp {{MT MT MT MT MT MT MT MT LP} 675} + lens {{MT A A A A A A A L } 675} + p1 {{P A MT MT MT MT MT MT MT} 4621} + p1lp {{P A MT MT MT MT MT MT LP} 4621} + p1lens {{P A MT MT MT MT MT MT L } 4621} + g1 {{G A A A A A A A A } 4929} + p2 {{P 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} + g3 {{G G G A A A A A A } 8949} + p4 {{P 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} + g5 {{G G G G G A A A A } 12943} + p6 {{P 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} + g7 {{G G G G G G G A A } 16971} + p8 {{P 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} + g9 {{G G G G G G G G G } 19925} } # This list maps the motor names to columns of the # guide_configuration table. set guide_configuration_columns { c1 c2 c3 c4 c5 c6 c7 c8 c9 -} +} } diff --git a/site_ansto/instrument/sans/config/parameters/parameters.tcl b/site_ansto/instrument/sans/config/parameters/parameters.tcl index 4c3ed007..b0b2289d 100644 --- a/site_ansto/instrument/sans/config/parameters/parameters.tcl +++ b/site_ansto/instrument/sans/config/parameters/parameters.tcl @@ -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 @@ -112,7 +112,7 @@ namespace eval parameters { set paramlist { AttFactor BSdiam - DetPosYOffset + DetPosYOffset EApPosY EApShape EApX @@ -121,8 +121,8 @@ namespace eval parameters { L1 L2 Plex - SamYOffset - Transmission + SamYOffset + Transmission } } ## @@ -144,9 +144,9 @@ proc ::parameters::missingparams {} { } ## -# @brief Check list +# @brief Check list proc check {args} { - switch $args { + switch $args { "missing" { ::parameters::missingparams } diff --git a/site_ansto/instrument/sans/config/plc/plc.tcl b/site_ansto/instrument/sans/config/plc/plc.tcl index df325317..e7896bcd 100644 --- a/site_ansto/instrument/sans/config/plc/plc.tcl +++ b/site_ansto/instrument/sans/config/plc/plc.tcl @@ -1,5 +1,5 @@ set sim_mode [SplitReply [plc_simulation]] -if {$sim_mode == "false"} { +if {$sim_mode == "false"} { MakeAsyncQueue plc_chan SafetyPLC 137.157.211.22 30001 MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/sans/config/velsel/sct_velsel.tcl b/site_ansto/instrument/sans/config/velsel/sct_velsel.tcl index c1e5e158..310905f8 100644 --- a/site_ansto/instrument/sans/config/velsel/sct_velsel.tcl +++ b/site_ansto/instrument/sans/config/velsel/sct_velsel.tcl @@ -44,7 +44,7 @@ namespace eval ::scobj::velocity_selector { proc AngleSpeedToWavelength {angle VsVarSpeed {velsel 0}} { variable nvs40Par - variable nvs43Par + variable nvs43Par variable velsel_ID if {$velsel == 40} { @@ -78,7 +78,7 @@ namespace eval ::scobj::velocity_selector { set lambda0 [expr ($m_dTwistAngle*60.0*$VNeutron)/(360.0*$m_dLength*$m_iMaxSpeed)] set pi [expr acos(-1)] # set pi = 3.14159265358979; - + set A [expr (2.0 * $rBeamCenter * $pi) / (60.0 * $VNeutron)] set angle_rad [expr ($angle * $pi) / 180.0] set lambda1 [expr ( tan($angle_rad)+($A * $m_iMaxSpeed * $lambda0) ) / ((-($A*$A) * $m_iMaxSpeed * $VsVarSpeed * $lambda0 * tan($angle_rad) )+($A * $VsVarSpeed))] @@ -88,7 +88,7 @@ namespace eval ::scobj::velocity_selector { proc WavelengthToSpeed {angle lambda1 {velsel 0}} { variable nvs40Par - variable nvs43Par + variable nvs43Par variable velsel_ID if {$velsel == 40} { @@ -122,7 +122,7 @@ namespace eval ::scobj::velocity_selector { set lambda0 [expr ($m_dTwistAngle*60.0*$VNeutron)/(360.0*$m_dLength*$m_iMaxSpeed)] set pi [expr acos(-1)] # set pi = 3.14159265358979; - + set A [expr (2.0 * $rBeamCenter * $pi) / (60.0 * $VNeutron)] set angle_rad [expr ($angle * $pi) / 180.0] set VsVarSpeed [expr ( tan($angle_rad)+($A * $m_iMaxSpeed * $lambda0) ) / ((-($A*$A) * $m_iMaxSpeed * $lambda1 * $lambda0 * tan($angle_rad) )+($A * $lambda1))] @@ -281,7 +281,7 @@ proc rdPwdAck {} { proc setSpeed {vs_root statuspath nextState} { variable paramindex - set speed [format "%5d" [sct target]] + set speed [format "%5d" [sct target]] sct send "N#SOS#SPEED $speed" set angle [lindex [hval $statuspath] $paramindex(ttang) end] @@ -300,7 +300,7 @@ proc rdPwdAck {} { } proc sendCommand {nextState} { - set state [string tolower [sct target]] + set state [string tolower [sct target]] switch $state { "idle" { sct send "N#SOS#IDLE " @@ -392,12 +392,12 @@ proc get_nearest_allowed_speed {speed} { ## # @brief This will check if the requested speed is allowed - proc checkBlockedSpeeds {statuspath} { + proc checkBlockedSpeeds {statuspath} { variable paramindex set speed [sct target] set ttang [lindex [hval $statuspath] $paramindex(ttang) end] - if {$ttang > 90} { + if {$ttang > 90} { error "ERROR: You must first initialise the turntable" } @@ -411,7 +411,7 @@ proc checkBlockedWavelengths {statuspath} { set lambda [sct target] set ttang [lindex [hval $statuspath] $paramindex(ttang) end] - if {$ttang > 90} { + if {$ttang > 90} { error "ERROR: You must first initialise the turntable" } set angle [lindex [hval $statuspath] $paramindex(ttang) end] @@ -457,7 +457,7 @@ proc halt {root} { set angle [lindex [hval $statuspath] $paramindex(ttang) end] set speed [WavelengthToSpeed $angle $lambda] - set fmtspeed [format "%5d" $speed] + set fmtspeed [format "%5d" $speed] sct send "N#SOS#SPEED $fmtspeed" sct target $lambda hsetprop $vs_root/setspeed target $fmtspeed @@ -497,7 +497,7 @@ proc halt {root} { hsetprop $velselPath/status values busy,idle hfactory $velselPath/device_error plain spy text hset $velselPath/device_error "" - + # Must be set by user hfactory $velselPath/wavelength plain user float hsetprop $velselPath/wavelength permlink data_set @@ -512,7 +512,7 @@ proc halt {root} { hfactory $velselPath/geometry/position/VelSelPosZ plain user float hsetprop $velselPath/geometry/position/VelSelPosZ units "mm" hfactory $velselPath/geometry/position/VelSelCoordScheme plain user text - + # Setup nodes for state report parameters foreach par [lsort [array names paramindex]] { hfactory $velselPath/$par plain spy $paramtype($par) @@ -635,7 +635,7 @@ proc halt {root} { hset $velselPath/geometry/position/VelSelPosY 0.0 hset $velselPath/geometry/position/VelSelPosZ 0.0 hset $velselPath/geometry/position/VelSelCoordScheme "Cartesian" - + proc sct_velsel_init {velselPath } { @@ -658,7 +658,7 @@ proc halt {root} { makesctcontroller sct_velsel astvelsel $velsel_IP:$velsel_port "" 10 sct_velsel poll $statusPath $pollrate } - namespace export AngleSpeedToWavelength + namespace export AngleSpeedToWavelength namespace export WavelengthToSpeed } namespace import ::scobj::velocity_selector::AngleSpeedToWavelength diff --git a/site_ansto/instrument/sans/quokka_configuration.tcl b/site_ansto/instrument/sans/quokka_configuration.tcl index eb087477..0983dbf7 100644 --- a/site_ansto/instrument/sans/quokka_configuration.tcl +++ b/site_ansto/instrument/sans/quokka_configuration.tcl @@ -1,8 +1,8 @@ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument quokka +Instrument quokka Instrument lock #START SERVER CONFIGURATION SECTION diff --git a/site_ansto/instrument/tas/config/anticollider/anticollider.tcl b/site_ansto/instrument/tas/config/anticollider/anticollider.tcl index db8cb21a..85a5de00 100644 --- a/site_ansto/instrument/tas/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/tas/config/anticollider/anticollider.tcl @@ -1,6 +1,6 @@ # 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 proc ::anticollider::enable {args} { diff --git a/site_ansto/instrument/tas/config/counter/counter.tcl b/site_ansto/instrument/tas/config/counter/counter.tcl index 4f7e802b..58a94083 100644 --- a/site_ansto/instrument/tas/config/counter/counter.tcl +++ b/site_ansto/instrument/tas/config/counter/counter.tcl @@ -5,7 +5,7 @@ namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist - variable isc_beam_monitor_list + variable isc_beam_monitor_list proc set_sobj_attributes {} { } } diff --git a/site_ansto/instrument/tas/config/environment/environment.tcl b/site_ansto/instrument/tas/config/environment/environment.tcl index 4dd78bed..99000a22 100644 --- a/site_ansto/instrument/tas/config/environment/environment.tcl +++ b/site_ansto/instrument/tas/config/environment/environment.tcl @@ -16,14 +16,14 @@ switch $envtemp { puts "Configuring RHQC" # 9600 8 1 None None Enable add_sct_ls340 tc1 ca5-[instname] 4001 "\r" 0.5 5.0 -# TODO Set controlsensor +# TODO Set controlsensor # if { [SplitReply [environment_simulation]] == "false"} { # tc1 controlsensor sensorB # } # puts "Added tc1 with [tc1 controlsensor]" # 9600 8 1 None None Enable add_sct_ls340 tc2 ca5-[instname] 4002 "\r" 0.5 5.0 -# TODO Set controlsensor +# TODO Set controlsensor # if { [SplitReply [environment_simulation]] == "false"} { # tc2 controlsensor sensorD # } @@ -39,7 +39,7 @@ switch $envtemp { sicslist setatt temperature long_name temperature sicslist setatt temperature klass sample sicslist setatt temperature units K -# TODO Set controlsensor +# TODO Set controlsensor # tc1 controlsensor sensorA # } add_ips120 ips120 ca5-taipan 4004 0.001 diff --git a/site_ansto/instrument/tas/config/environment/temperature/lakeshore340.tcl b/site_ansto/instrument/tas/config/environment/temperature/lakeshore340.tcl index 31c49bbd..c1a0f367 100644 --- a/site_ansto/instrument/tas/config/environment/temperature/lakeshore340.tcl +++ b/site_ansto/instrument/tas/config/environment/temperature/lakeshore340.tcl @@ -14,7 +14,7 @@ source $cfPath(environment)/temperature/lakeshore340_common.tcl # @param settle, settling time in seconds # @param range, lakeshore range # @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} { variable tc_dfltPar 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 ::environment::mkenvinfo $tcn {heateron {priv user} range {priv manager} } } message ] { diff --git a/site_ansto/instrument/tas/config/motors/motor_configuration.tcl b/site_ansto/instrument/tas/config/motors/motor_configuration.tcl index efa12c82..873b9411 100644 --- a/site_ansto/instrument/tas/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/tas/config/motors/motor_configuration.tcl @@ -239,7 +239,7 @@ Motor m2 $motor_driver_type [params \ absEnc 1\ absEncHome 2773144\ cntsPerX $m2_cntsPerX] -m2 part crystal +m2 part crystal m2 long_name m2 m2 softlowerlim 17 m2 softupperlim 80 @@ -289,7 +289,7 @@ a2 decel 0.2 # Motor Controller 2 # Motor Controller 2 ############################ -# +# # mc2: Sample Tilt 1 Motor sgu $tilt_motor_driver_type [params \ @@ -424,7 +424,7 @@ Motor s2 $motor_driver_type [params \ absEnc 1\ absEncHome 20305788\ cntsPerX -93206.7556] -s2 part sample +s2 part sample s2 long_name s2 s2 softlowerlim -78 s2 softupperlim -1.9 @@ -458,7 +458,7 @@ Motor ahfocus $motor_driver_type [params \ absEnc 1\ absEncHome 8475494\ cntsPerX [expr 8192.0/360.0]] -ahfocus part crystal +ahfocus part crystal ahfocus long_name ahfocus ahfocus softlowerlim 0 ahfocus softupperlim 300 @@ -588,7 +588,7 @@ Motor atilt $motor_driver_type [params \ absEnc 1\ absEncHome 7909802\ cntsPerX 8192] -atilt part crystal +atilt part crystal atilt long_name atilt atilt softlowerlim -5 atilt softupperlim 5 @@ -611,7 +611,7 @@ Motor atrans $motor_driver_type [params \ absEnc 1\ absEncHome 23726446\ cntsPerX -8192] -atrans part crystal +atrans part crystal atrans long_name atrans atrans softlowerlim -1 atrans softupperlim 22 @@ -684,7 +684,7 @@ Motor VS_right $motor_driver_type [params \ absEnc 1\ absEncHome 16269006\ cntsPerX 682.656] -VS_right part slits +VS_right part slits VS_right long_name VS_right VS_right softlowerlim -41 VS_right softupperlim -2 @@ -707,7 +707,7 @@ Motor mfilter $motor_driver_type [params \ absEnc 1\ absEncHome 22369621\ cntsPerX 8192] -mfilter part crystal +mfilter part crystal mfilter long_name mfilter mfilter softlowerlim 0 mfilter softupperlim 360 @@ -770,7 +770,7 @@ Motor ps_left $motor_driver_type [params \ maxDecel 3.0020\ stepsPerX $slitStepRate\ motorHome $ss1l_Home] -ps_left part slits +ps_left part slits ps_left long_name ps_left ps_left softlowerlim -27 ps_left softupperlim -2 @@ -792,7 +792,7 @@ Motor ps_top $motor_driver_type [params \ maxDecel 3.0020\ stepsPerX $slitStepRate\ motorHome $ss1t_Home] -ps_top part slits +ps_top part slits ps_top long_name ps_top ps_top softlowerlim -63 ps_top softupperlim -2 @@ -813,7 +813,7 @@ Motor ps_bottom $motor_driver_type [params \ maxDecel 3.0020\ stepsPerX $slitStepRate\ motorHome $ss1b_Home] -ps_bottom part slits +ps_bottom part slits ps_bottom long_name ps_bottom ps_bottom softlowerlim -63 ps_bottom softupperlim -2 @@ -834,7 +834,7 @@ Motor pa_right $motor_driver_type [params \ maxDecel 3.0020\ stepsPerX $slitStepRate\ motorHome $ss2r_Home] -pa_right part slits +pa_right part slits pa_right long_name pa_right pa_right softlowerlim -26 pa_right softupperlim -2 @@ -855,7 +855,7 @@ Motor pa_left $motor_driver_type [params \ maxDecel 3.0020\ stepsPerX $slitStepRate\ motorHome $ss2l_Home] -pa_left part slits +pa_left part slits pa_left long_name pa_left pa_left softlowerlim -26 pa_left softupperlim -2 @@ -876,10 +876,10 @@ Motor pa_top $motor_driver_type [params \ maxDecel 3.0020\ stepsPerX $slitStepRate\ motorHome $ss2t_Home] -pa_top part slits +pa_top part slits pa_top long_name pa_top pa_top softlowerlim -102 -pa_top softupperlim -2 +pa_top softupperlim -2 pa_top home 0.0 # mc6: Pre-sample bottom aperture -- Slit s2 bottom Blade @@ -896,10 +896,10 @@ Motor pa_bottom $motor_driver_type [params \ maxDecel 3.0020\ stepsPerX $slitStepRate\ motorHome $ss2b_Home] -pa_bottom part slits +pa_bottom part slits pa_bottom long_name pa_bottom pa_bottom softlowerlim -102 -pa_bottom softupperlim -2 +pa_bottom softupperlim -2 pa_bottom home 0.0000 proc motor_set_sobj_attributes {} { diff --git a/site_ansto/instrument/tas/config/plc/plc.tcl b/site_ansto/instrument/tas/config/plc/plc.tcl index 9a54c250..f8014979 100644 --- a/site_ansto/instrument/tas/config/plc/plc.tcl +++ b/site_ansto/instrument/tas/config/plc/plc.tcl @@ -1,5 +1,5 @@ set sim_mode [SplitReply [plc_simulation]] -if {$sim_mode == "false"} { +if {$sim_mode == "false"} { MakeAsyncQueue plc_chan SafetyPLC 137.157.203.149 30000 MakeSafetyPLC plc plc_chan 0 } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/andorhm.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/andorhm.tcl index 17b4e743..6cde25c9 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/andorhm.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/andorhm.tcl @@ -1,6 +1,6 @@ #-------------------------------------------------------------- # This is the initialisation code for the ANDOR iKon-M -# camera and the CDDWWW WWW-server. It got separated into +# camera and the CDDWWW WWW-server. It got separated into # a separate file in order to support moving that camera around. # # Mark Koennecke, November 2010 @@ -61,7 +61,7 @@ proc tempreply {} { return idle } #------------------------------------------------------------- -proc MakeAndorHM {name host } { +proc MakeAndorHM {name host } { ccdwww::MakeCCDWWW $name $host "ccdwww::initscript $name" hfactory /sics/$name/daqmode plain mugger text hset /sics/$name/daqmode single diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/astrium.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/astrium.tcl index b6230a59..05a36e79 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/astrium.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/astrium.tcl @@ -1,7 +1,7 @@ #-------------------------------------------------------------- # This is a new style driver for the Astrium chopper systems in # the new sicsobj/scriptcontext based system. Please note that -# actual implementations may differ in the number of choppers +# actual implementations may differ in the number of choppers # and the address of the chopper on the network. # # copyright: see file COPYRIGHT @@ -10,23 +10,23 @@ # - reading parameters: # astchopread - readastriumchopperpar - readastriumchopperpar - ... # - writing -# astchopwrite - astchopwritereply +# astchopwrite - astchopwritereply # # Another remark: -# In order for chosta to work properly, the chopperparlist and +# In order for chosta to work properly, the chopperparlist and # chopperlonglist must be aligned. # # Mark Koennecke, February 2009 # -# If something goes wrong with this, the following things ought +# If something goes wrong with this, the following things ought # to be checked: # - Is the standard Tcl scan command been properly renamed to stscan? # - Is a communication possible with the chopper via telnet? -# This may not be the case because of other SICS servers blocking +# This may not be the case because of other SICS servers blocking # things or the old driver being active and capturing the terminal # server port in SerPortServer. Scriptcontext then fails silently. -# But may be we will fix the latter. -# - The other thing which happens is that the parameter list of +# But may be we will fix the latter. +# - The other thing which happens is that the parameter list of # the chopper differs in little ways between instances. # # Mark Koennecke, April 2009 @@ -43,7 +43,7 @@ proc astriumchopperputerror {txt} { } } #-------------------------------------------------------------- -# Paramamters look like: name value, entries for parameters are +# Paramamters look like: name value, entries for parameters are # separated by ; #--------------------------------------------------------------- proc astriumsplitreply {chopper reply} { @@ -62,20 +62,20 @@ proc astriumsplitreply {chopper reply} { if {$val > 360} { set val [expr $val -360.] } - hupdate /sics/choco/${chopper}/dphas $val + hupdate /sics/choco/${chopper}/dphas $val hdelprop /sics/choco/${chopper}/dphas geterror } if {[string first averl $par] >= 0} { set val [string range $par 5 end] - hupdate /sics/choco/${chopper}/averl $val + hupdate /sics/choco/${chopper}/averl $val hdelprop /sics/choco/${chopper}/averl geterror } } } } #------------------------------------------------------------- -# update those parameters which are dependent on the chopper -# status just read. Some of them may or may not be there, this +# update those parameters which are dependent on the chopper +# status just read. Some of them may or may not be there, this # is why this is protected by catch'es. #------------------------------------------------------------- proc astcopydependentpar {} { @@ -91,7 +91,7 @@ proc astcopydependentpar {} { } #-------------------------------------------------------------- proc readastriumchopperpar {} { - global choppers + global choppers set reply [sct result] if {[string first ERR $reply] >= 0} { astriumchopperputerror $reply @@ -106,7 +106,7 @@ proc readastriumchopperpar {} { sct send @@NOSEND@@ sct replycount 0 hupdate /sics/choco/asyst "" - hdelprop /sics/choco/asyst geterror + hdelprop /sics/choco/asyst geterror return astchoppar } else { set oldval [hval /sics/choco/asyst] @@ -157,7 +157,7 @@ proc astchopwrite {prefix} { return astchopwritereply } #---------------------------------------------------------------- -# Make sure to send a status request immediatly after a reply in +# Make sure to send a status request immediatly after a reply in # order to avoid timing problems #---------------------------------------------------------------- proc astchopwritereply {} { @@ -393,7 +393,7 @@ proc astMakeChopperRatio {var} { chocosct write $path hsetprop $path checklimits astchopratiolimit hsetprop $path halt astchopstop - hsetprop $path checkstatus astchopcheckratio + hsetprop $path checkstatus astchopcheckratio makesctdriveobj $var $path DriveAdapter chocosct } #------------------------------------------------------------------------ @@ -466,7 +466,7 @@ if {$poldi == 1} { return idle } } - return [astchopwrite "nspee 1 "] + return [astchopwrite "nspee 1 "] } #----------- set choppers [list chopper] @@ -520,5 +520,5 @@ if {$focus == 1} { astMakeChopperSpeed2 diskspeed astMakeChopperRatio ratio astMakeChopperPhase2 phase - Publish chosta Spy + Publish chosta Spy } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/backup.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/backup.tcl index 483df21a..6e9260d2 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/backup.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/backup.tcl @@ -10,7 +10,7 @@ proc backupCron {path {minutes 10} {days 1}} { set minutes [expr $minutes * 60] set days [expr $days * 24*3600] if {! [info exists next_backup]} { - set next_backup(min) [nextBackupTime $now $minutes last] + set next_backup(min) [nextBackupTime $now $minutes last] set next_backup(day) [nextBackupTime $now $days last] set file [clock format $now -format "$path/backupd-%m-%d.tcl"] if {![file exists $file]} { @@ -18,7 +18,7 @@ proc backupCron {path {minutes 10} {days 1}} { } } if {$now > $next_backup(min)} { - set next_backup(min) [nextBackupTime $now $minutes last] + set next_backup(min) [nextBackupTime $now $minutes last] set file [clock format $last -format "$path/backup-%Hh%M.tcl"] } else { return 1 diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/batch.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/batch.tcl index 795a77f6..64f6c65f 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/batch.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/batch.tcl @@ -6,7 +6,7 @@ if { [info exists batchinit] == 0 } { set batchinit 1 Publish batchroot Spy - Publish batchrun User + Publish batchrun User } proc SplitReply { text } { diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/ccdwww.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/ccdwww.tcl index b882c42d..a0797584 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/ccdwww.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/ccdwww.tcl @@ -1,20 +1,20 @@ #------------------------------------------------------ # This is SICS HM driver code for the CCDWWW CCD camera -# WWW server as used at SINQ. It uses, of course, the +# WWW server as used at SINQ. It uses, of course, the # scriptcontext asynchronous I/O system # # Mark Koennecke, September 2010 #------------------------------------------------------- - + namespace eval ccdwww {} #------------------------------------------------------- -# This is a default init script. The user has to initialise +# This is a default init script. The user has to initialise # a list of nodes to send to the CCD in XML format as # variable ccdwww::initnodes #-------------------------------------------------------- proc ccdwww::initscript {name} { global ccdwww::initnodes - + append confdata "\n" foreach var $ccdwww::initnodes { set val [hval /sics/${name}/${var}] @@ -68,8 +68,8 @@ proc ccdwww::httpstartreply {} { return idle } #--------------------------------------------------------- -# A CCD works like a camera. When exposing, it cannot be stopped, -# paused or anything. This is why the appropriate methods +# A CCD works like a camera. When exposing, it cannot be stopped, +# paused or anything. This is why the appropriate methods # here have no implementation #---------------------------------------------------------- proc ccdwww::httpcontrol {} { @@ -111,7 +111,7 @@ proc ccdwww::httpdatareply {} { set status [catch {httpreply} txt] if {$status == 0} { set path [file dirname [sct]] - hdelprop $path/data geterror + hdelprop $path/data geterror } return idle } @@ -135,13 +135,13 @@ proc ccdwww::httpevalstatus {name} { clientput $data sct update error return idle - } + } hdelprop [sct] geterror if {$data == 0} { httpdata $name return httpstatusdata } else { - sct update run + sct update run [sct controller] queue [sct] progress read return idle } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/deltatau.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/deltatau.tcl index 10bba7d7..05577800 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/deltatau.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/deltatau.tcl @@ -1,5 +1,5 @@ #--------------------------------------------------------------- -# These are the scripts for the delta-tau PMAC motor +# These are the scripts for the delta-tau PMAC motor # controller. # # !!!!!!!!! Script Chains !!!!!!!!!!! @@ -12,11 +12,11 @@ # -- For reading the status # pmacsendaxer --- pmacrcvaxerr -- pmacrcvpos -- pmacrcvstat # This means we check for an axis error first, then update the position, -# then check the axis status itself. +# then check the axis status itself. # -- For setting the position # pmacsendhardpos -- pmacrcvhardpos -- pmacrcvhardax -# This means, we send the positioning command, read the reply and read the -# axisstatus until the axis has started +# This means, we send the positioning command, read the reply and read the +# axisstatus until the axis has started # # copyright: see file COPYRIGHT # @@ -66,7 +66,7 @@ proc translateAxisError {key} { } #--------------------------------------------------------------------- proc evaluateAxisStatus {key} { -#----- Tcl does not like negative numbers as keys. +#----- Tcl does not like negative numbers as keys. if {$key < 0} { set key [expr 50 + abs($key)] } @@ -181,7 +181,7 @@ proc pmacrcvaxerr {motname num} { sct update error sct geterror $data return idle - } + } hupdate /sics/$motname/axiserror $data if {$data != 0 } { set err [translateAxisError $data] @@ -206,7 +206,7 @@ proc pmacrcvpos {motname num} { sct geterror $data sct update error return idle - } + } hupdate /sics/$motname/hardposition $data sct send "P${num}00" return rcvstat @@ -218,7 +218,7 @@ proc pmacrcvstat {motname num sct} { clientput "ERROR: $motname : $data" sct update error return idle - } + } set status [catch {evaluateAxisStatus $data} msg] if {$status != 0} { sct update error @@ -260,7 +260,7 @@ proc pmacrcvhardpos {num} { clientput "ERROR: $data" sct seterror $data return idle - } + } sct send "P${num}00" return rcvhardax } @@ -271,7 +271,7 @@ proc pmacrcvhardax {motname num sct} { clientput "ERROR: $motname : $data" sct seterror $data return idle - } + } set status [catch {evaluateAxisStatus $data} msg] if {$status != 0} { clientput "ERROR: $motname : $msg" @@ -284,7 +284,7 @@ proc pmacrcvhardax {motname num sct} { return rcvhardax } run { - $sct queue /sics/$motname/status progress read + $sct queue /sics/$motname/status progress read return idle } } @@ -353,5 +353,5 @@ proc MakeDeltaTau {name sct num} { # $sct send [format "M%2.2d14=1" $num] foreach par $parlist { $sct queue /sics/$name/$par progress read - } + } } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/el734.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/el734.tcl index ca717cba..90192838 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/el734.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/el734.tcl @@ -1,13 +1,13 @@ #-------------------------------------------------------- # This is a scriptcontext based driver for the EL734 -# motor controller. This is part of an ongoing effort to -# expire older drivers and to consolidate on the new +# motor controller. This is part of an ongoing effort to +# expire older drivers and to consolidate on the new # scriptcontext system. # # Scriptchains: -# Rather then having long script chains many of the -# intricacies of the EL734 are handled via a command -# processing state machine. See the docs below for +# Rather then having long script chains many of the +# intricacies of the EL734 are handled via a command +# processing state machine. See the docs below for # details # # copyright: see file COPYRIGHT @@ -19,24 +19,24 @@ namespace eval el734 {} #--------------------------------------------------------- # The EL734 is a a tricky thing. Some special conditions -# apply: -# - On emergency stop an *ES is sent. But only the second -# response of this kind is valid because there can be -# spurious *ES on the line even when the emergency stop +# apply: +# - On emergency stop an *ES is sent. But only the second +# response of this kind is valid because there can be +# spurious *ES on the line even when the emergency stop # has been released. -# - If someone fingers the EL734 or after startup it is in +# - If someone fingers the EL734 or after startup it is in # local mode. Then two commands have to be sent in order to -# make it go into remote mode before retrying the command. -# - In some echo modes of the controller it sends a echo +# make it go into remote mode before retrying the command. +# - In some echo modes of the controller it sends a echo # of the command. This has to be ignored in order to get at # the real problem # -# In order to deal with all this, el734::command is implemented -# as a state machine which calls another script when a valid +# In order to deal with all this, el734::command is implemented +# as a state machine which calls another script when a valid # reponse has actually been found. # The state of the current command processing # is saved in a node property comstate. The actual command to send -# is in the property comstring. The script to call if we actually +# is in the property comstring. The script to call if we actually # have a valid response is stored in the property comresponse #--------------------------------------------------------------- proc el734::setcommand {command responsescript {motno 0}} { @@ -45,10 +45,10 @@ proc el734::setcommand {command responsescript {motno 0}} { sct comstring $command sct commotno $motno return command -} +} #--------------------------------------------------------------- # As implemented now this can go in an endless loop if switching -# to local fails repeatedly. TODO: test if this happens with the +# to local fails repeatedly. TODO: test if this happens with the # real device #--------------------------------------------------------------- proc el734::command {} { @@ -132,7 +132,7 @@ proc el734::checkerror {} { } } return $reply -} +} #========================== Position =============================== proc el734::readpos {num} { set com [format "u %d" $num] @@ -214,7 +214,7 @@ proc el734::decodemsr {name msr} { set msrdata(0x40) "Bad step" set msrdata(0x100) posfault set msrdata(0x400) posfault - + set oredmsr [hval /sics/${name}/oredmsr] if {$msr == 0} { #-------- FINISHED @@ -223,7 +223,7 @@ proc el734::decodemsr {name msr} { if {$pos > 0 || $run > 0} { return posfault } - + set orlist [array names oredata] foreach code $orlist { if {$oredmsr & $code} { @@ -402,7 +402,7 @@ proc el734::refrun {controller name num} { wait 2 set ss [hval /sics/${name}/ss] if { [string first ?BSY $ss] < 0} { - break + break } set rupt [getint] if { [string compare $rupt continue] != 0} { @@ -426,7 +426,7 @@ proc el734::reset {name} { #========================= Make ================================== proc el734::make {name no controller} { MakeSecMotor $name - + hfactory /sics/${name}/oredmsr plain internal int hfactory /sics/${name}/runfault plain internal int hfactory /sics/${name}/posfault plain internal int @@ -442,7 +442,7 @@ proc el734::make {name no controller} { hsetprop /sics/${name}/hardlowerlim read el734::getlim $name $no hsetprop /sics/${name}/hardlowerlim command el734::command $controller poll /sics/${name}/hardlowerlim 120 - + hsetprop /sics/${name}/status read el734::readstatus $no $name hsetprop /sics/${name}/status command el734::command $controller poll /sics/${name}/status 40 @@ -472,7 +472,7 @@ proc el734::addrefstuff {name no controller} { hfactory /sics/${name}/refnull plain user int hsetprop /sics/${name}/refnull read el734::readref $no hsetprop /sics/${name}/refnull command el734::command - $controller poll /sics/${name}/refnull 300 + $controller poll /sics/${name}/refnull 300 hsetprop /sics/${name}/refnull write el734::setref $name $no hsetprop /sics/${name}/refnull command el734::command @@ -481,8 +481,8 @@ proc el734::addrefstuff {name no controller} { hfactory /sics/${name}/ss plain internal text hsetprop /sics/${name}/ss read el734::readss $no hsetprop /sics/${name}/ss ssread el734::ssread - $controller poll /sics/${name}/ss 300 + $controller poll /sics/${name}/ss 300 $name makescriptfunc refrun "el734::refrun $controller $name $no" user - + } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/el737sec.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/el737sec.tcl index be77890a..e3d93071 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/el737sec.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/el737sec.tcl @@ -1,5 +1,5 @@ #----------------------------------------------------- -# This is a second generation counter driver for +# This is a second generation counter driver for # the PSI EL737 counter boxes using scriptcontext # communication. # @@ -11,8 +11,8 @@ # status: el737readstatus - el737status # \ el737statval - el737statread # values: el737readvalues - el737val -# threshold write: el737threshsend - el737threshrcv - el737cmdreply -# +# threshold write: el737threshsend - el737threshrcv - el737cmdreply +# # Mark Koennecke, February 2009 #----------------------------------------------------- proc el737error {reply} { @@ -107,7 +107,7 @@ proc el737control {} { return idle } } - + } #---------------------------------------------------- proc el737readstatus {} { @@ -187,7 +187,7 @@ proc swapFirst {l} { } #--------------------------------------------------- # There are two types of reponses to the RA command: -# the old form with 5 values and the new one +# the old form with 5 values and the new one # with 9 values #--------------------------------------------------- proc el737val {} { @@ -315,7 +315,7 @@ proc MakeSecEL737 {name netaddr} { hfactory /sics/${name}/RS plain internal int hfactory /sics/${name}/RA plain internal intvarar 8 - + $conname debug -1 } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/el755.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/el755.tcl index 0eddccf5..d29ee85e 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/el755.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/el755.tcl @@ -1,7 +1,7 @@ #------------------------------------------------------------- -# This is a scriptcontext driver for the PSI EL755 magnet +# This is a scriptcontext driver for the PSI EL755 magnet # controller. -# +# # scriptchains: # read - readreply # write - writereply - writereadback @@ -57,7 +57,7 @@ proc el755::writereply {num} { error $reply } sct send [format "I %d" $num] - return writereadback + return writereadback } #-------------------------------------------------------------------- proc el755::writereadback {num} { diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/fourcircle.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/fourcircle.tcl index 513eec3b..769ec71c 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/fourcircle.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/fourcircle.tcl @@ -1,7 +1,7 @@ #---------------------------------------------------------- -# This is a file full of support functions for four -# circle diffraction in the new four circle system. This -# is the common, shared stuff. There should be another +# This is a file full of support functions for four +# circle diffraction in the new four circle system. This +# is the common, shared stuff. There should be another # file which contains the instrument specific adaptions. # # Mark Koennecke, August 2008, November 2008, February 2009 @@ -10,7 +10,7 @@ if { [info exists __singlexinit] == 0 } { set __singlexinit 1 MakeSingleX Publish projectdir Spy - Publish cell Spy + Publish cell Spy Publish ub Spy Publish spgrp Spy Publish calcang Spy @@ -18,7 +18,7 @@ if { [info exists __singlexinit] == 0 } { Publish calctth Spy Publish refclear User Publish reflist Spy -# Publish refang User +# Publish refang User Publish refdel User Publish refhkl User Publish refang User @@ -38,7 +38,7 @@ if { [info exists __singlexinit] == 0 } { Publish tabload user Publish loadx User Publish testx User - Publish collconf User + Publish collconf User Publish hkllimit Spy Publish hklgen User Publish indw User @@ -79,14 +79,14 @@ if { [info exists __singlexinit] == 0 } { } #--------------------------------------------------------- # support function for handling ranges in measuring -# reflections. This is tricky: When calculating if a -# reflection is scannable one has to take the range of +# reflections. This is tricky: When calculating if a +# reflection is scannable one has to take the range of # the scan into account. SICS goes to great pain to calculate -# reflections in spite of restrictions. It tweaks ome, searches -# psi etc. In order to arrive at a scannable position for +# reflections in spite of restrictions. It tweaks ome, searches +# psi etc. In order to arrive at a scannable position for # calculations and initial driving, the ranges in om and stt # have to be corrected to include the scan range. These support -# functions take care of this. +# functions take care of this. #---------------------------------------------------------- set __fmessomup 0 set __fmessomlow 0 @@ -209,7 +209,7 @@ proc getsetangles {} { proc calchkl args { set mo [string trim [SplitReply [singlex mode]]] switch $mo { - bi { + bi { if {[llength $args] < 4} { set stt [singlex motval stt] set om [singlex motval om] @@ -333,7 +333,7 @@ proc refdel {id} { } #-------------------------------------------------------------- proc refhkl {id h k l } { - return [ref setx $id $h $k $l] + return [ref setx $id $h $k $l] } #------------------------------------------------------------- proc refang args { @@ -427,7 +427,7 @@ proc centerlist {preset {mode monitor} {skip 0} } { set h [lindex $val 2] set k [lindex $val 3] set l [lindex $val 4] - clientput "Processing reflection $refid = $h $k $l" + clientput "Processing reflection $refid = $h $k $l" set stt [lindex $val 5] if {$stt > .0} { set mo [string trim [SplitReply [singlex mode]]] @@ -519,7 +519,7 @@ proc tablist {} { } #--------------------------------------------------------------------------- proc tabclear {} { - return [fmess table clear] + return [fmess table clear] } #--------------------------------------------------------------------------- proc tabadd {sttend scanvar step np preset } { @@ -742,8 +742,8 @@ proc testx args { proc collconf args { set modelist [list monitor timer] if {[llength $args] < 4} { - append res [SplitReply [fmess mode]] - append res [SplitReply [fmess fast]] + append res [SplitReply [fmess mode]] + append res [SplitReply [fmess fast]] append res " " [SplitReply [fmess weak]] append res " " [SplitReply [fmess weakthreshold]] return $res @@ -808,7 +808,7 @@ proc scanref {ref} { xxxscan add $ommot $start $step if {[string first o2t $scanvar] >= 0} { set start [expr $stt - 2*$range] - xxxscan add $sttmot $start [expr $step * 2.] + xxxscan add $sttmot $start [expr $step * 2.] } set mode [string trim [SplitReply [fmess mode]]] xxxscan run $np $mode $preset @@ -859,7 +859,7 @@ proc hklgen { {sup no} } { } #---------------------------------------------------------------- proc indw {hw kw lw} { - return [fmess genw $hw $kw $lw] + return [fmess genw $hw $kw $lw] } #---------------------------------------------------------------- proc indsave {filename} { @@ -873,7 +873,7 @@ proc indsave {filename} { set idxlist [split [messref show $ref]] puts $out [format " %12.6f %12.6f %12.6f" [lindex $idxlist 2] \ [lindex $idxlist 3] [lindex $idxlist 4]] - + } close $out return "Done" @@ -890,8 +890,8 @@ proc indlist {} { proc indexconf args { if {[llength $args] < 2} { append res "simidxconf = " - append res [SplitReply [simidx sttlim]] ", " - append res [SplitReply [simidx anglim]] " " + append res [SplitReply [simidx sttlim]] ", " + append res [SplitReply [simidx anglim]] " " return $res } else { simidx sttlim [lindex $args 0] @@ -997,7 +997,7 @@ proc writerafinfile {filename cell} { puts $out "" puts $out "-1" close $out - catch {file attributes $filename -permissions 00664} + catch {file attributes $filename -permissions 00664} } #----------------------------------------------------------- proc writerafnbfile {filename cell} { @@ -1014,7 +1014,7 @@ proc writerafnbfile {filename cell} { puts $out "" puts $out "-1" close $out - catch {file attributes $filename -permissions 00664} + catch {file attributes $filename -permissions 00664} } #--------------------------------------------------------- proc checkResult {filename} { @@ -1093,7 +1093,7 @@ proc refshow {} { } if {[string first 0RESULTS $line] >= 0} { set dataappend 1 - } + } if {$dataappend == 1} { append res $line "\n" } @@ -1127,7 +1127,7 @@ proc loadub {} { gets $in line stscan $line "%f %f %f" u31 u32 u33 singlex ub $u11 $u12 $u13 $u21 $u22 $u23 $u31 $u32 $u33 - } + } if {[string first "0DIRECT CELL" $line] >= 0} { stscan $line "%s %s %f %f %f %f %f %f" junk junk2 a b c alpha beta gamma singlex cell $a $b $c $alpha $beta $gamma @@ -1201,7 +1201,7 @@ proc removeduplicatesold {peaklist} { foreach fp $final { if {abs($fp - $peak) < 2.} { set valid 0 - } + } } if {$valid == 1} { lappend final $peak @@ -1240,7 +1240,7 @@ proc removeduplicates {peaklist countlist} { return $final } #-------------------------------------------------------------------- -# Do not be confused by the use of phi. This is also used for finding +# Do not be confused by the use of phi. This is also used for finding # peaks in omega in NB #-------------------------------------------------------------------- proc findpeaksinscan {} { @@ -1321,7 +1321,7 @@ proc searchbi {preset mode maxpeak} { if {$status != 0} { clientput "WARNING: Cannot reach chi $chipos, skipping" continue - } + } clientput "Searching at chi: $chipos" success switch $detmode { @@ -1354,14 +1354,14 @@ proc searchbi {preset mode maxpeak} { if {[string first continue $interrupt] < 0} { error $msg } -#--------- Do I need to extract peaks from the area detector data or is this to be -# left to anatric? +#--------- Do I need to extract peaks from the area detector data or is this to be +# left to anatric? } default { error "Reflection search not supported for this detector mode" } } - } + } } } #----------------------------------------------------------------------- @@ -1447,7 +1447,7 @@ proc searchnb {preset mode maxpeak} { error "Reflection search not supported for this detector mode" } } - } + } } } #-------------------------------------------------------------------------------------- @@ -1598,7 +1598,7 @@ proc psiscan {h k l step stepom omnp preset {countmode NULL}} { break } } - } + } clientput "Scanning at $psi" set ompos [string trim [SplitReply [om]]] set status [catch {cscan om $ompos $stepom $omnp $preset} msg] @@ -1610,7 +1610,7 @@ proc psiscan {h k l step stepom omnp preset {countmode NULL}} { } else { clientput "ERROR: $msg while scanning" } - } + } set stt [SplitReply [stt]] set chi [SplitReply [chi]] set phi [SplitReply [phi]] @@ -1679,7 +1679,7 @@ proc savexxx {filename} { return "Done" } #====================================================================================== -# Stuff to support Hipadaba +# Stuff to support Hipadaba #====================================================================================== proc ubrefinehdb args { set path /instrument/reflection_list/ubrefresult diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/hdbutil.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/hdbutil.tcl index 580fedf6..f239237d 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/hdbutil.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/hdbutil.tcl @@ -1,6 +1,6 @@ #----------------------------------------------------------------------- -# This is a collection of utility procedures to help with Hipadaba and -# Gumtree Swiss Edition. This file is supposed to be sourced by any +# This is a collection of utility procedures to help with Hipadaba and +# Gumtree Swiss Edition. This file is supposed to be sourced by any # instrument using Hipadaba. # # Copyright: see file COPYRIGHT @@ -10,14 +10,14 @@ # Requirements: # * the internal scan command xxxscan # * scan data to live /graphics/scan_data -# +# # Many updates, till November 2008, Mark Koennecke #---------------------------------------------------------------------- if { [info exists hdbinit] == 0 } { set hdbinit 1 MakeStateMon Publish getgumtreexml Spy - if {[string first tmp $home] < 0} { + if {[string first tmp $home] < 0} { set tmppath $home/tmp } else { set tmppath $home @@ -30,7 +30,7 @@ if { [info exists hdbinit] == 0 } { Publish hdbcollect User Publish listbatchfiles Spy Publish makemumopos User - Publish dropmumo User + Publish dropmumo User Publish hdbbatchpath User Publish cscan User Publish sscan User @@ -39,7 +39,7 @@ if { [info exists hdbinit] == 0 } { Publish hmakescript Mugger Publish hlink Mugger Publish hcommand Mugger - Publish hdbstorenexus User + Publish hdbstorenexus User Publish scaninfo Spy } #=================================================================== @@ -52,7 +52,7 @@ if { [info exists hdbinit] == 0 } { # makeQuickPar name path # makeslit path left right upper lower # configures a slit. Missing motors can be indicated with NONE -# makestdadmin +# makestdadmin # makecount path # makerepeat path # makekillfile path @@ -60,8 +60,8 @@ if { [info exists hdbinit] == 0 } { # makestdgui # makewait path # makeevproxy rootpath hdbname devicename -# makemumo rootpath mumoname -# makeexe +# makemumo rootpath mumoname +# makeexe # confnxhdb path alias pass # makestddrive path #===================== hfactory adapters ========================== @@ -71,7 +71,7 @@ proc hmake {path priv type {len 1}} { #-------------------------------------------------------------------- proc hmakescript {path readscript writescript type {len 1}} { hfactory $path script $readscript $writescript $type $len -} +} #------------------------------------------------------------------- proc hlink {path obj {treename NONE} } { if {[string equal $treename NONE]} { @@ -133,7 +133,7 @@ proc property_elements_old {path indent} { # foreach v [split $value ,] { # lappend proplist "$prefix$prefix$v\n" # } - lappend proplist "$prefix$prefix$value\n" + lappend proplist "$prefix$prefix$value\n" lappend proplist "$prefix\n" } if [info exists proplist] {return $proplist} @@ -151,7 +151,7 @@ proc property_elements {path indent} { continue } lappend proplist "$prefix\n" - lappend proplist "$prefix$prefix$value\n" + lappend proplist "$prefix$prefix$value\n" lappend proplist "$prefix\n" } if [info exists proplist] {return $proplist} @@ -193,7 +193,7 @@ proc searchPathForDrivable {name} { } } return NONE -} +} #---------------------------------------------------------------- proc searchForCommand {name} { return [string trim [hmatchprop / sicscommand $name]] @@ -305,7 +305,7 @@ proc mgbatch {filename} { gets $f line close $f if {[string first MOUNTAINBATCH $line] > 0} { -#--------- This is a mountaingum batch file which does not need +#--------- This is a mountaingum batch file which does not need # to be massaged return $filename } @@ -313,7 +313,7 @@ proc mgbatch {filename} { set realfilename [file tail $filename] set out [open $tmppath/$realfilename w] puts $out \#MOUNTAINBATCH - while {[gets $f line] >= 0} { + while {[gets $f line] >= 0} { append buffer $line if {[info complete $buffer] == 1} { translateCommand $buffer $out @@ -377,7 +377,7 @@ proc hdbcollect {obj userobj np} { #----------------------------------------------------------------------------- proc gethdbscanvardata {no} { set np [string trim [SplitReply [xxxscan np]]] - if {$np == 0} { + if {$np == 0} { return ".0 .0 .0" } set status [catch {SplitReply [xxxscan getvardata $no]} txt] @@ -390,7 +390,7 @@ proc gethdbscanvardata {no} { #---------------------------------------------------------------------------- proc gethdbscancounts {} { set np [string trim [SplitReply [xxxscan np]]] - if {$np == 0} { + if {$np == 0} { return "0 0 0" } set status [catch {SplitReply [xxxscan getcounts]} txt] @@ -398,7 +398,7 @@ proc gethdbscancounts {} { return [join $txt] } else { return "0 0 0" - } + } } #================= helper to get the list of batch files ================= proc listbatchfiles {} { @@ -460,7 +460,7 @@ proc hsearchprop {root prop val} { #============ various utility routines ===================================== proc hdbReadOnly args { error "Parameter is READ ONLY" -} +} #--------------------------------------------------------------------------- proc makesampleenv {path} { hfactory $path plain spy none @@ -512,7 +512,7 @@ proc makestdscangraphics {path} { hsetprop $path/scan_variable dim 0 hsetprop $path/scan_variable transfer zip hsetprop $path/scan_variable priv internal - hfactory $path/scan_variable/name plain user text + hfactory $path/scan_variable/name plain user text hfactory $path/counts script "gethdbscancounts" hdbReadOnly intvarar 1 hsetprop $path/counts type data hsetprop $path/counts transfer zip @@ -626,7 +626,7 @@ proc makeevproxy {rootpath hdbname devicename} { hlink $rootpath p${devicename} $hdbname hsetprop $rootpath/$hdbname sicsdev $devicename hsetprop $rootpath/$hdbname type drivable - sicspoll add $rootpath/$hdbname hdb 30 + sicspoll add $rootpath/$hdbname hdb 30 } #================== multi motor stuff ======================= proc getNamposList {mumo} { @@ -660,7 +660,7 @@ proc updateNamePosValues {rootpath} { proc makemumopos {mumo rootpath name} { $mumo pos $name updateNamePosValues $rootpath -} +} #----------------------------------------------------------- proc dropmumo {mumo rootpath name} { $mumo drop $name @@ -676,11 +676,11 @@ proc getDropList {mumo} { proc makemumo {rootpath mumoname} { hfactory $rootpath/namedposition script "getNamPos $mumoname" \ $mumoname text - hsetprop $rootpath/namedposition priv user + hsetprop $rootpath/namedposition priv user hfactory $rootpath/namedposition/values script \ "getNamposList $mumoname" hdbReadOnly text hsetprop $rootpath/namedposition/values visible false - hupdate $rootpath/namedposition/values + hupdate $rootpath/namedposition/values hfactory $rootpath/assignname2current command \ "makemumopos $mumoname $rootpath" hsetprop $rootpath/assignname2current priv user @@ -688,14 +688,14 @@ proc makemumo {rootpath mumoname} { hfactory $rootpath/assignname2current/name plain user text hset $rootpath/assignname2current/name "Undefined" hfactory $rootpath/dropnamedposition command \ - "dropmumo $mumoname $rootpath" + "dropmumo $mumoname $rootpath" hsetprop $rootpath/dropnamedposition priv user hsetprop $rootpath/dropnamedposition type command hfactory $rootpath/dropnamedposition/name plain user text hfactory $rootpath/dropnamedposition/name/values script \ "getDropList $mumoname" hdbReadOnly text hsetprop $rootpath/dropnamedposition/name/values visible false - hupdate $rootpath/dropnamedposition/name/values + hupdate $rootpath/dropnamedposition/name/values } #----------------------------------------------------------------- proc hdbbatchpath {pathstring} { @@ -713,7 +713,7 @@ proc makeexe {} { hfactory $path/batchpath script "exe batchpath" hdbbatchpath text hsetprop $path/batchpath priv user hfactory $path/execute command exe - hsetprop $path/execute type command + hsetprop $path/execute type command hsetprop $path/execute priv user hfactory $path/execute/file plain user text hfactory $path/execute/file/values script listbatchfiles hdbReadOnly text @@ -753,13 +753,13 @@ proc hdbstorenexus args { } } #===================== Syntactical sugar around hdbscan =================== -# center scan. A convenience scan for the one and only Daniel Clemens -# at TOPSI. Scans around a given center point. Requires the scan command +# center scan. A convenience scan for the one and only Daniel Clemens +# at TOPSI. Scans around a given center point. Requires the scan command # for TOPSI to work. # # another convenience scan: -# sscan var1 start end var1 start end .... np preset -# scans var1, var2 from start to end with np steps and a preset of preset +# sscan var1 start end var1 start end .... np preset +# scans var1, var2 from start to end with np steps and a preset of preset # # Mark Koennecke, August 1997 # @@ -771,7 +771,7 @@ proc cscan { var center delta np preset } { if { [string compare $t DRIV] != 0 } { ClientPut [format "ERROR: %s is NOT drivable!" $var] return - } + } set t [SICSType $center] if { [string compare $t NUM] != 0 } { ClientPut [format "ERROR: %s is no number!" $center] @@ -807,7 +807,7 @@ proc cscan { var center delta np preset } { } } #--------------------------------------------------------------------------- -proc sscan args { +proc sscan args { scan clear #------- check arguments: the last two must be preset and np! set l [llength $args] @@ -940,5 +940,5 @@ proc makestddrive {path} { hsetprop $path priv user hfactory $path/motor plain user text hsetprop $path/motor argtype drivable - hfactory $path/value plain user float + hfactory $path/value plain user float } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/motorhp.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/motorhp.tcl index e2027e69..d24f0039 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/motorhp.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/motorhp.tcl @@ -57,7 +57,7 @@ proc motorload {filename} { #------------------------------------------------------------------------ proc loadmotordir {dirname} { set l [glob $dirname/*.par] - foreach e $l { + foreach e $l { set ret [catch {motorload $e} msg] if { $ret != 0} { clientput "ERROR: failed to load $e with $msg" diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/nxsupport.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/nxsupport.tcl index 04e6f0d9..1e61618b 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/nxsupport.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/nxsupport.tcl @@ -10,7 +10,7 @@ proc makeFileName args { set p [string trim [SplitReply [sicsdatapath]]] set pre [string trim [SplitReply [sicsdataprefix]]] set po [string trim [SplitReply [sicsdatapostfix]]] - return [format "%s%s%5.5d2003%s" $p $pre $num $po] + return [format "%s%s%5.5d2003%s" $p $pre $num $po] } #========================================================================== # new version, attending to the new 1000 grouping logic @@ -98,17 +98,17 @@ proc writeStandardAttributes {fileName} { proc appendMotor {np motor alias} { set val [SplitReply [$motor]] __transfer putfloat 0 $val - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } #--------------------------------------------------------------------- proc appendFloat {np alias val} { __transfer putfloat 0 $val - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } #--------------------------------------------------------------------- proc appendCount {np value alias} { __transfer putint 0 $value - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } #-------------------------------------------------------------------- proc appendSampleEnv {np device alias} { diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/phytron.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/phytron.tcl index f37bc9d2..b326479b 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/phytron.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/phytron.tcl @@ -1,24 +1,24 @@ #------------------------------------------------------------------ -# This is driver for the combination Phytron MCC-2 Motor Controller -# and SICS using the scriptcontext asynchronous I/O system. The -# MCC-2 has a funny protocl as that messages are enclosed into -# data sequences. This protocol is handled by the -# C-language phytron protocol handler. Per default, the MCC-2 is +# This is driver for the combination Phytron MCC-2 Motor Controller +# and SICS using the scriptcontext asynchronous I/O system. The +# MCC-2 has a funny protocl as that messages are enclosed into +# data sequences. This protocol is handled by the +# C-language phytron protocol handler. Per default, the MCC-2 is # configured to use 57600 baud. I have configured it to use 9600 -# baud and it ought to remember this. The command to change this -# 0IC1S9600, the command to read this is 0IC1R. +# baud and it ought to remember this. The command to change this +# 0IC1S9600, the command to read this is 0IC1R. # -# So, if this thing does not work on a serial port then the solution is +# So, if this thing does not work on a serial port then the solution is # to set the terminal server to 57600 and try again. And set the baud rate # or leave it. # -# There are surely many ways to use the MCC-2. It supports two axes, X and Y. +# There are surely many ways to use the MCC-2. It supports two axes, X and Y. # All examples below are given for X only. This driver uses it in -# this way: -# -# Nothing works properly without a reference run. The reference run is done +# this way: +# +# Nothing works properly without a reference run. The reference run is done # in the following way: -# 1) Send it into the negative limit switch with 0X0- +# 1) Send it into the negative limit switch with 0X0- # 2) Set the mechanical position with 0XP20Swert to the negative limit # 3) Set the encoder position with 0XP22Swert to the negative limit # @@ -46,7 +46,7 @@ # # - setting speed: # writespeed - rcvwspeed - rcvspeed -# +# # Mark Koennecke, June 2009 # # Added code to switch a brake on for schneider_m2 @@ -54,10 +54,10 @@ # Mark Koennecke, September 2009 # # Added code to support the speed parameter -# +# # Mark Koennecke, December 2009 # -# Added more code to configure non encoder phytron motors which need to +# Added more code to configure non encoder phytron motors which need to # read another parameter for position # # Mark Koennecke, January 2011 @@ -234,21 +234,21 @@ proc phytron::make {name axis controller lowlim upperlim {enc 1}} { $name softlowerlim $lowlim $name hardupperlim $upperlim $name softupperlim $upperlim - + hsetprop /sics/${name}/hardposition read phytron::readpos $axis $enc - hsetprop /sics/${name}/hardposition posrcv phytron::posrcv + hsetprop /sics/${name}/hardposition posrcv phytron::posrcv $controller poll /sics/${name}/hardposition 60 hsetprop /sics/${name}/hardposition write phytron::setpos $axis $name hsetprop /sics/${name}/hardposition setrcv phytron::setrcv $controller $name $controller write /sics/${name}/hardposition - + hsetprop /sics/${name}/status read phytron::sendstatus $axis hsetprop /sics/${name}/status rcvstatus phytron::rcvstatus $axis $controller $enc hsetprop /sics/${name}/status posrcv phytron::statpos $axis $name - hsetprop /sics/${name}/status statposlim phytron::statposlim $axis - hsetprop /sics/${name}/status statneglim phytron::statneglim $axis - hsetprop /sics/${name}/status statend phytron::statend $axis + hsetprop /sics/${name}/status statposlim phytron::statposlim $axis + hsetprop /sics/${name}/status statneglim phytron::statneglim $axis + hsetprop /sics/${name}/status statend phytron::statend $axis $controller poll /sics/${name}/status 60 hfactory /sics/${name}/speed plain user float @@ -269,9 +269,9 @@ proc phytron::make {name axis controller lowlim upperlim {enc 1}} { hupdate /sics/${name}/status idle $controller queue /sics/${name}/hardposition progress read $controller queue /sics/${name}/speed progress read -} +} #=============================================================================================== -# At MORPHEUS there is a special table where one motor needs a brake. This requires a digital I/O +# At MORPHEUS there is a special table where one motor needs a brake. This requires a digital I/O # to be disabled before driving and enabled after driving. The code below adds this feature to # a phytron motor #----------------------------------------------------------------------------------------------- @@ -306,6 +306,6 @@ proc phytron::configureM2 {motor axis out} { hsetprop $path/hardposition write phytron::openset $out hsetprop $path/hardposition openans phytron::openans $axis $motor - hsetprop $path/status statend phytron::outsend $axis $out + hsetprop $path/status statend phytron::outsend $axis $out hsetprop $path/status outend phytron::outend } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/pimotor.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/pimotor.tcl index 37bfee85..702f4da7 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/pimotor.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/pimotor.tcl @@ -1,6 +1,6 @@ #---------------------------------------------------- -# This is a scriptcontext motor driver for the -# prehistoric Physik Instrumente DC-406, C-804 DC +# This is a scriptcontext motor driver for the +# prehistoric Physik Instrumente DC-406, C-804 DC # motor controller. # # copyright: see file COPYRIGHT @@ -13,9 +13,9 @@ # - writespeed - speedreply # - writenull - speedreply # -# Mark Koennecke, November 2009, after the +# Mark Koennecke, November 2009, after the # C original from 1998 -# Made to work, Mark Koennecke, January 2011 +# Made to work, Mark Koennecke, January 2011 #----------------------------------------------------- namespace eval pimotor {} @@ -82,7 +82,7 @@ proc pimotor::statusreply {num} { clientput "Value = $val, length = $len" if {abs($val) > 0} { sct update run - [sct controller] queue [sct] progress read + [sct controller] queue [sct] progress read return idle } } @@ -145,20 +145,20 @@ proc pimotor::makepimotor {name num sct lowlim upperlim} { $name softlowerlim $lowlim $name hardupperlim $upperlim $name softupperlim $upperlim - + hsetprop /sics/${name}/hardposition read pimotor::read $num - hsetprop /sics/${name}/hardposition readreply pimotor::readreply + hsetprop /sics/${name}/hardposition readreply pimotor::readreply $sct poll /sics/${name}/hardposition 60 - + hsetprop /sics/${name}/hardposition write pimotor::write $num $name hsetprop /sics/${name}/hardposition writereply pimotor::writereply $name $sct write /sics/${name}/hardposition - + hsetprop /sics/${name}/status read pimotor::sendstatus $num hsetprop /sics/${name}/status statusreply pimotor::statusreply $num hsetprop /sics/${name}/status statuspos pimotor::statuspos $name $sct poll /sics/${name}/status 60 - + hfactory /sics/${name}/speed plain user int hsetprop /sics/${name}/speed read pimotor::readspeed $num hsetprop /sics/${name}/speed readreply pimotor::readreply @@ -167,11 +167,11 @@ proc pimotor::makepimotor {name num sct lowlim upperlim} { hsetprop /sics/${name}/speed write pimotor::writespeed $num hsetprop /sics/${name}/speed speedreply pimotor::speedreply $num $sct write /sics/${name}/speed - + $name makescriptfunc halt "pimotor::halt $sct $num" user $name makescriptfunc on "pimotor::writeon $sct $num" user $name makescriptfunc home "pimotor::writenull $sct $num" user - + hupdate /sics/${name}/status idle - $sct queue /sics/${name}/hardposition progress read + $sct queue /sics/${name}/hardposition progress read } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/secsim.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/secsim.tcl index e418a23a..b7a5a592 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/secsim.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/secsim.tcl @@ -1,5 +1,5 @@ #--------------------------------------------------------------- -# This is a second generation simulation motor. +# This is a second generation simulation motor. # # copyright: see file COPYRIGHT # @@ -39,7 +39,7 @@ proc simstatusget {motname} { } #------------------------------------------------------------- proc simstatusfault {motname } { - clientput "ERROR: I am feeling faulty!" + clientput "ERROR: I am feeling faulty!" return error } #-------------------------------------------------------------- @@ -53,11 +53,11 @@ proc MakeSecSim {name lower upper delay} { hfactory /sics/$name/starttime plain user int hset /sics/$name/delay $delay hdel /sics/$name/hardposition - hfactory /sics/$name/hardposition script "simhardget $name" "simhardset $name" float -# hfactory /sics/$name/hardposition script "simhardfaultget $name" "simhardset $name" float + hfactory /sics/$name/hardposition script "simhardget $name" "simhardset $name" float +# hfactory /sics/$name/hardposition script "simhardfaultget $name" "simhardset $name" float hdel /sics/$name/status - hfactory /sics/$name/status script "simstatusget $name" "hdbReadOnly b" text -# hfactory /sics/$name/status script "simstatusfault $name" "hdbReadOnly b" text + hfactory /sics/$name/status script "simstatusget $name" "hdbReadOnly b" text +# hfactory /sics/$name/status script "simstatusfault $name" "hdbReadOnly b" text $name makescriptfunc halt "simhalt $name" user hupdate /sics/$name/hardupperlim $upper hupdate /sics/$name/softupperlim $upper diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/simhm.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/simhm.tcl index 8785d093..1990eaae 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/simhm.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/simhm.tcl @@ -1,13 +1,13 @@ #----------------------------------------------------- -# This is a simulation driver for the second -# generation histogram memory. It provides +# This is a simulation driver for the second +# generation histogram memory. It provides # for a fill value which is used to initialize -# data. +# data. # # copyright: see file COPYRIGHT # # Mark Koennecke, January 2010 -#----------------------------------------------------- +#----------------------------------------------------- namespace eval simhm {} #----------------------------------------------------- proc simhm::getcontrol {name} { @@ -74,7 +74,7 @@ proc simhm::MakeSimHM {name rank {tof NULL} } { hfactory /sics/${name}/control script \ "simhm::getcontrol $name" "simhm::setcontrol $name" float hsetprop /sics/${name}/control priv user - + hdel /sics/${name}/status hfactory /sics/${name}/status script \ "simhm::getstatus $name" hdbReadOnly text diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/sinqhttp.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/sinqhttp.tcl index 1eff587c..8e42d3b7 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/sinqhttp.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/sinqhttp.tcl @@ -1,6 +1,6 @@ #-------------------------------------------------------- -# This is an asynchronous scriptcontext driven driver for -# the SINQ style http based histogram memory. +# This is an asynchronous scriptcontext driven driver for +# the SINQ style http based histogram memory. # # script chains: # -- control @@ -17,7 +17,7 @@ # You will need to override hmhttpevalstatus to implement # an update of the detector data # -# Mark Koennecke, April 2010 +# Mark Koennecke, April 2010 #--------------------------------------------------------- proc hmhttpsend {url} { sct send $url @@ -83,7 +83,7 @@ proc hmhttpdatareply {} { set status [catch {hmhttpreply} txt] if {$status == 0} { set path [file dirname [sct]] - hdelprop $path/data geterror + hdelprop $path/data geterror } return idle } @@ -107,13 +107,13 @@ proc hmhttpevalstatus {name} { clientput $data sct update error return idle - } + } hdelprop [sct] geterror set lines [split $data \n] foreach line $lines { set ld [split $line :] sct [string trim [lindex $ld 0]] [string trim [lindex $ld 1]] - } + } set daq [sct DAQ] set old [hval [sct]] if {$daq == 1} { diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/stddrive.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/stddrive.tcl index 2df85a96..97541a40 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/stddrive.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/stddrive.tcl @@ -1,13 +1,13 @@ #------------------------------------------------------ # This is some code for a standard drivable object in # the scriptcontext system. It implements an empty -# object which throws errors when accessed. Users -# of such an object can override it to do -# something more acceptable. This object also -# provides for basic limit checking and status +# object which throws errors when accessed. Users +# of such an object can override it to do +# something more acceptable. This object also +# provides for basic limit checking and status # checking. It can serve as a basis for creating # new drivable objects, for instance environment -# control devices. A possible user has as the +# control devices. A possible user has as the # first thing in a write script to set the target # node to the desired value. # @@ -61,7 +61,7 @@ proc stddrive::deread {} { proc stddrive::dewrite {name} { # hset /sics/${name}/stop 1 error "$name is not configured, cannot drive" -} +} #-------------------------------------------------------- proc stddrive::deconfigure {name} { set allowed [list upperlimit lowerlimit tolerance stop] @@ -89,12 +89,12 @@ proc stddrive::makestddrive {name sicsclass sct} { hset /sics/${name}/lowerlimit 10 hfactory /sics/${name}/stop plain user int hset /sics/${name}/stop 0 - + hsetprop /sics/${name} checklimits stddrive::stdcheck $name hsetprop /sics/${name} checkstatus stddrive::stdstatus $name hsetprop /sics/${name} halt stddrive::stop $name deconfigure $name $sct write /sics/${name} - $sct poll /sics/${name} 60 + $sct poll /sics/${name} 60 hupdate /sics/${name} -9999.99 } diff --git a/site_ansto/instrument/tas/config/tasmad/sicscommon/table.tcl b/site_ansto/instrument/tas/config/tasmad/sicscommon/table.tcl index dba5878a..d275c8f5 100644 --- a/site_ansto/instrument/tas/config/tasmad/sicscommon/table.tcl +++ b/site_ansto/instrument/tas/config/tasmad/sicscommon/table.tcl @@ -14,11 +14,11 @@ if { [info exists __tableheader] == 0 } { } #===================================================================== # Csv tcl package version 2.0 -# A tcl library to deal with CSV (comma separated value) +# A tcl library to deal with CSV (comma separated value) # files, generated and readable by some DOS/Windows programs # Contain two functions: # csv2list string ?separator? -# and +# and # list2csv list ?separator? # which converts line from CSV file to list and vice versa. # @@ -52,9 +52,9 @@ proc csv2list {str {separator ","}} { junk2 str]} { if {[string length $quoted]||$unquoted=="\"\""} { regsub -all {""} $quoted \" unquoted - } + } lappend list $unquoted - } + } if {[regexp $regexp2 $str junk unquoted quoted]} { if {[string length $quoted]||$unquoted=="\"\""} { regsub -all {""} $quoted \" unquoted @@ -62,7 +62,7 @@ proc csv2list {str {separator ","}} { lappend list $unquoted if {[uplevel info exist csvtail]} { uplevel set csvtail {""} - } + } } else { if {[uplevel info exist csvtail]} { uplevel [list set csvtail $str] @@ -72,18 +72,18 @@ proc csv2list {str {separator ","}} { } } return $list -} +} proc list2csv {list {separator ","}} { - set l {} + set l {} foreach elem $list { if {[string match {} $elem]|| [regexp {^[+-]?([0-9]+|([0-9]+\.?[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?)$}\ $elem]} { - lappend l $elem + lappend l $elem } else { regsub -all {"} $elem {""} selem - lappend l "\"$selem\"" + lappend l "\"$selem\"" } } return [join $l $separator] @@ -99,21 +99,21 @@ proc csvfile {f {separator ","}} { } elseif {![string length $line]} { lappend list {} continue - } + } set rec [csv2list $line $separator] set buffer [concat $buffer $rec] if {![ string length $csvtail]} { - lappend list $buffer + lappend list $buffer set buffer {} } - } + } if {[string length $csvtail]} { return -code error -errorcode {CSV 2 "Multiline parse error"}\ "CSV file parse error" } return $list -} - +} + proc csvstring {str {separator ","}} { set csvtail "" set list {} @@ -124,30 +124,30 @@ proc csvstring {str {separator ","}} { } elseif {![string length $line]} { lappend list {} continue - } + } set rec [csv2list $line $separator] set buffer [concat $buffer $rec] if {![ string length $csvtail]} { - lappend list $buffer + lappend list $buffer set buffer {} } - } + } if {[string length $cvstail]} { return -code error -errorcode {CSV 2 "Multiline parse error"}\ "CSV string parse error" } return $list -} +} package provide Csv 2.1 #======================================================================== -# The plan here is such: operations which happen fast or immediatly are -# done at once. Count commands or anything given as command is appended -# to a list for later execution. The idea is that this contains the +# The plan here is such: operations which happen fast or immediatly are +# done at once. Count commands or anything given as command is appended +# to a list for later execution. The idea is that this contains the # actual measuring payload of the row. # Drivables are immediatly started. # After processing the rows, there is a success to wait for motors to arrive -# Then the commands for later execution are run. This frees the user of the +# Then the commands for later execution are run. This frees the user of the # the necessity to have the count or whatever command as the last thing in the row #-------------------------------------------------------------------------------- proc testinterrupt {} { @@ -155,7 +155,7 @@ proc testinterrupt {} { if {[string first continue $int] < 0} { error "Interrupted" } -} +} #-------------------------------------------------------------------------------- proc processtablerow {line} { global __tableheader @@ -225,7 +225,7 @@ proc processtablerow {line} { } #------------------------------------------------------------------------ proc tableexe {tablefile} { - global __tableheader + global __tableheader if {[string first NULL $__tableheader] < 0} { error "Tableexe already running, terminated" } @@ -253,7 +253,7 @@ proc loop args { clientput $args if {[llength $args] < 2} { error \ -"Usage: loop \n\t number of repetions\n\t any SICS command" +"Usage: loop \n\t number of repetions\n\t any SICS command" } set len [lindex $args 0] set command [lrange $args 1 end] diff --git a/site_ansto/instrument/tas/config/tasmad/taspub_sics/nxtas.tcl b/site_ansto/instrument/tas/config/tasmad/taspub_sics/nxtas.tcl index 4aa6eb1b..5dc0e661 100644 --- a/site_ansto/instrument/tas/config/tasmad/taspub_sics/nxtas.tcl +++ b/site_ansto/instrument/tas/config/tasmad/taspub_sics/nxtas.tcl @@ -1,18 +1,18 @@ #------------------------------------------------------------------------- -# Functions for writing NeXus files for a triple axis spectrometer and +# Functions for writing NeXus files for a triple axis spectrometer and # configuration of the internal scan object to support this. # # Mark Koennecke, May 2005 # reworked to new NeXus standards, Mark Koennecke, February 2007 #----------------------------------------------------------------------- -catch {sicsdatafactory new __transfer} +catch {sicsdatafactory new __transfer} set __tasdata(out) "" #---------------------------------------------------------------------- proc appendMotor {np motor alias} { set val [tasSplit [$motor]] if { [string length $val] > 0} { __transfer putfloat 0 $val - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } else { clientput "WARNING: failed to read $motor" } @@ -33,22 +33,22 @@ proc appendIfPresent {np obj alias} { proc appendFloat {np alias val} { if {[string length $val] > 0} { __transfer putfloat 0 $val - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } else { - clientput "WARNING: failed to read $alias" + clientput "WARNING: failed to read $alias" } } #------------------------------------------------------------------- proc appendCount {np value alias} { __transfer putint 0 $value - nxscript putslab $alias [list $np] [list 1] __transfer + nxscript putslab $alias [list $np] [list 1] __transfer } -#-------------------------------------------------------------------- +#-------------------------------------------------------------------- proc donothing {obj userobj} { } #--------------------------------------------------------------------- proc xmlprepare {obj userobj} { - global __tasdata + global __tasdata #------- normal prepare tasscan prepare $obj $userobj @@ -92,24 +92,24 @@ proc xmlprepare {obj userobj} { #-------------------------------------------------------------------- proc xmlwritepoint {obj userobj np} { global __tasdata scripthome - + nxscript reopen $__tasdata(file) $scripthome/tasub.dic - + append line [format " %3d" $np] set scanvars [split [tasSplit [iscan getscanvars]]] foreach var $scanvars { if { [string length $var] > 1} { set val [tasSplit [eval $var]] - append line [format "%9.4f " [tasSplit [$var]]] - appendMotor $np $var sc_$var + append line [format "%9.4f " [tasSplit [$var]]] + appendMotor $np $var sc_$var lappend storedvars $var } } foreach var $__tasdata(out) { append line [format "%9.4f " [tasSplit [eval $var]]] - appendMotor $np $var sc_$var + appendMotor $np $var sc_$var lappend storedvars $var - + } @@ -118,12 +118,12 @@ proc xmlwritepoint {obj userobj np} { append line [format "%8.2f " [tasSplit [counter gettime]]] append line [format "%8d " [tasSplit [counter getcounts]]] clientput $line - + appendCount $np [tasSplit [counter getcounts]] counts appendCount $np [tasSplit [counter getmonitor 1]] cter_01 appendCount $np [tasSplit [counter getcounts]] cter_02 - appendFloat $np motime [tasSplit [counter gettime]] - + appendFloat $np motime [tasSplit [counter gettime]] + set varlist [list qh qk ql qm en ei ef a1 a2 a3 a4 a5 a6 sgu sgl] foreach var $varlist { @@ -131,11 +131,11 @@ proc xmlwritepoint {obj userobj np} { appendMotor $np $var sc_${var} } } - + if {$np == 0} { makeTASLinks } - + nxscript close } #====================== actual XML stuff ============================ @@ -144,7 +144,7 @@ proc writeUserData {} { writeTextVar usaff affiliation writeTextVar usadd address writeTextVar usmail email - writeTextVar lonam local + writeTextVar lonam local } #------------------------------------------------------------------- proc writeMonochromator {} { @@ -249,19 +249,19 @@ proc makeScanLinks {} { if {$testalias == 1} { nxscript putattribute $alias axis 1 set axis 1 - } - } + } + } } } -# if axis = 0 there is no alias; so we create something in here from the -# scan data in iscan +# if axis = 0 there is no alias; so we create something in here from the +# scan data in iscan if {$axis == 0} { set data [tasSplit [iscan getvardata 0]] set count 0 foreach e $data { set ar($count) [string trim $e] incr count - } + } nxscript putarray danascanvar ar [llength $data] } } @@ -293,7 +293,7 @@ proc xmltaswrite {obj userobj} { writeAnalyzer - writeDetector + writeDetector nxscript close @@ -326,7 +326,7 @@ proc xmlpowderwrite {obj userobj} { writeAnalyzer - writeDetector + writeDetector makePowderLinks diff --git a/site_ansto/instrument/tas/config/tasmad/taspub_sics/tasp.tcl b/site_ansto/instrument/tas/config/tasmad/taspub_sics/tasp.tcl index 997712df..13c0f6eb 100644 --- a/site_ansto/instrument/tas/config/tasmad/taspub_sics/tasp.tcl +++ b/site_ansto/instrument/tas/config/tasmad/taspub_sics/tasp.tcl @@ -7,7 +7,7 @@ # O P T I O N S #-------------------------------------------------------------------------- # simMode -# - 0 real instrument +# - 0 real instrument # - 1 development simulation # - 2 simserver at instrument #-------------------------------------------------------------------------- @@ -16,7 +16,7 @@ set simMode 1 set ts psts230.psi.ch set mupad 0 -#---------- Enable this for more startup debugging +#---------- Enable this for more startup debugging protocol set all #--------------- define home @@ -40,7 +40,7 @@ ServerOption ReadTimeOut 10 ServerOption AcceptTimeOut 10 -ServerOption ReadUserPasswdTimeout 500000 +ServerOption ReadUserPasswdTimeout 500000 ServerOption LogFileBaseName $loghome/tasplog @@ -70,7 +70,7 @@ SicsUser lnsmanager lnsSICSlns 1 SicsUser user 10lns1 2 SicsUser taspuser 10lns1 2 #--------------------------------------------------------------------------- -# M O T O R S +# M O T O R S if {$simMode == 0} { @@ -95,7 +95,7 @@ Motor MCV el734hp mota 3 # Monochromator curvature vertical Motor SRO el734hp mota 12 # Sample table second ring Motor MTL el734hp mota 4 # Monochromator translation lower Motor MTU el734hp mota 5 # Monochromator Translation upper -Motor MGL el734hp mota 7 # Monochromator lower goniometer +Motor MGL el734hp mota 7 # Monochromator lower goniometer MakeRS232Controller motb $ts 3003 @@ -115,14 +115,14 @@ Motor STL el734hp motb 1 # Sample lower translation Motor STU el734hp motb 2 # Sample upper translation Motor ATL el734hp motb 7 # Analyzer lower translation Motor ATU el734hp motb 8 # Analyzer upper translation -#Motor SGL SIM -17 17 -1 .0 # Monochromator upper goniometer -#Motor SGU SIM -17 17 -1 .0 # Monochromator upper goniometer -Motor SGL el734hp motb 3 # Sample lower goniometer -Motor SGU el734hp motb 4 # Sample upper goniometer -Motor AGL el734hp motb 11 # Analyzer lower goniometer -#Motor AGU SIM -30. 30. -.1 2. # Analyzer upper goniometer -#Motor MSC SIM -30. 30. -.1 2. # Monochromator changer -#Motor ASC SIM -30. 30. -.1 2. # Analyzer changer +#Motor SGL SIM -17 17 -1 .0 # Monochromator upper goniometer +#Motor SGU SIM -17 17 -1 .0 # Monochromator upper goniometer +Motor SGL el734hp motb 3 # Sample lower goniometer +Motor SGU el734hp motb 4 # Sample upper goniometer +Motor AGL el734hp motb 11 # Analyzer lower goniometer +#Motor AGU SIM -30. 30. -.1 2. # Analyzer upper goniometer +#Motor MSC SIM -30. 30. -.1 2. # Monochromator changer +#Motor ASC SIM -30. 30. -.1 2. # Analyzer changer #Motor CSC SIM -30. 30. -.1 2. # Collimator changer mcv precision .1 } else { @@ -141,10 +141,10 @@ Motor SGL sim -19 19 -1. 0 # Sample lower translation Motor SGU SIM -30. 30. -.1 2. # Sample upper translation Motor ATL sim -17 17 -.1 .1 # Analyzer lower translation Motor ATU sim -17 17 -.1 .1 # Analyzer upper translation -Motor MGL sim -10 10 -.1 .1 # Monochromator lower goniometer -Motor SGL sim -16 16 -.1 .1 # Sample lower goniometer -Motor SGU sim -16 16 -.1 .1 # Sample upper goniometer -Motor AGL sim -10 10 -.1 .1 # Analyzer lower goniometer +Motor MGL sim -10 10 -.1 .1 # Monochromator lower goniometer +Motor SGL sim -16 16 -.1 .1 # Sample lower goniometer +Motor SGU sim -16 16 -.1 .1 # Sample upper goniometer +Motor AGL sim -10 10 -.1 .1 # Analyzer lower goniometer #-------------------------------------------------------------------------- # C U R R E N T S @@ -180,7 +180,7 @@ MakeCounter counter sim -1. #-------------------------------------------------------------------------- VarMake instrument Text Mugger instrument TASPUB -instrument lock +instrument lock VarMake title Text User VarMake user Text User @@ -203,12 +203,12 @@ source $scripthome/stddrive.tcl source $scripthome/slsecho.tcl if {$simMode == 0} { makesctcontroller slssct slsecho taspmagnet:5001 -slsecho::makeslsecho i1 0 slssct -slsecho::makeslsecho i2 1 slssct -slsecho::makeslsecho i3 2 slssct -slsecho::makeslsecho i4 3 slssct -slsecho::makeslsecho i5 4 slssct -slsecho::makeslsecho i6 5 slssct +slsecho::makeslsecho i1 0 slssct +slsecho::makeslsecho i2 1 slssct +slsecho::makeslsecho i3 2 slssct +slsecho::makeslsecho i4 3 slssct +slsecho::makeslsecho i5 4 slssct +slsecho::makeslsecho i6 5 slssct } } @@ -255,7 +255,7 @@ MakeTasUB tasub MakeScanCommand iscan counter tas.hdd recover.bin MakePeakCenter iscan MakeTasScan iscan tasub -#-------------------------- new exe manager +#-------------------------- new exe manager definealias do exe alias batchroot exe batchpath #-------------------------- normal drive command diff --git a/site_ansto/instrument/tas/config/tasmad/taspub_sics/taspubcom.tcl b/site_ansto/instrument/tas/config/tasmad/taspub_sics/taspubcom.tcl index 71101b08..f8a5a60f 100644 --- a/site_ansto/instrument/tas/config/tasmad/taspub_sics/taspubcom.tcl +++ b/site_ansto/instrument/tas/config/tasmad/taspub_sics/taspubcom.tcl @@ -1,6 +1,6 @@ #--------------------------------------------------------------------------- -# The triple axis people love to have the command set emulate the command -# set of TASMAD as closely as possible. This is implemented through +# The triple axis people love to have the command set emulate the command +# set of TASMAD as closely as possible. This is implemented through # some scripting. This version is for the new syntax to be used with the # new UB matrix calculaus for triple axis. # diff --git a/site_ansto/instrument/tas/config/tasmad/taspub_sics/tasscript.tcl b/site_ansto/instrument/tas/config/tasmad/taspub_sics/tasscript.tcl index 7119ffb9..c6e74886 100644 --- a/site_ansto/instrument/tas/config/tasmad/taspub_sics/tasscript.tcl +++ b/site_ansto/instrument/tas/config/tasmad/taspub_sics/tasscript.tcl @@ -1,18 +1,18 @@ #----------------------------------------------------------------------------- # This file contains all the scripted commands to make a SICS-TAS look -# almost like a MAD-TAS. +# almost like a MAD-TAS. # # This version is special to RITA-2!! # # Mark Koennecke, September 2005 # -# The specialities for RITA have been separated and this is controlled -# by testing the instrument name. This way I can use the same version for +# The specialities for RITA have been separated and this is controlled +# by testing the instrument name. This way I can use the same version for # TASP, RITA-2 and EIGER -# +# # Mark Koennecke, November 2010 #------------------------------------------------------------------------ -# quite often we need to split a SICS answer of the form x = y and +# quite often we need to split a SICS answer of the form x = y and # extract the y. This is done here. #----------------------------------------------------------------------- proc tasSplit {text} { @@ -152,7 +152,7 @@ if { [info exists tasubinit] == 0 } { } #------------------------------------------------------------------------ # TASMAD relies on the order of variables in memory in order to interpret -# scan or drive commands. In the new syntax motor order is only preserved +# scan or drive commands. In the new syntax motor order is only preserved # for the QE motors, not for real motors. This list configures the order. #------------------------------------------------------------------------ set tasOrderList [list qh qk ql en] @@ -166,7 +166,7 @@ for {set i 0} {$i < [llength $tasmot]} { incr i } { set tasmap(l$mot) [format "%s softlowerlim " $mot] set tasmap(z$mot) [format "madZero %s " $mot] set tasmap(u$mot) [format "%s softupperlim " $mot] -} +} set tasmap(ss) "scatSense ss " set tasmap(sa) "scatSense sa " set tasmap(sm) "scatSense sm " @@ -186,7 +186,7 @@ for {set i 0} { $i < 8} { incr i} { # clientput [format " %s = %s" $e $tasmap($e)] #} #---------------------------------------------------------------------- -# put an angle into 360 +# put an angle into 360 proc circlify {val} { set p $val while {$p > 360.0} { @@ -207,12 +207,12 @@ proc madZero args { set length [llength $args] if { $length < 1} { error "ERROR: expected at least motor name as a parameter to madZero" - } + } set mot [lindex $args 0] if {$length == 1 } { #inquiry case set zero [tasSplit [$mot softzero]] - return [format "madZero = %f " [expr -$zero]] + return [format "madZero = %f " [expr -$zero]] } else { # a new value has been given. set val [lindex $args 1] @@ -225,14 +225,14 @@ proc madZero args { $mot softupperlim [circlify [expr $high - $displacement]] $mot softlowerlim [circlify [expr $low - $displacement]] } -} +} #-------------------------------------------------------------------------- # This routine throws an error if a bad value for fx is given #-------------------------------------------------------------------------- proc fxi { {val UNKNOWN} } { if {[string compare $val UNKNOWN] ==0} { return [format " fx = %2s " [tasSplit [tasub const]] ] - } + } return [tasub const $val] } #------------------------------------------------------------------------- @@ -258,17 +258,17 @@ proc scatSense {par {val -1000} } { error "ERROR: unknown scattering sense $par" } } -#-------- inquiry case +#-------- inquiry case if { $val == -1000 } { switch $par { sm { - return [format "sm = %d" [tasSplit [tasub mono ss]]] + return [format "sm = %d" [tasSplit [tasub mono ss]]] } ss { - return [format "ss = %d" [tasSplit [tasub ss]]] + return [format "ss = %d" [tasSplit [tasub ss]]] } sa { - return [format "sa = %d" [tasSplit [tasub ana ss]]] + return [format "sa = %d" [tasSplit [tasub ana ss]]] } default { error "Unknown scattering sense requested" @@ -325,9 +325,9 @@ proc scatSense {par {val -1000} } { madZero $mot $newzero $mot softupperlim $newupper $mot softlowerlim $newlower - } - } -} + } + } +} #------------------------------------------------------------------------- # The output command #------------------------------------------------------------------------- @@ -350,11 +350,11 @@ proc ou args { # typeATokenizer extracts tokens from a command string. Tokens can be # either variable names or - indicating a series of variables. # Returns the token value or END if the end of the string text is -# reached. Uses and updates a variable pos which indicates the current +# reached. Uses and updates a variable pos which indicates the current # position in the string. #--------------------------------------------------------------------------- proc typeATokenizer {text pos} { - upvar pos p + upvar pos p set l [string length $text] #------- check for end if {$p >= $l} { @@ -408,7 +408,7 @@ proc cl args { } } return - } + } #------ trying to clear individual fixed motors set command [join $args] set command [string tolower $command] @@ -438,10 +438,10 @@ proc cl args { error [format "ERROR: %s is no motor" $e] } else { clientput [format "%s unfixed" $e] - } + } if {[string compare $e $stop] == 0 } { break - } + } } } else { #------ should be a single motor here @@ -451,7 +451,7 @@ proc cl args { error [format "ERROR: %s is no motor" $token] } else { clientput [format "%s unfixed" $token] - } + } } #------- do not forget to proceed set token [typeATokenizer $command $pos] @@ -478,7 +478,7 @@ proc fi args { } } return - } + } #------ parse motors to fix set command [join $args] set command [string tolower $command] @@ -508,10 +508,10 @@ proc fi args { error [format "ERROR: %s is no motor" $e] } else { clientput [format "%s fixed" $e] - } + } if {[string compare $e $stop] == 0 } { break - } + } } } else { #------ should be a single motor here @@ -521,7 +521,7 @@ proc fi args { error [format "ERROR: %s is no motor" $token] } else { clientput [format "%s fixed" $token] - } + } } #------- do not forget to proceed set token [typeATokenizer $command $pos] @@ -532,7 +532,7 @@ proc fi args { # handles pos as in type A syntax above. #-------------------------------------------------------------------------- proc varToken {text pos} { - upvar pos p + upvar pos p set l [string length $text] #------- check for end if {$p >= $l} { @@ -565,7 +565,7 @@ proc varToken {text pos} { # varSet parses a string containing MAD variable statements and sets the # variables. Thereby it has to take care of mappings and special variables # which have to be set by special functions. The only format allowed here -# are name value pairs. +# are name value pairs. #-------------------------------------------------------------------------- proc varSet { command } { global tasmap @@ -580,7 +580,7 @@ proc varSet { command } { [string compare $token local] == 0 } { eval $command return - } + } if { [string compare $token out] == 0 || \ [string compare $token ou] == 0 } { append txt $token " " [string range $command $pos end] @@ -597,37 +597,37 @@ proc varSet { command } { if { [info exists tasmap($token)] == 1} { set ret [catch {eval $tasmap($token) $value} msg] if { $ret != 0} { - error [format "ERROR: > %s < while setting %s" $msg $token] + error [format "ERROR: > %s < while setting %s" $msg $token] } else { clientput [format " %s = %s" $token $value] } - } else { + } else { set ret [catch {eval $token $value} msg] if { $ret != 0 } { - error [format "ERROR: error %s while setting %s" $msg $token] + error [format "ERROR: error %s while setting %s" $msg $token] } else { clientput [format " %s = %s" $token $value] } - } + } set token [varToken $command $pos] set value [varToken $command $pos] } catch {tasub update} msg } #-------------------------------------------------------------------------- -# co for count is the funny MAD count procedure. Please note, that the +# co for count is the funny MAD count procedure. Please note, that the # count mode is automatically set through the last MN or TI variable. #-------------------------------------------------------------------------- proc coritacount {mode preset nloop} { - set rmode [ritamode] + set rmode [ritamode] hm countmode $mode hm preset $preset for { set i 0} {$i < $nloop} {incr i} { - set ret [catch {eval hm countblock} msg] + set ret [catch {eval hm countblock} msg] if {$ret != 0} { error $msg } - #----- format output + #----- format output set cts [tasSplit [hm sum 0 127 0 127]] set m1 [tasSplit [counter getmonitor 1]] set m2 [tasSplit [counter getmonitor 2]] @@ -642,18 +642,18 @@ proc coritacount {mode preset nloop} { append txt [format " %s = %d" $win [sumPSDWindow $i]] } clientput $txt - } + } } } #------------------------------------------------------------------------ proc conormalcount {mode preset nloop} { counter setmode $mode for { set i 0} {$i < $nloop} {incr i} { - set ret [catch {eval counter count $preset } msg] + set ret [catch {eval counter count $preset } msg] if {$ret != 0} { error $msg } - #----- format output + #----- format output set cts [tasSplit [counter getcounts]] set m1 [tasSplit [counter getmonitor 1]] set m2 [tasSplit [counter getmonitor 2]] @@ -664,7 +664,7 @@ proc conormalcount {mode preset nloop} { " Counts = %8d, M1 = %8d, M2 = %8d, M3 = %8d, Time = %8.2f" \ $cts $m1 $m2 $m3 $time] } -} +} #------------------------------------------------------------------------- proc co args { global ritaspecial @@ -712,17 +712,17 @@ proc co args { #---------------------------------------------------------------------------- proc fm args { #------ do the scan first - append com "sc " [ join $args] + append com "sc " [ join $args] set ret [catch {eval $com} msg] if { $ret != 0 } { error $msg - } + } # iscan simscan 15 .3 1000 #----- calculate the center set ret [catch {eval peak value} msg] if { $ret != 0 } { error $msg - } + } if { [string first "WARN" $msg ] >= 0 } { error [format "ERROR: failed to find peak: %s" $msg] } @@ -737,7 +737,7 @@ proc fm args { set ret [catch {eval dr $var $val} msg] if { $ret != 0 } { error $msg - } + } } #------------------------------------------------------------------------ # fz does almost the same as fm, but also sets the current position to be @@ -745,17 +745,17 @@ proc fm args { #------------------------------------------------------------------------ proc fz args { #------ do the scan first - append com "sc " [ join $args] + append com "sc " [ join $args] set ret [catch {eval $com} msg] if { $ret != 0 } { error $msg - } + } iscan simscan 15 .3 1000 #----- calculate the center set ret [catch {eval peak value} msg] if { $ret != 0 } { error $msg - } + } if { [string first "WARN" $msg ] >= 0 } { error [format "ERROR: failed to find peak: %s" $msg] } @@ -770,7 +770,7 @@ proc fz args { set ret [catch {eval dr $var $val} msg] if { $ret != 0 } { error $msg - } + } #------- now do zero point set temp [eval $var hardposition] set newZero [tasSplit $temp] @@ -785,16 +785,16 @@ proc pr args { set line [join $args] set line [string tolower $line] set pos 0 - set token [varToken $line $pos] + set token [varToken $line $pos] while { [string compare $token -end] } { #-------- check for mapped values first if { [info exists tasmap($token)] == 1 } { set val [tasSplit [eval $tasmap($token)]] - clientput [format " %s = %s" $token $val] + clientput [format " %s = %s" $token $val] } else { #------ simple variables go here set val [tasSplit [$token] ] - clientput [format " %s = %s" $token $val] + clientput [format " %s = %s" $token $val] } set token [varToken $line $pos] } @@ -858,7 +858,7 @@ proc lz args { incr count if { $count == 6 } { append outPut " \n" - } + } } return $outPut } @@ -962,7 +962,7 @@ proc le args { append output [format "POSN: %s" $val] append output [format "TARG: %s" $val2] - return $output + return $output } #----------------------------------------------------------------------- # fmtMot formats a motors parameters in order to fit the format for @@ -980,7 +980,7 @@ proc fmtMot mot { set txt [format "%-7s%1s %7.2f %7.2f %7.2f" $mot $fix $pos $target \ $zero] return $txt -} +} #------------------------------------------------------------------------- # lt --> list targets #------------------------------------------------------------------------- @@ -1011,7 +1011,7 @@ proc lt args { [fmtMot MTL] " " ] append output [format "%s | %s\n" \ [fmtMot MTU] " " ] - return $output + return $output } #-------------------------------------------------------------------- # li --> list everything @@ -1044,9 +1044,9 @@ proc log args { if { [ llength $args] == 0 } { if { [string compare $madlog disabled] == 0 } { return "Logging is disabled" - } else { + } else { return [format "Logging to %s" $madlog] - } + } } #------args, action according to keyword set key [string tolower [lindex $args 0]] @@ -1070,7 +1070,7 @@ proc log args { append output "\tLog close : stop logging\n" return $output } - } + } } #-------------------------------------------------------------------------- @@ -1080,7 +1080,7 @@ proc sz args { global tasmot set usage "\n Usage: \n\t sz motor newval \n" set line [string tolower [join $args]] - set pos 0 + set pos 0 set mot [varToken $line $pos] set val [varToken $line $pos] if { [lsearch $tasmot $mot] < 0 } { @@ -1091,7 +1091,7 @@ proc sz args { } #-------- output, output, output......... append output [format "Values : Lo(hard) Lo(soft) Posn%s" \ - " Target Hi(soft) Hi(hard) Zero\n"] + " Target Hi(soft) Hi(hard) Zero\n"] set zero [tasSplit [madZero $mot]] set loh [tasSplit [eval $mot hardlowerlim]] set loh [expr $loh + $zero] @@ -1134,7 +1134,7 @@ proc pa args { set fil $fil.pal } polfile $fil -} +} #-------------------------------------------------------------------------- # on and off for switching spin flippers #------------------------------------------------------------------------- @@ -1148,7 +1148,7 @@ proc checkarg args { return $flipper } else { error [format "%s not a recognized flipper" $flipper] - } + } } #------------------------------------------------------------------------ proc on args { @@ -1198,7 +1198,7 @@ proc syncdrive {mot pos} { } } #-------------------------------------------------------------------------- -# "set posttion" sp to reset the zero-position. +# "set posttion" sp to reset the zero-position. # syntax: "SP " to set the softzero value of # in a way that the targetposition is set to . # J. Stahn, 10. 2001 @@ -1255,7 +1255,7 @@ proc scan {name} { info { set scanvar [findscanvar] append result [tasSplit [iscan np]] ",1," $scanvar - append result , + append result , append result [string trim [tasSplit [iscan getfile]]] return $result } @@ -1291,7 +1291,7 @@ proc dr args { error "ERROR: do not know what to drive to $token" } } else { - set lastVar $token + set lastVar $token lappend motors $lastVar } set token [varToken $command $pos] @@ -1340,7 +1340,7 @@ proc sc args { set lastVar quarkPhaser set pos 0 set state 0 -# states: +# states: # 0 = expectToken, 1 = expectPosition, 2 = continuePosition # 3 = expectIncrement, 4 = continueIncrement @@ -1423,7 +1423,7 @@ proc sc args { error "ERROR: nothing to scan" } set __tasdata(qe) 0 - set qeVars [list qh qk ql ei ef en qm ki kf] + set qeVars [list qh qk ql ei ef en qm ki kf] foreach var $scanvars { if {[lsearch -exact $qeVars [string tolower $var]] >= 0} { set __tasdata(qe) 1 @@ -1445,7 +1445,7 @@ proc sc args { set start [expr $scanpos($var) - $inc($var) * ($np - 1)/2.] iscan add $var $start $inc($var) } - return [iscan run $np $mode $preset] + return [iscan run $np $mode $preset] } #--------------------------------------------------------------------- proc cell args { @@ -1454,7 +1454,7 @@ proc cell args { #-------------------------------------------------------------------- proc ref args { if { [llength $args] == 0} { - return [tasub listref] + return [tasub listref] } set key [string trim [lindex $args 0]] if { [string compare $key clear] == 0} { @@ -1470,13 +1470,13 @@ proc ref args { } elseif {[string compare $key aux] == 0} { set qpos [lrange $args 1 end] append cmd "tasub addauxref " [join $qpos] - return [eval $cmd] + return [eval $cmd] } else { return [eval tasub addref $args] } } #-------------------------------------------------------------------- -proc makeub args { +proc makeub args { if { [llength $args] >= 2} { tasub makeub [lindex $args 0] [lindex $args 1] return OK @@ -1485,7 +1485,7 @@ proc makeub args { } } #-------------------------------------------------------------------- -proc makeauxub {qh qk ql} { +proc makeauxub {qh qk ql} { tasub makeauxub $qh $qk $ql } #------------------------------------------------------------------- @@ -1493,18 +1493,18 @@ proc addauxref {qh qk ql} { tasub addauxref $qh $qk $ql } #-------------------------------------------------------------------- -proc makeubfromcell args { +proc makeubfromcell args { return [tasub makeubfromcell] } #--------------------------------------------------------------------- -proc listub args { +proc listub args { append output [tasSplit [tasub cell]] append output "\n" append output [tasub listub] append output [tasub listref] return $output } -#---------------------------------------------------------------------- +#---------------------------------------------------------------------- proc sf args { tasscan fast 1 set ret [catch {eval sc $args} msg] diff --git a/site_ansto/instrument/tas/taipan_configuration.tcl b/site_ansto/instrument/tas/taipan_configuration.tcl index 367f2c5f..2e910fc4 100644 --- a/site_ansto/instrument/tas/taipan_configuration.tcl +++ b/site_ansto/instrument/tas/taipan_configuration.tcl @@ -1,8 +1,8 @@ # Author: Jing Chen (jgn@ansto.gov.au) -# Required by server_config.tcl +# Required by server_config.tcl VarMake Instrument Text Internal -Instrument taipan +Instrument taipan Instrument lock #START SERVER CONFIGURATION SECTION @@ -131,7 +131,7 @@ if {$MY_INSTRUMENT_IS_BROKEN_AND_I_DIDNT_FIXIT} { publish tasacscript user anticollision script tasacscript } -# fix all motors +# fix all motors if {0} { foreach m [sicslist type motor] { if {$m == "motor" || $m == "dummy_motor"} { diff --git a/site_ansto/instrument/util/check/check_hdb.tcl b/site_ansto/instrument/util/check/check_hdb.tcl index f9b1e889..142f0186 100644 --- a/site_ansto/instrument/util/check/check_hdb.tcl +++ b/site_ansto/instrument/util/check/check_hdb.tcl @@ -1,7 +1,7 @@ ## \file # Must be loaded into an instance of SICS with fileeval # eg -# fileeval tests/query_sics.tcl +# fileeval tests/query_sics.tcl fileeval util/check/query_sics.tcl set hdb_prop_list { {control data} {true false} @@ -18,7 +18,7 @@ proc checknode {node} { set query "$a \{$v\}" if {![query_propval $node $query]} { clientput "$node: $a should be one of ($v) not [::utility::hgetplainprop $node $a]" - } + } } } } diff --git a/site_ansto/instrument/util/check/check_sobj.tcl b/site_ansto/instrument/util/check/check_sobj.tcl index e43c20e2..d7146fd3 100644 --- a/site_ansto/instrument/util/check/check_sobj.tcl +++ b/site_ansto/instrument/util/check/check_sobj.tcl @@ -28,7 +28,7 @@ proc checksobj {} { set attlist "$a \{$v\}" if {![query_attval $sobj $attlist]} { clientput "$sobj: $a should be one of ($v) not [getatt $sobj $a]" - } + } } } } diff --git a/site_ansto/instrument/util/check/query_sics.tcl b/site_ansto/instrument/util/check/query_sics.tcl index 007457aa..6bb32b8a 100644 --- a/site_ansto/instrument/util/check/query_sics.tcl +++ b/site_ansto/instrument/util/check/query_sics.tcl @@ -84,14 +84,14 @@ proc query_attval {sobj query} { } ## # prop_list list of property name value pairs -# value can be a @any @missing a single value or a list optionally preceded by -not +# value can be a @any @missing a single value or a list optionally preceded by -not # listnode / {data true sicsdev @missing type {-not part instrument nxvgroup}} proc listnode {hpath prop_list} { if {$hpath == "/"} { foreach hp [hlist /] { if [query_propval /$hp $prop_list] { clientput "/$hp" - } + } listnode /$hp $prop_list } } else { @@ -108,11 +108,11 @@ proc listsobj {sicstype att_list} { foreach sobj [sicslist type $sicstype] { if [query_attval $sobj $att_list] { clientput "$sobj" - } + } } } publish query_propval user publish query_attval user publish listnode user -publish listsobj user +publish listsobj user diff --git a/site_ansto/instrument/util/command.tcl b/site_ansto/instrument/util/command.tcl index 2f9a9ed9..07ecfb40 100644 --- a/site_ansto/instrument/util/command.tcl +++ b/site_ansto/instrument/util/command.tcl @@ -72,7 +72,7 @@ proc command {acmdName arglist body} { "feedback" { if {[info exists ${__cmd}_feedback_list] != 1} { return - } + } foreach {__var __fbvar} [set ${__cmd}_feedback_list] { eval [lindex $args 2] [lrange $args 3 end] $__fbvar $__var } @@ -107,13 +107,13 @@ proc command {acmdName arglist body} { if {[llength [sicslist ${__cmd}_${__ptype}_${__vname}]] == 0} { error_msg "${__cmd}_${__ptype}_${__vname} doesnt exist" return - } + } if {[info exists __val]} { ${__cmd}_${__ptype}_${__vname} $__val return } else { return [SplitReply [${__cmd}_${__ptype}_${__vname}]] - } + } } -addfb { foreach {__type __var} [lrange $args 1 end] { diff --git a/site_ansto/instrument/util/dmc2280/motorinfo.tcl b/site_ansto/instrument/util/dmc2280/motorinfo.tcl index f6751c38..13d9c79b 100644 --- a/site_ansto/instrument/util/dmc2280/motorinfo.tcl +++ b/site_ansto/instrument/util/dmc2280/motorinfo.tcl @@ -42,8 +42,8 @@ proc Motor {name type par} { # Returns the test result status colour for the gui proc color {status} { switch $status { - TEST_PASSED {return green} - TEST_FAILED {return red} + TEST_PASSED {return green} + TEST_FAILED {return red} default {return lightgrey} } } @@ -51,12 +51,12 @@ proc color {status} { # You can easily test the home position of individual motors # with this gui # Click on the button to run the checkHome command, the position -# (in encoder counts or motor steps) will be displayed with +# (in encoder counts or motor steps) will be displayed with # green if the configured home matches the reported position, # red otherwise. proc testgui {} { package require Tk - global motors + global motors toplevel .w frame .w.top @@ -64,7 +64,7 @@ proc testgui {} { global ${m}_status set info($m) [frame .w.top.f$m] - set testResult $info($m).e$m + set testResult $info($m).e$m button $info($m).$m -text $m -command "$testResult configure -background \[color \[checkHome $m\]\]" entry $testResult -textvariable ${m}_status(position) pack $info($m).$m -side left diff --git a/site_ansto/instrument/util/dmc2280/troubleShoot.tcl b/site_ansto/instrument/util/dmc2280/troubleShoot.tcl index 61d7cde7..1e8cad53 100755 --- a/site_ansto/instrument/util/dmc2280/troubleShoot.tcl +++ b/site_ansto/instrument/util/dmc2280/troubleShoot.tcl @@ -24,7 +24,7 @@ proc loadConfig {fName} { if [info exists ContList] {unset ContList} # Temporarily define unknown proc to skip undefined procs rename ::unknown _unknown - proc ::unknown {args} {} + proc ::unknown {args} {} if [catch {uplevel #0 source $fName} errMsg] { rename ::unknown "" rename _unknown ::unknown diff --git a/site_ansto/instrument/util/eventutil.tcl b/site_ansto/instrument/util/eventutil.tcl index e39e7ea7..ce5187e1 100644 --- a/site_ansto/instrument/util/eventutil.tcl +++ b/site_ansto/instrument/util/eventutil.tcl @@ -38,7 +38,7 @@ proc ::event::waitfor {sobj args} { eval $args while {$sobjBusy == 1} { wait 1 - } + } scriptcallback remove $sobj $CBID SetStatus $oldStatus } message ] { @@ -53,12 +53,12 @@ namespace import ::event::waitfor publish waitfor user -namespace eval ::batch::call_cleanup { } +namespace eval ::batch::call_cleanup { } proc ::batch::cleanup {} {} ## # @brief Calls a user defined cleanup script when a batch file ends or is aborted # The cleanup script must be called ::batch::call_cleanup -proc ::batch::call_cleanup {} { +proc ::batch::call_cleanup {} { ::batch::cleanup proc ::batch::cleanup {} {} } diff --git a/site_ansto/instrument/util/extra_utility.tcl b/site_ansto/instrument/util/extra_utility.tcl index dd1aec36..88ffbab5 100644 --- a/site_ansto/instrument/util/extra_utility.tcl +++ b/site_ansto/instrument/util/extra_utility.tcl @@ -95,8 +95,8 @@ proc callStack {enable} { } publish callStack mugger callStack false - - + + # LIST FUNCTIONS proc head {args} {lindex [join $args] 0} proc tail {args} {join [lrange [join $args] 1 end]} @@ -149,7 +149,7 @@ proc isoneof {element setb} { switch $elb { alpha {set result [string is alpha $element]} text {set result [string is wordchar $element]} - print {set result [string is print $element]} + print {set result [string is print $element]} float {set result [string is double $element]} int {set result [string is integer $element]} default {set result [expr {$element == $elb}]} @@ -174,7 +174,7 @@ proc tolower_sicslist {args} { # \brief Enables or disables the debug_msg command # # \param mode on turns on debugging, off turns off debugging -# +# # \see debug_msg # TODO Set a callstack global variable proc debug_mode {mode} { @@ -190,22 +190,22 @@ proc debug_mode {mode} { # This probably only occurs if you debug_msg directly. Why would you do that? set cmdinfo [info level 0] set cmd [lindex $cmdinfo 0] - set nscmd [namespace origin $cmd] + set nscmd [namespace origin $cmd] clientput "DEBUG, ${nscmd}::$cmdinfo]$args" } 2 { set cmdinfo [info level -1] set cmd [lindex $cmdinfo 0] - set nscmd [namespace origin $cmd] + set nscmd [namespace origin $cmd] clientput "DEBUG, ${nscmd}::$cmdinfo]$args" } 3 - default { set cmdinfo [info level -1] set cmd [lindex $cmdinfo 0] - set nscmd [namespace origin $cmd] + set nscmd [namespace origin $cmd] set callerinfo [info level -2] set caller [lindex $callerinfo 0] - set nscaller [namespace origin $caller] + set nscaller [namespace origin $caller] clientput "DEBUG, ${nscaller}::$callerinfo\n\t${nscmd}::$cmdinfo]$args" } } @@ -217,7 +217,7 @@ proc debug_mode {mode} { } } -## \brief You can use debug_msg in place of 'puts' for debug info in Tcl macros. +## \brief You can use debug_msg in place of 'puts' for debug info in Tcl macros. # # Add debug messages on the fly with # strace add execution enter debug_msg diff --git a/site_ansto/instrument/util/motor_utility.tcl b/site_ansto/instrument/util/motor_utility.tcl index 3436d2ef..6f831ee6 100644 --- a/site_ansto/instrument/util/motor_utility.tcl +++ b/site_ansto/instrument/util/motor_utility.tcl @@ -45,14 +45,14 @@ proc reldrive {args} { } message ] { if {$::errorCode=="NONE"} {return } return -code error $message - } + } } publish reldrive user ## # @brief A convenience command for fetching motor parameter values # -# This convenience command is useful for avoiding command +# This convenience command is useful for avoiding command # substitution problems when defining hdb node read scripts. proc getmotpar {motor par} { return [SplitReply [$motor $par]] diff --git a/site_ansto/instrument/util/utility.tcl b/site_ansto/instrument/util/utility.tcl index 556e872a..594785e0 100644 --- a/site_ansto/instrument/util/utility.tcl +++ b/site_ansto/instrument/util/utility.tcl @@ -98,7 +98,7 @@ proc ::environment::mkSensors {sobj} { # # eg ::environment::mkenvinfo tc1 {heateron {priv user} range {priv manager}} proc ::environment::mkenvinfo {sobj paramlist} { - lappend paramlist controlsensor {priv user} + lappend paramlist controlsensor {priv user} if [ catch { # Create polling procedure to update hdb sensor data nodes. # proc ::environment::${sobj}_poll [subst {{sobj $sobj}}] { @@ -163,7 +163,7 @@ sicslist setatt $setpoint_script mutable true lappend env_macrolist $ctrlss_script } - # Create environment information structure for hdb + # Create environment information structure for hdb set env_name [getatt $sobj environment_name] eval [subst { proc ::${sobj}_dict {} { @@ -233,13 +233,13 @@ namespace eval utility { return $instrument_name; } -# Initialise the attributes of sobj +# Initialise the attributes of sobj # to make it ready for adding to the hdb tree. proc mkData {sobj name aklass args} { sicslist setatt $sobj long_name $name sicslist setatt $sobj nxalias $sobj sicslist setatt $sobj klass $aklass - switch [getatt $sobj type] { + switch [getatt $sobj type] { "sicsvariable" { sicslist setatt $sobj kind hobj sicslist setatt $sobj data true @@ -264,8 +264,8 @@ proc mkData {sobj name aklass args} { proc mkVar {name type access {along_name x} {anxsave false} {aklass @none} {acontrol false} {adata false}} { array set sicsAccess {spy spy user user manager mugger internal internal readonly internal} VarMake $name $type $sicsAccess($access); - sicslist setatt $name privilege $access; - sicslist setatt $name kind hobj; + sicslist setatt $name privilege $access; + sicslist setatt $name kind hobj; sicslist setatt $name mutable false if {$access != "internal"} { sicslist setatt $name data $adata @@ -306,7 +306,7 @@ proc ::utility::normalattlist {sicsobj} { foreach att [sicslist $sicsobj] { lappend atts [split [string range $att 0 end-1] =] } - return [join $atts] + return [join $atts] } message ] { if {$::errorCode=="NONE"} {return $message} return -code error $message @@ -341,7 +341,7 @@ with the lower limit at 85 and the upper limit at 97 " if {$args == ""} {clientput $usage; return} array set params $args - set motor $params(-motor) + set motor $params(-motor) set home $params(-home) set lowlim [expr $home - $params(-lowrange)] set uplim [expr $home + $params(-uprange)] @@ -383,14 +383,14 @@ proc getinfo {object} { set wc [format "%s_*" $object]; set objlist [sicslist match $wc]; foreach v $objlist { - if { [SplitReply [sicslist $v type]]== "SicsVariable"} { + if { [SplitReply [sicslist $v type]]== "SicsVariable"} { clientput [$v]; } } } -# Convenience function for setting klass group and name attributes +# Convenience function for setting klass group and name attributes # on sics object metadata proc set_sicsobj_atts {sobj aklass agroup aname acontrol adata} { sicslist setatt $sobj klass $aklass; @@ -430,7 +430,7 @@ proc ::utility::set_sobj_attributes {} { } proc ::utility::set_histomem_attributes {} { - foreach hm [sicslist type histmem] { + foreach hm [sicslist type histmem] { sicslist setatt $hm nxalias $hm sicslist setatt $hm mutable true } @@ -450,13 +450,13 @@ proc ::utility::set_motor_attributes {} { # The first entry in [sicslist type motor] is 'motor' when # we run the sicslist command on initialisation. This is because # The 'Motor' command has type motor, so we skip it with lrange. - foreach m [lrange [sicslist type motor] 1 end] { + foreach m [lrange [sicslist type motor] 1 end] { sicslist setatt $m kind hobj sicslist setatt $m data true sicslist setatt $m control true sicslist setatt $m nxsave true sicslist setatt $m mutable true - catch { + catch { # This block is specific to the dmc2280 driver. # Skip it for "tclmot" motors which don't # have 'units', 'part' or 'long_name' parameters @@ -476,7 +476,7 @@ proc ::utility::set_motor_attributes {} { 3 {sicslist setatt $m privilege spy} } } - foreach m [sicslist type configurablevirtualmotor] { + foreach m [sicslist type configurablevirtualmotor] { sicslist setatt $m kind hobj sicslist setatt $m data true sicslist setatt $m control true @@ -485,7 +485,7 @@ proc ::utility::set_motor_attributes {} { sicslist setatt $m nxalias $m sicslist setatt $m mutable true } - foreach m [sicslist type TasMot] { + foreach m [sicslist type TasMot] { sicslist setatt $m klass sample sicslist setatt $m long_name $m sicslist setatt $m kind hobj @@ -498,7 +498,7 @@ proc ::utility::set_motor_attributes {} { } } proc ::utility::set_chopper_attributes {} { - foreach ch [lrange [sicslist type chopperadapter] 1 end] { + foreach ch [lrange [sicslist type chopperadapter] 1 end] { sicslist setatt $ch kind hobj sicslist setatt $ch data true sicslist setatt $ch control true @@ -575,9 +575,9 @@ proc lstarts_with {l1 l2} { # #\param port this can either be a port name or number #\return always returns the port number -proc ::utility::get_portnum {port} { +proc ::utility::get_portnum {port} { global env tcl_platform - variable sics_port + variable sics_port if [ catch { if [string is integer $port] { return $port @@ -643,7 +643,7 @@ proc ::utility::check_valid_options {arglist valid_options} { ## # @brief Raises an error if any of the required_options are not in the argument list arglist -proc ::utility::check_required_options {arglist required_options} { +proc ::utility::check_required_options {arglist required_options} { if [ catch { if {$arglist == ""} { error "ERROR: You must provide the following options: [join $required_options {, }]" @@ -655,7 +655,7 @@ proc ::utility::check_required_options {arglist required_options} { if {$req_opt == $opt} { set option_missing "false" break - } + } } if {$option_missing} { error "ERROR: Required option $req_opt is missing" @@ -702,10 +702,10 @@ proc ::utility::get_opt_arglist {args} { # # ::utility::tabmktable {NXgeometry geometry NXshape sicsvariable {shape size}} # returns -# NXgeometry {geometry {NXshape {sicsvariable {shape size}}}} +# NXgeometry {geometry {NXshape {sicsvariable {shape size}}}} # ::utility::tabxml hmm_table SAT # ::utility::tabset hmm_table SAT/SPLIT/_ATTLIST_/MIDPOINT 256 -# ::utility::tabget hmm_table SAT/SPLIT/_ATTLIST_/MIDPOINT +# ::utility::tabget hmm_table SAT/SPLIT/_ATTLIST_/MIDPOINT # ::utility::tabxml hmm_table SAT # ::utility::tabget hmm_table OAT/_DATA_/T_MAX @@ -723,7 +723,7 @@ proc ::utility::tabmktable {flatlist} { } set el [lindex $flatlist 0] set table [list $el \$subtable ] - foreach el [lrange $flatlist 1 end-2] { + foreach el [lrange $flatlist 1 end-2] { set subtable [list $el \$subtable] set table [subst $table] } @@ -737,8 +737,8 @@ proc ::utility::tabmktable {flatlist} { } # If some component of the path doesn't exist then return -# a list of indices up to the invalid step. Note if the -# first step doesn't exist this returns nothing which is a +# a list of indices up to the invalid step. Note if the +# first step doesn't exist this returns nothing which is a # valid argument to lset and lindex representing the entire list proc ::utility::tabindices {itable tpath} { if [ catch { @@ -772,7 +772,7 @@ proc ::utility::tabdel {itable tpath} { set subtable [lreplace $subtable $datindex $datindex] incr datindex -1 set subtable [lreplace $subtable $datindex $datindex] - lset table $subtabpos $subtable + lset table $subtabpos $subtable } message ] { if {$::errorCode=="NONE"} {return $message} return -code error $message @@ -785,7 +785,7 @@ proc ::utility::tabget {itable tpath} { if {[llength $indices] == [llength [split $tpath "/"] ]} { return [lindex $table $indices] } else { - return + return } } @@ -849,7 +849,7 @@ proc ::utility::macro::getset {type name arglist body} { publish $name spy if {$arglist == ""} { sicslist setatt $name access read_only - } else { + } else { sicslist setatt $name access user } sicslist setatt $name privilege user diff --git a/site_ansto/test_west.tcl b/site_ansto/test_west.tcl index 6de9ef70..fc5b8a69 100644 --- a/site_ansto/test_west.tcl +++ b/site_ansto/test_west.tcl @@ -1,13 +1,13 @@ -# Author: Ferdi Franceschini (ffr@ansto.gov.au) - -# Required by server_config.tcl -VarMake Instrument Text Internal -Instrument echidna -Instrument lock - -#START SERVER CONFIGURATION SECTION +# Author: Ferdi Franceschini (ffr@ansto.gov.au) + +# Required by server_config.tcl +VarMake Instrument Text Internal +Instrument echidna +Instrument lock + +#START SERVER CONFIGURATION SECTION #source util/dmc2280/dmc2280_util.tcl - + #source sics_ports.tcl ServerOption TelnetPort 60093 ServerOption InterruptPort 60092 @@ -15,8 +15,8 @@ ServerOption ServerPort 60091 ServerOption QuieckPort 60090 SicsUser manager ansto 1 SicsUser user sydney 2 -SicsUser spy 007 3 - +SicsUser spy 007 3 + #WEST4100 tempcontroller creation MakeRS232Controller sertemp 127.0.0.1 4502 sertemp timeout 300