- Added a SICS to Hipadaba adapter
- Added a separate polling module to SICS
This commit is contained in:
37
histmem.c
37
histmem.c
@ -1238,13 +1238,19 @@ static int checkHMEnd(pHistMem self, char *text){
|
||||
}
|
||||
else if(strcmp(argv[1],"init") == 0)
|
||||
{
|
||||
if(GetStatus() != eEager)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: cannot initialize HM while running",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
if(SCMatchRights(pCon,usMugger))
|
||||
{
|
||||
iRet = HistConfigure(self,pCon,pSics);
|
||||
if(iRet)
|
||||
{
|
||||
self->iInit = 1;
|
||||
SCSendOK(pCon);
|
||||
SCSendOK(pCon);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1362,6 +1368,31 @@ static int checkHMEnd(pHistMem self, char *text){
|
||||
}
|
||||
return iRet;
|
||||
}
|
||||
else if(strcmp(argv[1],"initfile") == 0) /* initialize from a file */
|
||||
{
|
||||
/* check user rights */
|
||||
if(!SCMatchRights(pCon,self->iAccess))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* enough arguments */
|
||||
if(argc < 3)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: insufficient number of arguments to %s %s",
|
||||
argv[0], argv[1]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
iRet = loadHMData(self->pDriv->data,pCon,argv[2]);
|
||||
self->pDriv->SetHistogram(self->pDriv,pCon,0,0,GetHistLength(self),
|
||||
self->pDriv->data->localBuffer);
|
||||
if(iRet)
|
||||
{
|
||||
SCSendOK(pCon);
|
||||
}
|
||||
return iRet;
|
||||
}
|
||||
else if(strcmp(argv[1],"get") == 0) /* get a histogram */
|
||||
{
|
||||
/* check parameters, first required: no of Hist */
|
||||
@ -1602,8 +1633,8 @@ static int checkHMEnd(pHistMem self, char *text){
|
||||
return 0;
|
||||
}
|
||||
if(GetStatus() == eCounting)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: cannot modify timebinning while counting",
|
||||
{
|
||||
SCWrite(pCon,"ERROR: cannot modify timebinning while counting",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user