- do not check running state for changing evvontroller parameters
This commit is contained in:
@ -920,19 +920,32 @@ int EVCGetPar(pEVControl self, char *name, float *fVal)
|
|||||||
int EVCSetPar(pEVControl self, char *name, float fVal, SConnection * pCon)
|
int EVCSetPar(pEVControl self, char *name, float fVal, SConnection * pCon)
|
||||||
{
|
{
|
||||||
ObPar *pPar = NULL;
|
ObPar *pPar = NULL;
|
||||||
char pBueffel[512];
|
|
||||||
int iRet, savedStatus;
|
int iRet, savedStatus;
|
||||||
|
|
||||||
assert(self);
|
assert(self);
|
||||||
assert(pCon);
|
assert(pCon);
|
||||||
|
|
||||||
savedStatus = GetStatus(); /* fool status check in ObParSet (avoid "Cannot change parameter while running" message */
|
/* find the parameter */
|
||||||
SetStatus(eBatch);
|
pPar = ObParFind(self->pParam, name);
|
||||||
iRet = ObParSet(self->pParam, self->pName, name, fVal, pCon);
|
if (pPar == NULL) {
|
||||||
SetStatus(savedStatus);
|
SCPrintf(pCon, eError, "ERROR: %s.%s parameter not found",
|
||||||
if (!iRet) {
|
self->pName, name);
|
||||||
return iRet;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DO NOT CHECK RUNNING STATE, this is not needed */
|
||||||
|
|
||||||
|
/* check permission */
|
||||||
|
if (!SCMatchRights(pCon, pPar->iCode)) {
|
||||||
|
SCPrintf(pCon, eError, "ERROR: Insufficient privilege to change %s.%s",
|
||||||
|
self->pName, name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* passed all tests: do It! */
|
||||||
|
pPar->fVal = fVal;
|
||||||
|
|
||||||
|
iRet = 1;
|
||||||
if (self->iTcl) {
|
if (self->iTcl) {
|
||||||
iRet = UpdateTclVariable(self->pDriv, name, fVal);
|
iRet = UpdateTclVariable(self->pDriv, name, fVal);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user