- Cleaned all old dtatus setting code
This commit is contained in:
13
drive.c
13
drive.c
@ -302,19 +302,16 @@ int DriveWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
}
|
||||
|
||||
/* interprete arguments as pairs name value and try to start */
|
||||
SetStatus(eDriving);
|
||||
for (i = 1; i < argc; i += 2) {
|
||||
if (argv[i + 1] == NULL) {
|
||||
snprintf(pBueffel, 511, "ERROR: no value found for driving %s", argv[i]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
iRet = Tcl_GetDouble(tcl_interp, argv[i + 1], &dTarget);
|
||||
if (iRet == TCL_ERROR) {
|
||||
SCWrite(pCon, Tcl_GetStringResult(tcl_interp), eError);
|
||||
StopExe(GetExecutor(), "ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
iRet = Start2Run(pCon, pSics, argv[i], RUNDRIVE, dTarget);
|
||||
@ -328,7 +325,6 @@ int DriveWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
}
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
StopExe(GetExecutor(), "ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -351,17 +347,14 @@ int DriveWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
sprintf(pBueffel, "Driving finished with problem");
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
ClearExecutor(GetExecutor());
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
} else if (iRet == DEVINT) {
|
||||
sprintf(pBueffel, "ERROR: Driving Interrupted!");
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
ClearExecutor(GetExecutor());
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
SCWrite(pCon, "Driving finished sucessfully", eValue);
|
||||
SetStatus(eOld);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -399,19 +392,16 @@ int RunWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
}
|
||||
|
||||
/* interprete arguments as pairs name value and try to start */
|
||||
SetStatus(eDriving);
|
||||
for (i = 1; i < argc; i += 2) {
|
||||
if (argv[i + 1] == NULL) {
|
||||
snprintf(pBueffel,511, "ERROR: no value found for driving %s", argv[i]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
iRet = Tcl_GetDouble(tcl_interp, argv[i + 1], &dTarget);
|
||||
if (iRet == TCL_ERROR) {
|
||||
SCWrite(pCon, Tcl_GetStringResult(tcl_interp), eError);
|
||||
StopExe(GetExecutor(), "ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
iRet = Start2Run(pCon, pSics, argv[i], RUNRUN, dTarget);
|
||||
@ -420,7 +410,6 @@ int RunWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
argv[i + 1]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
StopExe(GetExecutor(), "ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -466,14 +455,12 @@ int MoveWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
if (argv[i + 1] == NULL) {
|
||||
snprintf(pBueffel,511, "ERROR: no value found for driving %s", argv[i]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
iRet = Tcl_GetDouble(tcl_interp, argv[i + 1], &dTarget);
|
||||
if (iRet == TCL_ERROR) {
|
||||
SCWrite(pCon, Tcl_GetStringResult(tcl_interp), eError);
|
||||
StopExe(GetExecutor(), "ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
obj = FindCommandData(pSics,argv[i],NULL);
|
||||
|
Reference in New Issue
Block a user