PSI update

r1464 | ffr | 2007-02-12 12:20:21 +1100 (Mon, 12 Feb 2007) | 2 lines
This commit is contained in:
Ferdi Franceschini
2007-02-12 12:20:21 +11:00
committed by Douglas Clowes
parent 634f2023b1
commit 3168325921
157 changed files with 29053 additions and 910 deletions

View File

@@ -519,38 +519,13 @@ static int ClimbDrive(SConnection *pCon,char *name, float value)
}
return 1;
}
/*-------------------------------------------------------------------------*/
static int ClimbVariable(pOptimise self, SConnection *pCon, int i)
{
pOVarEntry pOvar;
void *pData;
int status, direction = 1;
long oneCount, twoCount, lastCount, currentCount;
float varValue, startValue;
char buffer[256];
int (*CollectFunc)(pScanData self, int iPoint) = NULL;
assert(self);
assert( (i >= 0) && (i < self->iVar));
assert(pCon);
/* get variable data */
DynarGet(self->pVariables,i,&pData);
pOvar = (pOVarEntry)pData;
startValue = pOvar->fCenter;
/*
* prepare scan object
*/
self->pScanner->pCon = pCon;
self->pScanner->pSics = pServ->pSics;
self->pScanner->iNP = 1;
self->pScanner->iMode = self->eCount;
self->pScanner->fPreset = self->fPreset;
/*
* test for upwards direction
*/
/*------------------------------------------------------------------------*/
static int findDirection(pOptimise self, pOVarEntry pOvar, SConnection *pCon)
{
int status, direction;
float varValue;
long oneCount, twoCount;
varValue = pOvar->fCenter + pOvar->fStep;
status = ClimbDrive(pCon,pOvar->pName,varValue);
if(!status)
@@ -584,14 +559,46 @@ static int ClimbDrive(SConnection *pCon,char *name, float value)
if(oneCount > twoCount)
{
direction = 1;
lastCount = oneCount;
}
else
{
direction = -1;
lastCount = twoCount;
}
return direction;
}
/*-------------------------------------------------------------------------*/
static int ClimbVariable(pOptimise self, SConnection *pCon, int i)
{
pOVarEntry pOvar;
void *pData;
int status, direction = 1;
long oneCount, twoCount, lastCount, currentCount;
float varValue, startValue;
char buffer[256];
int (*CollectFunc)(pScanData self, int iPoint) = NULL;
assert(self);
assert( (i >= 0) && (i < self->iVar));
assert(pCon);
/* get variable data */
DynarGet(self->pVariables,i,&pData);
pOvar = (pOVarEntry)pData;
startValue = pOvar->fCenter;
/*
* prepare scan object
*/
self->pScanner->pCon = pCon;
self->pScanner->pSics = pServ->pSics;
self->pScanner->iNP = 1;
self->pScanner->iMode = self->eCount;
self->pScanner->fPreset = self->fPreset;
direction = findDirection(self,pOvar, pCon);
if(direction < -1){
return direction;
}
/*
* drive to the last best position
*/
@@ -600,7 +607,12 @@ static int ClimbDrive(SConnection *pCon,char *name, float value)
if(!status)
{
return DRIVEERROR;
}
}
lastCount = ClimbCount(self,pCon);
if(lastCount < 0)
{
return SCANERROR;
}
currentCount = lastCount;
/*