- Fixed a bug in countersec.c which prevented counting in monitor mode
- Fixes to make the second generation velocity selector driver work - Modified obpar.c to allow parameter changes while running. This makes it possible to collect data at TRICS while cooling down.
This commit is contained in:
@ -228,7 +228,7 @@ static int SecCtrSetMode(pCounter self, CounterMode eNew)
|
||||
v = MakeHdbText("timer");
|
||||
break;
|
||||
case ePreset:
|
||||
v = MakeHdbText("timer");
|
||||
v = MakeHdbText("monitor");
|
||||
break;
|
||||
}
|
||||
return SetHipadabaPar(node,v,NULL);
|
||||
|
1
devser.c
1
devser.c
@ -243,6 +243,7 @@ int DevQueue(DevSer * devser, void *actionData, DevPrio prio,
|
||||
prio = NullPRIO + 1;
|
||||
if (prio >= NumberOfPRIO)
|
||||
prio = NumberOfPRIO - 1;
|
||||
|
||||
ptr2Last = &devser->actions;
|
||||
for (action = devser->actions; action != NULL && action->prio >= prio;
|
||||
action = action->next) {
|
||||
|
6
exeman.c
6
exeman.c
@ -515,7 +515,11 @@ static int handleBatchPath(pExeMan self, SConnection * pCon, int argc,
|
||||
free(self->batchPath);
|
||||
}
|
||||
self->batchPath = strdup(argv[2]);
|
||||
SCSendOK(pCon);
|
||||
if(self->batchPath[0] != '/'){
|
||||
SCPrintf(pCon,eLog, "WARNING: batchpath %s not an absolute path", argv[2]);
|
||||
} else {
|
||||
SCSendOK(pCon);
|
||||
}
|
||||
SCparChange(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
|
10
motor.c
10
motor.c
@ -992,7 +992,7 @@ int MotorCreate(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
|
||||
/* a first check */
|
||||
if (argc < 3) {
|
||||
SCWrite(pCon, "Insufficient arguments for motor creation", eError);
|
||||
SCWrite(pCon, "Insufficient arguments for motor creation", eLogError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1009,7 +1009,7 @@ int MotorCreate(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
pNew = MotorInit("SIM", argv[1], pDriver);
|
||||
if (!pNew) {
|
||||
sprintf(pBueffel, "Failure to create motor %s", argv[1]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SCWrite(pCon, pBueffel, eLogError);
|
||||
return 0;
|
||||
}
|
||||
} else if (strcmp(argv[2], "tclmot") == 0) {
|
||||
@ -1021,7 +1021,7 @@ int MotorCreate(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
pNew = MotorInit("TCLMOT", argv[1], pDriver);
|
||||
if (!pNew) {
|
||||
sprintf(pBueffel, "Failure to create motor %s", argv[1]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SCWrite(pCon, pBueffel, eLogError);
|
||||
return 0;
|
||||
}
|
||||
} else if (strcmp(argv[2], "regress") == 0) {
|
||||
@ -1033,7 +1033,7 @@ int MotorCreate(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
pNew = MotorInit("regress", argv[1], pDriver);
|
||||
if (!pNew) {
|
||||
sprintf(pBueffel, "Failure to create motor %s", argv[1]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SCWrite(pCon, pBueffel, eLogError);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
@ -1044,7 +1044,7 @@ int MotorCreate(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
if (pNew == NULL) {
|
||||
sprintf(pBueffel, "Motor Type %s not recognized for motor %s",
|
||||
argv[2], argv[1]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SCWrite(pCon, pBueffel, eLogError);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
7
obpar.c
7
obpar.c
@ -39,12 +39,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "Scommon.h"
|
||||
#include "sics.h"
|
||||
#include "fortify.h"
|
||||
#include "conman.h"
|
||||
#include "status.h"
|
||||
#include "obpar.h"
|
||||
|
||||
#include "devexec.h"
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
int ObParLength(ObPar * self)
|
||||
@ -175,8 +175,7 @@ int ObParSet(ObPar * self, char *obname, char *name, float fVal,
|
||||
}
|
||||
|
||||
/* are we running? */
|
||||
eStat = GetStatus();
|
||||
if (!((eStat == eEager) || (eStat == eBatch))) {
|
||||
if(DevExecLevelRunning(pServ->pExecutor, RUNDRIVE)){
|
||||
sprintf(pBueffel, "ERROR: Cannot change parameter while running");
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
|
@ -520,7 +520,7 @@ static int SctMatchNode(void *vNode, void *vData)
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the read callback for nodes particpating in the
|
||||
* This is the read callback for nodes participating in the
|
||||
* scriptcontext system
|
||||
*/
|
||||
static hdbCallbackReturn SctMainCallback(Hdb * node, void *userData,
|
||||
@ -967,7 +967,7 @@ void SctQueueNode(SctController * controller, Hdb * node,
|
||||
SctData *data;
|
||||
hdbCallback *cb;
|
||||
|
||||
if (!FindHdbCallbackData(node, controller)) {
|
||||
if (!FindHdbCallbackData(node, controller) && strcmp(action,"read") == 0) {
|
||||
cb = MakeHipadabaCallback(SctMainCallback, controller, NULL);
|
||||
assert(cb);
|
||||
AppendHipadabaCallback(node, cb);
|
||||
|
@ -149,8 +149,7 @@ static long SCTDRIVSetValue(void *data, SConnection * pCon, float val)
|
||||
|
||||
StopByData(pServ->pExecutor, data);
|
||||
|
||||
v.dataType = HIPFLOAT;
|
||||
v.v.doubleValue = (double) val;
|
||||
v = MakeHdbFloat(val);
|
||||
SetHdbProperty(self->objectNode, "writestatus", "start");
|
||||
status = SetHipadabaPar(self->objectNode, v, pCon);
|
||||
if (status == 1) {
|
||||
|
@ -121,7 +121,7 @@ static int ConfigureCmd(pSICSOBJ self, SConnection * pCon,
|
||||
GetHipadabaPar(par[1], &v, pCon);
|
||||
mot = (pMotor) FindCommandData(pServ->pSics, v.v.text, "Motor");
|
||||
if (mot == NULL) {
|
||||
SCPrintf(pCon, eError, "ERROR: fialed to locate motor %s", v.v.text);
|
||||
SCPrintf(pCon, eLogError, "ERROR: failed to locate motor %s", v.v.text);
|
||||
return 0;
|
||||
}
|
||||
switch (mf) {
|
||||
|
@ -42,8 +42,9 @@ static hdbCallbackReturn tiltCallback(pHdb node, void *userData,
|
||||
val = tilt->pDrivInt->GetValue(tilt,pServ->dummyCon);
|
||||
}
|
||||
node->value.v.doubleValue = val;
|
||||
return hdbContinue;
|
||||
}
|
||||
if((set = GetHdbGetMessage(message)) != NULL){
|
||||
if((set = GetHdbSetMessage(message)) != NULL){
|
||||
if(set->callData != NULL){
|
||||
pCon = (SConnection *)set->callData;
|
||||
} else {
|
||||
@ -98,7 +99,7 @@ int MakeSecNVS(SConnection * pCon, SicsInterp * pSics,
|
||||
{
|
||||
pMotor tilt = NULL;
|
||||
pSICSOBJ pNew = NULL;
|
||||
SctController *sct = NULL;
|
||||
pSICSOBJ sct = NULL;
|
||||
pHdb node = NULL, tilli;
|
||||
int status;
|
||||
|
||||
@ -115,7 +116,7 @@ int MakeSecNVS(SConnection * pCon, SicsInterp * pSics,
|
||||
return 0;
|
||||
}
|
||||
|
||||
sct = (SctController *)FindCommandData(pSics, argv[3],"ScriptContext");
|
||||
sct = (pSICSOBJ)FindCommandData(pSics, argv[3],"SctController");
|
||||
if(sct == NULL){
|
||||
SCPrintf(pCon,eError, "ERROR: scriptcontext %s not found", argv[3]);
|
||||
return 0;
|
||||
@ -125,7 +126,7 @@ int MakeSecNVS(SConnection * pCon, SicsInterp * pSics,
|
||||
SetHdbProperty(node,"sicsdev",argv[1]);
|
||||
SetHdbProperty(node,"priv", "user");
|
||||
|
||||
pNew = MakeSctDriveObj(node, "NVS", sct, 0);
|
||||
pNew = MakeSctDriveObj(node, "NVS", sct->pPrivate, 0);
|
||||
if(pNew == NULL || node == NULL){
|
||||
SCWrite(pCon,"ERROR: failed to create NVS, out of memory?",
|
||||
eError);
|
||||
|
Reference in New Issue
Block a user