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.
This commit is contained in:
Ferdi Franceschini
2013-08-27 12:23:23 +10:00
parent 6c6f100c0f
commit 39497e2810
2 changed files with 16 additions and 5 deletions

View File

@@ -663,6 +663,9 @@ pPriv->pause = 1;
return OKOK; return OKOK;
} }
static int AnstoHttpPauseNoCon(pHistDriver self) {
return AnstoHttpPause(self, NULL);
}
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
static int AnstoHttpContinue(pHistDriver self, SConnection *pCon){ static int AnstoHttpContinue(pHistDriver self, SConnection *pCon){
pAnstoHttp pPriv = NULL; pAnstoHttp pPriv = NULL;
@@ -934,7 +937,7 @@ pHistDriver CreateAnstoHttpDriver(pStringDict pOption){
/* configure all those functions */ /* configure all those functions */
pNew->Configure = AnstoHttpConfigure; pNew->Configure = AnstoHttpConfigure;
pNew->Start = AnstoHttpStart; pNew->Start = AnstoHttpStart;
pNew->Halt = AnstoHttpHalt; pNew->Halt = AnstoHttpPauseNoCon;
pNew->GetCountStatus = AnstoHttpStatus; pNew->GetCountStatus = AnstoHttpStatus;
pNew->GetError = AnstoHttpError; pNew->GetError = AnstoHttpError;
pNew->TryAndFixIt = AnstoHttpFixIt; pNew->TryAndFixIt = AnstoHttpFixIt;
@@ -967,6 +970,14 @@ pHistDriver CreateAnstoHttpDriver(pStringDict pOption){
self = (pHistMem)pData; 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(strcmp(argv[1],"pause") == 0) {
if(!SCMatchRights(pCon,usUser)) { if(!SCMatchRights(pCon,usUser)) {
return 0; return 0;

View File

@@ -1263,7 +1263,7 @@ proc ::histogram_memory::upload_config {filler_defaults} {
if [ catch { if [ catch {
::histogram_memory::synch_tables ::histogram_memory::synch_tables
::histogram_memory::filler_defaults $filler_defaults ::histogram_memory::filler_defaults $filler_defaults
hmm stop hmm astop
hmm configure init 1 hmm configure init 1
hmm init hmm init
# Restore the init level to 0 # 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 # 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. # which get placed in the dictionary as part of the status checking done during the stop.
hmm configure statuscheck true hmm configure statuscheck true
hmm stop hmm astop
hmm configure statuscheck false hmm configure statuscheck false
# ::histogram_memory::configure_dims # ::histogram_memory::configure_dims
# foreach axis {X Y T} { # foreach axis {X Y T} {
@@ -1650,7 +1650,7 @@ Publish SAT_TABLE user
if [ catch { if [ catch {
hmm pause hmm pause
hmm configure statuscheck true hmm configure statuscheck true
hmm stop hmm astop
hmm configure statuscheck false hmm configure statuscheck false
set reply [SplitReply [hmm configure daq]] set reply [SplitReply [hmm configure daq]]
if {$histmem_simulation==false && $reply != "Stopped"} { if {$histmem_simulation==false && $reply != "Stopped"} {
@@ -1710,7 +1710,7 @@ Publish SAT_TABLE user
} else { } else {
set monitor_controlled "false" set monitor_controlled "false"
} }
hmm stop hmm astop
hmm init hmm init
hmm_mode $method hmm_mode $method
} message ] { } message ] {