- Fixed a couple of Hipadaba Issues
- Added properties to Hipadaba Nodes - Made Morpheus Hipadaba aware and implemented scans for Morpheus and Hipadaba SKIPPED: psi/tecs/make_crv
This commit is contained in:
@ -23,6 +23,30 @@
|
||||
#include "sicsvar.h"
|
||||
#include "sicshipadaba.h"
|
||||
#include "sicshdbadapter.h"
|
||||
|
||||
#define PRIVNAM "priv"
|
||||
/*==================== support code ====================================*/
|
||||
static void AddPrivProperty(pHdb node, int priv){
|
||||
char pPriv[80];
|
||||
switch(priv){
|
||||
case usInternal:
|
||||
strcpy(pPriv,"internal");
|
||||
break;
|
||||
case usMugger:
|
||||
strcpy(pPriv,"manager");
|
||||
break;
|
||||
case usUser:
|
||||
strcpy(pPriv,"user");
|
||||
break;
|
||||
case usSpy:
|
||||
strcpy(pPriv,"spy");
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
SetHdbProperty(node,PRIVNAM,pPriv);
|
||||
}
|
||||
/*=================== motor code =======================================*/
|
||||
static int MoveCallback(int iEvent, void *eventData, void *userData,
|
||||
commandContext cc){
|
||||
@ -122,6 +146,7 @@ static int AddStdMotorPar(pHdb motorNode, pMotor pMot){
|
||||
i = 0;
|
||||
while(addPar[i] != NULL){
|
||||
parNode = MakeMotParNode(addPar[i],pMot);
|
||||
SetHdbProperty(parNode,PRIVNAM,"internal");
|
||||
if(parNode == NULL){
|
||||
return 0;
|
||||
}
|
||||
@ -138,6 +163,7 @@ static int AddStdMotorPar(pHdb motorNode, pMotor pMot){
|
||||
return 0;
|
||||
}
|
||||
AddHipadabaChild(motorNode,parNode, NULL);
|
||||
AddPrivProperty(parNode,pMot->ParArray[i].iCode);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -197,6 +223,7 @@ static int CreateDriverParameters(pMotor pM, pHdb parent){
|
||||
while((pPtr = stptok(pPtr,line,79,"\n")) != NULL){
|
||||
name = extractName(line);
|
||||
node = MakeMotParNode(name,pM);
|
||||
SetHdbProperty(node,PRIVNAM,"manager");
|
||||
if(node != NULL){
|
||||
AddHipadabaChild(parent,node,NULL);
|
||||
}
|
||||
@ -208,6 +235,7 @@ static int CreateDriverParameters(pMotor pM, pHdb parent){
|
||||
static pHdb CreateMotorAdapter(char *name, pMotor pMot){
|
||||
pHdb result = NULL;
|
||||
commandContext comCom;
|
||||
float access;
|
||||
|
||||
assert(pMot != NULL);
|
||||
|
||||
@ -215,6 +243,9 @@ static pHdb CreateMotorAdapter(char *name, pMotor pMot){
|
||||
if(result == NULL){
|
||||
return NULL;
|
||||
}
|
||||
MotorGetPar(pMot,"accesscode",&access);
|
||||
AddPrivProperty(result,(int)access);
|
||||
SetHdbProperty(result,"type","Motor");
|
||||
/*
|
||||
* We want to be notified when this motor drives around. Or
|
||||
* its parameters change.
|
||||
@ -359,6 +390,7 @@ static pHdb MakeSicsVarNode(pSicsVariable pVar, char *name){
|
||||
if(node == NULL){
|
||||
return NULL;
|
||||
}
|
||||
AddPrivProperty(node,pVar->iAccessCode);
|
||||
pCall = MakeHipadabaCallback(SicsVarSetCallback,pVar,NULL,-1,-1);
|
||||
if(pCall == NULL){
|
||||
return NULL;
|
||||
@ -427,6 +459,8 @@ int SICSHdbAdapter(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
SCWrite(pCon,"ERROR: out of memory creating drivable node",eError);
|
||||
return 0;
|
||||
}
|
||||
SetHdbProperty(node,PRIVNAM,"user");
|
||||
SetHdbProperty(node,"type","drivable");
|
||||
AddHipadabaChild(path,node,pCon);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user