- reintroducted MF/TEM
This commit is contained in:
33
ptasdrive.c
33
ptasdrive.c
@@ -42,7 +42,9 @@ extern char *stptok(const char *s, char *tok, size_t toklen, char *brk);
|
||||
par=val. However, it is possible that the we get par = val, val, val
|
||||
which means that the motors following par in storage order are
|
||||
driven. Additionally we have to check for special energy or Q variables
|
||||
which require a triple axis calculation.
|
||||
which require a triple axis calculation.
|
||||
|
||||
M.Z. June 07: storage order mode only allowed for QH,QK,QL,EN.
|
||||
|
||||
It helps if one understands some fundamental things used in the code
|
||||
below:
|
||||
@@ -77,7 +79,7 @@ int TASDrive(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
unsigned char motorMask[MAXMOT];
|
||||
float newPositions[MAXMOT];
|
||||
pMotor pMot;
|
||||
|
||||
int qhPars;
|
||||
|
||||
|
||||
assert(pCon);
|
||||
@@ -116,7 +118,8 @@ int TASDrive(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
varPointer = -1;
|
||||
motorPointer = -1;
|
||||
rStatus = 1;
|
||||
|
||||
qhPars = 0;
|
||||
|
||||
/* parse loop */
|
||||
while(pPtr != NULL)
|
||||
{
|
||||
@@ -129,13 +132,9 @@ int TASDrive(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
if(lastToken == NUM)
|
||||
{
|
||||
/* handle storage order logic */
|
||||
if(motorPointer > -1)
|
||||
if(varPointer > -1 && qhPars > 1)
|
||||
{
|
||||
motorPointer++;
|
||||
}
|
||||
else if(varPointer > -1)
|
||||
{
|
||||
varPointer++;
|
||||
varPointer++; qhPars--;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -175,6 +174,9 @@ int TASDrive(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
iTAS = 1;
|
||||
motorPointer = -1;
|
||||
varPointer = status;
|
||||
if (EMIN + varPointer == QH) {
|
||||
qhPars = 4;
|
||||
}
|
||||
}
|
||||
else if( (status = isTASMotor(pToken)) > -1)
|
||||
{
|
||||
@@ -190,6 +192,7 @@ int TASDrive(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
}
|
||||
}
|
||||
}/* end of parse loop */
|
||||
|
||||
if(rStatus != 1)
|
||||
return rStatus;
|
||||
|
||||
@@ -208,13 +211,14 @@ int TASDrive(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
if(pMot)
|
||||
{
|
||||
MotorGetSoftPosition(pMot, pCon, &oldPos);
|
||||
sprintf(pBueffel,"Driving %s from %f to %f",
|
||||
tasMotorOrder[i],oldPos,newPositions[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldPos = -9999.;
|
||||
sprintf(pBueffel,"Driving %s to %f",
|
||||
tasMotorOrder[i],newPositions[i]);
|
||||
}
|
||||
sprintf(pBueffel,"Driving %s from %f to %f",
|
||||
tasMotorOrder[i],oldPos,newPositions[i]);
|
||||
SCWrite(pCon,pBueffel,eWarning);
|
||||
status = StartMotor(pServ->pExecutor,pSics,pCon,
|
||||
tasMotorOrder[i],newPositions[i]);
|
||||
@@ -232,6 +236,11 @@ int TASDrive(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
*/
|
||||
if(iTAS > 0)
|
||||
{
|
||||
if (qhPars == 3) {
|
||||
SCWrite(pCon, "ERROR: QH cannot have 2 values", eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
status = TASCalc(self,pCon,tasMask,tasTargets, tasTargetMask);
|
||||
if(status)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user