- Added asynchronous IO code from ANSTO
- Added new ACT protocol - Extended sicshdbadapter to cover counters and status to put the status into Hipadaba - Fixes to napi5.c - Exe now supports hdbrun which allows to write output for a buffer into hdb node.
This commit is contained in:
43
status.c
43
status.c
@ -49,6 +49,7 @@
|
||||
#include "status.h"
|
||||
#include "interrupt.h"
|
||||
#include "devexec.h"
|
||||
#include "sicshipadaba.h"
|
||||
#undef VALUECHANGE
|
||||
#define VALUECHANGE 2
|
||||
|
||||
@ -197,13 +198,30 @@
|
||||
SCPopContext(pCon);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*------------------- The CallBack function for interest ------------------*/
|
||||
static int StatusHDBCallback(int iEvent, void *pEvent, void *pUser,
|
||||
commandContext cc)
|
||||
{
|
||||
pHdb node = NULL;
|
||||
char pBueffel[80];
|
||||
hdbValue v;
|
||||
|
||||
assert(pUser);
|
||||
|
||||
node = (pHdb)pUser;
|
||||
v = MakeHdbText(pText[eCode]);
|
||||
if(node != NULL && iEvent == VALUECHANGE){
|
||||
UpdateHipadabaPar(node,v,NULL);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*-----------------------------------------------------------------------*/
|
||||
int UserStatus(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int argc, char *argv[])
|
||||
{
|
||||
char pBueffel[512];
|
||||
long lID;
|
||||
pHdb node = NULL;
|
||||
|
||||
assert(pSics);
|
||||
assert(pCon);
|
||||
@ -221,12 +239,33 @@
|
||||
if(strcmp(argv[1],"interest") == 0)
|
||||
{
|
||||
lID = RegisterCallback(pCall, SCGetContext(pCon),
|
||||
VALUECHANGE, StatusCallback,
|
||||
VALUECHANGE, StatusCallback,
|
||||
pCon, NULL);
|
||||
SCRegister(pCon,pSics, pCall,lID);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
}
|
||||
else if(strcmp(argv[1],"hdbinterest") == 0)
|
||||
{
|
||||
if(argc > 2){
|
||||
node = GetHipadabaNode(GetHipadabaRoot(),argv[2]);
|
||||
if(node != NULL){
|
||||
lID = RegisterCallback(pCall, SCGetContext(pCon),
|
||||
VALUECHANGE, StatusHDBCallback,
|
||||
node, NULL);
|
||||
/* SCRegister(pCon,pSics, pCall,lID); */
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
SCWrite(pCon,"ERROR: Hipadaba node not found",eError);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SCWrite(pCon,"ERROR: require node parameter to register status callback",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* else just print value */
|
||||
|
Reference in New Issue
Block a user