- Fixed a normalisation problem in diffscan when the first value
did not have enough counts - Reduced polling frequency in emon - Fixed a scriptcontext bug which would cause it to dump core in SctTransact on interrupts - Fixed an issue with missing <nl> at the end of batch files - Added a feature which does not call halt when counting stops in hmcontrol.c This is necessary for the BOA CCD - Initalized doNotFree properly in hipadaba.c - Added the travelling salesman reflection measurement algorithm - Added another component to amorset - Removed old SicsWait from nserver.c - Added a means to nxscript to write 16 bit data for BOA - Modified tasub to accept a drivabel as a motor and not only a motor. This became necessary to make EIGER work as A2 on EIGER is a virtual motor SKIPPED: psi/amorcomp.h psi/amordrive.h psi/amorset.c psi/amorset.h psi/amorset.tex psi/amorset.w psi/el734hp.c psi/el737hpdriv.c psi/make_gen psi/pardef.c psi/polterwrite.c psi/psi.c psi/sinqhttpopt.c
This commit is contained in:
59
hmcontrol.c
59
hmcontrol.c
@ -9,11 +9,19 @@
|
||||
copyright: see copyright.h
|
||||
|
||||
Mark Koennecke, June 2001
|
||||
|
||||
Added a flag which does not call halt after the counter
|
||||
finished. This feauture is necessary to allow normal
|
||||
counting on CCD camera. When they get interrupted, the
|
||||
image is invalid. This is not what is wanted.
|
||||
|
||||
Mark Koennecke, July 2011
|
||||
-------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <tcl.h>
|
||||
#include <unistd.h>
|
||||
#include "fortify.h"
|
||||
#include "hmcontrol.h"
|
||||
#include "HistMem.h"
|
||||
@ -66,14 +74,27 @@ static int HMCStart(void *pData, SConnection * pCon)
|
||||
return HWFault;
|
||||
}
|
||||
|
||||
for (i = 0; i < self->nSlaves; i++) {
|
||||
ReleaseCountLock(self->slaves[i]);
|
||||
status = self->slaves[i]->StartCount(self->slaveData[i], pCon);
|
||||
if (status != OKOK) {
|
||||
HMCHalt(self);
|
||||
return status;
|
||||
}
|
||||
for (i = 1; i < self->nSlaves; i++) {
|
||||
ReleaseCountLock(self->slaves[i]);
|
||||
status = self->slaves[i]->StartCount(self->slaveData[i], pCon);
|
||||
if (status != OKOK) {
|
||||
HMCHalt(self);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This starts the counter: always 0, last.This should be the
|
||||
* right thing as the HM do not start counting in earnest before
|
||||
* the busy line from the counter box is set.
|
||||
*/
|
||||
ReleaseCountLock(self->slaves[0]);
|
||||
status = self->slaves[0]->StartCount(self->slaveData[0], pCon);
|
||||
if (status != OKOK) {
|
||||
HMCHalt(self);
|
||||
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
|
||||
@ -114,7 +135,10 @@ static int HMCStatus(void *pData, SConnection * pCon)
|
||||
stop counting on slaves when finished or when an error
|
||||
occurred.
|
||||
*/
|
||||
HMCHalt(self);
|
||||
if(self->stopSlaves){
|
||||
HMCHalt(self);
|
||||
}
|
||||
ReleaseCountLock(self->pCount);
|
||||
self->checkSlaves = 1;
|
||||
status = HWBusy;
|
||||
}
|
||||
@ -301,6 +325,7 @@ int MakeHMControl(SConnection * pCon, SicsInterp * pSics,
|
||||
pNew->slaves[pNew->nSlaves] = pCount;
|
||||
pNew->slaveData[pNew->nSlaves] = pCom->pData;
|
||||
pNew->nSlaves++;
|
||||
pNew->stopSlaves = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -335,14 +360,19 @@ int HMControlAction(SConnection * pCon, SicsInterp * pSics,
|
||||
*/
|
||||
self = (pHMcontrol) pData;
|
||||
assert(self);
|
||||
if (argc < 4) {
|
||||
if (argc < 2) {
|
||||
snprintf(pBueffel, 131, "ERROR: Usage %s start preset mode", argv[0]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
strtolower(argv[1]);
|
||||
if (strcmp(argv[1], "start") == 0) {
|
||||
/*
|
||||
if (argc < 4) {
|
||||
snprintf(pBueffel, 131, "ERROR: Usage %s start preset mode", argv[0]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
interpret count parameters
|
||||
*/
|
||||
status = Tcl_GetDouble(pSics->pTcl, argv[2], &dPreset);
|
||||
@ -374,6 +404,15 @@ int HMControlAction(SConnection * pCon, SicsInterp * pSics,
|
||||
}
|
||||
InvokeCallBack(self->pCall, COUNTSTART, pCon);
|
||||
SCSendOK(pCon);
|
||||
}else if(strcmp(argv[1],"stopslaves") == 0){
|
||||
if(argc < 3){
|
||||
SCPrintf(pCon,eValue,"hm.stopslaves = %d", self->stopSlaves);
|
||||
return 1;
|
||||
} else {
|
||||
self->stopSlaves = atoi(argv[2]);
|
||||
SCPrintf(pCon,eValue,"hm.stopslaves = %d", self->stopSlaves);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
SCWrite(pCon, "ERROR: subcommand not recognized", eError);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user