- Added a protocol driver for the munich sputter machine
- Added a multicountsersec to teplace hmcontrol and multicounter - Fixed a case sensitivity bug in haddcheck - Made oscillate work with second generation motors for POLDI - Added a time stamper to trace. Now there will be time stamps in trace files which allow to correlate things from the master log with the trace. - Updated polterwrite. - Updated testprot to work with the behave test SKIPPED: psi/make_gen psi/polterwrite.c psi/psi.c psi/sputterprot.c
This commit is contained in:
169
countersec.c
169
countersec.c
@ -121,96 +121,96 @@ static int SecContinue(void *pData, SConnection *pCon)
|
||||
/*----------------------------------------------------------------------------*/
|
||||
static int SecCtrCheckStatus(void *pData, SConnection *pCon)
|
||||
{
|
||||
pCounter self = (pCounter)pData;
|
||||
pHdb node = NULL, control = NULL;
|
||||
hdbValue v;
|
||||
int status;
|
||||
MonEvent sMon;
|
||||
float fControl, fPreset;
|
||||
char error[132];
|
||||
pCounter self = (pCounter)pData;
|
||||
pHdb node = NULL, control = NULL;
|
||||
hdbValue v;
|
||||
int status;
|
||||
MonEvent sMon;
|
||||
float fControl, fPreset;
|
||||
char error[132];
|
||||
|
||||
assert(self != NULL);
|
||||
assert(self != NULL);
|
||||
|
||||
node = GetHipadabaNode(self->pDes->parNode,"status");
|
||||
assert(node != NULL);
|
||||
status = GetHipadabaPar(node,&v,pCon);
|
||||
node = GetHipadabaNode(self->pDes->parNode,"status");
|
||||
assert(node != NULL);
|
||||
status = GetHipadabaPar(node,&v,pCon);
|
||||
|
||||
if(status != 1){
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
return HWFault;
|
||||
}
|
||||
if(status != 1){
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
return HWFault;
|
||||
}
|
||||
|
||||
if(v.v.text == NULL){
|
||||
return HWBusy;
|
||||
}
|
||||
if (strstr(v.v.text, "idle") != NULL) {
|
||||
InvokeCallBack(self->pCall, COUNTEND, NULL);
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
status = HWIdle;
|
||||
} else if (strstr(v.v.text, "run") != NULL) {
|
||||
status = HWBusy;
|
||||
} else if (strstr(v.v.text, "nobeam") != NULL) {
|
||||
status = HWNoBeam;
|
||||
} else if (strstr(v.v.text, "pause") != NULL) {
|
||||
status = HWPause;
|
||||
} else if (strstr(v.v.text, "restart") != NULL) {
|
||||
SecStartCount(self, pCon);
|
||||
return HWBusy;
|
||||
} else if (strstr(v.v.text, "error") != NULL) {
|
||||
InvokeCallBack(self->pCall, COUNTEND, NULL);
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
if(GetHdbProperty(node,"geterror",error,sizeof(error)) == 1){
|
||||
SCPrintf(pCon,eError,"ERROR: %s", error);
|
||||
SecCounterSetError(self,error);
|
||||
} else {
|
||||
SecCounterSetError(self,"Undefined counter error: set status geterror");
|
||||
SCPrintf(pCon,eError,"ERROR: Unknown counter status error: set status geterror property");
|
||||
}
|
||||
status = HWFault;
|
||||
} else {
|
||||
SCPrintf(pCon, eError, "ERROR: unknown counter status %s found",
|
||||
v.v.text);
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
status = HWFault;
|
||||
}
|
||||
ReleaseHdbValue(&v);
|
||||
if(v.v.text == NULL){
|
||||
return HWBusy;
|
||||
}
|
||||
if (strstr(v.v.text, "idle") != NULL) {
|
||||
InvokeCallBack(self->pCall, COUNTEND, NULL);
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
status = HWIdle;
|
||||
} else if (strstr(v.v.text, "run") != NULL) {
|
||||
status = HWBusy;
|
||||
} else if (strstr(v.v.text, "nobeam") != NULL) {
|
||||
status = HWNoBeam;
|
||||
} else if (strstr(v.v.text, "pause") != NULL) {
|
||||
status = HWPause;
|
||||
} else if (strstr(v.v.text, "restart") != NULL) {
|
||||
SecStartCount(self, pCon);
|
||||
return HWBusy;
|
||||
} else if (strstr(v.v.text, "error") != NULL) {
|
||||
InvokeCallBack(self->pCall, COUNTEND, NULL);
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
if(GetHdbProperty(node,"geterror",error,sizeof(error)) == 1){
|
||||
SCPrintf(pCon,eError,"ERROR: %s", error);
|
||||
SecCounterSetError(self,error);
|
||||
} else {
|
||||
SecCounterSetError(self,"Undefined counter error: set status geterror");
|
||||
SCPrintf(pCon,eError,"ERROR: Unknown counter status error: set status geterror property");
|
||||
}
|
||||
status = HWFault;
|
||||
} else {
|
||||
SCPrintf(pCon, eError, "ERROR: unknown counter status %s found",
|
||||
v.v.text);
|
||||
ReleaseCountLock(self->pCountInt);
|
||||
status = HWFault;
|
||||
}
|
||||
ReleaseHdbValue(&v);
|
||||
|
||||
|
||||
node = GetHipadabaNode(self->pDes->parNode,"control");
|
||||
assert(node != NULL);
|
||||
GetHipadabaPar(node,&v,pCon);
|
||||
fControl = v.v.doubleValue;
|
||||
node = GetHipadabaNode(self->pDes->parNode,"preset");
|
||||
assert(node != NULL);
|
||||
GetHipadabaPar(node,&v,pCon);
|
||||
fPreset = v.v.doubleValue;
|
||||
node = GetHipadabaNode(self->pDes->parNode,"control");
|
||||
assert(node != NULL);
|
||||
GetHipadabaPar(node,&v,pCon);
|
||||
fControl = v.v.doubleValue;
|
||||
node = GetHipadabaNode(self->pDes->parNode,"preset");
|
||||
assert(node != NULL);
|
||||
GetHipadabaPar(node,&v,pCon);
|
||||
fPreset = v.v.doubleValue;
|
||||
|
||||
sMon.fCurrent = fControl;
|
||||
sMon.fPreset = fPreset;
|
||||
sMon.pName = self->name;
|
||||
self->badStatusCount = 0;
|
||||
sMon.fCurrent = fControl;
|
||||
sMon.fPreset = fPreset;
|
||||
sMon.pName = self->name;
|
||||
self->badStatusCount = 0;
|
||||
|
||||
/*
|
||||
* check for overrun counter boxes
|
||||
*/
|
||||
if(self->getMode(self) == eTimer &&
|
||||
(sMon.fCurrent > sMon.fPreset +1)
|
||||
&& self->haltFixFlag == 0){
|
||||
SecCtrHalt(self);
|
||||
self->haltFixFlag = 1;
|
||||
}
|
||||
/*
|
||||
* check for overrun counter boxes
|
||||
*/
|
||||
if(self->getMode(self) == eTimer &&
|
||||
(sMon.fCurrent > sMon.fPreset +1)
|
||||
&& self->haltFixFlag == 0){
|
||||
SecCtrHalt(self);
|
||||
self->haltFixFlag = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* invoke notifiactions, if necessary
|
||||
*/
|
||||
if (self->iCallbackCounter > 20) {
|
||||
InvokeCallBack(self->pCall, MONITOR, &sMon);
|
||||
self->iCallbackCounter = 0;
|
||||
} else {
|
||||
self->iCallbackCounter++;
|
||||
}
|
||||
/*
|
||||
* invoke notifiactions, if necessary
|
||||
*/
|
||||
if (self->iCallbackCounter > 20) {
|
||||
InvokeCallBack(self->pCall, MONITOR, &sMon);
|
||||
self->iCallbackCounter = 0;
|
||||
} else {
|
||||
self->iCallbackCounter++;
|
||||
}
|
||||
|
||||
return status;
|
||||
return status;
|
||||
}
|
||||
/*---------------------------------------------------------------------------
|
||||
* Here is an issue: this ought to wait until data has arrived. Callers
|
||||
@ -221,6 +221,12 @@ static int SecCtrCheckStatus(void *pData, SConnection *pCon)
|
||||
* - add an update callback which deletes the property when done.
|
||||
* - Check that property or the geterror property here in a loop
|
||||
* until done or we timeout.
|
||||
*
|
||||
* Nope! Update October 2013:
|
||||
* How it is normally done is to read the data through scripcontext when
|
||||
* counting is finished and not to finish with counting until this has
|
||||
* been done. The code below is only usefule for non scriptcontext
|
||||
* drivers.
|
||||
* -----------------------------------------------------------------------*/
|
||||
static int SecCtrTransferData(void *pData, SConnection *pCon)
|
||||
{
|
||||
@ -551,6 +557,9 @@ pCounter CreateSecCounter(SConnection *pCon, char *type, char *name, int length)
|
||||
return NULL;
|
||||
}
|
||||
SetHdbProperty(child, "__save", "true");
|
||||
SetHdbProperty(child, "values", "timer,monitor");
|
||||
PrependHipadabaCallback(child,MakeHipadabaCallback(SICSValueCheckCallback,
|
||||
NULL,NULL));
|
||||
AddHipadabaChild(node, child, NULL);
|
||||
|
||||
child = MakeSICSHdbPar("status", usInternal, MakeHdbText("idle"));
|
||||
|
Reference in New Issue
Block a user