- Fixed a normalisation problem in diffscan when the first value
did not have enough counts - Reduced polling frequency in emon - Fixed a scriptcontext bug which would cause it to dump core in SctTransact on interrupts - Fixed an issue with missing <nl> at the end of batch files - Added a feature which does not call halt when counting stops in hmcontrol.c This is necessary for the BOA CCD - Initalized doNotFree properly in hipadaba.c - Added the travelling salesman reflection measurement algorithm - Added another component to amorset - Removed old SicsWait from nserver.c - Added a means to nxscript to write 16 bit data for BOA - Modified tasub to accept a drivabel as a motor and not only a motor. This became necessary to make EIGER work as A2 on EIGER is a virtual motor SKIPPED: psi/amorcomp.h psi/amordrive.h psi/amorset.c psi/amorset.h psi/amorset.tex psi/amorset.w psi/el734hp.c psi/el737hpdriv.c psi/make_gen psi/pardef.c psi/polterwrite.c psi/psi.c psi/sinqhttpopt.c
This commit is contained in:
81
tasub.c
81
tasub.c
@ -9,10 +9,15 @@
|
||||
Reworked to support an updater script for Integration into Hipadaba
|
||||
|
||||
Mark Koennecke, July 2009
|
||||
|
||||
Modified to use drivables rather then motors
|
||||
|
||||
Mark Koennecke, September 2011
|
||||
----------------------------------------------------------------------*/
|
||||
#include <assert.h>
|
||||
#include "sics.h"
|
||||
#include "lld.h"
|
||||
#include "SCinter.h"
|
||||
#include "trigd.h"
|
||||
#include "tasub.h"
|
||||
#include "tasdrive.h"
|
||||
@ -203,7 +208,7 @@ static int readTASAngles(ptasUB self, SConnection * pCon, ptasAngles ang)
|
||||
/*
|
||||
Monochromator
|
||||
*/
|
||||
status = MotorGetSoftPosition(self->motors[A2], pCon, &val);
|
||||
status = GetDrivablePosition(self->motors[A2], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
@ -213,7 +218,7 @@ static int readTASAngles(ptasUB self, SConnection * pCon, ptasAngles ang)
|
||||
Analyzer
|
||||
*/
|
||||
if (self->tasMode != ELASTIC) {
|
||||
status = MotorGetSoftPosition(self->motors[A6], pCon, &val);
|
||||
status = GetDrivablePosition(self->motors[A6], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
@ -225,22 +230,22 @@ static int readTASAngles(ptasUB self, SConnection * pCon, ptasAngles ang)
|
||||
/*
|
||||
crystal
|
||||
*/
|
||||
status = MotorGetSoftPosition(self->motors[A3], pCon, &val);
|
||||
status = GetDrivablePosition(self->motors[A3], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->a3 = val;
|
||||
status = MotorGetSoftPosition(self->motors[A4], pCon, &val);
|
||||
status = GetDrivablePosition(self->motors[A4], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->sample_two_theta = val;
|
||||
status = MotorGetSoftPosition(self->motors[SGU], pCon, &val);
|
||||
status = GetDrivablePosition(self->motors[SGU], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
ang->sgu = val;
|
||||
status = MotorGetSoftPosition(self->motors[SGL], pCon, &val);
|
||||
status = GetDrivablePosition(self->motors[SGL], pCon, &val);
|
||||
if (status == 0) {
|
||||
return status;
|
||||
}
|
||||
@ -270,7 +275,21 @@ static void updateTargets(ptasUB pNew, SConnection * pCon)
|
||||
readTASAngles(pNew, pCon, &ang);
|
||||
calcTasQEPosition(&pNew->machine, ang, &pNew->target);
|
||||
}
|
||||
/*--------------------------------------------------------------------*/
|
||||
static pMotor TasFindMotor(SicsInterp *pSics, char *name)
|
||||
{
|
||||
pMotor mot = NULL;
|
||||
CommandList *pCom = NULL;
|
||||
|
||||
mot = FindMotor(pSics,name);
|
||||
if(mot == NULL){
|
||||
pCom = FindCommand(pSics,name);
|
||||
if(pCom != NULL && GetDrivableInterface(pCom->pData) != NULL){
|
||||
mot = (pMotor)pCom->pData;
|
||||
}
|
||||
}
|
||||
return mot;
|
||||
}
|
||||
/*--------------------------------------------------------------------*/
|
||||
int TasUBFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
int argc, char *argv[])
|
||||
@ -306,34 +325,34 @@ int TasUBFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
/*
|
||||
* default names and assignement
|
||||
*/
|
||||
pNew->motors[0] = FindMotor(pSics, "a1");
|
||||
pNew->motors[1] = FindMotor(pSics, "a2");
|
||||
pNew->motors[2] = FindMotor(pSics, "mcv");
|
||||
pNew->motors[3] = FindMotor(pSics, "mch");
|
||||
pNew->motors[4] = FindMotor(pSics, "a3");
|
||||
pNew->motors[5] = FindMotor(pSics, "a4");
|
||||
pNew->motors[6] = FindMotor(pSics, "sgu");
|
||||
pNew->motors[7] = FindMotor(pSics, "sgl");
|
||||
pNew->motors[8] = FindMotor(pSics, "a5");
|
||||
pNew->motors[9] = FindMotor(pSics, "a6");
|
||||
pNew->motors[10] = FindMotor(pSics, "acv");
|
||||
pNew->motors[11] = FindMotor(pSics, "ach");
|
||||
pNew->motors[0] = TasFindMotor(pSics, "a1");
|
||||
pNew->motors[1] = TasFindMotor(pSics, "a2");
|
||||
pNew->motors[2] = TasFindMotor(pSics, "mcv");
|
||||
pNew->motors[3] = TasFindMotor(pSics, "mch");
|
||||
pNew->motors[4] = TasFindMotor(pSics, "a3");
|
||||
pNew->motors[5] = TasFindMotor(pSics, "a4");
|
||||
pNew->motors[6] = TasFindMotor(pSics, "sgu");
|
||||
pNew->motors[7] = TasFindMotor(pSics, "sgl");
|
||||
pNew->motors[8] = TasFindMotor(pSics, "a5");
|
||||
pNew->motors[9] = TasFindMotor(pSics, "a6");
|
||||
pNew->motors[10] = TasFindMotor(pSics, "acv");
|
||||
pNew->motors[11] = TasFindMotor(pSics, "ach");
|
||||
} else {
|
||||
/*
|
||||
* user defined names
|
||||
*/
|
||||
pNew->motors[0] = FindMotor(pSics, argv[2]);
|
||||
pNew->motors[1] = FindMotor(pSics, argv[3]);
|
||||
pNew->motors[2] = FindMotor(pSics, argv[4]);
|
||||
pNew->motors[3] = FindMotor(pSics, argv[5]);
|
||||
pNew->motors[4] = FindMotor(pSics, argv[6]);
|
||||
pNew->motors[5] = FindMotor(pSics, argv[7]);
|
||||
pNew->motors[6] = FindMotor(pSics, argv[8]);
|
||||
pNew->motors[7] = FindMotor(pSics, argv[9]);
|
||||
pNew->motors[8] = FindMotor(pSics, argv[10]);
|
||||
pNew->motors[9] = FindMotor(pSics, argv[11]);
|
||||
pNew->motors[10] = FindMotor(pSics, argv[12]);
|
||||
pNew->motors[11] = FindMotor(pSics, argv[13]);
|
||||
pNew->motors[0] = TasFindMotor(pSics, argv[2]);
|
||||
pNew->motors[1] = TasFindMotor(pSics, argv[3]);
|
||||
pNew->motors[2] = TasFindMotor(pSics, argv[4]);
|
||||
pNew->motors[3] = TasFindMotor(pSics, argv[5]);
|
||||
pNew->motors[4] = TasFindMotor(pSics, argv[6]);
|
||||
pNew->motors[5] = TasFindMotor(pSics, argv[7]);
|
||||
pNew->motors[6] = TasFindMotor(pSics, argv[8]);
|
||||
pNew->motors[7] = TasFindMotor(pSics, argv[9]);
|
||||
pNew->motors[8] = TasFindMotor(pSics, argv[10]);
|
||||
pNew->motors[9] = TasFindMotor(pSics, argv[11]);
|
||||
pNew->motors[10] = TasFindMotor(pSics, argv[12]);
|
||||
pNew->motors[11] = TasFindMotor(pSics, argv[13]);
|
||||
}
|
||||
/*
|
||||
curvature motors may be missing, anything else is a serious problem
|
||||
@ -1047,7 +1066,7 @@ static int addAuxReflection(ptasUB self, SConnection * pCon,
|
||||
if (status != 1) {
|
||||
r2.qe.kf = self->current.kf;
|
||||
r2.qe.ki = self->current.ki;
|
||||
MotorGetSoftPosition(self->motors[A3], pCon, &value);
|
||||
GetDrivablePosition(self->motors[A3], pCon, &value);
|
||||
r2.angles.a3 = value + 180.;
|
||||
r2.angles.sgu = .0;
|
||||
r2.angles.sgl = .0;
|
||||
|
Reference in New Issue
Block a user