- Added file checking and listings to exeman
- Fixed some problems with mesure - Fixed issues with tasub
This commit is contained in:
33
tasub.c
33
tasub.c
@ -490,7 +490,7 @@ static void listReflections(ptasUB self, SConnection *pCon){
|
||||
|
||||
Tcl_DStringInit(&list);
|
||||
snprintf(line,255,
|
||||
" NO QH QK QL A3 A4 SGU SGL KI KF\n");
|
||||
" NO QH QK QL A3 A4 SGU SGL EI EF\n");
|
||||
Tcl_DStringAppend(&list,line,-1);
|
||||
status = LLDnodePtr2First(self->reflectionList);
|
||||
while(status == 1){
|
||||
@ -498,7 +498,7 @@ static void listReflections(ptasUB self, SConnection *pCon){
|
||||
LLDnodeDataTo(self->reflectionList,&r);
|
||||
snprintf(line,255,"%3d %6.2f %6.2f %6.2f %7.2f %7.2f %6.2f %6.2f %6.2f %6.2f\n",
|
||||
count, r.qe.qh, r.qe.qk, r.qe.ql, r.angles.a3, r.angles.sample_two_theta,
|
||||
r.angles.sgu, r.angles.sgl, r.qe.ki, r.qe.kf);
|
||||
r.angles.sgu, r.angles.sgl, KtoEnergy(r.qe.ki), KtoEnergy(r.qe.kf));
|
||||
Tcl_DStringAppend(&list,line,-1);
|
||||
status = LLDnodePtr2Next(self->reflectionList);
|
||||
}
|
||||
@ -510,6 +510,8 @@ static void listReflections(ptasUB self, SConnection *pCon){
|
||||
Tcl_DStringFree(&list);
|
||||
}
|
||||
/*-------------------------------------------------------------------*/
|
||||
#define ABS(x) (x < 0 ? -(x) : (x))
|
||||
/*-------------------------------------------------------------------*/
|
||||
static int addReflection(ptasUB self, SicsInterp *pSics,
|
||||
SConnection *pCon,
|
||||
int argc, char *argv[]){
|
||||
@ -597,18 +599,22 @@ static int addReflection(ptasUB self, SicsInterp *pSics,
|
||||
if(status != 1){
|
||||
return status;
|
||||
}
|
||||
r.qe.ki = maCalcK(self->machine.monochromator,angles.monochromator_two_theta);
|
||||
r.qe.kf = maCalcK(self->machine.analyzer,angles.analyzer_two_theta);
|
||||
r.qe.ki = maCalcK(self->machine.monochromator,r.angles.monochromator_two_theta);
|
||||
r.qe.kf = maCalcK(self->machine.analyzer,r.angles.analyzer_two_theta);
|
||||
}
|
||||
if(ABS(r.qe.ki - r.qe.kf) > .01) {
|
||||
SCWrite(pCon,"WARNING: KI != KF!",eWarning);
|
||||
}
|
||||
LLDnodeAppend(self->reflectionList,&r);
|
||||
Tcl_DStringInit(&list);
|
||||
snprintf(pBueffel,255,
|
||||
" QH QK QL A3 A4 SGU SGL KI KF\n");
|
||||
" QH QK QL A3 A4 SGU SGL EI EF\n");
|
||||
Tcl_DStringAppend(&list,pBueffel,-1);
|
||||
snprintf(pBueffel,255,
|
||||
" %6.2f %6.2f %6.2f %7.2f %7.2f %6.2f %6.2f %6.2f %6.2f\n",
|
||||
r.qe.qh, r.qe.qk, r.qe.ql, r.angles.a3, r.angles.sample_two_theta,
|
||||
r.angles.sgu, r.angles.sgl, r.qe.ki, r.qe.kf);
|
||||
r.angles.sgu, r.angles.sgl, KtoEnergy(r.qe.ki),
|
||||
KtoEnergy(r.qe.kf));
|
||||
Tcl_DStringAppend(&list,pBueffel,-1);
|
||||
SCWrite(pCon,Tcl_DStringValue(&list),eValue);
|
||||
Tcl_DStringFree(&list);
|
||||
@ -669,12 +675,13 @@ static void printReflectionDiagnostik(ptasUB self, SConnection *pCon,
|
||||
|
||||
Tcl_DStringInit(&list);
|
||||
snprintf(line,255,
|
||||
"METHOD QH QK QL A3 A4 SGU SGL KI KF\n");
|
||||
"METHOD QH QK QL A3 A4 SGU SGL EI EF\n");
|
||||
Tcl_DStringAppend(&list,line,-1);
|
||||
snprintf(line,255,
|
||||
"INPUT %6.2f %6.2f %6.2f %7.2f %7.2f %6.2f %6.2f %6.2f %6.2f\n",
|
||||
"INPUT %8.4f %8.4f %8.4f %7.2f %7.2f %6.2f %6.2f %6.2f %6.2f\n",
|
||||
r.qe.qh, r.qe.qk, r.qe.ql, r.angles.a3,
|
||||
r.angles.sample_two_theta, r.angles.sgu, r.angles.sgl, r.qe.ki, r.qe.kf);
|
||||
r.angles.sample_two_theta, r.angles.sgu, r.angles.sgl,
|
||||
KtoEnergy(r.qe.ki), KtoEnergy(r.qe.kf));
|
||||
Tcl_DStringAppend(&list,line,-1);
|
||||
qe.ki = r.qe.ki;
|
||||
qe.kf = r.qe.kf;
|
||||
@ -683,10 +690,10 @@ static void printReflectionDiagnostik(ptasUB self, SConnection *pCon,
|
||||
qe.ql = r.qe.ql;
|
||||
calcAllTasAngles(&self->machine,qe,&angles);
|
||||
snprintf(line,255,
|
||||
"QE->ANG %6.2f %6.2f %6.2f %7.2f %7.2f %6.2f %6.2f %6.2f %6.2f\n",
|
||||
"QE->ANG %8.4f %8.4f %8.4f %7.2f %7.2f %6.2f %6.2f %6.2f %6.2f\n",
|
||||
r.qe.qh, r.qe.qk, r.qe.ql,
|
||||
angles.a3, angles.sample_two_theta,
|
||||
angles.sgu, angles.sgl, r.qe.ki, r.qe.kf);
|
||||
angles.sgu, angles.sgl, KtoEnergy(r.qe.ki), KtoEnergy(r.qe.kf));
|
||||
Tcl_DStringAppend(&list,line,-1);
|
||||
angles.a3 = r.angles.a3;
|
||||
angles.sample_two_theta = r.angles.sample_two_theta;
|
||||
@ -694,9 +701,9 @@ static void printReflectionDiagnostik(ptasUB self, SConnection *pCon,
|
||||
angles.sgl = r.angles.sgl;
|
||||
calcTasQEPosition(&self->machine,angles,&qe);
|
||||
snprintf(line,255,
|
||||
"ANG->QE %6.2f %6.2f %6.2f %7.2f %7.2f %6.2f %6.2f %6.2f %6.2f\n",
|
||||
"ANG->QE %8.4f %8.4f %8.4f %7.2f %7.2f %6.2f %6.2f %6.2f %6.2f\n",
|
||||
qe.qh, qe.qk, qe.ql, angles.a3, angles.sample_two_theta,
|
||||
angles.sgu, angles.sgl, qe.ki, qe.kf);
|
||||
angles.sgu, angles.sgl, KtoEnergy(qe.ki), KtoEnergy(qe.kf));
|
||||
Tcl_DStringAppend(&list,line,-1);
|
||||
SCWrite(pCon,Tcl_DStringValue(&list),eWarning);
|
||||
Tcl_DStringFree(&list);
|
||||
|
Reference in New Issue
Block a user