diff --git a/amorstat.c b/amorstat.c index 87b7080..b7cc7c2 100644 --- a/amorstat.c +++ b/amorstat.c @@ -347,7 +347,7 @@ int AmorStatusFactory(SConnection * pCon, SicsInterp * pSics, pCom = FindCommand(pSics, argv[3]); if (pCom) { 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", argv[3]); SCWrite(pCon, pBueffel, eError); diff --git a/make_gen b/make_gen index a2f4a24..36bceea 100644 --- a/make_gen +++ b/make_gen @@ -39,7 +39,7 @@ libpsi.a: $(OBJ) clean: 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 $(CC) $(SINQOPT) -c -g dgrambroadcast.c diff --git a/makefile_linux b/makefile_linux index dbb606f..4a0097b 100644 --- a/makefile_linux +++ b/makefile_linux @@ -13,7 +13,7 @@ include ../sllinux_def CC = gcc 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 EXTRA=nintf.o diff --git a/polterwrite.c b/polterwrite.c index b7a34cf..c2508c6 100644 --- a/polterwrite.c +++ b/polterwrite.c @@ -492,6 +492,7 @@ static void PoldiUpdate(pPolterdi self, SConnection * pCon) write time binning */ + /* fTime = GetHistTimeBin(self->pHist, &iLength); fTime2 = (float *) malloc(iLength * sizeof(float)); if (fTime2) { @@ -506,6 +507,7 @@ static void PoldiUpdate(pPolterdi self, SConnection * pCon) SCWrite(pCon, "ERROR: out of memory while writing time binning", eError); } +*/ /* write Histogram diff --git a/sinq.c b/sinq.c index 154a4cc..5fbcb04 100644 --- a/sinq.c +++ b/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 * 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 diff --git a/sinqhttp.c b/sinqhttp.c index 9d2cbf4..e3571e0 100644 --- a/sinqhttp.c +++ b/sinqhttp.c @@ -281,7 +281,23 @@ static int SinqHttpConfigure(pHistDriver self, SConnection * pCon, } 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) { @@ -512,8 +528,8 @@ static int SinqHttpGetData(pHistDriver self, SConnection * pCon) */ static void swapTrics(HistInt *data, pHMdata hmdata, int length) { - int i,j, xdim, ydim; - HistInt *tmpData = NULL, *val; + int x,y, xdim, ydim; + HistInt *tmpData = NULL, val; /* * do nothing if no match @@ -528,11 +544,10 @@ static void swapTrics(HistInt *data, pHMdata hmdata, int length) return; } memcpy(tmpData, data, length*sizeof(HistInt)); - val = tmpData; - for(j = 0; j < ydim; j++){ - for(i = 0; i < xdim; i++){ - data[j*xdim+i] = *val; - val++; + for(y = 0; y < ydim; y++){ + for(x = 0; x < xdim; x++){ + val = tmpData[x*ydim + y]; + data[y*xdim+x] = val; } } free(tmpData); @@ -546,6 +561,7 @@ static int SinqHttpGetHistogram(pHistDriver self, SConnection * pCon, HistInt *hmdata; pSinqHttp pPriv = NULL; int status, len, i; + long dataSum = 0; pPriv = (pSinqHttp) self->pPriv; assert(pPriv != NULL); @@ -567,7 +583,10 @@ static int SinqHttpGetHistogram(pHistDriver self, SConnection * pCon, hmdata = (HistInt *) ghttp_get_body(pPriv->syncRequest); for (i = 0; i < (end - start); i++) { data[i] = ntohl(hmdata[i]); + dataSum += data[i]; } + /* printf("Read %ld counts from HM\n", dataSum); */ + if(pPriv->tricsswap == 1){ swapTrics(data, self->data, end-start); } @@ -648,23 +667,6 @@ static float SinqHttpGetTime(pHistDriver self, SConnection * pCon) 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) diff --git a/sinqhttpprot.c b/sinqhttpprot.c index 27434fc..4399c25 100644 --- a/sinqhttpprot.c +++ b/sinqhttpprot.c @@ -93,7 +93,7 @@ static int configRequest(Ascon * a) /*---------------------------------------------------------------------*/ static void handleReply(Ascon * a) { - char *pPtr = NULL, *pType = NULL; + char *pPtr = NULL, *pType = NULL, *path = NULL; int len, i, *dataPtr = NULL; HistInt *hmData = NULL; pHttpProt pHttp = (pHttpProt) a->private; @@ -140,6 +140,13 @@ static void handleReply(Ascon * a) pHttp->node->value.v.intArray[i] = htonl(hmData[i]); } NotifyHipadabaPar(pHttp->node,NULL); + /* + path = GetHipadabaPath(pHttp->node); + if(path != NULL){ + printf("Sinqhttpprot has updated node: %s\n", path); + free(path); + } + */ } } } diff --git a/sps.c b/sps.c index 994bf22..16a3a96 100644 --- a/sps.c +++ b/sps.c @@ -67,8 +67,8 @@ static int init(pSPS self) return 0; } setRS232SendTerminator(rs232,"\r\n"); - setRS232ReplyTerminator(rs232,"\r\n"); - setRS232Timeout(rs232,10000); + setRS232ReplyTerminator(rs232,"\n"); + setRS232Timeout(rs232,20000); /* setRS232Debug(rs232,1); */ return 1; diff --git a/tdchm.c b/tdchm.c index fb48c73..8b13599 100644 --- a/tdchm.c +++ b/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 - 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 beam comes on. However, this is done in hardware at SANS-II. So we leave it for now.