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