From 4dbaa0f73dafafa812b9cab1a26a5ee40328cf56 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 3 Nov 2014 14:28:41 +1100 Subject: [PATCH] SICS-723 Provide a detector/reset_trip node to notify GumTree and allow reset. --- .../sans/config/hmm/hmm_configuration.tcl | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/site_ansto/instrument/sans/config/hmm/hmm_configuration.tcl b/site_ansto/instrument/sans/config/hmm/hmm_configuration.tcl index 8a619d2e..c34715e7 100644 --- a/site_ansto/instrument/sans/config/hmm/hmm_configuration.tcl +++ b/site_ansto/instrument/sans/config/hmm/hmm_configuration.tcl @@ -64,6 +64,26 @@ proc ::histogram_memory::isc_initialize {} { } } +# Returns 0 If all trips acknowledged, -n if n trips unacknowledged, +n if too many acks? +::utility::macro::getset float ::histogram_memory::reset_trip {args} { + set num_trips [ SplitReply [hmm configure detector_protect_num_trip] ] + set num_acks [ SplitReply [hmm configure detector_protect_num_trip_ack] ] + set trip_cnt_diff [expr {$num_acks - $num_trips}] + if {$args == ""} { + return "reset_trip = $trip_cnt_diff" + } else { + if {$trip_cnt_diff != 0} { + hmm configure fat_detector_protect_num_trip_ack $num_trips + hmm astop + wait 2 + hmm init + } + } +} +sicslist setatt ::histogram_memory::reset_trip klass detector +sicslist setatt ::histogram_memory::reset_trip long_name reset_trip +sicslist setatt ::histogram_memory::reset_trip data false + proc histmem {cmd args} { eval "_histmem $cmd $args" }