Bug fixes
- transfer of monitor values in mutlicountersec - Permission denied mesage when restarting a second generation motor fixed
This commit is contained in:
@ -271,7 +271,7 @@ static int checkPosition(pMotor self, SConnection * pCon)
|
|||||||
SetHipadabaPar(node, MakeHdbFloat(target), pCon);
|
SetHipadabaPar(node, MakeHdbFloat(target), pCon);
|
||||||
node = GetHipadabaNode(self->pDescriptor->parNode, "targetposition");
|
node = GetHipadabaNode(self->pDescriptor->parNode, "targetposition");
|
||||||
assert(node != NULL);
|
assert(node != NULL);
|
||||||
SetHipadabaPar(node, MakeHdbFloat(target), pCon);
|
UpdateHipadabaPar(node, MakeHdbFloat(target), pCon);
|
||||||
return HWBusy;
|
return HWBusy;
|
||||||
}
|
}
|
||||||
return HWIdle;
|
return HWIdle;
|
||||||
|
@ -16,6 +16,12 @@
|
|||||||
#include <stptok.h>
|
#include <stptok.h>
|
||||||
#include <macro.h>
|
#include <macro.h>
|
||||||
#include "sicshipadaba.h"
|
#include "sicshipadaba.h"
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
typedef struct {
|
||||||
|
float fPreset;
|
||||||
|
float fCurrent;
|
||||||
|
char *pName;
|
||||||
|
} MonEvent, *pMonEvent;
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
static void SecCounterSetError(pCounter self, char *text)
|
static void SecCounterSetError(pCounter self, char *text)
|
||||||
{
|
{
|
||||||
@ -232,6 +238,31 @@ static hdbCallbackReturn MultiSecControllCallback(pHdb node,
|
|||||||
|
|
||||||
return hdbContinue;
|
return hdbContinue;
|
||||||
}
|
}
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
static int MultiSecTransfer(void *pData, SConnection * pCon)
|
||||||
|
{
|
||||||
|
int i, retVal = OKOK, tclStatus;
|
||||||
|
char pBueffel[132];
|
||||||
|
pCounter pCount = NULL;
|
||||||
|
pHdb transfer;
|
||||||
|
|
||||||
|
pCount = (pCounter) pData;
|
||||||
|
|
||||||
|
transfer = GetHipadabaNode(pCount->objectNode,"transfer");
|
||||||
|
if(transfer != NULL){
|
||||||
|
MacroPush(pCon);
|
||||||
|
tclStatus = Tcl_Eval(InterpGetTcl(pServ->pSics), transfer->value.v.text);
|
||||||
|
if (tclStatus != TCL_OK) {
|
||||||
|
snprintf(pBueffel, 131, "ERROR: TransferScript returned: %s",
|
||||||
|
Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));
|
||||||
|
SCWrite(pCon, pBueffel, eError);
|
||||||
|
MacroPop();
|
||||||
|
return HWFault;
|
||||||
|
}
|
||||||
|
MacroPop();
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
/*-------------------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------------------*/
|
||||||
static int isMultiMasterRunning(pCounter self, SConnection *pCon, int *status)
|
static int isMultiMasterRunning(pCounter self, SConnection *pCon, int *status)
|
||||||
{
|
{
|
||||||
@ -241,6 +272,7 @@ static int isMultiMasterRunning(pCounter self, SConnection *pCon, int *status)
|
|||||||
void *data;
|
void *data;
|
||||||
pICountable pCount;
|
pICountable pCount;
|
||||||
float controlVal, tVal;
|
float controlVal, tVal;
|
||||||
|
MonEvent sMon;
|
||||||
|
|
||||||
mID = GetHipadabaNode(self->objectNode,"masterID");
|
mID = GetHipadabaNode(self->objectNode,"masterID");
|
||||||
master = GetHipadabaNode(self->objectNode,"master");
|
master = GetHipadabaNode(self->objectNode,"master");
|
||||||
@ -291,6 +323,16 @@ static int isMultiMasterRunning(pCounter self, SConnection *pCon, int *status)
|
|||||||
default:
|
default:
|
||||||
*status = HWBusy;
|
*status = HWBusy;
|
||||||
UpdateHipadabaPar(myStatus,MakeHdbText("run"),pCon);
|
UpdateHipadabaPar(myStatus,MakeHdbText("run"),pCon);
|
||||||
|
if (self->iCallbackCounter > 20) {
|
||||||
|
MultiSecTransfer(self,pCon);
|
||||||
|
sMon.fCurrent = controlVal;
|
||||||
|
sMon.fPreset = GetCounterPreset(self);
|
||||||
|
sMon.pName = self->name;
|
||||||
|
InvokeCallBack(self->pCall, MONITOR, &sMon);
|
||||||
|
self->iCallbackCounter = 0;
|
||||||
|
} else {
|
||||||
|
self->iCallbackCounter++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -360,7 +402,7 @@ static void multiEndCounting(pCounter self, SConnection *pCon)
|
|||||||
|
|
||||||
InvokeCallBack(self->pCall, COUNTEND, NULL);
|
InvokeCallBack(self->pCall, COUNTEND, NULL);
|
||||||
ReleaseCountLock(self->pCountInt);
|
ReleaseCountLock(self->pCountInt);
|
||||||
|
MultiSecTransfer(self,pCon);
|
||||||
|
|
||||||
}
|
}
|
||||||
/*-------------------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------------------*/
|
||||||
@ -385,32 +427,6 @@ static int MultiSecStatus(void *pData, SConnection * pCon)
|
|||||||
|
|
||||||
return HWIdle;
|
return HWIdle;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
|
||||||
static int MultiSecTransfer(void *pData, SConnection * pCon)
|
|
||||||
{
|
|
||||||
int i, retVal = OKOK, tclStatus;
|
|
||||||
char pBueffel[132];
|
|
||||||
pCounter pCount = NULL;
|
|
||||||
pHdb transfer;
|
|
||||||
|
|
||||||
pCount = (pCounter) pData;
|
|
||||||
|
|
||||||
transfer = GetHipadabaNode(pCount->objectNode,"transfer");
|
|
||||||
if(transfer != NULL){
|
|
||||||
MacroPush(pCon);
|
|
||||||
tclStatus = Tcl_Eval(InterpGetTcl(pServ->pSics), transfer->value.v.text);
|
|
||||||
if (tclStatus != TCL_OK) {
|
|
||||||
snprintf(pBueffel, 131, "ERROR: TransferScript returned: %s",
|
|
||||||
Tcl_GetStringResult(InterpGetTcl(pServ->pSics)));
|
|
||||||
SCWrite(pCon, pBueffel, eError);
|
|
||||||
MacroPop();
|
|
||||||
return HWFault;
|
|
||||||
}
|
|
||||||
MacroPop();
|
|
||||||
}
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
Forward unknown commands to the master counter
|
Forward unknown commands to the master counter
|
||||||
-----------------------------------------------------------------------------*/
|
-----------------------------------------------------------------------------*/
|
||||||
|
Reference in New Issue
Block a user