- Introduced a command history log for statistical and
syntax checking input purposes - Rectified an error message in fourmess.c - HMcontrol did not check for the HM to stop before returning. This caused weird data files at AMOR as the data had not yet been downloaded from the HM. - Fixed an issue about parameters in multicounter - Temporary fix in nxscript.c to always read the Hm from the HM and not a buffer. This is prior to rethinking caching strategies for old style HM's. - Synchronize now copies fixed motors correctly. This used to cause irritation with users. This now requires a script syncdrive to exist in the sync server which takes care of handling the fixed flag when this is desired. - Added initify to sicsdata in order to copy large value timebins over properly at AMOR SKIPPED: psi/amorstat.c psi/make_gen psi/makefile_linux psi/polterwrite.c psi/sinq.c psi/sinqhttp.c psi/sinqhttpprot.c psi/sps.c psi/tdchm.c
This commit is contained in:
@ -464,7 +464,7 @@ int WriteSicsStatus(SicsInterp * self, char *file, int iMot)
|
|||||||
fVal = pDriv->GetValue(pDum, pServ->dummyCon);
|
fVal = pDriv->GetValue(pDum, pServ->dummyCon);
|
||||||
}
|
}
|
||||||
if (fVal > -990.) {
|
if (fVal > -990.) {
|
||||||
fprintf(fd, "drive %s %f\n", pCurrent->pName, fVal);
|
fprintf(fd, "syncdrive %s %f\n", pCurrent->pName, fVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
43
commandlog.c
43
commandlog.c
@ -521,3 +521,46 @@ void CommandLogInit(void)
|
|||||||
{
|
{
|
||||||
AddCommand(pServ->pSics, "commandlog", CommandLog, CommandLogClose, NULL);
|
AddCommand(pServ->pSics, "commandlog", CommandLog, CommandLogClose, NULL);
|
||||||
}
|
}
|
||||||
|
/*---------------------- History -----------------------------------------*/
|
||||||
|
static FILE *comHistory = NULL;
|
||||||
|
/*-----------------------------------------------------------------------*/
|
||||||
|
static int openHistoryLog()
|
||||||
|
{
|
||||||
|
char *fileName = NULL;
|
||||||
|
char fileBuffer[1024];
|
||||||
|
time_t iDate;
|
||||||
|
struct tm *psTime;
|
||||||
|
|
||||||
|
|
||||||
|
if (comHistory == NULL) {
|
||||||
|
fileName = IFindOption(pSICSOptions, "historylog");
|
||||||
|
if (fileName != NULL) {
|
||||||
|
strlcpy(fileBuffer, fileName,1024);
|
||||||
|
} else {
|
||||||
|
iDate = time(NULL);
|
||||||
|
psTime = localtime(&iDate);
|
||||||
|
fileBuffer[0] = '\0';
|
||||||
|
fileName = getenv("HOME");
|
||||||
|
if (fileName != NULL) {
|
||||||
|
snprintf(fileBuffer, 1023, "%s/log/comhistory%4.4d.log",
|
||||||
|
fileName, psTime->tm_year + 1900);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
comHistory = fopen(fileBuffer, "a+");
|
||||||
|
}
|
||||||
|
if (comHistory == NULL) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------------------*/
|
||||||
|
void WriteCommandHistory(char *txt)
|
||||||
|
{
|
||||||
|
if(comHistory == NULL){
|
||||||
|
openHistoryLog();
|
||||||
|
}
|
||||||
|
if(comHistory != NULL){
|
||||||
|
fprintf(comHistory,"%s\n", txt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -17,4 +17,5 @@ int CommandLog(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
int argc, char *argv[]);
|
int argc, char *argv[]);
|
||||||
|
|
||||||
void CommandLogClose(void *pData);
|
void CommandLogClose(void *pData);
|
||||||
|
void WriteCommandHistory(char *txt);
|
||||||
#endif
|
#endif
|
||||||
|
6
conman.c
6
conman.c
@ -1416,6 +1416,12 @@ int SCInvoke(SConnection * self, SicsInterp * pInter, char *pCommand)
|
|||||||
SCDeleteConnection(pCopy);
|
SCDeleteConnection(pCopy);
|
||||||
StatusFileTask(NULL); /* save changed parameters */
|
StatusFileTask(NULL); /* save changed parameters */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* log successful commands for later evaluation
|
||||||
|
*/
|
||||||
|
if(iRet == 1){
|
||||||
|
WriteCommandHistory(pCommand);
|
||||||
|
}
|
||||||
self->inUse--;
|
self->inUse--;
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
|
@ -258,6 +258,7 @@ static int CheckCountStatus(void *pData, SConnection * pCon)
|
|||||||
notification on finish
|
notification on finish
|
||||||
*/
|
*/
|
||||||
if (eCt == HWIdle) {
|
if (eCt == HWIdle) {
|
||||||
|
self->isUpToDate = 0;
|
||||||
InvokeCallBack(self->pCall, COUNTEND, NULL);
|
InvokeCallBack(self->pCall, COUNTEND, NULL);
|
||||||
ReleaseCountLock(self->pCountInt);
|
ReleaseCountLock(self->pCountInt);
|
||||||
}
|
}
|
||||||
@ -770,7 +771,7 @@ int CountAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
int argc, char *argv[])
|
int argc, char *argv[])
|
||||||
{
|
{
|
||||||
pCounter self = NULL;
|
pCounter self = NULL;
|
||||||
int iRet, iRet2;
|
int iRet, iRet2, i;
|
||||||
FuPaResult PaRes;
|
FuPaResult PaRes;
|
||||||
char pBueffel[256], pError[80];
|
char pBueffel[256], pError[80];
|
||||||
char **argx;
|
char **argx;
|
||||||
@ -929,9 +930,13 @@ int CountAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
case 11: /* status */
|
case 11: /* status */
|
||||||
self->pCountInt->TransferData(self, pCon);
|
self->pCountInt->TransferData(self, pCon);
|
||||||
if (GetCounterMode(self) == ePreset) {
|
if (GetCounterMode(self) == ePreset) {
|
||||||
|
lVal = GetCounterPreset(self);
|
||||||
|
for(i = 0; i < self->iExponent; i++){
|
||||||
|
lVal *= 10;
|
||||||
|
}
|
||||||
sprintf(pBueffel, "%s.CountStatus = %d %d Beam: %ld E6",
|
sprintf(pBueffel, "%s.CountStatus = %d %d Beam: %ld E6",
|
||||||
argv[0],
|
argv[0],
|
||||||
(int) nintf(GetCounterPreset(self)),
|
(int) nintf(lVal),
|
||||||
(int) nintf(GetControlValue(self)),
|
(int) nintf(GetControlValue(self)),
|
||||||
GetMonitor(self, 4, pCon) / 100000);
|
GetMonitor(self, 4, pCon) / 100000);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1298,6 +1298,7 @@ void DevExecSignal(void *pEL, int iSignal, void *pSigData)
|
|||||||
"ERROR: Interrupting Current Hardware Operation",
|
"ERROR: Interrupting Current Hardware Operation",
|
||||||
eError);
|
eError);
|
||||||
SCSetInterrupt(pCon, *iInt);
|
SCSetInterrupt(pCon, *iInt);
|
||||||
|
SCSetInterrupt(self->pOwner, *iInt);
|
||||||
SCDeleteConnection(pCon);
|
SCDeleteConnection(pCon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
5
exebuf.c
5
exebuf.c
@ -18,6 +18,7 @@
|
|||||||
#include "dynstring.h"
|
#include "dynstring.h"
|
||||||
#include "exebuf.i"
|
#include "exebuf.i"
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
|
#include "commandlog.h"
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
pExeBuf exeBufCreate(char *name)
|
pExeBuf exeBufCreate(char *name)
|
||||||
@ -216,6 +217,7 @@ int exeBufProcess(pExeBuf self, SicsInterp * pSics,
|
|||||||
/* print only SICS commands */
|
/* print only SICS commands */
|
||||||
SCPrintf(pCon, eLog, "%s:%d>> %s", self->name, self->lineno,
|
SCPrintf(pCon, eLog, "%s:%d>> %s", self->name, self->lineno,
|
||||||
cmd);
|
cmd);
|
||||||
|
WriteCommandHistory(cmd);
|
||||||
} else {
|
} else {
|
||||||
/* debugging */
|
/* debugging */
|
||||||
/* SCPrintf(pCon, eValue, "%s:%d>> %s",self->name,self->lineno,cmd); */
|
/* SCPrintf(pCon, eValue, "%s:%d>> %s",self->name,self->lineno,cmd); */
|
||||||
@ -245,6 +247,9 @@ int exeBufProcess(pExeBuf self, SicsInterp * pSics,
|
|||||||
if (SCGetInterrupt(pCon) >= eAbortBatch) {
|
if (SCGetInterrupt(pCon) >= eAbortBatch) {
|
||||||
SCWrite(pCon, "ERROR: batch processing interrupted", eError);
|
SCWrite(pCon, "ERROR: batch processing interrupted", eError);
|
||||||
SetStatus(eEager);
|
SetStatus(eEager);
|
||||||
|
if (pCall != NULL) {
|
||||||
|
InvokeCallBack(pCall, BATCHEND, self->name);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
SCSetInterrupt(pCon, eContinue);
|
SCSetInterrupt(pCon, eContinue);
|
||||||
|
@ -286,7 +286,7 @@ static int FourMessScanPar(pSICSOBJ self, SConnection * pCon,
|
|||||||
dVal = GetFourCircleStep(priv->stepTable, stt);
|
dVal = GetFourCircleStep(priv->stepTable, stt);
|
||||||
np = GetFourCircleScanNP(priv->stepTable, stt);
|
np = GetFourCircleScanNP(priv->stepTable, stt);
|
||||||
preset = GetFourCirclePreset(priv->stepTable, stt);
|
preset = GetFourCirclePreset(priv->stepTable, stt);
|
||||||
if (strcmp(scanvar, "NOT FOUND") == 0) {
|
if (strcmp(scanvar, "Not found") == 0) {
|
||||||
SCPrintf(pCon, eValue, "%s,%f,%d,%d", "om", dVal, np, preset);
|
SCPrintf(pCon, eValue, "%s,%f,%d,%d", "om", dVal, np, preset);
|
||||||
} else {
|
} else {
|
||||||
SCPrintf(pCon, eValue, "%s,%f,%d,%d", scanvar, dVal, np, preset);
|
SCPrintf(pCon, eValue, "%s,%f,%d,%d", scanvar, dVal, np, preset);
|
||||||
|
13
histmem.c
13
histmem.c
@ -641,6 +641,19 @@ int GetHistDim(pHistMem self, int iDim[MAXDIM], int *nDim)
|
|||||||
{
|
{
|
||||||
|
|
||||||
assert(self);
|
assert(self);
|
||||||
|
pDummy pDum;
|
||||||
|
hdbValue v;
|
||||||
|
pHdb node;
|
||||||
|
|
||||||
|
pDum = (pDummy)self;
|
||||||
|
if(strcmp(pDum->pDescriptor->name,"HistMemSec") == 0){
|
||||||
|
node = GetHipadabaNode(pDum->pDescriptor->parNode,"dim");
|
||||||
|
assert(node != NULL);
|
||||||
|
GetHipadabaPar(node,&v,NULL);
|
||||||
|
*nDim = v.arrayLength;
|
||||||
|
memcpy(iDim,v.v.intArray, *nDim*sizeof(int));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
getHMDataDim(self->pDriv->data, iDim, nDim);
|
getHMDataDim(self->pDriv->data, iDim, nDim);
|
||||||
if (isInTOFMode(self->pDriv->data)) {
|
if (isInTOFMode(self->pDriv->data)) {
|
||||||
|
26
histmemsec.c
26
histmemsec.c
@ -145,6 +145,27 @@ static int HMCtrTransferData(void *pData, SConnection *pCon)
|
|||||||
ReleaseHdbValue(&v);
|
ReleaseHdbValue(&v);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
/*-------------------------------------------------------------------------
|
||||||
|
* automatically update the last entry of the dim variable when
|
||||||
|
* setting time_binning
|
||||||
|
--------------------------------------------------------------------------*/
|
||||||
|
static hdbCallbackReturn HMTOFCallback(pHdb currentNode, void *data,
|
||||||
|
pHdbMessage message)
|
||||||
|
{
|
||||||
|
pHdbDataMessage update = NULL;
|
||||||
|
hdbValue dim;
|
||||||
|
pHdb dimNode = NULL;
|
||||||
|
|
||||||
|
if((update = GetHdbUpdateMessage(message)) != NULL){
|
||||||
|
dimNode = GetHipadabaNode(currentNode->mama,"dim");
|
||||||
|
assert(dimNode != NULL);
|
||||||
|
GetHipadabaPar(dimNode,&dim,NULL);
|
||||||
|
dim.v.intArray[dim.arrayLength-1] = update->v->arrayLength;
|
||||||
|
UpdateHipadabaPar(dimNode, dim, NULL);
|
||||||
|
}
|
||||||
|
return hdbContinue;
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* Usage:
|
* Usage:
|
||||||
* MakeSecHM name rank (tof)
|
* MakeSecHM name rank (tof)
|
||||||
@ -164,7 +185,7 @@ int MakeSecHM(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
|
|
||||||
rank = atoi(argv[2]);
|
rank = atoi(argv[2]);
|
||||||
|
|
||||||
pRes = CreateSecCounter(pCon,"HistMem", argv[1], 2);
|
pRes = CreateSecCounter(pCon,"HistMemSec", argv[1], 2);
|
||||||
if(pRes == NULL){
|
if(pRes == NULL){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -217,6 +238,9 @@ int MakeSecHM(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
AddHipadabaChild(node, child, NULL);
|
AddHipadabaChild(node, child, NULL);
|
||||||
|
AppendHipadabaCallback(child,
|
||||||
|
MakeHipadabaCallback(HMTOFCallback, NULL, NULL));
|
||||||
|
|
||||||
child = AddSICSHdbPar(node,"genbin", usMugger, MakeSICSFunc(GenbinCmd));
|
child = AddSICSHdbPar(node,"genbin", usMugger, MakeSICSFunc(GenbinCmd));
|
||||||
AddSICSHdbPar(child, "start", usMugger, MakeHdbFloat(10.));
|
AddSICSHdbPar(child, "start", usMugger, MakeHdbFloat(10.));
|
||||||
AddSICSHdbPar(child, "step", usMugger, MakeHdbFloat(10.));
|
AddSICSHdbPar(child, "step", usMugger, MakeHdbFloat(10.));
|
||||||
|
47
hmcontrol.c
47
hmcontrol.c
@ -74,6 +74,17 @@ static int HMCStart(void *pData, SConnection * pCon)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
Warning: this assumes that slaves 1 - MAXSLAVE are histogram memories.
|
||||||
|
If this assumption does not hold, change this code to check if this
|
||||||
|
is really a histogram memory.
|
||||||
|
*/
|
||||||
|
for (i = 1; i < MAXSLAVE; i++) {
|
||||||
|
if (self->slaves[i] != NULL) {
|
||||||
|
HistDirty((pHistMem) self->slaveData[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self->checkSlaves = 0;
|
||||||
return OKOK;
|
return OKOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,17 +97,10 @@ static int HMCStatus(void *pData, SConnection * pCon)
|
|||||||
self = (pHMcontrol) pData;
|
self = (pHMcontrol) pData;
|
||||||
assert(self);
|
assert(self);
|
||||||
|
|
||||||
|
if(self->checkSlaves == 0) {
|
||||||
status = self->slaves[0]->CheckCountStatus(self->slaveData[0], pCon);
|
status = self->slaves[0]->CheckCountStatus(self->slaveData[0], pCon);
|
||||||
if (status == HWIdle || status == HWFault) {
|
|
||||||
/*
|
/*
|
||||||
stop counting on slaves when finished or when an error
|
Warning: this assumes that slaves 1 - MAXSLAVE are histogram memories.
|
||||||
occurred.
|
|
||||||
*/
|
|
||||||
InvokeCallBack(self->pCall, COUNTEND, pCon);
|
|
||||||
HMCHalt(self);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
Warning: this assumes that salves 1 - MAXSLAVE are histogram memories.
|
|
||||||
If this assumption does not hold, change this code to check if this
|
If this assumption does not hold, change this code to check if this
|
||||||
is really a histogram memory.
|
is really a histogram memory.
|
||||||
*/
|
*/
|
||||||
@ -105,7 +109,30 @@ static int HMCStatus(void *pData, SConnection * pCon)
|
|||||||
HistDirty((pHistMem) self->slaveData[i]);
|
HistDirty((pHistMem) self->slaveData[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (status == HWIdle || status == HWFault) {
|
||||||
|
/*
|
||||||
|
stop counting on slaves when finished or when an error
|
||||||
|
occurred.
|
||||||
|
*/
|
||||||
|
HMCHalt(self);
|
||||||
|
self->checkSlaves = 1;
|
||||||
|
status = HWBusy;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* wait for the detectors to report finish too. Otherwise, with the second
|
||||||
|
* generation HM data may not be fully transferred.
|
||||||
|
*/
|
||||||
|
for(i = 1; i < self->nSlaves; i++){
|
||||||
|
status = self->slaves[i]->CheckCountStatus(self->slaveData[i], pCon);
|
||||||
|
if(status != HWIdle || status != HWFault){
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
status = HWIdle;
|
||||||
|
InvokeCallBack(self->pCall, COUNTEND, pCon);
|
||||||
|
self->checkSlaves = 0;
|
||||||
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ typedef struct {
|
|||||||
float fPreset;
|
float fPreset;
|
||||||
CounterMode eMode;
|
CounterMode eMode;
|
||||||
pICallBack pCall;
|
pICallBack pCall;
|
||||||
|
int checkSlaves;
|
||||||
} HMcontrol, *pHMcontrol;
|
} HMcontrol, *pHMcontrol;
|
||||||
|
|
||||||
|
|
||||||
|
42
macro.c
42
macro.c
@ -71,6 +71,7 @@
|
|||||||
#include "stringdict.h"
|
#include "stringdict.h"
|
||||||
#include "exeman.h"
|
#include "exeman.h"
|
||||||
#include "nxcopy.h"
|
#include "nxcopy.h"
|
||||||
|
#include "commandlog.h"
|
||||||
|
|
||||||
#define SICSERROR "005567SICS"
|
#define SICSERROR "005567SICS"
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
@ -117,7 +118,33 @@ int MacroPop(void)
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
/*---------------------------------------------------------------------------
|
||||||
|
* This is to suppress certain stuff from the history log in order to stop it
|
||||||
|
* from filling with garbage
|
||||||
|
-----------------------------------------------------------------------------*/
|
||||||
|
static int historyFilter(pDummy pDum, char *command, char *fullCommand)
|
||||||
|
{
|
||||||
|
static char *toRemove[] = {"sct", "hupdate",NULL};
|
||||||
|
static char *typeRemove[] = {"ScriptContext",NULL};
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
while(toRemove[i] != NULL){
|
||||||
|
if(strcmp(command,toRemove[i]) == 0){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while(typeRemove[i] != NULL){
|
||||||
|
if(strcmp(pDum->pDescriptor->name, typeRemove[i]) == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static int SicsUnknownProc(ClientData pData, Tcl_Interp * pInter,
|
static int SicsUnknownProc(ClientData pData, Tcl_Interp * pInter,
|
||||||
int argc, char *argv[])
|
int argc, char *argv[])
|
||||||
@ -128,7 +155,7 @@ static int SicsUnknownProc(ClientData pData, Tcl_Interp * pInter,
|
|||||||
SicsInterp *pSinter = NULL;
|
SicsInterp *pSinter = NULL;
|
||||||
SConnection *pCon = NULL;
|
SConnection *pCon = NULL;
|
||||||
CommandList *pCommand = NULL;
|
CommandList *pCommand = NULL;
|
||||||
char *lastCommand = NULL, comBuffer[132];
|
char *lastCommand = NULL, comBuffer[132], comHistory[256];
|
||||||
int iRet = 0, i;
|
int iRet = 0, i;
|
||||||
int iMacro;
|
int iMacro;
|
||||||
Statistics *old;
|
Statistics *old;
|
||||||
@ -188,6 +215,19 @@ static int SicsUnknownProc(ClientData pData, Tcl_Interp * pInter,
|
|||||||
iRet = pCommand->OFunc(pCon, pSinter, pCommand->pData, margc, myarg);
|
iRet = pCommand->OFunc(pCon, pSinter, pCommand->pData, margc, myarg);
|
||||||
StatisticsEnd(old);
|
StatisticsEnd(old);
|
||||||
SCsetMacro(pCon, iMacro);
|
SCsetMacro(pCon, iMacro);
|
||||||
|
|
||||||
|
if(iRet == 1){
|
||||||
|
/*
|
||||||
|
* this is OK because comBuffer is length restricted
|
||||||
|
*/
|
||||||
|
strcpy(comHistory,"SICSUNKNOWN: ");
|
||||||
|
strcat(comHistory,comBuffer);
|
||||||
|
/* This gives just to many unwanted entries.... TODO: Filter better
|
||||||
|
if(historyFilter(pCommand->pData, myarg[0], comBuffer) == 1){
|
||||||
|
WriteCommandHistory(comHistory);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
lastUnkown gets deeply stacked with each SICS command exec'd.
|
lastUnkown gets deeply stacked with each SICS command exec'd.
|
||||||
This is not reflected in code. However, lastUnknown has already
|
This is not reflected in code. However, lastUnknown has already
|
||||||
|
@ -314,7 +314,11 @@ static int MultiCounterSet(struct __COUNTER *pCount, char *name,
|
|||||||
pDum = (pDummy)self->slaveData[i];
|
pDum = (pDummy)self->slaveData[i];
|
||||||
if(strcmp(pDum->pDescriptor->name, "SingleCounter") == 0){
|
if(strcmp(pDum->pDescriptor->name, "SingleCounter") == 0){
|
||||||
pCter = (pCounter)self->slaveData[i];
|
pCter = (pCounter)self->slaveData[i];
|
||||||
|
if(pCter->pDriv != NULL){
|
||||||
return pCter->pDriv->Set(pCter->pDriv, name, iCter, fVal);
|
return pCter->pDriv->Set(pCter->pDriv, name, iCter, fVal);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -327,6 +331,8 @@ static int MultiCounterGet(struct __COUNTER *pCount, char *name,
|
|||||||
int i;
|
int i;
|
||||||
pMultiCounter self = NULL;
|
pMultiCounter self = NULL;
|
||||||
pCounter pCter;
|
pCounter pCter;
|
||||||
|
pHdb node;
|
||||||
|
hdbValue v;
|
||||||
|
|
||||||
self = (pMultiCounter) pCount->pData;
|
self = (pMultiCounter) pCount->pData;
|
||||||
assert(self);
|
assert(self);
|
||||||
@ -335,7 +341,11 @@ static int MultiCounterGet(struct __COUNTER *pCount, char *name,
|
|||||||
pDum = (pDummy)self->slaveData[i];
|
pDum = (pDummy)self->slaveData[i];
|
||||||
if(strcmp(pDum->pDescriptor->name, "SingleCounter") == 0){
|
if(strcmp(pDum->pDescriptor->name, "SingleCounter") == 0){
|
||||||
pCter = (pCounter)self->slaveData[i];
|
pCter = (pCounter)self->slaveData[i];
|
||||||
|
if(pCter->pDriv != NULL){
|
||||||
return pCter->pDriv->Get(pCter->pDriv, name, iCter, fVal);
|
return pCter->pDriv->Get(pCter->pDriv, name, iCter, fVal);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -505,7 +505,7 @@ static void putHdb(SConnection * pCon, SicsInterp * pSics, pNXScript self,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (i = 0; i < v.arrayLength; i++) {
|
for (i = 0; i < v.arrayLength; i++) {
|
||||||
floatAr[i] = v.v.floatArray[i];
|
floatAr[i] = (float)v.v.floatArray[i];
|
||||||
}
|
}
|
||||||
NXDputalias(self->fileHandle, self->dictHandle, alias, floatAr);
|
NXDputalias(self->fileHandle, self->dictHandle, alias, floatAr);
|
||||||
free(floatAr);
|
free(floatAr);
|
||||||
@ -733,6 +733,7 @@ static void putHistogramMemory(SConnection * pCon, SicsInterp * pSics,
|
|||||||
*/
|
*/
|
||||||
start = 0;
|
start = 0;
|
||||||
length = GetHistLength(mem);
|
length = GetHistLength(mem);
|
||||||
|
subset = 1;
|
||||||
|
|
||||||
updateHMDim(self, mem);
|
updateHMDim(self, mem);
|
||||||
|
|
||||||
|
20
sicsdata.c
20
sicsdata.c
@ -868,6 +868,23 @@ static int copyNode(pSICSData self, int argc, char *argv[],
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
static int intify(pSICSData self, int argc, char *argv[],
|
||||||
|
SConnection * pCon, SicsInterp * pSics)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
float fval;
|
||||||
|
|
||||||
|
for(i = 0; i < self->dataUsed; i++){
|
||||||
|
if(self->dataType[i] == FLOATTYPE){
|
||||||
|
memcpy(&fval,self->data+i,sizeof(float));
|
||||||
|
self->data[i] = (int)fval;
|
||||||
|
self->dataType[i] = INTTYPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SCSendOK(pCon);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
/*--------------------------------------------------------------------*/
|
||||||
static int copyToNode(pSICSData self, int argc, char *argv[],
|
static int copyToNode(pSICSData self, int argc, char *argv[],
|
||||||
SConnection * pCon, SicsInterp * pSics)
|
SConnection * pCon, SicsInterp * pSics)
|
||||||
{
|
{
|
||||||
@ -1051,6 +1068,9 @@ int SICSDataAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
} else if (strcmp(argv[1], "copytonode") == 0) {
|
} else if (strcmp(argv[1], "copytonode") == 0) {
|
||||||
/*--------- copyTonode */
|
/*--------- copyTonode */
|
||||||
return copyToNode(self, argc - 2, &argv[2], pCon, pSics);
|
return copyToNode(self, argc - 2, &argv[2], pCon, pSics);
|
||||||
|
} else if (strcmp(argv[1], "intify") == 0) {
|
||||||
|
/*--------- copyTonode */
|
||||||
|
return intify(self, argc - 2, &argv[2], pCon, pSics);
|
||||||
} else if (strcmp(argv[1], "writezipped") == 0) {
|
} else if (strcmp(argv[1], "writezipped") == 0) {
|
||||||
/*--------- writezipped */
|
/*--------- writezipped */
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
|
@ -228,7 +228,7 @@ tryagain:
|
|||||||
}
|
}
|
||||||
pServ->simMode = 1;
|
pServ->simMode = 1;
|
||||||
if (!test) {
|
if (!test) {
|
||||||
SCWrite(pCon, "WARNING: sync server may not have exectued backup",
|
SCWrite(pCon, "WARNING: sync server may not have executed backup",
|
||||||
eWarning);
|
eWarning);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,8 +268,6 @@ tryagain:
|
|||||||
tell everybody that we have sync'ed
|
tell everybody that we have sync'ed
|
||||||
*/
|
*/
|
||||||
ServerWriteGlobal("Simulation Server has SYNCHRONIZED!", eWarning);
|
ServerWriteGlobal("Simulation Server has SYNCHRONIZED!", eWarning);
|
||||||
ServerWriteGlobal("Fixed motors may not have correct positions",
|
|
||||||
eWarning);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ ServerOption InterruptPort 2913
|
|||||||
# The UDP port where the server will wait for Interrupts from clients.
|
# The UDP port where the server will wait for Interrupts from clients.
|
||||||
# Obviously, clients wishing to interrupt need to know this number.
|
# Obviously, clients wishing to interrupt need to know this number.
|
||||||
|
|
||||||
|
ServerOption historylog $env(HOME)/src/workspace/sics/sim/tmp/comhistorytst.txt
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# U S E R S
|
# U S E R S
|
||||||
@ -527,6 +528,7 @@ amorhmsct poll /sics/amorhm/collapse 20
|
|||||||
|
|
||||||
#source ../sim/mars/julcho.tcl
|
#source ../sim/mars/julcho.tcl
|
||||||
|
|
||||||
|
MakeSinq
|
||||||
|
|
||||||
MakeSingleX
|
MakeSingleX
|
||||||
singlex configure stt a4
|
singlex configure stt a4
|
||||||
@ -648,9 +650,11 @@ if {$hmhttp == 1} {
|
|||||||
set simhm 1
|
set simhm 1
|
||||||
#if {$simhm == 1} {
|
#if {$simhm == 1} {
|
||||||
source ../tcl/simhm.tcl
|
source ../tcl/simhm.tcl
|
||||||
simhm::MakeSimHM simi 2
|
simhm::MakeSimHM simi 3 tof
|
||||||
# simhm::makeSecond simi singledet 30
|
# simhm::makeSecond simi singledet 30
|
||||||
simi dim 64 64
|
simi dim 64 64 5
|
||||||
|
lappend tlist 10 20 30 40 50
|
||||||
|
simi time_binning $tlist
|
||||||
simi init
|
simi init
|
||||||
#}
|
#}
|
||||||
|
|
||||||
@ -711,16 +715,16 @@ proc testerr {input} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
set slsecho 1
|
set slsecho 0
|
||||||
|
|
||||||
if {$slsecho == 1} {
|
if {$slsecho == 1} {
|
||||||
makesctcontroller echo testprot testprot.dat
|
|
||||||
|
|
||||||
source ../tcl/stddrive.tcl
|
source ../tcl/stddrive.tcl
|
||||||
source ../tcl/slsecho.tcl
|
source ../tcl/slsecho.tcl
|
||||||
#makesctcontroller slssct slsecho taspmagnet:5001
|
makesctcontroller slssct slsecho taspmagnet:5001
|
||||||
makesctcontroller slssct slsecho localhost:8080
|
#makesctcontroller slssct slsecho localhost:8080
|
||||||
slsecho::makeslsecho ma1 0 slssct
|
slsecho::makeslsecho ma1 5 slssct
|
||||||
|
#slsecho::makeslsecho ma3 2 slssct
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user