From 32baca27f30be6d7adffd5f12122944f09246316 Mon Sep 17 00:00:00 2001 From: koennecke Date: Thu, 23 May 2013 08:54:55 +0000 Subject: [PATCH] - Introduced a state filed into first generation objects - Fixed some issues with error returns not being properly handled in devexec - Fixed a bug in motorlist which caused limit checks to fail - Fixed an issue with the TDCHM not properly updating the counter values on finish - Readded getHipadabaPar in ChainCallback as this caused a problem in ei - Made tasdrive ignore sgu, sgl when out of plane not allowed --- eigermono.c | 15 +++++++++++++++ sinqhttp.c | 4 +++- tdchm.c | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/eigermono.c b/eigermono.c index 713b11b..057492b 100644 --- a/eigermono.c +++ b/eigermono.c @@ -20,6 +20,10 @@ * fixed in the old module. * * Mark Koennecke, February 2013 + * + * Go to maximum or minimum value for mt when limit problem do not abort + * + * Mark Koennecke, April 2013 */ #include #include @@ -223,6 +227,7 @@ static void startMono(pSICSOBJ self, SConnection *pCon) float d2r, d2l, mtx; peigerMono mono = (peigerMono)self->pPrivate; hdbValue mta, mtb; + float lim; assert(mono != NULL); @@ -314,6 +319,16 @@ static void startMono(pSICSOBJ self, SConnection *pCon) SICSHdbGetPar(self,pCon,"MTA",&mta); SICSHdbGetPar(self,pCon,"MTB",&mtb); mtx = mta.v.doubleValue + mtb.v.doubleValue*pow(curve,.75); + MotorGetPar((pMotor)mono->motData[MTX],"softupperlim",&lim); + if(mtx > lim){ + SCPrintf(pCon,eLog,"WARNING: correcting mt target %f to %f within upper limit", mtx, lim-.1); + mtx = lim - .1; + } + MotorGetPar((pMotor)mono->motData[MTX],"softlowerlim",&lim); + if(mtx < lim){ + SCPrintf(pCon,eLog,"WARNING: correcting mt target %f to %f within lower limit", mtx, lim +.1); + mtx = lim + .1; + } status = startTASMotor((pMotor)mono->motData[MTX], pCon, "mt", mtx, silent,stopFixed); if (status < 0 && status != NOTSTARTED) { diff --git a/sinqhttp.c b/sinqhttp.c index 0bfc34c..2b5e37f 100644 --- a/sinqhttp.c +++ b/sinqhttp.c @@ -209,7 +209,7 @@ static int SinqHttpConfigure(pHistDriver self, SConnection * pCon, status = StringDictGet(pOpt,"tricsswap", buffer, sizeof(buffer)); if(status == 1){ - pPriv->tricsswap = 1; + pPriv->tricsswap = atoi(buffer); } /* actually do configure @@ -596,6 +596,8 @@ static int SinqHttpGetHistogram(pHistDriver self, SConnection * pCon, if(pPriv->tricsswap == 1){ swapTrics(data, self->data, end-start); + } else if(pPriv->tricsswap == 2) { + memcpy(data,hmdata,(end-start)*sizeof(HistInt)); } return 1; } diff --git a/tdchm.c b/tdchm.c index d15f722..a6f09e2 100644 --- a/tdchm.c +++ b/tdchm.c @@ -319,6 +319,9 @@ static int TDCCountStatus(pHistDriver self, SConnection * pCon) leave it for now. */ if (status == HWIdle || status == HWFault) { + if(tdc->counter != NULL){ + tdc->counter->pDriv->ReadValues(tdc->counter->pDriv); + } InvokeCallBack(tdc->counter->pCall,COUNTEND,NULL); tdcstatus = disableTdc(tdc); if (tdcstatus != 1) {