Merging release 2.0 branch with CVS trunk
r2601 | ffr | 2008-05-30 10:26:57 +1000 (Fri, 30 May 2008) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
4a937e1608
commit
0749b0effa
129
drive.c
129
drive.c
@@ -39,6 +39,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "fortify.h"
|
||||
#include "sics.h"
|
||||
#include "drive.h"
|
||||
@@ -333,32 +334,44 @@
|
||||
|
||||
/* interprete arguments as pairs name value and try to start */
|
||||
SetStatus(eDriving);
|
||||
for(i = 1; i < argc; i+=2)
|
||||
{
|
||||
if(argv[i+1] == NULL)
|
||||
{
|
||||
sprintf(pBueffel,"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],dTarget);
|
||||
if(!iRet)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: cannot run %s to %s",argv[i],argv[i+1]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
StopExe(GetExecutor(),"ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
for(i = 1; i < argc; i+=2) {
|
||||
if(argv[i+1] == NULL)
|
||||
{
|
||||
sprintf(pBueffel,"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);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
} else if (!isfinite(dTarget)) {
|
||||
sprintf(pBueffel,"ERROR: target %s value for %s is not a finite number",
|
||||
argv[i+1], argv[i]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
for(i = 1; i < argc; i+=2) {
|
||||
iRet = Tcl_GetDouble(tcl_interp, argv[i+1], &dTarget);
|
||||
if (iRet == TCL_ERROR) {
|
||||
SCWrite(pCon, Tcl_GetStringResult(tcl_interp), eError);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
iRet = Start2Run(pCon,pSics,argv[i],dTarget);
|
||||
if(!iRet)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: cannot run %s to %s",argv[i],argv[i+1]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
StopExe(GetExecutor(),"ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* wait for completion */
|
||||
@@ -433,32 +446,44 @@
|
||||
|
||||
/* interprete arguments as pairs name value and try to start */
|
||||
SetStatus(eDriving);
|
||||
for(i = 1; i < argc; i+=2)
|
||||
{
|
||||
if(argv[i+1] == NULL)
|
||||
{
|
||||
sprintf(pBueffel,"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],dTarget);
|
||||
if(!iRet)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: cannot run %s to %s",argv[i],argv[i+1]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
StopExe(GetExecutor(),"ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
for(i = 1; i < argc; i+=2) {
|
||||
if(argv[i+1] == NULL)
|
||||
{
|
||||
sprintf(pBueffel,"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);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
} else if (!isfinite(dTarget)) {
|
||||
sprintf(pBueffel,"ERROR: target value %s for %s is not a finite number",
|
||||
argv[i+1], argv[i]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
for(i = 1; i < argc; i+=2) {
|
||||
iRet = Tcl_GetDouble(tcl_interp, argv[i+1], &dTarget);
|
||||
if (iRet == TCL_ERROR) {
|
||||
SCWrite(pCon, Tcl_GetStringResult(tcl_interp), eError);
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
iRet = Start2Run(pCon,pSics,argv[i],dTarget);
|
||||
if(!iRet)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: cannot run %s to %s",argv[i],argv[i+1]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
StopExe(GetExecutor(),"ALL");
|
||||
SetStatus(eOld);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user