- Improvements to Hipadaba
- New chopper driver for MARS Juelich chopper system - New docbook based SANS manual
This commit is contained in:
@ -92,6 +92,11 @@ int handleCompCommand(pamorComp comp, SConnection *pCon,
|
|||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
} else if (strcmp(argv[2], "calc") == 0) {
|
||||||
|
snprintf(pBueffel,511," %s %s calc = %f",
|
||||||
|
argv[0], argv[1], calcCompPosition(comp));
|
||||||
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
snprintf(pBueffel,511,"ERROR: subcommand %s to %s %s not understood",
|
snprintf(pBueffel,511,"ERROR: subcommand %s to %s %s not understood",
|
||||||
argv[2], argv[0], argv[1]);
|
argv[2], argv[0], argv[1]);
|
||||||
|
@ -22,4 +22,3 @@ int AmorDriveAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
int argc, char *argv[]);
|
int argc, char *argv[]);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
48
amorset.c
48
amorset.c
@ -79,8 +79,8 @@ static int calcAmorSettings(pamorSet self,SConnection *pCon){
|
|||||||
/*
|
/*
|
||||||
* soz
|
* soz
|
||||||
*/
|
*/
|
||||||
dist = ABS(calcCompPosition(&self->S) - calcCompPosition(&self->M));
|
dist = ABS(calcCompPosition(&self->S) - calcCompPosition(&self->M));
|
||||||
soz = dist*Tand(-self->targetm2t);
|
soz = dist*Tand(-self->targetm2t);
|
||||||
addMotorToList(self->driveList,"soz",soz);
|
addMotorToList(self->driveList,"soz",soz);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -357,8 +357,10 @@ static int amorSetSave(void *data, char *name,FILE *fd){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
fprintf(fd,"%s dspar %f\n", name, self->dspar);
|
fprintf(fd,"%s dspar %f\n", name, self->dspar);
|
||||||
|
fprintf(fd,"%s detectoroffset %f\n", name, self->detectoroffset);
|
||||||
fprintf(fd,"%s verbose %d\n", name, self->verbose);
|
fprintf(fd,"%s verbose %d\n", name, self->verbose);
|
||||||
saveAmorComp(fd,name,"mono",&self->M);
|
saveAmorComp(fd,name,"chopper",&self->chopper);
|
||||||
|
saveAmorComp(fd,name,"mono",&self->M);
|
||||||
saveAmorComp(fd,name,"ds",&self->DS);
|
saveAmorComp(fd,name,"ds",&self->DS);
|
||||||
saveAmorComp(fd,name,"slit2",&self->D2);
|
saveAmorComp(fd,name,"slit2",&self->D2);
|
||||||
saveAmorComp(fd,name,"slit3",&self->D3);
|
saveAmorComp(fd,name,"slit3",&self->D3);
|
||||||
@ -519,6 +521,8 @@ static pamorComp locateComponent(pamorSet self, char *name){
|
|||||||
return &self->D;
|
return &self->D;
|
||||||
}else if(strcmp(name,"ana") == 0){
|
}else if(strcmp(name,"ana") == 0){
|
||||||
return &self->A;
|
return &self->A;
|
||||||
|
} else if(strcmp(name,"chopper") == 0){
|
||||||
|
return &self->chopper;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -527,6 +531,7 @@ static pamorComp locateComponent(pamorSet self, char *name){
|
|||||||
static double calcCD(pamorSet self){
|
static double calcCD(pamorSet self){
|
||||||
double soz, cmh, smh, sdh, cd, dist;
|
double soz, cmh, smh, sdh, cd, dist;
|
||||||
|
|
||||||
|
dist = ABS(calcCompPosition(&self->S) - calcCompPosition(&self->M));
|
||||||
soz = dist*Cotd(self->targetm2t);
|
soz = dist*Cotd(self->targetm2t);
|
||||||
cmh = calcCompPosition(&self->M);
|
cmh = calcCompPosition(&self->M);
|
||||||
smh = calcCompPosition(&self->S) - calcCompPosition(&self->M);
|
smh = calcCompPosition(&self->S) - calcCompPosition(&self->M);
|
||||||
@ -535,6 +540,20 @@ static double calcCD(pamorSet self){
|
|||||||
return cd;
|
return cd;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
static double calcChopperDetectorDistance(pamorSet self){
|
||||||
|
double dist, diff, soz;
|
||||||
|
|
||||||
|
dist = ABS(calcCompPosition(&self->S) - calcCompPosition(&self->M));
|
||||||
|
soz = dist*Tand(-self->targetm2t);
|
||||||
|
|
||||||
|
dist = ABS(calcCompPosition(&self->M) - calcCompPosition(&self->chopper));
|
||||||
|
diff = calcCompPosition(&self->M) - calcCompPosition(&self->S);
|
||||||
|
dist += sqrt(diff*diff + soz*soz);
|
||||||
|
dist += ABS(calcCompPosition(&self->S) - calcCompPosition(&self->D));
|
||||||
|
dist += self->detectoroffset;
|
||||||
|
return dist;
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------------------*/
|
||||||
int AmorSetAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
int AmorSetAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||||
int argc, char *argv[]){
|
int argc, char *argv[]){
|
||||||
pamorSet self = NULL;
|
pamorSet self = NULL;
|
||||||
@ -587,12 +606,33 @@ int AmorSetAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}else if(strcmp(argv[1],"detectoroffset") == 0){
|
||||||
|
if(argc > 2){
|
||||||
|
if(!SCMatchRights(pCon,usUser)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
self->detectoroffset = atof(argv[2]);
|
||||||
|
SCSendOK(pCon);
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
snprintf(pBueffel,131,"%s detectoroffset = %f", argv[0],
|
||||||
|
self->detectoroffset);
|
||||||
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
} else if(strcmp(argv[1],"cd") == 0){
|
} else if(strcmp(argv[1],"cd") == 0){
|
||||||
snprintf(pBueffel,131,"%s cd = %f", argv[0], calcCD(self));
|
snprintf(pBueffel,131,"%s cd = %f", argv[0], calcCD(self));
|
||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
return 1;
|
return 1;
|
||||||
|
} else if(strcmp(argv[1],"cdd") == 0){
|
||||||
|
snprintf(pBueffel,131,"%s cdd = %f", argv[0],
|
||||||
|
calcChopperDetectorDistance(self));
|
||||||
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
SCWrite(pCon,"ERROR: unknown subcommand to amorset",eError);
|
snprintf(pBueffel,131,"ERROR: unknown subcommand %s to amorset",
|
||||||
|
argv[1]);
|
||||||
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ typedef struct {
|
|||||||
pObjectDescriptor pDes;
|
pObjectDescriptor pDes;
|
||||||
pIDrivable pDriv;
|
pIDrivable pDriv;
|
||||||
pIDrivable listDrive;
|
pIDrivable listDrive;
|
||||||
|
amorComp chopper;
|
||||||
amorComp M;
|
amorComp M;
|
||||||
amorComp DS;
|
amorComp DS;
|
||||||
amorComp D2;
|
amorComp D2;
|
||||||
@ -35,6 +36,7 @@ typedef struct {
|
|||||||
int mustRecalculate;
|
int mustRecalculate;
|
||||||
int driveList;
|
int driveList;
|
||||||
double dspar;
|
double dspar;
|
||||||
|
double detectoroffset;
|
||||||
int verbose;
|
int verbose;
|
||||||
}amorSet, *pamorSet;
|
}amorSet, *pamorSet;
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
@ -67,6 +67,7 @@ $\langle$amorsetint {\footnotesize ?}$\rangle\equiv$
|
|||||||
\mbox{}\verb@ pObjectDescriptor pDes;@\\
|
\mbox{}\verb@ pObjectDescriptor pDes;@\\
|
||||||
\mbox{}\verb@ pIDrivable pDriv;@\\
|
\mbox{}\verb@ pIDrivable pDriv;@\\
|
||||||
\mbox{}\verb@ pIDrivable listDrive;@\\
|
\mbox{}\verb@ pIDrivable listDrive;@\\
|
||||||
|
\mbox{}\verb@ amorComp chopper;@\\
|
||||||
\mbox{}\verb@ amorComp M;@\\
|
\mbox{}\verb@ amorComp M;@\\
|
||||||
\mbox{}\verb@ amorComp DS;@\\
|
\mbox{}\verb@ amorComp DS;@\\
|
||||||
\mbox{}\verb@ amorComp D2;@\\
|
\mbox{}\verb@ amorComp D2;@\\
|
||||||
@ -86,6 +87,7 @@ $\langle$amorsetint {\footnotesize ?}$\rangle\equiv$
|
|||||||
\mbox{}\verb@ int mustRecalculate;@\\
|
\mbox{}\verb@ int mustRecalculate;@\\
|
||||||
\mbox{}\verb@ int driveList;@\\
|
\mbox{}\verb@ int driveList;@\\
|
||||||
\mbox{}\verb@ double dspar;@\\
|
\mbox{}\verb@ double dspar;@\\
|
||||||
|
\mbox{}\verb@ double detectoroffset;@\\
|
||||||
\mbox{}\verb@ int verbose;@\\
|
\mbox{}\verb@ int verbose;@\\
|
||||||
\mbox{}\verb@}amorSet, *pamorSet;@\\
|
\mbox{}\verb@}amorSet, *pamorSet;@\\
|
||||||
\mbox{}\verb@/*--------------------------------------------------------------------*/@\\
|
\mbox{}\verb@/*--------------------------------------------------------------------*/@\\
|
||||||
|
@ -50,6 +50,7 @@ typedef struct {
|
|||||||
pObjectDescriptor pDes;
|
pObjectDescriptor pDes;
|
||||||
pIDrivable pDriv;
|
pIDrivable pDriv;
|
||||||
pIDrivable listDrive;
|
pIDrivable listDrive;
|
||||||
|
amorComp chopper;
|
||||||
amorComp M;
|
amorComp M;
|
||||||
amorComp DS;
|
amorComp DS;
|
||||||
amorComp D2;
|
amorComp D2;
|
||||||
@ -69,6 +70,7 @@ typedef struct {
|
|||||||
int mustRecalculate;
|
int mustRecalculate;
|
||||||
int driveList;
|
int driveList;
|
||||||
double dspar;
|
double dspar;
|
||||||
|
double detectoroffset;
|
||||||
int verbose;
|
int verbose;
|
||||||
}amorSet, *pamorSet;
|
}amorSet, *pamorSet;
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
2
make_gen
2
make_gen
@ -17,7 +17,7 @@ OBJ=psi.o buffer.o ruli.o dmc.o nxsans.o nextrics.o sps.o pimotor.o \
|
|||||||
t_rlp.o t_conv.o el737hpdriv.o dornier2.o el734hp.o \
|
t_rlp.o t_conv.o el737hpdriv.o dornier2.o el734hp.o \
|
||||||
el737hpv2driv.o swmotor2.o tricssupport.o amorcomp.o \
|
el737hpv2driv.o swmotor2.o tricssupport.o amorcomp.o \
|
||||||
$(MZOBJ) amordrive.o amorset.o tcpdornier.o sinqhttp.o\
|
$(MZOBJ) amordrive.o amorset.o tcpdornier.o sinqhttp.o\
|
||||||
dgrambroadcast.o sinq.o tabledrive.o tcpdocho.o
|
dgrambroadcast.o sinq.o tabledrive.o tcpdocho.o julcho.o
|
||||||
|
|
||||||
MZOBJ=fsm.o logger.o sugar.o pardef.o ease.o strobj.o oxinst.o logreader.o \
|
MZOBJ=fsm.o logger.o sugar.o pardef.o ease.o strobj.o oxinst.o logreader.o \
|
||||||
ipsdriv.o ilmdriv.o itcdriv.o ighdriv.o euro2kdriv.o modbus.o arrobj.o
|
ipsdriv.o ilmdriv.o itcdriv.o ighdriv.o euro2kdriv.o modbus.o arrobj.o
|
||||||
|
9
psi.c
9
psi.c
@ -60,7 +60,11 @@
|
|||||||
*/
|
*/
|
||||||
extern int VelSelTcpFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
|
extern int VelSelTcpFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||||
int argc, char *argv[]);
|
int argc, char *argv[]);
|
||||||
|
/*
|
||||||
|
* from julcho.c
|
||||||
|
*/
|
||||||
|
extern int JulChoFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||||
|
int argc, char *argv[]);
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
void SiteInit(void) {
|
void SiteInit(void) {
|
||||||
|
|
||||||
@ -110,6 +114,7 @@ static void AddPsiCommands(SicsInterp *pInter){
|
|||||||
AddCommand(pInter,"MakeTableDrive",TableDriveFactory,NULL,NULL);
|
AddCommand(pInter,"MakeTableDrive",TableDriveFactory,NULL,NULL);
|
||||||
AddCommand(pInter,"MakeAmorSet",AmorSetFactory,NULL,NULL);
|
AddCommand(pInter,"MakeAmorSet",AmorSetFactory,NULL,NULL);
|
||||||
AddCommand(pInter,"MakeTCPSelector",VelSelTcpFactory,NULL,NULL);
|
AddCommand(pInter,"MakeTCPSelector",VelSelTcpFactory,NULL,NULL);
|
||||||
|
AddCommand(pInter,"MakeJulCho",JulChoFactory,NULL,NULL);
|
||||||
/*
|
/*
|
||||||
AddCommand(pInter,"MakeDifrac",MakeDifrac,NULL,NULL);
|
AddCommand(pInter,"MakeDifrac",MakeDifrac,NULL,NULL);
|
||||||
*/
|
*/
|
||||||
@ -130,6 +135,7 @@ static void RemovePsiCommands(SicsInterp *pSics){
|
|||||||
RemoveCommand(pSics,"MakeStoreAmor");
|
RemoveCommand(pSics,"MakeStoreAmor");
|
||||||
RemoveCommand(pSics,"MakeAmorStatus");
|
RemoveCommand(pSics,"MakeAmorStatus");
|
||||||
RemoveCommand(pSics,"MakeTCPSelector");
|
RemoveCommand(pSics,"MakeTCPSelector");
|
||||||
|
RemoveCommand(pSics,"MakeJulCho");
|
||||||
/*
|
/*
|
||||||
RemoveCommand(pSics,"MakeDifrac");
|
RemoveCommand(pSics,"MakeDifrac");
|
||||||
*/
|
*/
|
||||||
@ -285,7 +291,6 @@ extern pCodri MakeDoChoDriver(char *pHost, int iPort, int iChannel,
|
|||||||
int iSingle);
|
int iSingle);
|
||||||
extern pCodri MakeCookerDriver(char *pHost, int iPort, int iChannel);
|
extern pCodri MakeCookerDriver(char *pHost, int iPort, int iChannel);
|
||||||
extern pCodri MakeTcpDoChoDriver(char *tclArray, SConnection *pCon);
|
extern pCodri MakeTcpDoChoDriver(char *tclArray, SConnection *pCon);
|
||||||
|
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
static pCodri CreatePsiController(SConnection *pCon,int argc, char *argv[]){
|
static pCodri CreatePsiController(SConnection *pCon,int argc, char *argv[]){
|
||||||
pCodri pNew = NULL;
|
pCodri pNew = NULL;
|
||||||
|
Reference in New Issue
Block a user