- 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:
50
sinqhttp.c
50
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)
|
||||
|
||||
Reference in New Issue
Block a user