- Removed old code

- Extended tasker to support task groups
- Added task functions for motors and counters
- Modifed devexec to use the new task functions
- Modified TAS to treat the monochromator separatly
- Coded a EIGER monochromator module to reflect even more new
  requirements
- Added EPICS counters and motors
- Modified multicounter to be better performing


SKIPPED:
	psi/eigermono.c
	psi/make_gen
	psi/makefile_linux
	psi/psi.c
	psi/sinqhttp.c
This commit is contained in:
koennecke
2013-04-02 15:13:35 +00:00
parent 86e246416b
commit 1afe142812
54 changed files with 1654 additions and 2841 deletions

View File

@ -37,6 +37,7 @@ typedef struct {
pICountable slaves[MAXSLAVE];
char *transferScript;
int nSlaves;
int checkSlaves;
} MultiCounter, *pMultiCounter;
/*--------------------------------------------------------------------------*/
static void KillMultiDriver(struct __COUNTER *data)
@ -106,10 +107,12 @@ static int MMCCStart(void *pData, SConnection * pCon)
pCount->isUpToDate = 0;
pCount->tStart = time(NULL);
InvokeCallBack(pCount->pCall, COUNTSTART, pCon);
self->checkSlaves = 0;
return OKOK;
}
/*-------------------------------------------------------------------------*/
static int MMCCStatus(void *pData, SConnection * pCon)
{
int status, i;
@ -129,25 +132,46 @@ static int MMCCStatus(void *pData, SConnection * pCon)
return HWFault;
}
status = self->slaves[0]->CheckCountStatus(self->slaveData[0], pCon);
pMaster = (pCounter)self->slaveData[0];
pCount->pDriv->fLastCurrent = GetControlValue(pMaster);
if (status == HWIdle || status == HWFault) {
/*
stop counting on slaves when finished or when an error
occurred.
*/
InvokeCallBack(pCount->pCall, COUNTEND, pCon);
MMCCHalt(pCount);
}
for (i = 1; i < MAXSLAVE; i++) {
if (self->slaves[i] != NULL) {
pDum = (pDummy) self->slaveData[i];
if (strcmp(pDum->pDescriptor->name, "HistMem") == 0) {
HistDirty((pHistMem) self->slaveData[i]);
}
ReleaseCountLock(self->slaves[i]);
if(self->checkSlaves == 0) {
status = self->slaves[0]->CheckCountStatus(self->slaveData[0], pCon);
if (status == HWIdle || status == HWFault) {
/*
stop counting on slaves when finished or when an error
occurred.
*/
MMCCHalt(pData);
ReleaseCountLock(pCount->pCountInt);
self->checkSlaves = 1;
status = HWBusy;
}
} else {
/*
* wait for the detectors to report finish too. Otherwise, with the second
* generation HM data may not be fully transferred.
*/
for(i = 1; i < self->nSlaves; i++){
status = self->slaves[i]->CheckCountStatus(self->slaveData[i], pCon);
if(!(status == HWIdle || status == HWFault)){
return status;
}
}
/*
Warning: this assumes that slaves 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 < self->nSlaves; i++) {
if (self->slaves[i] != NULL) {
pDum = (pDummy)self->slaveData[i];
if (strcmp(pDum->pDescriptor->name, "HistMem") == 0) {
HistDirty((pHistMem) self->slaveData[i]);
}
ReleaseCountLock(self->slaves[i]);
}
}
status = HWIdle;
InvokeCallBack(pCount->pCall, COUNTEND, pCon);
self->checkSlaves = 0;
}
return status;
}