From f11384ad2fe1761c6728de6e747bad83e9c8be8b Mon Sep 17 00:00:00 2001 From: koennecke Date: Tue, 5 Jul 2005 07:06:16 +0000 Subject: [PATCH] - DMC McStas simulation working --- amorstat.c | 1 - nxamor.c | 8 +++++--- pimotor.c | 14 +++++++------- polterwrite.c | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/amorstat.c b/amorstat.c index 9fce747..4c75328 100644 --- a/amorstat.c +++ b/amorstat.c @@ -755,7 +755,6 @@ fTime = GetHistTimeBin(self->pHM,&nTime); iDim[i3] = nTime; i3++; - assert(i3 == 3); /* check limits */ if(x2 < x1){ diff --git a/nxamor.c b/nxamor.c index 70cb071..851e716 100644 --- a/nxamor.c +++ b/nxamor.c @@ -90,18 +90,20 @@ static int psdSave = 1; iRet = NXopen(file,NXACC_CREATE5,&hfil); if(iRet != NX_OK) { - sprintf(pBueffel,"ERROR: cannot open file %s for writing",file); + snprintf(pBueffel,511,"ERROR: cannot open file %s for writing",file); SCWrite(pCon,pBueffel,eError); return 0; } iRet = NXDinitfromfile(AMORDICT,&hdict); if(iRet != NX_OK) { - sprintf(pBueffel,"ERROR: cannot open dictionary file %s",AMORDICT); + snprintf(pBueffel,511,"ERROR: cannot open dictionary file %s",AMORDICT); SCWrite(pCon,pBueffel,eError); return 0; } - + snprintf(pBueffel,511,"Writing to: %s", file); + SCWrite(pCon,pBueffel,eWarning); + /* put some global information */ SNXSPutGlobals(hfil,file,"AMOR",pCon); SNXSPutVariable(pServ->pSics,pCon,hfil, hdict,"etitle","title"); diff --git a/pimotor.c b/pimotor.c index 4d26bcd..d162237 100644 --- a/pimotor.c +++ b/pimotor.c @@ -310,7 +310,7 @@ memset(pNew,0,sizeof(C804Driv)); /* connection parameters */ - pPar = Tcl_GetVar2(pTcl,pArray,"Computer",TCL_GLOBAL_ONLY); + pPar = Tcl_GetVar2(pTcl,pArray,"Computer",TCL_LEAVE_ERR_MSG); if(!pPar) { Tcl_SetResult(pTcl,"Failed to find serial port server host name",NULL); @@ -320,7 +320,7 @@ pNew->hostname = strdup(pPar); pPar = NULL; - pPar = Tcl_GetVar2(pTcl,pArray,"port",TCL_GLOBAL_ONLY); + pPar = Tcl_GetVar2(pTcl,pArray,"port",TCL_LEAVE_ERR_MSG); if(!pPar) { Tcl_SetResult(pTcl,"Failed to find serial port server port adress",NULL); @@ -337,7 +337,7 @@ pNew->iPort = iVal; pPar = NULL; - pPar = Tcl_GetVar2(pTcl,pArray,"channel",TCL_GLOBAL_ONLY); + pPar = Tcl_GetVar2(pTcl,pArray,"channel",TCL_LEAVE_ERR_MSG); if(!pPar) { Tcl_SetResult(pTcl,"Failed to find serial port server channel adress",NULL); @@ -354,7 +354,7 @@ pNew->iChannel = iVal; pPar = NULL; - pPar = Tcl_GetVar2(pTcl,pArray,"motor",TCL_GLOBAL_ONLY); + pPar = Tcl_GetVar2(pTcl,pArray,"motor",TCL_LEAVE_ERR_MSG); if(!pPar) { Tcl_SetResult(pTcl,"Failed to find motor number",NULL); @@ -372,7 +372,7 @@ /* limits */ pPar = NULL; - pPar = Tcl_GetVar2(pTcl,pArray,"lowerlimit",TCL_GLOBAL_ONLY); + pPar = Tcl_GetVar2(pTcl,pArray,"lowerlimit",TCL_LEAVE_ERR_MSG); if(!pPar) { Tcl_SetResult(pTcl,"Failed to find lower motor limit",NULL); @@ -389,7 +389,7 @@ pNew->fLower = dVal; pPar = NULL; - pPar = Tcl_GetVar2(pTcl,pArray,"upperlimit",TCL_GLOBAL_ONLY); + pPar = Tcl_GetVar2(pTcl,pArray,"upperlimit",TCL_LEAVE_ERR_MSG); if(!pPar) { Tcl_SetResult(pTcl,"Failed to find upper motor limit",NULL); @@ -423,7 +423,7 @@ SerialConfig(&pNew->pSerial,0); sprintf(pCommand,"%1.1dMN\r",pNew->iMotor); SerialWriteRead(&pNew->pSerial,pCommand,pReply,39); - SerialConfig(&pNew->pSerial,iTmo); + SerialConfig(&pNew->pSerial,iTmo+5000); /* configure the connection */ SerialATerm(&pNew->pSerial,"1\x03"); diff --git a/polterwrite.c b/polterwrite.c index 14159dd..061a3c1 100644 --- a/polterwrite.c +++ b/polterwrite.c @@ -716,7 +716,7 @@ int PolterInstall(SConnection *pCon, SicsInterp *pSics, AddCommand(pSics,"storedata",PolterAction,KillPolterdi,pNew); return 1; - + } /*----------------------------------------------------------------------*/