First version of remoteobject. In the implementation of this, the following

sub problems were solved:
- sicsget was not reporting geterrors on nodes properly
- rwpuffer contained dirt after wrap
- property change events were added to hipadaba
- Some tuning of SICS output
- The number of codes was wrong in outcode.c
This commit is contained in:
2015-03-17 11:41:18 +01:00
parent fb19bf9bf6
commit 2eef24bf3c
13 changed files with 1117 additions and 12 deletions

View File

@@ -375,7 +375,7 @@ static float SecMotorGetValue(void *pData, SConnection * pCon)
assert(pData);
status = GetHdbProperty(self->pDescriptor->parNode,"geterror", error,sizeof(error));
if(status == 1 && strcmp(error,"none") != 0) {
SCPrintf(pCon,eValue,"ERROR: Failed to read %s with %s", self->name, error);
SCPrintf(pCon,eError,"ERROR: Failed to read %s with %s", self->name, error);
return -9999999.99;
}
status = GetHipadabaPar(self->pDescriptor->parNode, &v, pCon);
@@ -465,7 +465,7 @@ static hdbCallbackReturn SecMotorCallback(pHdb node, void *userData,
pHdb child = NULL;
pMotor self = NULL;
float fHard, fVal, sign, zero;
char pBueffel[512], pError[132];
char pBueffel[512], pError[132], *pPtr = NULL;
int status;
self = (pMotor) userData;
@@ -526,6 +526,8 @@ static hdbCallbackReturn SecMotorCallback(pHdb node, void *userData,
ServerWriteGlobal(pBueffel, eError);
SCSetInterrupt(pCon, eAbortBatch);
self->pDrivInt->iErrorCount = 0;
child = GetHipadabaNode(self->pDescriptor->parNode, "status");
UpdateHipadabaPar(child, MakeHdbText("run"), pCon);
return hdbAbort;
}
@@ -547,6 +549,12 @@ static hdbCallbackReturn SecMotorCallback(pHdb node, void *userData,
if (mm != NULL) {
pCon = (SConnection *) mm->callData;
SecMotorGetPar(self, "hardposition", &fVal);
child = GetHipadabaNode(self->pDescriptor->parNode, "hardposition");
if((pPtr = GetHdbProp(child,"geterror")) != NULL){
SetHdbProperty(node,"geterror",pPtr);
} else {
SetHdbProperty(node,"geterror",NULL);
}
fVal = hardToSoftPosition(self, fVal);
node->value.v.doubleValue = fVal;
mm->v->v.doubleValue = fVal;
@@ -561,6 +569,7 @@ static hdbCallbackReturn HardUpdateCallback(pHdb node, void *userData,
pHdbMessage message)
{
pHdbDataMessage mm = NULL;
pHdbPropertyChange pm = NULL;
pMotor self = (pMotor) userData;
float fVal;
hdbValue v;
@@ -575,6 +584,18 @@ static hdbCallbackReturn HardUpdateCallback(pHdb node, void *userData,
UpdateHipadabaPar(self->pDescriptor->parNode, v, mm->callData);
return hdbContinue;
}
/*
forward geterror
*/
pm = GetPropertyChangeMessage(message);
if(pm != NULL){
if(strstr(pm->key,"geterror") != NULL){
SetHdbProperty(self->pDescriptor->parNode,pm->key, pm->value);
}
}
return hdbContinue;
}