- 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 SKIPPED: psi/eigermono.c psi/sinqhttp.c psi/tdchm.c
This commit is contained in:
69
tasub.c
69
tasub.c
@@ -207,60 +207,6 @@ static void KillTasUB(void *pData)
|
||||
free(self);
|
||||
}
|
||||
|
||||
/*===================== computation section =========================*/
|
||||
static int readTASAngles(ptasUB self, SConnection * pCon, ptasAngles ang)
|
||||
{
|
||||
int status;
|
||||
float val;
|
||||
|
||||
/*
|
||||
Monochromator
|
||||
*/
|
||||
status = GetDrivablePosition(self->motors[A2], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->monochromator_two_theta = val;
|
||||
|
||||
/*
|
||||
Analyzer
|
||||
*/
|
||||
if (self->tasMode != ELASTIC) {
|
||||
status = GetDrivablePosition(self->motors[A6], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->analyzer_two_theta = val;
|
||||
} else {
|
||||
ang->analyzer_two_theta = ang->monochromator_two_theta;
|
||||
}
|
||||
|
||||
/*
|
||||
crystal
|
||||
*/
|
||||
status = GetDrivablePosition(self->motors[A3], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->a3 = val;
|
||||
status = GetDrivablePosition(self->motors[A4], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->sample_two_theta = val;
|
||||
status = GetDrivablePosition(self->motors[SGU], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->sgu = val;
|
||||
status = GetDrivablePosition(self->motors[SGL], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->sgl = val;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*==================== interpreter interface section =================*/
|
||||
static int testMotor(ptasUB pNew, SConnection * pCon, char *name, int idx)
|
||||
{
|
||||
@@ -280,7 +226,7 @@ static void updateTargets(ptasUB pNew, SConnection * pCon)
|
||||
{
|
||||
tasAngles ang;
|
||||
|
||||
readTASAngles(pNew, pCon, &ang);
|
||||
readTASMotAngles(pNew, pCon, &ang);
|
||||
calcTasQEPosition(&pNew->machine, ang, &pNew->target);
|
||||
}
|
||||
/*--------------------------------------------------------------------*/
|
||||
@@ -761,7 +707,7 @@ static int addReflection(ptasUB self, SicsInterp * pSics,
|
||||
"WARNING: not all angles given on command line, using positions instead",
|
||||
eWarning);
|
||||
}
|
||||
status = readTASAngles(self, pCon, &r.angles);
|
||||
status = readTASMotAngles(self, pCon, &r.angles);
|
||||
if (status != 1) {
|
||||
return status;
|
||||
}
|
||||
@@ -1253,6 +1199,13 @@ static int calcUB(ptasUB self, SConnection * pCon, SicsInterp * pSics,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!self->outOfPlaneAllowed){
|
||||
r1.angles.sgu = .0;
|
||||
r1.angles.sgl = .0;
|
||||
r2.angles.sgu = .0;
|
||||
r2.angles.sgl = .0;
|
||||
}
|
||||
|
||||
UB = calcTasUBFromTwoReflections(self->cell, r1, r2, &status);
|
||||
if (UB == NULL) {
|
||||
switch (status) {
|
||||
@@ -1848,7 +1801,7 @@ int tasUpdate(SConnection * pCon, ptasUB self)
|
||||
int status;
|
||||
tasAngles angles;
|
||||
|
||||
status = readTASAngles(self, pCon, &angles);
|
||||
status = readTASMotAngles(self, pCon, &angles);
|
||||
if (status != 1) {
|
||||
return status;
|
||||
}
|
||||
@@ -2126,6 +2079,8 @@ int TasUBWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
}
|
||||
self->outOfPlaneAllowed = newSS;
|
||||
invokeUpdate(self,pCon,"main");
|
||||
SCWrite(pCon,"WARNING: You have to recalculate the UB matrix after swapping outofplane mode",
|
||||
eWarning);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user