- 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:
koennecke
2010-06-01 10:01:01 +00:00
parent fd150f35a2
commit 1e9f9d408c
9 changed files with 43 additions and 32 deletions

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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);
}
*/
}
}
}

4
sps.c
View File

@ -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;

View File

@ -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.