- Fixed a singlex death when there was no lambda. Was a problem during
shutdown when nothing works as it should - Made an attempt to have all error message printed on demand - Added a tricsswap feature to sinqhttp which swaps the data right for SICS - Edited speed for phytron driver - First attack on adding a misalignment calculation to tasub - Added a test protocol for scriptcontext which can be configured.
This commit is contained in:
40
sinqhttp.c
40
sinqhttp.c
@ -61,6 +61,7 @@ typedef struct {
|
||||
int pause;
|
||||
int failCount;
|
||||
int asyncRunning;
|
||||
int tricsswap;
|
||||
} sinqHttp, *pSinqHttp;
|
||||
/*------------------------------------------------------------------*/
|
||||
static int sinqHttpGetPrepare(pSinqHttp self, char *request)
|
||||
@ -153,7 +154,7 @@ static int sinqHttpGet(pSinqHttp self, char *request)
|
||||
static int SinqHttpConfigure(pHistDriver self, SConnection * pCon,
|
||||
pStringDict pOpt, SicsInterp * pSics)
|
||||
{
|
||||
char hmname[512];
|
||||
char hmname[512], buffer[132];
|
||||
char confCommand[512], url[512];
|
||||
pSinqHttp pPriv = NULL;
|
||||
int status, iInit;
|
||||
@ -203,6 +204,10 @@ static int SinqHttpConfigure(pHistDriver self, SConnection * pCon,
|
||||
}
|
||||
}
|
||||
|
||||
status = StringDictGet(pOpt,"tricsswap", buffer, sizeof(buffer));
|
||||
if(status == 1){
|
||||
pPriv->tricsswap = 1;
|
||||
}
|
||||
/*
|
||||
actually do configure
|
||||
*/
|
||||
@ -501,7 +506,37 @@ static int SinqHttpGetData(pHistDriver self, SConnection * pCon)
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
/*-------------------------------------------------------------------
|
||||
* This is an ugly hack to swap TRICS data into the
|
||||
* correct order.
|
||||
*/
|
||||
static void swapTrics(HistInt *data, pHMdata hmdata, int length)
|
||||
{
|
||||
int i,j, xdim, ydim;
|
||||
HistInt *tmpData = NULL, *val;
|
||||
|
||||
/*
|
||||
* do nothing if no match
|
||||
*/
|
||||
xdim = hmdata->iDim[0];
|
||||
ydim = hmdata->iDim[1];
|
||||
if(xdim*ydim < length){
|
||||
return;
|
||||
}
|
||||
tmpData = malloc(length*sizeof(HistInt));
|
||||
if(tmpData == NULL){
|
||||
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++;
|
||||
}
|
||||
}
|
||||
free(tmpData);
|
||||
}
|
||||
/*-------------------------------------------------------------------*/
|
||||
static int SinqHttpGetHistogram(pHistDriver self, SConnection * pCon,
|
||||
int bank, int start, int end,
|
||||
@ -533,6 +568,9 @@ static int SinqHttpGetHistogram(pHistDriver self, SConnection * pCon,
|
||||
for (i = 0; i < (end - start); i++) {
|
||||
data[i] = ntohl(hmdata[i]);
|
||||
}
|
||||
if(pPriv->tricsswap == 1){
|
||||
swapTrics(data, self->data, end-start);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user