- 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
This commit is contained in:
@ -347,7 +347,7 @@ int AmorStatusFactory(SConnection * pCon, SicsInterp * pSics,
|
|||||||
pCom = FindCommand(pSics, argv[3]);
|
pCom = FindCommand(pSics, argv[3]);
|
||||||
if (pCom) {
|
if (pCom) {
|
||||||
if (pCom->pData) {
|
if (pCom->pData) {
|
||||||
if (!iHasType(pCom->pData, "HistMem")) {
|
if (!iHasType(pCom->pData, "HistMem") && !iHasType(pCom->pData,"HistMemSec")) {
|
||||||
sprintf(pBueffel, "ERROR: %s is NO histogram memory object",
|
sprintf(pBueffel, "ERROR: %s is NO histogram memory object",
|
||||||
argv[3]);
|
argv[3]);
|
||||||
SCWrite(pCon, pBueffel, eError);
|
SCWrite(pCon, pBueffel, eError);
|
||||||
|
2
make_gen
2
make_gen
@ -39,7 +39,7 @@ libpsi.a: $(OBJ)
|
|||||||
clean:
|
clean:
|
||||||
rm -f *.a *.o *.d
|
rm -f *.a *.o *.d
|
||||||
|
|
||||||
SINQOPT=-DGRAPH_MHC3 -DUSE_MULTICAST -DSEND_PORT=0xABCB -DSERVER_HOST="\"acslg1\""
|
SINQOPT=-DGRAPH_MHC3 -DUSE_MULTICAST -DSEND_PORT=0xABCB -DSERVER_HOST="\"acslg1mc\""
|
||||||
dgrambroadcast.o: dgrambroadcast.h dgrambroadcast.c
|
dgrambroadcast.o: dgrambroadcast.h dgrambroadcast.c
|
||||||
$(CC) $(SINQOPT) -c -g dgrambroadcast.c
|
$(CC) $(SINQOPT) -c -g dgrambroadcast.c
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ include ../sllinux_def
|
|||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -I$(TCLINC) -Ihardsup \
|
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -I$(TCLINC) -Ihardsup \
|
||||||
-I.. -I. -MMD -DCYGNUS -DNONINTF -g $(DFORTIFY) \
|
-I.. -I. -MMD -DCYGNUS -DNONINTF -g $(DFORTIFY) -p \
|
||||||
-Wall -Wno-unused -Wunused-value -Wno-comment -Wno-switch -Werror
|
-Wall -Wno-unused -Wunused-value -Wno-comment -Wno-switch -Werror
|
||||||
|
|
||||||
EXTRA=nintf.o
|
EXTRA=nintf.o
|
||||||
|
@ -492,6 +492,7 @@ static void PoldiUpdate(pPolterdi self, SConnection * pCon)
|
|||||||
write time binning
|
write time binning
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
fTime = GetHistTimeBin(self->pHist, &iLength);
|
fTime = GetHistTimeBin(self->pHist, &iLength);
|
||||||
fTime2 = (float *) malloc(iLength * sizeof(float));
|
fTime2 = (float *) malloc(iLength * sizeof(float));
|
||||||
if (fTime2) {
|
if (fTime2) {
|
||||||
@ -506,6 +507,7 @@ static void PoldiUpdate(pPolterdi self, SConnection * pCon)
|
|||||||
SCWrite(pCon, "ERROR: out of memory while writing time binning",
|
SCWrite(pCon, "ERROR: out of memory while writing time binning",
|
||||||
eError);
|
eError);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
write Histogram
|
write Histogram
|
||||||
|
2
sinq.c
2
sinq.c
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* A module which reads the broadcast messages from the PSI Accelerator group
|
* A module which reads the broadcast messages from the PSI Accelerator group
|
||||||
* and allows to use the information in them in SICS. This facility runs
|
* and allows to use the information in them in SICS. This facility runs
|
||||||
* as a SICS task which tries to read incoming messages and stores the
|
* as a SICS task which tries to read incoming messages and stores the
|
||||||
* messages of interest in an internal data structure. Some code is provided
|
* messages of interest in an internal data structure. Some code is provided
|
||||||
|
50
sinqhttp.c
50
sinqhttp.c
@ -281,7 +281,23 @@ static int SinqHttpConfigure(pHistDriver self, SConnection * pCon,
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
/*---------------------------------------------------------------------*/
|
||||||
|
static int SinqHttpPreset(pHistDriver self, SConnection * pCon, int val)
|
||||||
|
{
|
||||||
|
pSinqHttp pPriv = NULL;
|
||||||
|
int status;
|
||||||
|
char command[512];
|
||||||
|
|
||||||
|
pPriv = (pSinqHttp) self->pPriv;
|
||||||
|
assert(pPriv != NULL);
|
||||||
|
|
||||||
|
snprintf(command, 512, "%s?value=%d", preset, val);
|
||||||
|
status = sinqHttpGet(pPriv, command);
|
||||||
|
if (status != 1) {
|
||||||
|
return HWFault;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
static int SinqHttpStart(pHistDriver self, SConnection * pCon)
|
static int SinqHttpStart(pHistDriver self, SConnection * pCon)
|
||||||
{
|
{
|
||||||
@ -512,8 +528,8 @@ static int SinqHttpGetData(pHistDriver self, SConnection * pCon)
|
|||||||
*/
|
*/
|
||||||
static void swapTrics(HistInt *data, pHMdata hmdata, int length)
|
static void swapTrics(HistInt *data, pHMdata hmdata, int length)
|
||||||
{
|
{
|
||||||
int i,j, xdim, ydim;
|
int x,y, xdim, ydim;
|
||||||
HistInt *tmpData = NULL, *val;
|
HistInt *tmpData = NULL, val;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* do nothing if no match
|
* do nothing if no match
|
||||||
@ -528,11 +544,10 @@ static void swapTrics(HistInt *data, pHMdata hmdata, int length)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memcpy(tmpData, data, length*sizeof(HistInt));
|
memcpy(tmpData, data, length*sizeof(HistInt));
|
||||||
val = tmpData;
|
for(y = 0; y < ydim; y++){
|
||||||
for(j = 0; j < ydim; j++){
|
for(x = 0; x < xdim; x++){
|
||||||
for(i = 0; i < xdim; i++){
|
val = tmpData[x*ydim + y];
|
||||||
data[j*xdim+i] = *val;
|
data[y*xdim+x] = val;
|
||||||
val++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(tmpData);
|
free(tmpData);
|
||||||
@ -546,6 +561,7 @@ static int SinqHttpGetHistogram(pHistDriver self, SConnection * pCon,
|
|||||||
HistInt *hmdata;
|
HistInt *hmdata;
|
||||||
pSinqHttp pPriv = NULL;
|
pSinqHttp pPriv = NULL;
|
||||||
int status, len, i;
|
int status, len, i;
|
||||||
|
long dataSum = 0;
|
||||||
|
|
||||||
pPriv = (pSinqHttp) self->pPriv;
|
pPriv = (pSinqHttp) self->pPriv;
|
||||||
assert(pPriv != NULL);
|
assert(pPriv != NULL);
|
||||||
@ -567,7 +583,10 @@ static int SinqHttpGetHistogram(pHistDriver self, SConnection * pCon,
|
|||||||
hmdata = (HistInt *) ghttp_get_body(pPriv->syncRequest);
|
hmdata = (HistInt *) ghttp_get_body(pPriv->syncRequest);
|
||||||
for (i = 0; i < (end - start); i++) {
|
for (i = 0; i < (end - start); i++) {
|
||||||
data[i] = ntohl(hmdata[i]);
|
data[i] = ntohl(hmdata[i]);
|
||||||
|
dataSum += data[i];
|
||||||
}
|
}
|
||||||
|
/* printf("Read %ld counts from HM\n", dataSum); */
|
||||||
|
|
||||||
if(pPriv->tricsswap == 1){
|
if(pPriv->tricsswap == 1){
|
||||||
swapTrics(data, self->data, end-start);
|
swapTrics(data, self->data, end-start);
|
||||||
}
|
}
|
||||||
@ -648,23 +667,6 @@ static float SinqHttpGetTime(pHistDriver self, SConnection * pCon)
|
|||||||
return -999.99;
|
return -999.99;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
static int SinqHttpPreset(pHistDriver self, SConnection * pCon, int val)
|
|
||||||
{
|
|
||||||
pSinqHttp pPriv = NULL;
|
|
||||||
int status;
|
|
||||||
char command[512];
|
|
||||||
|
|
||||||
pPriv = (pSinqHttp) self->pPriv;
|
|
||||||
assert(pPriv != NULL);
|
|
||||||
|
|
||||||
snprintf(command, 512, "%s?value=%d", preset, val);
|
|
||||||
status = sinqHttpGet(pPriv, command);
|
|
||||||
if (status != 1) {
|
|
||||||
return HWFault;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
static int SinqHttpFreePrivate(pHistDriver self)
|
static int SinqHttpFreePrivate(pHistDriver self)
|
||||||
|
@ -93,7 +93,7 @@ static int configRequest(Ascon * a)
|
|||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
static void handleReply(Ascon * a)
|
static void handleReply(Ascon * a)
|
||||||
{
|
{
|
||||||
char *pPtr = NULL, *pType = NULL;
|
char *pPtr = NULL, *pType = NULL, *path = NULL;
|
||||||
int len, i, *dataPtr = NULL;
|
int len, i, *dataPtr = NULL;
|
||||||
HistInt *hmData = NULL;
|
HistInt *hmData = NULL;
|
||||||
pHttpProt pHttp = (pHttpProt) a->private;
|
pHttpProt pHttp = (pHttpProt) a->private;
|
||||||
@ -140,6 +140,13 @@ static void handleReply(Ascon * a)
|
|||||||
pHttp->node->value.v.intArray[i] = htonl(hmData[i]);
|
pHttp->node->value.v.intArray[i] = htonl(hmData[i]);
|
||||||
}
|
}
|
||||||
NotifyHipadabaPar(pHttp->node,NULL);
|
NotifyHipadabaPar(pHttp->node,NULL);
|
||||||
|
/*
|
||||||
|
path = GetHipadabaPath(pHttp->node);
|
||||||
|
if(path != NULL){
|
||||||
|
printf("Sinqhttpprot has updated node: %s\n", path);
|
||||||
|
free(path);
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
sps.c
4
sps.c
@ -67,8 +67,8 @@ static int init(pSPS self)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
setRS232SendTerminator(rs232,"\r\n");
|
setRS232SendTerminator(rs232,"\r\n");
|
||||||
setRS232ReplyTerminator(rs232,"\r\n");
|
setRS232ReplyTerminator(rs232,"\n");
|
||||||
setRS232Timeout(rs232,10000);
|
setRS232Timeout(rs232,20000);
|
||||||
/* setRS232Debug(rs232,1); */
|
/* setRS232Debug(rs232,1); */
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
2
tdchm.c
2
tdchm.c
@ -297,7 +297,7 @@ static int TDCCountStatus(pHistDriver self, SConnection * pCon)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
This is no proper fix. The proper fix would be to keep the state
|
This is no proper fix. The proper fix would be to keep the state
|
||||||
in the private data structure as well and disbale to TDC
|
in the private data structure as well and disable the TDC
|
||||||
on HWNoBeam and enable the TDC again if the
|
on HWNoBeam and enable the TDC again if the
|
||||||
beam comes on. However, this is done in hardware at SANS-II. So we
|
beam comes on. However, this is done in hardware at SANS-II. So we
|
||||||
leave it for now.
|
leave it for now.
|
||||||
|
Reference in New Issue
Block a user