- introduced header file dependency check

- improvements in ease drivers
- no "Counting finished" message in tas scan
This commit is contained in:
zolliker
2009-11-10 10:40:14 +00:00
parent 4aca8c9e94
commit 3021eda66f
10 changed files with 59 additions and 40 deletions

4
ease.c
View File

@ -92,7 +92,7 @@ void EaseWriteError(EaseBase * eab)
case EASE_DEV_CHANGED:
ParPrintf(eab, eError, "ERROR: controller was exchanged on %s",
eab->p.name);
EaseStop(eab);
/* EaseStop(eab); */
break;
case EASE_FAULT:
ParPrintf(eab, eError, "ERROR: error on %s", eab->p.name);
@ -268,7 +268,9 @@ int EaseHandler(EaseBase * eab)
eab->state = EASE_notconnected;
return 0;
} else {
if (eab->tmo > 20) {
eab->tmo = 20;
}
snprintf(eab->msg, sizeof eab->msg,
"get a first answer from %s", eab->p.name);
eab->state = EASE_idle;

View File

@ -80,8 +80,18 @@ int HaakeHandler(void *object)
}
goto quit;
}
if (iret == 1) {
ParPrintf(eab, -2, "ans: %s", eab->ans);
if (eab->state == EASE_lost) {
if (strcmp(eab->ans, "F001") == 0) {
EaseWrite(eab, "V");
}
goto quit;
}
l = strlen(eab->ans) - 1;
if (l >= 0 && eab->ans[l] != '$') { /* end char is not $ -> send again */
if (l >= 0 && eab->ans[l] != '$') {
/* end char is not $ -> send again */
ParPrintf(eab, -2, "ans: %s", eab->ans);
if (drv->errcnt < 10) {
eab->state = EASE_read;
@ -95,8 +105,8 @@ int HaakeHandler(void *object)
} else {
drv->errcnt = 0;
}
if (iret == 1) {
ParPrintf(eab, -2, "ans: %s", eab->ans);
if (eab->state == EASE_lost) {
goto quit;
} else if (eab->cmd[0] == 'V') {
@ -112,7 +122,7 @@ int HaakeHandler(void *object)
eab->state = EASE_idle;
goto quit;
} else {
eab->tmo = 120;
/* eab->tmo = 20; no need to change the timeout ? */
}
}
if (iret != 1) {
@ -126,12 +136,10 @@ int HaakeHandler(void *object)
eab->state = EASE_lost;
}
} else if (eab->state == EASE_lost) {
/*
if (time(NULL) > eab->cmdtime) {
EaseWrite(eab, "check");
eab->state = EASE_lost;
}
*/
}
goto quit;
error:

View File

@ -59,11 +59,14 @@ int LinaHandler(void *object)
if (iret == 1) {
ParPrintf(eab, -2, "ans: %s", eab->ans);
if (eab->state == EASE_lost) {
if (strcmp(eab->ans, "6,0") == 0) {
EaseWrite(eab, "ID");
}
goto quit;
} else if (strncmp(eab->cmd, "ID", 2) == 0) {
if (strcmp(eab->ans, eab->version) == 0) {
/* we are still connected with the same device */
} else if (*eab->version == '\0') {
} else if (*eab->version == '\0' && strcmp(eab->ans, "7265") == 0) {
strncat(eab->version, eab->ans, sizeof(eab->version) - 1);
} else { /* version (and therefore device) changed */
eab->errCode = EASE_DEV_CHANGED;
@ -73,7 +76,7 @@ int LinaHandler(void *object)
eab->state = EASE_idle;
goto quit;
} else {
eab->tmo = 120;
eab->tmo = 10;
}
}
if (iret != 1) {
@ -87,12 +90,10 @@ int LinaHandler(void *object)
eab->state = EASE_lost;
}
} else if (eab->state == EASE_lost) {
/*
if (time(NULL) > eab->cmdtime) {
EaseWrite(eab, "RS");
eab->state = EASE_lost;
}
*/
}
goto quit;
error:

View File

@ -257,6 +257,7 @@ static void Lsc370ParDef(void *object)
ParName("maxPower");
ParTail("mW");
power = Lsc370Power(drv, 100.0);
ParFmt("%.0g");
ParFloat(&power, 0.0);
ParName("power");
@ -349,9 +350,11 @@ static long Lsc370Read(long pc, void *object)
goto skipHtrRng;
if (1 == sscanf(eab->ans, "%d", &rng)) {
drv->htrRange = rng;
/*
if (rng == 0) {
drv->set = 0;
}
*/
}
skipHtrRng:

View File

@ -37,8 +37,7 @@ libpsi.a: $(OBJ)
ranlib libpsi.a
clean:
rm -f *.a
rm -f *.o
rm -f *.a *.o *.d
SINQOPT=-DGRAPH_MHC3 -DUSE_MULTICAST -DSEND_PORT=0xABCB -DSERVER_HOST="\"acslg1\""
dgrambroadcast.o: dgrambroadcast.h dgrambroadcast.c

View File

@ -11,9 +11,11 @@ include ../sllinux_def
CC = gcc
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -Ihardsup \
-I.. -DCYGNUS -DNONINTF -g $(DFORTIFY) \
-I.. -MMD -DCYGNUS -DNONINTF -g $(DFORTIFY) \
-Wall -Wno-unused -Wunused-value -Wno-comment -Wno-switch -Werror
EXTRA=nintf.o
include make_gen
-include $(OBJ:.o=.d)

View File

@ -100,7 +100,7 @@ int OxiHandler(void *object)
goto quit;
} else if (eab->cmd[2] == 'k') { /* ?ck */
} else {
eab->tmo = 120;
eab->tmo = 120; /* long timeout: the user may block the response with the adjust keys */
if (eab->syntax <= -8) {
corr = OxiCorrect(eab->ans);
if (corr) {

View File

@ -25,6 +25,7 @@ Markus Zolliker, March 2005
#define ILLPRIV -5
#define BADLOG -6
#define UNKPAR -7
#define PARUNDEF -8
typedef enum { NO_OP, FMT_OP, SET_OP, GET_OP, INIT_OP } ParOp;
@ -392,11 +393,10 @@ static int ParOutError(SConnection * con, ParData * o)
SCPrintf(con, eError, "ERROR: %s %s is unknown", o->name,
ctx->thisPar);
break;
/*
case BUSY:
SCPrintf(con, eError, "ERROR: %s busy", o->name);
case PARUNDEF:
SCPrintf(con, eError, "ERROR: %s %s is undefined",
o->name, ctx->thisPar);
break;
*/
default:
if (ctx->returnValue < 0) {
return -1;
@ -1199,10 +1199,11 @@ void ParFloat(float *value, float defValue)
case FMT_OP:
if (*value == PAR_NAN) {
ctx->fmt = NULL;
ParOut(""); /* undefined */
/* ctx->returnValue = PARUNDEF; */
ParOut("");
} else {
if (ctx->fmt == NULL) {
ctx->fmt = "%#.5g";
ctx->fmt = "%.5g";
}
snprintf(buf, sizeof buf, ctx->fmt, *value);
ctx->fmt = NULL;
@ -1249,6 +1250,7 @@ void ParInt(int *value, int defValue)
/* fall through */
case FMT_OP:
if (*value == PAR_LNAN) {
/* ctx->returnValue = PARUNDEF; */
ParOut(""); /* undefined */
} else {
snprintf(buf, sizeof buf, "%d", *value);

View File

@ -745,7 +745,7 @@ static int TASScanCount(pScanData self, int iPoint)
*/
fVal = GetCounterPreset(self->pCounterData);
eOld = GetStatus();
status = DoCount(self->pCounterData, fVal, self->pCon, 1);
status = DoCount(self->pCounterData, fVal, self->pCon, 2);
iRet = Wait4Success(GetExecutor());
if (iRet == DEVINT) {
SCWrite(self->pCon, "Counting aborted due to Interrupt", eLog);
@ -1322,6 +1322,10 @@ int TASScan(SConnection * pCon, SicsInterp * pSics, void *pData,
if (!SCMatchRights(pCon, usUser))
return 0;
if (pTAS->pScan->iActive) {
SCWrite(pCon, "ERROR: a scan is still running", eError);
return 0;
}
/*
check if we are a fast scan or a normal scan
*/

View File

@ -113,9 +113,7 @@ int TecsWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
assert(pD);
pMe = pD->pPrivate;
assert(pMe);
strcpy(pBueffel, " ");
strcat(pBueffel, argv[1]);
strcat(pBueffel, " ");
snprintf(pBueffel, sizeof pBueffel, " %s ", argv[1]);
strtolower(pBueffel);
if (0 == strcmp(pBueffel, " targetvalue ")) {
if (argc == 2) {