- Added a sinq module for monitoring the Accelerator broadcast

- Added automatic notification via SMS


SKIPPED:
	psi/dgrambroadcast.c
	psi/dgrambroadcast.h
	psi/make_gen
	psi/psi.c
	psi/sinq.c
	psi/sinq.h
This commit is contained in:
koennecke
2005-07-08 12:32:38 +00:00
parent 96e8cdb2d5
commit 054e2133ee
20 changed files with 163 additions and 46 deletions

View File

@ -41,6 +41,7 @@
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <time.h>
#include <string.h> #include <string.h>
#include "fortify.h" #include "fortify.h"
#include "sics.h" #include "sics.h"
@ -106,6 +107,7 @@
pTaskMan pTask; pTaskMan pTask;
int iLock; int iLock;
pICallBack pCall; pICallBack pCall;
time_t lastRun;
} ExeList; } ExeList;
static pExeList pExecutor = NULL; static pExeList pExecutor = NULL;
@ -141,6 +143,7 @@
pRes->lTask = -1; pRes->lTask = -1;
pRes->iLock = 0; pRes->iLock = 0;
pRes->pCall = CreateCallBackInterface(); pRes->pCall = CreateCallBackInterface();
pRes->lastRun = time(NULL);
return pRes; return pRes;
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
@ -868,6 +871,21 @@
SCWrite(pCon, "ERROR: illegal arguments for ListExe", eError); SCWrite(pCon, "ERROR: illegal arguments for ListExe", eError);
return 0; return 0;
} }
/*-------------------------------------------------------------------------*/
int SicsIdle(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[])
{
pExeList self = NULL;
int idle;
char pBueffel[80];
self = (pExeList)pData;
assert(self);
idle = time(NULL) - self->lastRun;
snprintf(pBueffel,79,"sicsidle = %d",idle);
SCWrite(pCon,pBueffel,eValue);
return 1;
}
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
Usage: Usage:
Success Success
@ -985,6 +1003,7 @@
return 0; return 0;
} }
self->lastRun = time(NULL);
iRet = CheckExeList(self); iRet = CheckExeList(self);
switch(iRet) switch(iRet)
{ {

View File

@ -126,10 +126,15 @@
int ListExe(SConnection *pCon, SicsInterp *pSics, void *pData, int ListExe(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]); int argc, char *argv[]);
/* /*
lists all currently executing objects lists all currently executing objects
*/ */
int SicsIdle(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*
prints the seconds since the device executor was running the last time
*/
int Success(SConnection *pCon, SicsInterp *pSics, void *pData, int Success(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]); int argc, char *argv[]);
/* /*
@ -156,7 +161,7 @@
void UnlockDeviceExecutor(pExeList self); void UnlockDeviceExecutor(pExeList self);
#line 292 "devexec.w" #line 297 "devexec.w"
/* -------------------------- Executor management -------------------------*/ /* -------------------------- Executor management -------------------------*/

View File

@ -320,10 +320,15 @@ to the global SICS device executor.
\mbox{}\verb@ @\\ \mbox{}\verb@ @\\
\mbox{}\verb@ int ListExe(SConnection *pCon, SicsInterp *pSics, void *pData,@\\ \mbox{}\verb@ int ListExe(SConnection *pCon, SicsInterp *pSics, void *pData,@\\
\mbox{}\verb@ int argc, char *argv[]);@\\ \mbox{}\verb@ int argc, char *argv[]);@\\
\mbox{}\verb@@\\
\mbox{}\verb@ /*@\\ \mbox{}\verb@ /*@\\
\mbox{}\verb@ lists all currently executing objects@\\ \mbox{}\verb@ lists all currently executing objects@\\
\mbox{}\verb@ */@\\ \mbox{}\verb@ */@\\
\mbox{}\verb@ int SicsIdle(SConnection *pCon, SicsInterp *pSics, void *pData,@\\
\mbox{}\verb@ int argc, char *argv[]);@\\
\mbox{}\verb@ /*@\\
\mbox{}\verb@ prints the seconds since the device executor was running the last time@\\
\mbox{}\verb@ */@\\
\mbox{}\verb@@\\
\mbox{}\verb@ int Success(SConnection *pCon, SicsInterp *pSics, void *pData,@\\ \mbox{}\verb@ int Success(SConnection *pCon, SicsInterp *pSics, void *pData,@\\
\mbox{}\verb@ int argc, char *argv[]);@\\ \mbox{}\verb@ int argc, char *argv[]);@\\
\mbox{}\verb@ /*@\\ \mbox{}\verb@ /*@\\

View File

@ -266,10 +266,15 @@ to the global SICS device executor.
int ListExe(SConnection *pCon, SicsInterp *pSics, void *pData, int ListExe(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]); int argc, char *argv[]);
/* /*
lists all currently executing objects lists all currently executing objects
*/ */
int SicsIdle(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*
prints the seconds since the device executor was running the last time
*/
int Success(SConnection *pCon, SicsInterp *pSics, void *pData, int Success(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]); int argc, char *argv[]);
/* /*

View File

@ -21,6 +21,7 @@ typedef struct {
char scanVar[30]; char scanVar[30];
double step; double step;
int np; int np;
float preset;
}FourTableEntry, *pFourTableEntry; }FourTableEntry, *pFourTableEntry;
/*==================== functions =======================================*/ /*==================== functions =======================================*/
int MakeFourCircleTable(){ int MakeFourCircleTable(){
@ -52,8 +53,8 @@ static void printList(int handle, SConnection *pCon){
status = LLDnodePtr2First(handle); status = LLDnodePtr2First(handle);
while(status == 1) { while(status == 1) {
LLDnodeDataTo(handle,&entry); LLDnodeDataTo(handle,&entry);
snprintf(pBueffel,131,"%8.3f %s %8.3f %d\n", entry.twoThetaEnd, snprintf(pBueffel,131,"%8.3f %10s %8.3f %d %8.3f\n", entry.twoThetaEnd,
entry.scanVar,entry.step, entry.np); entry.scanVar,entry.step, entry.np,entry.preset);
Tcl_DStringAppend(&list,pBueffel,-1); Tcl_DStringAppend(&list,pBueffel,-1);
printed = 1; printed = 1;
status = LLDnodePtr2Next(handle); status = LLDnodePtr2Next(handle);
@ -153,6 +154,12 @@ static int addToList(int handle, SConnection *pCon, int argc, char *argv[]){
SCWrite(pCon,pBueffel,eError); SCWrite(pCon,pBueffel,eError);
return 0; return 0;
} }
entry.preset = -1.0;
if(argc > 7){
if(isNumeric(argv[7])){
entry.preset = atof(argv[7]);
}
}
insertEntry(handle,entry); insertEntry(handle,entry);
return 1; return 1;
} }
@ -273,6 +280,17 @@ double GetFourCircleStep(int handle, double two_theta){
} }
} }
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
float GetFourCirclePreset(int handle, double two_theta){
FourTableEntry entry;
entry = findEntry(handle,two_theta);
if(strcmp(entry.scanVar,"NOT FOUND") == 0){
return -999.99;
} else {
return entry.preset;
}
}
/*------------------------------------------------------------------------*/
int GetFourCircleScanNP(int handle, double two_theta){ int GetFourCircleScanNP(int handle, double two_theta){
FourTableEntry entry; FourTableEntry entry;
@ -292,9 +310,9 @@ int SaveFourCircleTable(int handle, char *objName, FILE *fd){
status = LLDnodePtr2Last(handle); status = LLDnodePtr2Last(handle);
while(status != 0) { while(status != 0) {
LLDnodeDataTo(handle,&entry); LLDnodeDataTo(handle,&entry);
fprintf(fd,"%s table add %f %s %f %d\n",objName, fprintf(fd,"%s table add %f %s %f %d %f\n",objName,
entry.twoThetaEnd,entry.scanVar, entry.twoThetaEnd,entry.scanVar,
entry.step,entry.np); entry.step,entry.np,entry.preset);
status = LLDnodePtr2Prev(handle); status = LLDnodePtr2Prev(handle);
} }
return 1; return 1;

View File

@ -18,6 +18,7 @@
char *GetFourCircleScanVar(int handle, double two_theta); char *GetFourCircleScanVar(int handle, double two_theta);
int GetFourCircleScanNP(int handle, double two_theta); int GetFourCircleScanNP(int handle, double two_theta);
double GetFourCircleStep(int handle, double two_theta); double GetFourCircleStep(int handle, double two_theta);
float GetFourCirclePreset(int handle, double two_theta);
int SaveFourCircleTable(int handle, char *objName, FILE *fd); int SaveFourCircleTable(int handle, char *objName, FILE *fd);
#endif #endif

17
macro.c
View File

@ -829,7 +829,7 @@ static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
{ {
char pBueffel[1024]; char pBueffel[1024];
pPubTcl self = NULL; pPubTcl self = NULL;
int iRet; int iRet, length;
char *pPtr; char *pPtr;
Tcl_Interp *pTcl = NULL; Tcl_Interp *pTcl = NULL;
@ -853,9 +853,22 @@ static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
iRet = Tcl_Eval(pTcl,pBueffel); iRet = Tcl_Eval(pTcl,pBueffel);
if(iRet == TCL_OK) if(iRet == TCL_OK)
{ { length = strlen(pTcl->result);
if(length < 1024){
strncpy(pBueffel,pTcl->result,1023); strncpy(pBueffel,pTcl->result,1023);
SCWrite(pCon,pBueffel,eStatus); SCWrite(pCon,pBueffel,eStatus);
} else {
length += 10;
pPtr = (char *)malloc(length*sizeof(char));
if(pPtr == NULL){
SCWrite(pCon,"ERROR: out of memory in TclAction",eError);
return 0;
}
memset(pPtr,0,length*sizeof(char));
strncpy(pPtr,pTcl->result,length-1);
SCWrite(pCon,pPtr,eStatus);
free(pPtr);
}
return 1; return 1;
} }
else else

View File

@ -12,6 +12,7 @@
#include <assert.h> #include <assert.h>
#include <tcl.h> #include <tcl.h>
#include <time.h> #include <time.h>
#include <fcntl.h>
#include "stringdict.h" #include "stringdict.h"
#include "mccontrol.h" #include "mccontrol.h"
/*========================= life and death ==================================*/ /*========================= life and death ==================================*/
@ -294,14 +295,25 @@ int McStasStart(pMcStasController self, CounterMode mode, float fPreset){
static long readMonFile(pMcStasController self){ static long readMonFile(pMcStasController self){
char pResult[256]; char pResult[256];
FILE *fd = NULL; FILE *fd = NULL;
struct flock fl;
long monValue = -1; long monValue = -1;
int i;
if(!StringDictGet(self->scripts,"mcmonfile",pResult,255)){ if(!StringDictGet(self->scripts,"mcmonfile",pResult,255)){
return -1; 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"); fd = fopen(pResult,"r");
if(fd != NULL){ if(fd != NULL){
fcntl(fileno(fd),F_SETLKW,&fl);
fscanf(fd,"%ld", &monValue); fscanf(fd,"%ld", &monValue);
fl.l_type = F_UNLCK;
fcntl(fileno(fd),F_SETLK,&fl);
fclose(fd); fclose(fd);
} }
return monValue; return monValue;
@ -313,11 +325,10 @@ int McStasStatus(pMcStasController self, float *fControl){
int status, i; int status, i;
/* /*
* check at max any second, else we keep the system busy and * check at max any second, else SICS keeps the system busy and
* there is no CPU left for McStas * there is no CPU left for McStas
*/ */
SicsWait(1); SicsWait(1);
status = invokeScript(self,"mcisrunning",pServ->pSics,pResult, 255); status = invokeScript(self,"mcisrunning",pServ->pSics,pResult, 255);
if(status == 0){ if(status == 0){
strncpy(self->errorText,pResult,255); strncpy(self->errorText,pResult,255);
@ -342,6 +353,7 @@ int McStasStatus(pMcStasController self, float *fControl){
* check only any three seconds, else SICS uses up all the CPU time * check only any three seconds, else SICS uses up all the CPU time
* and the simulation has no chance. * and the simulation has no chance.
*/ */
*fControl = self->lastMon;
if(time(NULL) < self->lastMonitorRead + 3) { if(time(NULL) < self->lastMonitorRead + 3) {
return HWBusy; return HWBusy;
} }
@ -362,6 +374,7 @@ int McStasStatus(pMcStasController self, float *fControl){
self->lastMonitorRead = time(NULL); self->lastMonitorRead = time(NULL);
monValue *= self->monitorScale; monValue *= self->monitorScale;
*fControl = monValue; *fControl = monValue;
self->lastMon = monValue;
if(monValue >= self->fPreset){ if(monValue >= self->fPreset){
McStasStop(self); McStasStop(self);
} }

View File

@ -28,6 +28,7 @@
time_t startTime; time_t startTime;
time_t stopTime; time_t stopTime;
time_t lastMonitorRead; time_t lastMonitorRead;
float lastMon;
}McStasController, *pMcStasController; }McStasController, *pMcStasController;
/*---------------------- function prototypes -------------------------------------------*/ /*---------------------- function prototypes -------------------------------------------*/

View File

@ -82,6 +82,7 @@ $\langle$mcconint {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ time_t startTime;@\\ \mbox{}\verb@ time_t startTime;@\\
\mbox{}\verb@ time_t stopTime;@\\ \mbox{}\verb@ time_t stopTime;@\\
\mbox{}\verb@ time_t lastMonitorRead;@\\ \mbox{}\verb@ time_t lastMonitorRead;@\\
\mbox{}\verb@ float lastMon;@\\
\mbox{}\verb@ }McStasController, *pMcStasController;@\\ \mbox{}\verb@ }McStasController, *pMcStasController;@\\
\mbox{}\verb@ @$\diamond$ \mbox{}\verb@ @$\diamond$
\end{list} \end{list}

View File

@ -77,6 +77,7 @@ deemed advisable to separate this logic into a separate module. The McStas contr
time_t startTime; time_t startTime;
time_t stopTime; time_t stopTime;
time_t lastMonitorRead; time_t lastMonitorRead;
float lastMon;
}McStasController, *pMcStasController; }McStasController, *pMcStasController;
@} @}
The fields are: The fields are:

View File

@ -1,3 +1,3 @@
71 81
NEVER, EVER modify or delete this file NEVER, EVER modify or delete this file
You'll risk eternal damnation and a reincarnation as a cockroach!|n You'll risk eternal damnation and a reincarnation as a cockroach!|n

View File

@ -47,12 +47,23 @@ OUTPUT PARAMETERS (Nsum, psum, p2sum,currentCount)
STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p) STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p)
SHARE SHARE
%{ %{
#include <fcntl.h>
void dumpTotal(char *ffilename, long totalCounts){ void dumpTotal(char *ffilename, long totalCounts){
FILE *fd = NULL; FILE *fd = NULL;
struct flock fl;
fl.l_type = F_WRLCK;
fl.l_whence = 0;
fl.l_start = 0;
fl.l_len = 0;
fl.l_pid = getpid();
fd = fopen(ffilename,"w"); fd = fopen(ffilename,"w");
if(fd != NULL){ if(fd != NULL){
fcntl(fileno(fd),F_SETLKW,&fl);
fprintf(fd,"%ld\n",totalCounts); fprintf(fd,"%ld\n",totalCounts);
fl.l_type = F_UNLCK;
fcntl(fileno(fd),F_SETLK,&fl);
fclose(fd); fclose(fd);
} }
} }

View File

@ -107,7 +107,7 @@ COMPONENT Bmoin_slit = Slit(
AT (0,0,0.525) RELATIVE msa ROTATED (0,0,0) RELATIVE msa AT (0,0,0.525) RELATIVE msa ROTATED (0,0,0) RELATIVE msa
COMPONENT out = Virtual_output(file=lambdafile) COMPONENT out = Virtual_output(file=lambdafile,bufsize=100000)
AT(0,0,0.64) RELATIVE msa ROTATED (0,0,0) RELATIVE msa AT(0,0,0.64) RELATIVE msa ROTATED (0,0,0) RELATIVE msa
END END

View File

@ -163,7 +163,7 @@ proc copydmcdata { } {
mcreader open $home/dmc.xml mcreader open $home/dmc.xml
mcreader insertmon \ mcreader insertmon \
"/$mcversion/DMC_diff/dmc.xml/PSD_sample/values" \ "/$mcversion/DMC_diff/dmc.xml/PSD_sample/values" \
counter 1 [expr 1./10000] counter 1 [expr 1./1000]
mcreader insertmon \ mcreader insertmon \
"/$mcversion/DMC_diff/dmc.xml/Det9/det9.dat/values" \ "/$mcversion/DMC_diff/dmc.xml/Det9/det9.dat/values" \
counter 5 counter 5
@ -171,7 +171,7 @@ proc copydmcdata { } {
if { $hmScale <= 0} { if { $hmScale <= 0} {
set hmScale 1e9 set hmScale 1e9
} else { } else {
set hmScale [expr $hmScale * 1e9] set hmScale [expr $hmScale * 1e7]
} }
clientput "HM scale = $hmScale" clientput "HM scale = $hmScale"
mcreader inserthm \ mcreader inserthm \
@ -188,7 +188,7 @@ mccontrol configure mcstart rundmcoptsim
mccontrol configure mccopydata copydmcdata mccontrol configure mccopydata copydmcdata
mccontrol configure update 60 mccontrol configure update 60
mccontrol configure mcmonfile $home/monfile mccontrol configure mcmonfile $home/monfile
mccontrol configure monitorscale [expr 1. /10000] mccontrol configure monitorscale [expr 1. /1000]
mccontrol configure mcdump mcstasdump mccontrol configure mcdump mcstasdump
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# A count command for VDMC # A count command for VDMC

View File

@ -14,7 +14,7 @@ sicsdatapostfix .hdf
sicsdatapostfix setAccess 0 sicsdatapostfix setAccess 0
sicsdataprefix powder sicsdataprefix powder
sicsdataprefix setAccess 0 sicsdataprefix setAccess 0
starttime 2005-07-01 16:19:39 starttime 2005-07-08 10:41:56
starttime setAccess 2 starttime setAccess 2
comment3 UNKNOWN comment3 UNKNOWN
comment3 setAccess 2 comment3 setAccess 2
@ -121,9 +121,9 @@ a1 precision 0.010000
a1 AccessCode 2.000000 a1 AccessCode 2.000000
a1 movecount 10.000000 a1 movecount 10.000000
banana CountMode monitor banana CountMode monitor
banana preset 5.000000 banana preset 2.000000
# Counter counter # Counter counter
counter SetPreset 5000.000000 counter SetPreset 2000.000000
counter SetMode Monitor counter SetMode Monitor
# Motor twothetad # Motor twothetad
twothetad sign 1.000000 twothetad sign 1.000000

View File

@ -371,6 +371,9 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
/* loop over all scan variables */ /* loop over all scan variables */
status = 1; status = 1;
memset(pHead,0,512*sizeof(char));
memset(pStatus,0,512*sizeof(char));
memset(pItem,0,20*sizeof(char));
for(i = 0; i < self->iScanVar; i++) for(i = 0; i < self->iScanVar; i++)
{ {
DynarGet(self->pScanVar,i,&pDings); DynarGet(self->pScanVar,i,&pDings);
@ -551,12 +554,14 @@ int weakScan(pMesure self, double twoTheta)
} }
} }
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
static int PerformPSDScan(pMesure self, char *scanVar, float fStart, float step, int np) static int PerformPSDScan(pMesure self, char *scanVar, float fStart,
float step, int np, float two_theta)
{ {
int status; int status;
char pCommand[1024]; char pCommand[1024];
char countMode[20]; char countMode[20];
Tcl_Interp *pTcl; Tcl_Interp *pTcl;
float fPreset;
/* /*
PSD scans are done by calling the routine Tcl procedure tricsscan with the PSD scans are done by calling the routine Tcl procedure tricsscan with the
@ -570,7 +575,12 @@ static int PerformPSDScan(pMesure self, char *scanVar, float fStart, float step,
{ {
strcpy(countMode,"monitor"); strcpy(countMode,"monitor");
} }
snprintf(pCommand,1023,"tricsscan %f %f %d %s %f", fStart, step, np,countMode,self->fPreset); fPreset = GetFourCirclePreset(self->stepTable,(double)two_theta);
if(fPreset < .0){
fPreset = self->fPreset;
}
snprintf(pCommand,1023,"tricsscan %f %f %d %s %f", fStart, step, np,
countMode,fPreset);
pTcl = InterpGetTcl(pServ->pSics); pTcl = InterpGetTcl(pServ->pSics);
status = Tcl_Eval(pTcl,pCommand); status = Tcl_Eval(pTcl,pCommand);
if(status != TCL_OK) if(status != TCL_OK)
@ -585,7 +595,7 @@ static int PerformPSDScan(pMesure self, char *scanVar, float fStart, float step,
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon) static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
{ {
float fStart, stepWidth; float fStart, stepWidth, fPreset;
int iRet, np; int iRet, np;
char pBueffel[132]; char pBueffel[132];
char *scanVar = NULL; char *scanVar = NULL;
@ -619,7 +629,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
*/ */
if(self->psd == 1) if(self->psd == 1)
{ {
iRet = PerformPSDScan(self,scanVar,fStart, stepWidth, np); iRet = PerformPSDScan(self,scanVar,fStart, stepWidth, np,twoTheta);
free(scanVar); free(scanVar);
return iRet; return iRet;
} }
@ -668,6 +678,14 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
memset(self->lCounts,0,np*sizeof(long)); memset(self->lCounts,0,np*sizeof(long));
} }
/*
* determine preset
*/
fPreset = GetFourCirclePreset(self->stepTable,(double)twoTheta);
if(fPreset < .0){
fPreset = self->fPreset;
}
/* do the scan */ /* do the scan */
free(scanVar); free(scanVar);
if(self->iCompact) if(self->iCompact)
@ -679,7 +697,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
self->pScanner->ScanDrive = ScanFastDrive; self->pScanner->ScanDrive = ScanFastDrive;
} }
iRet = SilentScan(self->pScanner,np,self->CountMode, iRet = SilentScan(self->pScanner,np,self->CountMode,
self->fPreset,pServ->pSics,pCon); fPreset,pServ->pSics,pCon);
if(weakScan(self,twoTheta)) if(weakScan(self,twoTheta))
{ {
/* /*
@ -701,7 +719,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
*/ */
SCWrite(pCon,"Remeasuring weak reflection",eWarning); SCWrite(pCon,"Remeasuring weak reflection",eWarning);
iRet = SilentScan(self->pScanner,np,self->CountMode, iRet = SilentScan(self->pScanner,np,self->CountMode,
self->fPreset*5.,pServ->pSics,pCon); fPreset*5.,pServ->pSics,pCon);
} }
ResetScanFunctions(self->pScanner); ResetScanFunctions(self->pScanner);
@ -941,6 +959,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
assert(self); assert(self);
assert(pCon); assert(pCon);
memset(pTime,0,132*sizeof(char));
#ifdef MESSDEBUG #ifdef MESSDEBUG
self->np = 90; self->np = 90;

View File

@ -326,9 +326,13 @@ static int evaluateStatus(pMotor self, SConnection *pCon)
newStatus = HWPosFault; newStatus = HWPosFault;
} }
if(newStatus == HWIdle || newStatus == OKOK) if(newStatus == HWIdle || newStatus == OKOK)
{
newStatus = checkPosition(self,pCon);
if(newStatus != HWBusy)
{ {
finishDriving(self,pCon); finishDriving(self,pCon);
} }
}
break; break;
case HWBusy: case HWBusy:
newStatus = HWBusy; newStatus = HWBusy;

1
ofac.c
View File

@ -243,6 +243,7 @@
*/ */
AddCommand(pInter,"StopExe",StopCommand,DeleteExeList, pExe); AddCommand(pInter,"StopExe",StopCommand,DeleteExeList, pExe);
AddCommand(pInter,"ListExe",ListExe,NULL,pExe); AddCommand(pInter,"ListExe",ListExe,NULL,pExe);
AddCommand(pInter,"sicsidle",SicsIdle,NULL,pExe);
AddCommand(pInter,"Success",Success,NULL,pExe); AddCommand(pInter,"Success",Success,NULL,pExe);
AddCommand(pInter,"pause",PauseAction,NULL,pExe); AddCommand(pInter,"pause",PauseAction,NULL,pExe);
AddCommand(pInter,"continue",ContinueAction,NULL,pExe); AddCommand(pInter,"continue",ContinueAction,NULL,pExe);