Changed HM-configuration at FOCUS
This commit is contained in:
23
hmcontrol.c
23
hmcontrol.c
@ -16,6 +16,7 @@
|
||||
#include <tcl.h>
|
||||
#include "fortify.h"
|
||||
#include "hmcontrol.h"
|
||||
#include "HistMem.h"
|
||||
#include "devexec.h"
|
||||
|
||||
|
||||
@ -57,7 +58,7 @@ static int HMCStart(void *pData, SConnection *pCon)
|
||||
|
||||
self = (pHMcontrol)pData;
|
||||
assert(self);
|
||||
|
||||
|
||||
for(i = 0; i < self->nSlaves; i++)
|
||||
{
|
||||
status = self->slaves[i]->StartCount(self->slaveData[i],pCon);
|
||||
@ -72,7 +73,7 @@ static int HMCStart(void *pData, SConnection *pCon)
|
||||
/*----------------------------------------------------------------------*/
|
||||
static int HMCStatus(void *pData, SConnection *pCon)
|
||||
{
|
||||
int status;
|
||||
int status,i;
|
||||
pHMcontrol self = NULL;
|
||||
|
||||
self = (pHMcontrol)pData;
|
||||
@ -85,8 +86,22 @@ static int HMCStatus(void *pData, SConnection *pCon)
|
||||
stop counting on slaves when finished or when an error
|
||||
occurred.
|
||||
*/
|
||||
InvokeCallBack(self->pCall,COUNTEND,pCon);
|
||||
HMCHalt(self);
|
||||
}
|
||||
/*
|
||||
Warning: this assumes that salves 1 - MAXSLAVE are histogram memories.
|
||||
If this assumption does not hold, change this code to check if this
|
||||
is really a histogram memory.
|
||||
*/
|
||||
for(i = 1; i < MAXSLAVE; i++)
|
||||
{
|
||||
if(self->slaves[i] != NULL)
|
||||
{
|
||||
HistDirty((pHistMem)self->slaveData[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@ -214,6 +229,7 @@ int MakeHMControl(SConnection *pCon, SicsInterp *pSics,
|
||||
memset(pNew,0,sizeof(HMcontrol));
|
||||
pNew->pDes = CreateDescriptor("HMcontrol");
|
||||
pNew->pCount = CreateCountableInterface();
|
||||
pNew->pCall = CreateCallBackInterface();
|
||||
if(!pNew->pDes || ! pNew->pCount)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: out of memory in MakeHMControl",eError);
|
||||
@ -334,7 +350,8 @@ int HMControlAction(SConnection *pCon, SicsInterp *pSics,
|
||||
{
|
||||
SCWrite(pCon,"ERROR: failed to start counting",eError);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
InvokeCallBack(self->pCall,COUNTSTART,pCon);
|
||||
SCSendOK(pCon);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user