- 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:
19
devexec.c
19
devexec.c
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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 -------------------------*/
|
||||||
|
|
||||||
|
@ -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@ /*@\\
|
||||||
|
@ -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[]);
|
||||||
/*
|
/*
|
||||||
|
26
fourtable.c
26
fourtable.c
@ -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;
|
||||||
|
@ -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
|
||||||
|
21
macro.c
21
macro.c
@ -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);
|
||||||
strncpy(pBueffel,pTcl->result,1023);
|
if(length < 1024){
|
||||||
SCWrite(pCon,pBueffel,eStatus);
|
strncpy(pBueffel,pTcl->result,1023);
|
||||||
|
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
|
||||||
|
17
mccontrol.c
17
mccontrol.c
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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 -------------------------------------------*/
|
||||||
|
@ -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}
|
||||||
|
1
mcstas.w
1
mcstas.w
@ -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:
|
||||||
|
@ -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
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
33
mesure.c
33
mesure.c
@ -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);
|
||||||
@ -378,7 +381,7 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
|
|||||||
if(pVar)
|
if(pVar)
|
||||||
{
|
{
|
||||||
fVal = pVar->pInter->GetValue(pVar->pObject,self->pCon);
|
fVal = pVar->pInter->GetValue(pVar->pObject,self->pCon);
|
||||||
AppendScanVar(pVar,fVal);
|
AppendScanVar(pVar,fVal);
|
||||||
sprintf(pItem,"%-10.10s",pVar->Name);
|
sprintf(pItem,"%-10.10s",pVar->Name);
|
||||||
strcat(pHead,pItem);
|
strcat(pHead,pItem);
|
||||||
sprintf(pItem,"%-10.3f",fVal);
|
sprintf(pItem,"%-10.3f",fVal);
|
||||||
@ -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;
|
||||||
|
6
motor.c
6
motor.c
@ -327,7 +327,11 @@ static int evaluateStatus(pMotor self, SConnection *pCon)
|
|||||||
}
|
}
|
||||||
if(newStatus == HWIdle || newStatus == OKOK)
|
if(newStatus == HWIdle || newStatus == OKOK)
|
||||||
{
|
{
|
||||||
finishDriving(self,pCon);
|
newStatus = checkPosition(self,pCon);
|
||||||
|
if(newStatus != HWBusy)
|
||||||
|
{
|
||||||
|
finishDriving(self,pCon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HWBusy:
|
case HWBusy:
|
||||||
|
1
ofac.c
1
ofac.c
@ -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);
|
||||||
|
28
scan.c
28
scan.c
@ -305,20 +305,20 @@ static void ConfigureScanDict(pStringDict dict)
|
|||||||
pCount = (pCountEntry)pData;
|
pCount = (pCountEntry)pData;
|
||||||
if(pCount != NULL)
|
if(pCount != NULL)
|
||||||
{
|
{
|
||||||
fprintf(fd,"%s storecounts %ld %f %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n",
|
fprintf(fd,"%s storecounts %ld %f %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n",
|
||||||
self->objectName,
|
self->objectName,
|
||||||
pCount->lCount,
|
pCount->lCount,
|
||||||
pCount->fTime,
|
pCount->fTime,
|
||||||
pCount->Monitors[0],
|
pCount->Monitors[0],
|
||||||
pCount->Monitors[1],
|
pCount->Monitors[1],
|
||||||
pCount->Monitors[2],
|
pCount->Monitors[2],
|
||||||
pCount->Monitors[3],
|
pCount->Monitors[3],
|
||||||
pCount->Monitors[4],
|
pCount->Monitors[4],
|
||||||
pCount->Monitors[5],
|
pCount->Monitors[5],
|
||||||
pCount->Monitors[6],
|
pCount->Monitors[6],
|
||||||
pCount->Monitors[7],
|
pCount->Monitors[7],
|
||||||
pCount->Monitors[8],
|
pCount->Monitors[8],
|
||||||
pCount->Monitors[9]);
|
pCount->Monitors[9]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(self->iMode == eTimer){
|
if(self->iMode == eTimer){
|
||||||
|
Reference in New Issue
Block a user