- Adapted amor status stuff to work with the new http based HM

This commit is contained in:
koennecke
2006-08-16 14:14:08 +00:00
parent 4b91d841d6
commit 928738dbd8
9 changed files with 131 additions and 13 deletions

View File

@ -19,6 +19,10 @@
An additional projection mode: onto the y -tof plane was added
Mark Koennecke, June 2005
Support for new HTTP HM added
Mark Koennecke, July 2006
--------------------------------------------------------------------------*/
#include <stdlib.h>
#include <assert.h>
@ -526,6 +530,8 @@
pSINQHM pHist;
SinqHMDriv *pTata;
int iMax = -999999;
char hmCommand[256];
HistInt *data = NULL;
/* get size of our problem */
GetHistDim(self->pHM,iDim,&i3);
@ -580,6 +586,22 @@
return 0;
}
}
else if(self->iHTTP == 1)
{
snprintf(hmCommand,255,"sum:2:0:%d",iDim[2]);
data = self->pHM->pDriv->SubSample(self->pHM->pDriv,pCon,0,hmCommand);
if(data == NULL)
{
SCWrite(pCon,"ERROR: failed to retrieve collapsed data from HM", eError);
return 0;
}
for(i = 2; i < length; i++)
{
iImage[i] = htonl(data[i-1]);
}
free(data);
}
else
{
/*
@ -615,6 +637,8 @@
pSINQHM pHist;
SinqHMDriv *pTata;
int iMax = -999999;
char hmCommand[256];
HistInt *data = NULL;
/* get size of our problem */
GetHistDim(self->pHM,iDim,&i3);
@ -658,6 +682,21 @@
return 0;
}
}
else if(self->iHTTP == 1)
{
snprintf(hmCommand,255,"sum:0:0:%d", iDim[0]);
data = self->pHM->pDriv->SubSample(self->pHM->pDriv,pCon,0,hmCommand);
if(data == NULL)
{
SCWrite(pCon,"ERROR: failed to retrieve Y-projection from HM", eError);
return 0;
}
for(i = 2; i < length; i++)
{
iImage[i] = htonl(data[i-1]);
}
free(data);
}
else
{
/*
@ -727,6 +766,14 @@
iData[i] = htonl(iData[i]);
}
}
else if(self->iHTTP == 1)
{
GetHistogramDirect(self->pHM,pCon,1,0,2*nTime,&iData[1],2*nTime*sizeof(HistInt));
for(i = 1; i < length; i++)
{
iData[i] = htonl(iData[i]);
}
}
else
{
/*
@ -763,6 +810,8 @@
pSINQHM pHist;
SinqHMDriv *pTata;
const float *fTime;
char hmCommand[256];
HistInt *data = NULL;
/* get histogram dimensions */
GetHistDim(self->pHM,iDim,&i3);
@ -875,6 +924,22 @@
return 0;
}
}
else if(self->iHTTP == 1)
{
snprintf(hmCommand,255,"sample:%d:%d:%d:%d:0:%d;sum:0:0:%d;sum:0:0:%d",
x1,x2,y1,y2,iDim[2]-1,x2-x1,y2-y1);
data = self->pHM->pDriv->SubSample(self->pHM->pDriv,pCon,0,hmCommand);
if(data == NULL)
{
SCWrite(pCon,"ERROR: failed to retrieve sub sampled data fromHM", eError);
return 0;
}
for(i = 1; i < iDim[2]+1; i++)
{
iSum[i] = htonl(data[i-1]);
}
free(data);
}
else
{
/* do acouple of random numbers! */
@ -957,6 +1022,21 @@
}
return iRet;
}
else if(strcmp(argv[1],"http") == 0)
{
if(argc > 2){
if(!SCMatchRights(pCon,usMugger)){
return 0;
}
self->iHTTP = atoi(argv[2]);
SCSendOK(pCon);
return 1;
} else {
snprintf(pBueffel,511,"amorstat.http = %d", self->iHTTP);
SCWrite(pCon,pBueffel,eValue);
return 1;
}
}
else if(strcmp(argv[1],"sample") == 0)
{
if(argc < 7)