From 39497e28100e1656b17d3cd6c1766cb6c1ba7c7c Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Tue, 27 Aug 2013 12:23:23 +1000 Subject: [PATCH] SICS-638 Send a pause to the histmem when SICS receives an INT1712 interrupt. This is done by mapping AnstoHttpPauseNoCon() to Halt in the histmem interface. An ANSTO stop command astop has been added to send a Stop to the histmem which is needed when uploading a new configuration. --- site_ansto/anstohttp.c | 13 ++++++++++++- .../config/hmm/hmm_configuration_common_1.tcl | 8 ++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/site_ansto/anstohttp.c b/site_ansto/anstohttp.c index 6a9c8018..00cf993f 100644 --- a/site_ansto/anstohttp.c +++ b/site_ansto/anstohttp.c @@ -663,6 +663,9 @@ pPriv->pause = 1; return OKOK; } +static int AnstoHttpPauseNoCon(pHistDriver self) { + return AnstoHttpPause(self, NULL); +} /*---------------------------------------------------------------------*/ static int AnstoHttpContinue(pHistDriver self, SConnection *pCon){ pAnstoHttp pPriv = NULL; @@ -934,7 +937,7 @@ pHistDriver CreateAnstoHttpDriver(pStringDict pOption){ /* configure all those functions */ pNew->Configure = AnstoHttpConfigure; pNew->Start = AnstoHttpStart; - pNew->Halt = AnstoHttpHalt; + pNew->Halt = AnstoHttpPauseNoCon; pNew->GetCountStatus = AnstoHttpStatus; pNew->GetError = AnstoHttpError; pNew->TryAndFixIt = AnstoHttpFixIt; @@ -967,6 +970,14 @@ pHistDriver CreateAnstoHttpDriver(pStringDict pOption){ self = (pHistMem)pData; + if(strcmp(argv[1],"astop") == 0) { + if(!SCMatchRights(pCon,usUser)) { + return 0; + } + AnstoHttpHalt(self->pDriv); + SCSendOK(pCon); + return 1; + } if(strcmp(argv[1],"pause") == 0) { if(!SCMatchRights(pCon,usUser)) { return 0; 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 c5557398..29f28ed8 100644 --- a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl +++ b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl @@ -1263,7 +1263,7 @@ proc ::histogram_memory::upload_config {filler_defaults} { if [ catch { ::histogram_memory::synch_tables ::histogram_memory::filler_defaults $filler_defaults - hmm stop + hmm astop hmm configure init 1 hmm init # Restore the init level to 0 @@ -1275,7 +1275,7 @@ proc ::histogram_memory::upload_config {filler_defaults} { # This not only makes sure it's stopped, but lets us see certain configuration variables # which get placed in the dictionary as part of the status checking done during the stop. hmm configure statuscheck true - hmm stop + hmm astop hmm configure statuscheck false # ::histogram_memory::configure_dims # foreach axis {X Y T} { @@ -1650,7 +1650,7 @@ Publish SAT_TABLE user if [ catch { hmm pause hmm configure statuscheck true - hmm stop + hmm astop hmm configure statuscheck false set reply [SplitReply [hmm configure daq]] if {$histmem_simulation==false && $reply != "Stopped"} { @@ -1710,7 +1710,7 @@ Publish SAT_TABLE user } else { set monitor_controlled "false" } - hmm stop + hmm astop hmm init hmm_mode $method } message ] {