Merge commit 'refs/merge-requests/1' of ssh://gitorious.psi.ch/sinqdev/sics into merge-requests/1

First merge with ANSTO which compiles

Conflicts:
	SICSmain.c
	asynnet.c
	confvirtualmot.c
	counter.c
	devexec.c
	drive.c
	exebuf.c
	hipadaba.c
	interface.h
	make_gen
	motor.c
	nserver.c
	nwatch.c
	ofac.c
	protocol.c
	sicshipadaba.c
This commit is contained in:
2015-04-23 17:00:33 +02:00
93 changed files with 3977 additions and 1572 deletions

14
drive.c
View File

@ -1,7 +1,7 @@
/*--------------------------------------------------------------------------
Implementation file for the drive command
This version as Test for Device Executor.
Mark Koennecke, December 1996
@ -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"
@ -66,7 +67,7 @@ int Drive(SConnection * pCon, SicsInterp * pInter, char *name, float fNew)
/* check if user is allowed to drive */
if (!SCMatchRights(pCon, usUser)) {
snprintf(pBueffel, 511, "Insuficient Privilege to drive %s", name);
snprintf(pBueffel, 511, "Insufficient Privilege to drive %s", name);
SCWrite(pCon, pBueffel, eError);
return 0;
}
@ -301,7 +302,7 @@ int DriveWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
return 0;
}
/* interprete arguments as pairs name value and try to start */
/* interpret arguments as pairs (name, value) and check */
for (i = 1; i < argc; i += 2) {
if (argv[i + 1] == NULL) {
snprintf(pBueffel, 511, "ERROR: no value found for driving %s", argv[i]);
@ -311,7 +312,12 @@ int DriveWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
iRet = Tcl_GetDouble(tcl_interp, argv[i + 1], &dTarget);
if (iRet == TCL_ERROR) {
SCWrite(pCon, Tcl_GetStringResult(tcl_interp), eError);
StopExe(GetExecutor(), "ALL");
return 0;
} else if (!isfinite(dTarget)) {
snprintf(pBueffel, 511,
"ERROR: target %s value for %s is not a finite number",
argv[i + 1], argv[i]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
iRet = Start2Run(pCon, pSics, argv[i], RUNDRIVE, dTarget);