- Fix to various drivers due to changes in rs232controller
- hkl now searches psi in .5 steps - first point of fastscan is driven normally SKIPPED: psi/amor2t.c psi/amor2t.h psi/amor2t.i psi/amor2t.tex psi/amor2t.w psi/dornier2.c psi/el734hp.c psi/nxamor.c psi/slsmagnet.c psi/sps.c
This commit is contained in:
13
mccontrol.c
13
mccontrol.c
@ -1,4 +1,4 @@
|
||||
/*----------------------------------------------------------------------------
|
||||
/*----------------------------------------------------------------------------
|
||||
McStas simulation to SICS controller module implementation file. For more
|
||||
details see mcstas.tex.
|
||||
|
||||
@ -296,25 +296,16 @@ int McStasStart(pMcStasController self, CounterMode mode, float fPreset){
|
||||
static long readMonFile(pMcStasController self){
|
||||
char pResult[256];
|
||||
FILE *fd = NULL;
|
||||
struct flock fl;
|
||||
long monValue = -1;
|
||||
int i;
|
||||
|
||||
if(!StringDictGet(self->scripts,"mcmonfile",pResult,255)){
|
||||
return -1;
|
||||
}
|
||||
fl.l_type = F_RDLCK;
|
||||
fl.l_whence = SEEK_SET;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 0;
|
||||
fl.l_pid = getpid();
|
||||
|
||||
|
||||
fd = fopen(pResult,"r");
|
||||
if(fd != NULL){
|
||||
fcntl(fileno(fd),F_SETLKW,&fl);
|
||||
fscanf(fd,"%ld", &monValue);
|
||||
fl.l_type = F_UNLCK;
|
||||
fcntl(fileno(fd),F_SETLK,&fl);
|
||||
fclose(fd);
|
||||
}
|
||||
return monValue;
|
||||
|
Reference in New Issue
Block a user