- Fixed bug with ECB not stopping when no beam
- Fixed synchronisation issues - Fixed hsitogram memory writing from nxscript - Started module for writing SICS interfaces in Tcl - Fixed a bug in scan, which allowed to corrupt files - Fixed memory problems in napi5
This commit is contained in:
39
ecbcounter.c
39
ecbcounter.c
@@ -150,6 +150,13 @@ static int ECBGetStatus(struct __COUNTER *self, float *fControl){
|
||||
|
||||
assert(pPriv);
|
||||
|
||||
/*
|
||||
This can happen after a stop
|
||||
*/
|
||||
if(pPriv->state == IDLE){
|
||||
return HWIdle;
|
||||
}
|
||||
|
||||
/*
|
||||
read status bit
|
||||
*/
|
||||
@@ -159,15 +166,8 @@ static int ECBGetStatus(struct __COUNTER *self, float *fControl){
|
||||
pPriv->state = IDLE;
|
||||
return HWFault;
|
||||
}
|
||||
if(out.d == 0){
|
||||
result = HWIdle;
|
||||
pPriv->state = IDLE;
|
||||
} else {
|
||||
result = HWBusy;
|
||||
}
|
||||
|
||||
/*
|
||||
check beam status
|
||||
read beam status
|
||||
*/
|
||||
status = check4Beam(self,&beam);
|
||||
if(status != 1){
|
||||
@@ -175,16 +175,35 @@ static int ECBGetStatus(struct __COUNTER *self, float *fControl){
|
||||
return HWFault;
|
||||
}
|
||||
beam &= 1;
|
||||
if(result == HWBusy && pPriv->state == COUNT && beam == 0){
|
||||
|
||||
/*
|
||||
sophisticated logic in order to keep track of the various states
|
||||
the thing can be in. Complicated by the fact that the status becomes
|
||||
idle (out.d = 0) when the measurement is paused due to the lack of
|
||||
beam.
|
||||
*/
|
||||
if(pPriv->state == COUNT && beam == 1){
|
||||
ECBPause(self);
|
||||
pPriv->state = NOBEAM;
|
||||
SetStatus(eOutOfBeam);
|
||||
result = HWNoBeam;
|
||||
}
|
||||
if(result == HWBusy && pPriv->state == NOBEAM && beam == 1){
|
||||
if(pPriv->state == NOBEAM && beam == 0){
|
||||
ECBContinue(self);
|
||||
pPriv->state = COUNT;
|
||||
SetStatus(eCounting);
|
||||
return HWBusy;
|
||||
}
|
||||
if(pPriv->state == NOBEAM && beam == 1){
|
||||
return HWNoBeam;
|
||||
}
|
||||
if(out.d == 0 && pPriv->state == COUNT){
|
||||
result = HWIdle;
|
||||
pPriv->state = IDLE;
|
||||
} else {
|
||||
result = HWBusy;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
select which scaler to read
|
||||
|
||||
Reference in New Issue
Block a user