- Fixes to make SL6 work
- New NeXus libraries - Added new raw binary transfer mode for mass data - Added a check script option to configurable virtual motor SKIPPED: psi/dumprot.c psi/make_gen psi/psi.c psi/rebin.c psi/sanslirebin.c
This commit is contained in:
106
hkl.c
106
hkl.c
@ -395,13 +395,13 @@ int hklInRange(void *data, double fSet[4], int mask[4])
|
||||
often restricted due to the cryogenic garbage around the sample.
|
||||
-------------------------------------------------------------------------*/
|
||||
int CalculateSettings(pHKL self, float fHKL[3], float fPsi, int iHamil,
|
||||
float fSet[4], SConnection * pCon)
|
||||
float fSet[5], SConnection * pCon)
|
||||
{
|
||||
char pBueffel[512];
|
||||
double myPsi = fPsi;
|
||||
int i, status;
|
||||
pSingleDiff single = NULL;
|
||||
double dHkl[4], dSet[4];
|
||||
double dHkl[4], dSet[5];
|
||||
|
||||
/* catch shitty input */
|
||||
if ((fHKL[0] == 0.) && (fHKL[1] == 0.) && (fHKL[2] == 0.)) {
|
||||
@ -422,7 +422,7 @@ int CalculateSettings(pHKL self, float fHKL[3], float fPsi, int iHamil,
|
||||
dHkl[3] = myPsi;
|
||||
|
||||
status = single->calculateSettings(single, dHkl, dSet);
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < 5; i++) {
|
||||
fSet[i] = dSet[i];
|
||||
}
|
||||
|
||||
@ -446,17 +446,17 @@ void stopHKLMotors(pHKL self)
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
int startHKLMotors(pHKL self, SConnection * pCon, float fSet[4])
|
||||
int startHKLMotors(pHKL self, SConnection * pCon, float fSet[5])
|
||||
{
|
||||
char pBueffel[512];
|
||||
pSingleDiff single = NULL;
|
||||
double dSet[4];
|
||||
double dSet[5];
|
||||
int i, status;
|
||||
|
||||
single = SXGetDiffractometer();
|
||||
assert(single != NULL);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < 5; i++) {
|
||||
dSet[i] = fSet[i];
|
||||
}
|
||||
single->settingsToList(single, dSet);
|
||||
@ -471,7 +471,7 @@ int startHKLMotors(pHKL self, SConnection * pCon, float fSet[4])
|
||||
int RunHKL(pHKL self, float fHKL[3],
|
||||
float fPsi, int iHamil, SConnection * pCon)
|
||||
{
|
||||
float fSet[4];
|
||||
float fSet[5];
|
||||
int iRet, i;
|
||||
char pBueffel[512];
|
||||
pDummy pDum;
|
||||
@ -496,7 +496,7 @@ int RunHKL(pHKL self, float fHKL[3],
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
int DriveSettings(pHKL self, float fSet[4], SConnection * pCon)
|
||||
int DriveSettings(pHKL self, float fSet[5], SConnection * pCon)
|
||||
{
|
||||
int iRet;
|
||||
|
||||
@ -579,77 +579,6 @@ int DriveHKL(pHKL self, float fHKL[3],
|
||||
return iReturn;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* This is only used in mesure, remove when mesure can be killed
|
||||
* ----------------------------------------------------------------------*/
|
||||
int GetCurrentPosition(pHKL self, SConnection * pCon, float fPos[4])
|
||||
{
|
||||
float fVal;
|
||||
int iRet, iResult;
|
||||
pMotor pTheta, pOmega, pChi, pPhi, pNu;
|
||||
|
||||
pTheta = SXGetMotor(TwoTheta);
|
||||
pOmega = SXGetMotor(Omega);
|
||||
pChi = SXGetMotor(Chi);
|
||||
pPhi = SXGetMotor(Phi);
|
||||
if (pTheta == NULL || pOmega == NULL || pChi == NULL || pPhi == NULL) {
|
||||
SCWrite(pCon,
|
||||
"ERROR: configuration problem, stt,om,chi,phi motors not found,",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(self);
|
||||
assert(pCon);
|
||||
|
||||
iResult = 1;
|
||||
iRet = MotorGetSoftPosition(pTheta, pCon, &fVal);
|
||||
if (iRet == 1) {
|
||||
fPos[0] = fVal;
|
||||
} else {
|
||||
iResult = 0;
|
||||
}
|
||||
iRet = MotorGetSoftPosition(pOmega, pCon, &fVal);
|
||||
if (iRet == 1) {
|
||||
fPos[1] = fVal;
|
||||
} else {
|
||||
iResult = 0;
|
||||
}
|
||||
|
||||
/* normal beam geometry */
|
||||
if (SXGetMode() == NB) {
|
||||
pNu = SXGetMotor(Nu);
|
||||
if (pNu) {
|
||||
SCWrite(pCon, "ERROR: configuration problem, nu motor not found,",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
iRet = MotorGetSoftPosition(pNu, pCon, &fVal);
|
||||
if (iRet == 1) {
|
||||
fPos[2] = fVal;
|
||||
} else {
|
||||
iResult = 0;
|
||||
}
|
||||
return iResult;
|
||||
}
|
||||
|
||||
/* bissecting geometry */
|
||||
iRet = MotorGetSoftPosition(pChi, pCon, &fVal);
|
||||
if (iRet == 1) {
|
||||
fPos[2] = fVal;
|
||||
} else {
|
||||
iResult = 0;
|
||||
}
|
||||
iRet = MotorGetSoftPosition(pPhi, pCon, &fVal);
|
||||
if (iRet == 1) {
|
||||
fPos[3] = fVal;
|
||||
} else {
|
||||
iResult = 0;
|
||||
}
|
||||
|
||||
return iResult;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
For the conversion from angles to HKL.
|
||||
-------------------------------------------------------------------------*/
|
||||
@ -803,14 +732,15 @@ int HKLAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
int iRet, i, iHamil;
|
||||
char pBueffel[512];
|
||||
float fUB[9], fPsi, fVal;
|
||||
float fHKL[3], fSet[4];
|
||||
double dHKL[3], dSet[4];
|
||||
float fHKL[3], fSet[5];
|
||||
double dHKL[3], dSet[5];
|
||||
double dVal, lambda, stt;
|
||||
const double *dUB;
|
||||
pHKL self = NULL;
|
||||
CommandList *pCom = NULL;
|
||||
pDummy pDum = NULL;
|
||||
pSingleDiff single = NULL;
|
||||
int mode, nargs;
|
||||
|
||||
assert(pCon);
|
||||
assert(pSics);
|
||||
@ -857,13 +787,19 @@ int HKLAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
return 1;
|
||||
} else if (strcmp(argv[1], "fromangles") == 0) {
|
||||
if (argc < 6) {
|
||||
mode = SXGetMode();
|
||||
if(mode == BiNB) {
|
||||
nargs = 7;
|
||||
} else {
|
||||
nargs = 6;
|
||||
}
|
||||
if (argc < nargs) {
|
||||
SCWrite(pCon,
|
||||
"ERROR: need stt, om, chi,phi to calculate HKL from angles",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < nargs-2; i++) {
|
||||
iRet = Tcl_GetDouble(InterpGetTcl(pSics), argv[i + 2], &dVal);
|
||||
if (iRet != TCL_OK) {
|
||||
snprintf(pBueffel, 511, "ERROR: failed to convert %s to number",
|
||||
@ -1031,6 +967,10 @@ int HKLAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, " gamma = %f, omega = %f, nu = %f",
|
||||
fSet[0], fSet[1], fSet[2]);
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
} else if(SXGetMode() == BiNB){
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, " 2-theta = %f, omega = %f, chi = %f, phi = %f, nu = %f",
|
||||
fSet[0], fSet[1], fSet[2], fSet[3], fSet[4]);
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
} else {
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, " 2-theta = %f, omega = %f, chi = %f, phi = %f",
|
||||
fSet[0], fSet[1], fSet[2], fSet[3]);
|
||||
|
Reference in New Issue
Block a user