From 2d6dbe647f1a67df749fc26d283127b3d280869a Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 22 Dec 2008 14:57:01 +1100 Subject: [PATCH] Only send histmem parameters if they've been changed r2759 | ffr | 2008-12-22 14:57:01 +1100 (Mon, 22 Dec 2008) | 2 lines --- .../config/commands/commands_common.tcl | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/site_ansto/instrument/config/commands/commands_common.tcl b/site_ansto/instrument/config/commands/commands_common.tcl index 9de84bb1..8bd8616a 100644 --- a/site_ansto/instrument/config/commands/commands_common.tcl +++ b/site_ansto/instrument/config/commands/commands_common.tcl @@ -7,6 +7,8 @@ namespace eval commands { } proc ::commands::ic_initialize {} { namespace eval ::histogram { set NS [namespace current] + variable parameters + array set parameters {mode UNKNOWN preset UNKNOWN freq UNKNOWN frame_source UNKNOWN} command histmem_cmd [subst { text=start,stop,pause cmd @@ -15,6 +17,7 @@ namespace eval ::histogram { float freq text=[join $::histogram_memory::ic_fsrce_values , ] frame_source }] { + variable parameters switch $cmd { "stop" { histmem stop @@ -26,10 +29,22 @@ namespace eval ::histogram { } "start" { ::histogram::histmem_cmd -set feedback status STARTING - histmem mode $mode - histmem preset $preset - histmem freq $freq - histmem fsrce $frame_source + if {$parameters(mode) != $mode} { + histmem mode $mode + set parameters(mode) $mode + } + if {$parameters(preset) != $preset} { + histmem preset $preset + set parameters(preset) $preset + } + if {$parameters(freq) != $freq} { + histmem freq $freq + set parameters(freq) $freq + } + if {$parameters(frame_source) != $frame_source} { + histmem fsrce $frame_source + set parameters(frame_source) $frame_source + } histmem start ::histogram::histmem_cmd -set feedback status BUSY }