From 27c3a48d913f45818e75255008eb2971853ff493 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 19 Feb 2015 15:59:22 +1100 Subject: [PATCH] Pullback from Dingo 2015-02-19 --- .../temperature/sct_lakeshore_370.tcl | 2 +- .../temperature/sct_oxford_mercury.tcl | 2 +- .../instrument/dingo/config/plc/plc.tcl | 34 +++++++++++++++---- .../instrument/dingo/dingo_configuration.tcl | 25 ++++++++++++-- .../instrument/dingo/sics_simulation.tcl | 2 +- site_ansto/instrument/server_config.tcl | 31 ++++++++--------- 6 files changed, 67 insertions(+), 29 deletions(-) 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 74233b4a..6fe63945 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl @@ -50,7 +50,7 @@ namespace eval ::scobj::[set vendor]_[set device] { proc debug_log {debug_level arg_string} { # write a timestamped string message to a log file for debugging - set debug_threshold 0 + set debug_threshold 5 if {$debug_level >= $debug_threshold} { set fd [open "[set [namespace current]::log_file]" "a"] set line "[clock format [clock seconds] -format "%T"] $arg_string" 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 22ebad6b..67266192 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl @@ -58,7 +58,7 @@ namespace eval ::scobj::[set vendor]_[set device] { proc debug_log {debug_level arg_string} { # write a timestamped string message to a log file for debugging - set debug_threshold 0 + set debug_threshold 5 if {$debug_level >= $debug_threshold} { set fd [open "[set [namespace current]::log_file]" "a"] set line "[clock format [clock seconds] -format "%T"] $arg_string" diff --git a/site_ansto/instrument/dingo/config/plc/plc.tcl b/site_ansto/instrument/dingo/config/plc/plc.tcl index 1386c276..531c7902 100644 --- a/site_ansto/instrument/dingo/config/plc/plc.tcl +++ b/site_ansto/instrument/dingo/config/plc/plc.tcl @@ -5,8 +5,6 @@ if {$sim_mode == "false"} { MakeSafetyPLC plc plc_chan 0 } -makesctcontroller sct_shutter std 137.157.204.213:30000 - # Configuration Note: # # A default setting has been set in safetyplc.c code. following configuration @@ -51,14 +49,38 @@ proc focuslight {args} { sct_shutter transact $cmd } -proc tertiary_shutter {args} { - set cmd "set tertiary shutter=$args\r\n" - sct_shutter transact $cmd +proc tertiary {sw} { + set sw [string tolower $sw] + switch $sw { + "open" { + wait 1 + plc_chan send set output=0 + wait 1 + plc_chan send set output=3 + wait 1 + plc_chan send set output=1 + wait 1 + plc_chan send set output=3 + } + "close" { + wait 1 + plc_chan send set output=0 + wait 1 + plc_chan send set output=3 + wait 1 + plc_chan send set output=2 + wait 1 + plc_chan send set output=3 + } + default { + clientput ERROR: [info level 0] command should be open or close not $sw + } + } } publish shutter user publish focuslight user -publish tertiary_shutter user +publish tertiary user source $cfPath(plc)/plc_common_1.tcl diff --git a/site_ansto/instrument/dingo/dingo_configuration.tcl b/site_ansto/instrument/dingo/dingo_configuration.tcl index 0c6c3804..144390ee 100644 --- a/site_ansto/instrument/dingo/dingo_configuration.tcl +++ b/site_ansto/instrument/dingo/dingo_configuration.tcl @@ -21,14 +21,33 @@ fileeval $cfPath(source)/source.tcl fileeval $cfPath(motors)/motor_configuration.tcl #fileeval $cfPath(motors)/positmotor_configuration.tcl #fileeval $cfPath(motors)/extraconfig.tcl -#fileeval $cfPath(plc)/plc.tcl +fileeval $cfPath(plc)/plc.tcl #fileeval $cfPath(counter)/counter.tcl #fileeval $cfPath(hmm)/hmm_configuration.tcl +fileeval $cfPath(environment)/sct_agilent_33220A.tcl +fileeval $cfPath(environment)/sct_isotech_ps.tcl +fileeval $cfPath(environment)/sct_keithley_2700.tcl +fileeval $cfPath(environment)/sct_keithley_m2700.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_218.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl +fileeval $cfPath(environment)/temperature/sct_ls336.tcl +fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl +fileeval $cfPath(environment)/temperature/sct_ls340.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_base.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_level.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_pres.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_scpi.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_temp.tcl +fileeval $cfPath(environment)/temperature/sct_mercury_valve.tcl +fileeval $cfPath(environment)/sct_protek_common.tcl +fileeval $cfPath(environment)/sct_protekmm.tcl +fileeval $cfPath(environment)/temperature/west400.tcl +fileeval $cfPath(environment)/temperature/sct_west4100.tcl fileeval $cfPath(nexus)/nxscripts.tcl fileeval $cfPath(scan)/scan.tcl fileeval $cfPath(commands)/commands.tcl -#fileeval $cfPath(commands)/pulser.tcl -#fileeval $cfPath(commands)/hvcommands.tcl +fileeval $cfPath(commands)/pulser.tcl +fileeval $cfPath(commands)/hvcommands.tcl fileeval $cfPath(anticollider)/anticollider.tcl source gumxml.tcl diff --git a/site_ansto/instrument/dingo/sics_simulation.tcl b/site_ansto/instrument/dingo/sics_simulation.tcl index d1fad2a9..400867c3 100644 --- a/site_ansto/instrument/dingo/sics_simulation.tcl +++ b/site_ansto/instrument/dingo/sics_simulation.tcl @@ -12,7 +12,7 @@ foreach {simflag icsval fakedev} { motor_simulation false false chopper_simulation false true velsel_simulation false true - plc_simulation true true + plc_simulation false true rfgen_simulation false true goniometer_simulation false true magnetic_simulation false true diff --git a/site_ansto/instrument/server_config.tcl b/site_ansto/instrument/server_config.tcl index 64e1ece4..2d6732c2 100644 --- a/site_ansto/instrument/server_config.tcl +++ b/site_ansto/instrument/server_config.tcl @@ -254,25 +254,20 @@ proc waitaction {obj action args} { publish waitaction user proc server_set_sobj_attributes {} { - if [ catch { - motor_set_sobj_attributes - ::utility::set_motor_attributes + if [ catch { motor_set_sobj_attributes } msg ] { puts $msg } + if [ catch { ::utility::set_motor_attributes } msg ] { puts $msg } #XXX::utility::set_histomem_attributes - ::utility::set_sobj_attributes - ::utility::set_envcontrol_attributes - ::plc::set_sobj_attributes - ::counter::set_sobj_attributes - ::nexus::set_sobj_attributes - ::histogram_memory::set_sobj_attributes - ::utility::set_chopper_attributes - ::utility::set_sct_object_attributes + if [ catch { ::utility::set_sobj_attributes } msg ] { puts $msg } + if [ catch { ::utility::set_envcontrol_attributes } msg ] { puts $msg } + if [ catch { ::plc::set_sobj_attributes } msg ] { puts $msg } + if [ catch { ::counter::set_sobj_attributes } msg ] { puts $msg } + if [ catch { ::nexus::set_sobj_attributes } msg ] { puts $msg } + if [ catch { ::histogram_memory::set_sobj_attributes } msg ] { puts $msg } + if [ catch { ::utility::set_chopper_attributes } msg ] { puts $msg } + if [ catch { ::utility::set_sct_object_attributes } msg ] { puts $msg } ## TODO move the following to the new ansto gumxml.tcl - sicslist setatt getgumtreexml privilege internal + if [ catch { sicslist setatt getgumtreexml privilege internal } msg ] { puts $msg } clientput "serverport $::serverport" - } message ] { - if {$::errorCode=="NONE"} {return $message} - return -code error $message - } } proc server_init {} { @@ -312,9 +307,11 @@ proc server_init {} { if [file exists ../extraconfig.tcl] { fileeval ../extraconfig.tcl } +clientput "DBG 1" server_set_sobj_attributes +clientput "DBG 2" buildHDB instrument_dictionary - +clientput "DBG 3" } message ] handle_exception $catch_status $message }