- Many fixes to tas code

- fixes to amor writing and status code
- edited ecbcounter to stop at no beam
- updated documentation
- fixed a bug in project code affecting SANS
This commit is contained in:
cvs
2003-05-05 07:49:26 +00:00
parent 4ca2fcff60
commit 4ebf207325
25 changed files with 271 additions and 102 deletions

11
A1931.c
View File

@@ -12,6 +12,7 @@
#include <time.h>
#include <math.h>
#include <assert.h>
#include <unistd.h>
#include "fortify.h"
#include "sics.h"
#include "obpar.h"
@@ -20,13 +21,15 @@
#include "evdriver.i"
#include "gpibcontroller.h"
#include "A1931.h"
/*========================== private data structure ====================*/
typedef struct {
int sensor; /* the control sensor */
pGPIB gpib; /* the GPIB interface to use in order to talk to the thing*/
int gpibAddress; /* address on bus */
int devID; /* deviceID of the controller on the GPIB */
char errorBuffer[132]; /* a buffer for error meesages from the thing*/
char errorBuffer[132]; /* a buffer for error messages from the thing*/
char commandLine[132]; /* buffer to keep the offending command line */
int errorCode; /* error indicator */
}A1931, *pA1931;
/*============================ defines ================================*/
@@ -263,11 +266,13 @@ static int downloadFile(pA1931 self, FILE *fd){
pPtr = GPIBreadTillTerm(self->gpib,self->devID,10);
if(pPtr[0] == '#'){
self->errorCode = A1931ERROR;
strcpy(self->errorBuffer,pPtr);
strncpy(self->errorBuffer,pPtr,131);
strncpy(self->commandLine,buffer,131);
free(pPtr);
return 0;
}
free(pPtr);
usleep(50);
}
return 1;
}
@@ -327,6 +332,8 @@ int A1931Action(SConnection *pCon, SicsInterp *pSics, void *pData,
A1931error(pEV->pDriv,&iCode,error,131);
sprintf(buffer,"%s while transfering file", error);
SCWrite(pCon,buffer,eError);
sprintf(buffer,"Offending command: %s",self->commandLine);
SCWrite(pCon,buffer,eError);
return 0;
}
SCSendOK(pCon);