Fixed a bug with the eiger monochromator not driving mt when mcv did not drive

Fixed expression searching in sicslogquery
Added proton monitot to tasscan output
Chnaged SICS scripts to reflect the switch from TRICS to ZEBRA
This commit is contained in:
2016-07-01 10:51:37 +02:00
parent 7b1704c9fa
commit 2caac1016f
5 changed files with 37 additions and 33 deletions

View File

@ -316,33 +316,36 @@ static void startMono(pSICSOBJ self, SConnection *pCon)
/* /*
the translation the translation
There used to be a test here to run the tranlsation only when mcv succeded. This test caused
issues when mcv already was at the correct position in that the translation was not driven.
Thus the test was removed on request of the IC. The current state of the code can have the consequence
that mt is driven even when mcv fails. This then can throw the focus point completely off, resulting
in a loss of intensity, resolution and even move peaks.
*/ */
if(status > 0){ SICSHdbGetPar(self,pCon,"MTA",&mta);
/* SICSHdbGetPar(self,pCon,"MTB",&mtb);
only run mt when mcv started mtx = mta.v.doubleValue + mtb.v.doubleValue*pow(curve,.75);
*/ MotorGetPar((pMotor)mono->motData[MTX],"softupperlim",&lim);
SICSHdbGetPar(self,pCon,"MTA",&mta); if(mtx > lim){
SICSHdbGetPar(self,pCon,"MTB",&mtb); SCPrintf(pCon,eLog,"WARNING: correcting mt target %f to %f within upper limit", mtx, lim-.1);
mtx = mta.v.doubleValue + mtb.v.doubleValue*pow(curve,.75); mtx = lim - .1;
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) {
SCWrite(pCon,"WARNING: monochromator translation motor failed to start", eLog);
SCSetInterrupt(pCon,eContinue);
} else {
AddTaskToGroup(pServ->pTasker,status, mono->waitID);
}
} }
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) {
SCWrite(pCon,"WARNING: monochromator translation motor failed to start", eLog);
SCSetInterrupt(pCon,eContinue);
} else {
AddTaskToGroup(pServ->pTasker,status, mono->waitID);
}
} }
/*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/

View File

@ -132,7 +132,7 @@ int sicslogQuery(int argc, char *argv[], ResultCallback_t func, void *userData)
case 'h': case 'h':
snprintf( snprintf(
lastError,sizeof(lastError), lastError,sizeof(lastError),
"Options: -s subsystem\n-l last(h,d)\n-f fromtime\n-t totime\n-i instrument\n-c severity\n%s", "Options: \n-s subsystem\n-l last(h,d)\n-f fromtime\n-t totime\n-i instrument\n-c severity\n%s",
"-e search-expression"); "-e search-expression");
return 1; return 1;
break; break;
@ -166,7 +166,7 @@ int sicslogQuery(int argc, char *argv[], ResultCallback_t func, void *userData)
strncat(jsonQuery,subQuery,sizeof(jsonQuery)); strncat(jsonQuery,subQuery,sizeof(jsonQuery));
} }
if(exp != NULL){ if(exp != NULL){
snprintf(subQuery,sizeof(subQuery),", \"message\" : {$regexp : \"/%s/\" }", exp); snprintf(subQuery,sizeof(subQuery),", \"message\" : {\"$regex\": \"%s\" }", exp);
strncat(jsonQuery,subQuery,sizeof(jsonQuery)); strncat(jsonQuery,subQuery,sizeof(jsonQuery));
} }
strncat(jsonQuery,"}",sizeof(jsonQuery)); strncat(jsonQuery,"}",sizeof(jsonQuery));

View File

@ -420,8 +420,8 @@ static int TASHeader(pScanData self)
/* /*
put the standard counter things put the standard counter things
*/ */
strcat(pBueffel, "F8.0,1X,F8.0,1X,F9.2,1X,F8.0,1X,F8.0,1X,"); strcat(pBueffel, "F8.0,1X,F8.0,1X,F9.2,1X,F8.0,1X,F8.0,1X,F9.0,1X,");
strcat(pHeader, " M1 M2 TIME CNTS M3 "); strcat(pHeader, " M1 M2 TIME CNTS M3 M4 ");
/* /*
now the additional variables now the additional variables
*/ */
@ -471,7 +471,7 @@ static int TASScanPoint(pScanData self, int iPoint)
int i, status, iPtr; int i, status, iPtr;
float fVal; float fVal;
pMotor pMot = NULL; pMotor pMot = NULL;
long m1, m2, m3, cnts; long m1, m2, m3, m4, cnts;
char pBueffel[1024], pWork[80], pError[132]; char pBueffel[1024], pWork[80], pError[132];
/* /*
@ -527,9 +527,10 @@ static int TASScanPoint(pScanData self, int iPoint)
m1 = GetMonitor(self->pCounterData, 1, self->pCon); m1 = GetMonitor(self->pCounterData, 1, self->pCon);
m2 = GetMonitor(self->pCounterData, 2, self->pCon); m2 = GetMonitor(self->pCounterData, 2, self->pCon);
m3 = GetMonitor(self->pCounterData, 3, self->pCon); m3 = GetMonitor(self->pCounterData, 3, self->pCon);
m4 = GetMonitor(self->pCounterData, 4, self->pCon); // integrated proton charge on target
cnts = GetCounts(self->pCounterData, self->pCon); cnts = GetCounts(self->pCounterData, self->pCon);
fVal = GetCountTime(self->pCounterData, self->pCon); fVal = GetCountTime(self->pCounterData, self->pCon);
sprintf(pWork, "%8ld %8ld %9.2f %8ld %8ld ", m1, m2, fVal, cnts, m3); sprintf(pWork, "%8ld %8ld %9.2f %8ld %8ld %9ld", m1, m2, fVal, cnts, m3, m4);
strcat(pBueffel, pWork); strcat(pBueffel, pWork);
/* /*

View File

@ -6,7 +6,7 @@
#---------------------------------------------------------- #----------------------------------------------------------
set instlist [list amor boa dmc eiger focus hrpt mars \ set instlist [list amor boa dmc eiger focus hrpt mars \
morpheus narziss orion poldi rita2 sans sans2 tasp trics] morpheus narziss orion poldi rita2 sans sans2 tasp zebra]
proc execCommand {command} { proc execCommand {command} {

View File

@ -7,7 +7,7 @@
#---------------------------------------------------------- #----------------------------------------------------------
set instlist [list amor boa dmc eiger focus hrpt mars \ set instlist [list amor boa dmc eiger focus hrpt mars \
morpheus narziss orion poldi rita2 sans sans2 tasp trics] morpheus narziss orion poldi rita2 sans sans2 tasp zebra]
proc execCommand {command} { proc execCommand {command} {