- Reworked the connection object and the IO system

- Reworked the support for TRICS
- Added a second generation motor
This commit is contained in:
koennecke
2009-02-03 08:05:39 +00:00
parent f6d595665e
commit 361ee9ebea
119 changed files with 16455 additions and 3674 deletions

View File

@ -99,14 +99,14 @@ void WriteTemplate(FILE *fd, FILE *temp, char *filename, pScanData pScan,
if(!pCom)
{
sprintf(pError,"ERROR: variable %s NOT found",pName);
SCWrite(pCon,pError,eError);
SCWrite(pCon,pError,eLogError);
continue;
}
pVar = (pSicsVariable)pCom->pData;
if(!pVar)
{
sprintf(pError,"ERROR: variable %s NOT found",pName);
SCWrite(pCon,pError,eError);
SCWrite(pCon,pError,eLogError);
continue;
}
switch(pVar->eType)
@ -143,21 +143,21 @@ void WriteTemplate(FILE *fd, FILE *temp, char *filename, pScanData pScan,
if(!pCom)
{
sprintf(pError,"ERROR: variable %s NOT found",pName);
SCWrite(pCon,pError,eError);
SCWrite(pCon,pError,eLogError);
continue;
}
pDum = (pDummy)pCom->pData;
if(!pDum)
{
sprintf(pError,"ERROR: variable %s is NOT drivable",pName);
SCWrite(pCon,pError,eError);
SCWrite(pCon,pError,eLogError);
continue;
}
pDriv = (pIDrivable)pDum->pDescriptor->GetInterface(pDum,DRIVEID);
if(!pDriv)
{
sprintf(pError,"ERROR: variable %s is NOT drivable",pName);
SCWrite(pCon,pError,eError);
SCWrite(pCon,pError,eLogError);
continue;
}
fVal = pDriv->GetValue(pDum,pCon);
@ -182,13 +182,13 @@ void WriteTemplate(FILE *fd, FILE *temp, char *filename, pScanData pScan,
if(!pMot)
{
sprintf(pError,"ERROR: motor %s NOT found",pName);
SCWrite(pCon,pError,eError);
SCWrite(pCon,pError,eLogError);
continue;
}
iRet = MotorGetPar(pMot,"softzero",&fVal);
if(!iRet)
{
SCWrite(pCon,"ERROR: failed to read zero point",eError);
SCWrite(pCon,"ERROR: failed to read zero point",eLogError);
continue;
}
fprintf(fd,"%s %f\n",pBuffer,fVal);
@ -215,7 +215,7 @@ void WriteTemplate(FILE *fd, FILE *temp, char *filename, pScanData pScan,
{
SCWrite(pCon,"ERROR: failed to execute Tcl command",eError);
strncpy(pBuffer, Tcl_GetStringResult(InterpGetTcl(pSics)), 511);
SCWrite(pCon,pBuffer,eError);
SCWrite(pCon,pBuffer,eLogError);
continue;
}
}
@ -273,7 +273,7 @@ void WriteTemplate(FILE *fd, FILE *temp, char *filename, pScanData pScan,
self->fd = fopen(self->pFile,"w");
if(!self->fd)
{
SCWrite(self->pCon,"ERROR: cannot write data file",eError);
SCWrite(self->pCon,"ERROR: cannot write data file",eLogError);
return 0;
}
@ -281,7 +281,7 @@ void WriteTemplate(FILE *fd, FILE *temp, char *filename, pScanData pScan,
fd = fopen(self->pHeaderFile,"r");
if(!fd)
{
SCWrite(self->pCon,"ERROR: cannot open header description file",eError);
SCWrite(self->pCon,"ERROR: cannot open header description file",eLogError);
return 0;
}
@ -513,7 +513,7 @@ void WriteTemplate(FILE *fd, FILE *temp, char *filename, pScanData pScan,
{
SCWrite(self->pCon,
"ERROR: Failed to reopen scan file, aborting scan",
eError);
eLogError);
return 0;
}
@ -615,13 +615,13 @@ int prepareDataFile(pScanData self){
{
SCWrite(self->pCon,
"ERROR: cannot allocate new data filename, Scan aborted",
eError);
eLogError);
self->pCon = NULL;
self->pSics = NULL;
return 0;
}
snprintf(pBueffel,511,"Writing data file: %s ...",pPtr);
SCWrite(self->pCon,pBueffel,eWarning);
SCWrite(self->pCon,pBueffel,eLog);
strcpy(self->pFile,pPtr);
free(pPtr);
return 1;
@ -657,7 +657,7 @@ int prepareDataFile(pScanData self){
{
SCWrite(self->pCon,
"WARNING: Internal error, no scan variable, I try to continue",
eWarning);
eLog);
}
pVar = NULL;
} /* end for */
@ -705,7 +705,7 @@ int prepareDataFile(pScanData self){
{
SCWrite(self->pCon,
"WARNING: Internal error, no scan variable, I try to continue",
eWarning);
eLog);
}
pVar = NULL;
} /* end for */
@ -743,7 +743,7 @@ int prepareDataFile(pScanData self){
{
SCWrite(self->pCon,
"WARNING: Internal error, no scan variable, I try to continue",
eWarning);
eLog);
}
pVar = NULL;
} /* end for */
@ -824,8 +824,8 @@ int prepareDataFile(pScanData self){
strcat(pHead,"\r\n");
strcat(pStatus,"\r\n");
*/
SCWrite(self->pCon,pHead,eWarning);
SCWrite(self->pCon,pStatus,eWarning);
SCWrite(self->pCon,pHead,eLog);
SCWrite(self->pCon,pStatus,eLog);
return 1;
}
@ -904,7 +904,7 @@ int prepareDataFile(pScanData self){
iRet = StartToDrive(self,iPoint);
if(!iRet)
{
SCWrite(self->pCon,"ERROR: Cannot Drive, Scan aborted",eError);
SCWrite(self->pCon,"ERROR: Cannot Drive, Scan aborted",eLogError);
status = 0;
}
else
@ -939,7 +939,7 @@ int prepareDataFile(pScanData self){
iRet = StartToDrive(self,iPoint);
if(!iRet)
{
SCWrite(self->pCon,"ERROR: Cannot Drive, Scan aborted",eError);
SCWrite(self->pCon,"ERROR: Cannot Drive, Scan aborted",eLogError);
status = 0;
}
else
@ -964,7 +964,7 @@ int prepareDataFile(pScanData self){
self->fPreset);
if(!iRet)
{
SCWrite(self->pCon,"ERROR: Cannot Count, Scan aborted",eError);
SCWrite(self->pCon,"ERROR: Cannot Count, Scan aborted",eLogError);
return 0;
}
SetStatus(eCounting);
@ -983,12 +983,12 @@ static pDynString GetStandardInvocation(pScanData self, char *function){
result = CreateDynString(80,80);
if(result == NULL){
SCWrite(self->pCon,"ERROR: out of memory in scan invocation",eError);
SCWrite(self->pCon,"ERROR: out of memory in scan invocation",eLogError);
return NULL;
}
if(StringDictGet(self->scanFunctions,function,value,131) != 1){
snprintf(value,131,"ERROR: scan function %s not found",function);
SCWrite(self->pCon,value,eError);
SCWrite(self->pCon,value,eLogError);
DeleteDynString(result);
return NULL;
}