diff --git a/doc/manager/managerman.dvi b/doc/manager/managerman.dvi index 6795a0c8..077356c0 100644 Binary files a/doc/manager/managerman.dvi and b/doc/manager/managerman.dvi differ diff --git a/doc/manager/managerman.pdf b/doc/manager/managerman.pdf index d262d4f7..90ed39df 100644 Binary files a/doc/manager/managerman.pdf and b/doc/manager/managerman.pdf differ diff --git a/doc/manager/managerman.tex b/doc/manager/managerman.tex index 3a14d8f7..62ce1d11 100644 --- a/doc/manager/managerman.tex +++ b/doc/manager/managerman.tex @@ -24,6 +24,7 @@ CH--5232 Villigen--PSI\\ Switzerland\\ \end{center} \clearpage +\clearpage \tableofcontents \clearpage @@ -1035,10 +1036,10 @@ Currently these drivers are supported: \item[tdc ] for the Risoe histogram memory. \item[mcstas ] for the integration with the McStas (cf.\ Section~\ref{f8}) simulation. \end{description} - Please care to note, that the SINQHM -requires a EL737 counter box for count control. This counter must have been -defined before creating the HM object. \end{description} + Please care to note, that the SINQHM +requires a counter box for count control. This counter must have been +defined before creating the HM object. As an example the configuration of a SINQHM HM with the name banana will be shown: \begin{verbatim} diff --git a/evcontroller.c b/evcontroller.c index 515a2258..e5fbbba9 100644 --- a/evcontroller.c +++ b/evcontroller.c @@ -66,6 +66,7 @@ #include "chadapter.h" #include "status.h" #include "site.h" +#include "commandlog.h" /*--------------------- Functions needed to implement interfaces -----------*/ static long EVIDrive(void *pData, SConnection *pCon, float fVal) { @@ -176,7 +177,7 @@ static int EVIStatus(void *pData, SConnection *pCon) { pEVControl self = NULL; - float fPos, fDelta; + float fPos, fDelta = .0; int iRet, iCode, iFix; char pBueffel[256], pError[132]; static int callCount; @@ -196,7 +197,6 @@ /* get the current position */ iRet = self->pDriv->GetValues(self->pDriv,&self->fTarget,&fPos,&fDelta); - if(iRet == 0) { self->pDriv->GetError(self->pDriv,&iCode, pError,131); @@ -241,7 +241,7 @@ if(callCount >= 10) { sprintf(pBueffel,"%s = %g", self->pName, fPos); - InvokeCallBack(self->pCall, VALUECHANGE,pBueffel); + InvokeCallBack(self->pCall, VALUECHANGE,pBueffel); callCount = 0; } @@ -362,7 +362,7 @@ static void ErrWrite(char *txt, SCStore *conn) /*-----------------------------------------------------------------------*/ static void ErrReport(pEVControl self) { - float fPos, fDelta; + float fPos =.0, fDelta =.0; char pBueffel[256]; self->pDriv->GetValues(self->pDriv,&self->fTarget,&fPos,&fDelta); @@ -550,7 +550,7 @@ static void ErrReport(pEVControl self) pEVControl self = NULL; float fPos, fDelta; int iRet, iCode, iStat; - char pError[10], pBueffel[512]; + char pError[132], pBueffel[512]; pExeList pExe = NULL; SConnection *pCon = NULL; float tol; @@ -607,7 +607,9 @@ static void ErrReport(pEVControl self) /* break down of connection to a environment device has to be considered a problem as well */ - self->pDriv->GetError(self->pDriv, &iCode,pError,9); + memset(pError,0,132*sizeof(char)); + self->pDriv->GetError(self->pDriv, &iCode,pError,131); + WriteToCommandLog("emon>> ",pError); iStat = self->pDriv->TryFixIt(self->pDriv, iCode); if( (iStat == DEVOK) || (iStat == DEVREDO) ) { diff --git a/hmdata.c b/hmdata.c index 4d847951..e506aea4 100644 --- a/hmdata.c +++ b/hmdata.c @@ -320,6 +320,9 @@ static long SumRow(HistInt *iData, int iDataLength, int iStart, int iEnd){ for(i = iStart; i < iEnd; i++){ lSum += iData[i]; } + if(lSum < 0){ + lSum = -lSum; + } return lSum; } /*--------------------------------------------------------------------------*/ @@ -329,7 +332,7 @@ long sumHMDataRectangle(pHistMem hist, SConnection *pCon, pHMdata self = hist->pDriv->data; int i, iHistLength, status, iIndex; char pBueffel[256]; - long lSum; + unsigned long lSum; assert(self); @@ -386,8 +389,11 @@ long sumHMDataRectangle(pHistMem hist, SConnection *pCon, "ERROR: summing in %d dimensions not yet implemented", self->rank); SCWrite(pCon,pBueffel,eError); - lSum = -1; + return -1; break; } + if(lSum < 0){ + lSum = -lSum; + } return lSum; } diff --git a/make_gen b/make_gen index d1b2268e..641f2a3f 100644 --- a/make_gen +++ b/make_gen @@ -46,7 +46,7 @@ full: purge all SICServer: $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) \ $(VELOOBJ) $(DIFIL) $(EXTRA) \ $(SUBLIBS) - $(CC) -pg -o SICServer \ + $(CC) -g -o SICServer \ $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) \ $(VELOOBJ) $(DIFOBJ) $(EXTRA) $(LIBS) diff --git a/mcstas/dmc/DataNumber b/mcstas/dmc/DataNumber index 68a86760..9b513bdd 100644 --- a/mcstas/dmc/DataNumber +++ b/mcstas/dmc/DataNumber @@ -1,3 +1,3 @@ - 98 + 106 NEVER, EVER modify or delete this file You'll risk eternal damnation and a reincarnation as a cockroach!|n \ No newline at end of file diff --git a/mcstas/dmc/vdmcstatus.tcl b/mcstas/dmc/vdmcstatus.tcl index b13c25c8..d93288ef 100644 --- a/mcstas/dmc/vdmcstatus.tcl +++ b/mcstas/dmc/vdmcstatus.tcl @@ -1,210 +1,3 @@ -exe batchpath ./ -exe syspath ./ -sample_mur 0.000000 -sample_mur setAccess 2 -email UNKNOWN -email setAccess 2 -fax UNKNOWN -fax setAccess 2 -phone UNKNOWN -phone setAccess 2 -adress UNKNOWN -adress setAccess 2 -sicsdatapostfix .hdf -sicsdatapostfix setAccess 0 -sicsdataprefix powder -sicsdataprefix setAccess 0 -starttime 2005-08-16 16:46:50 -starttime setAccess 2 -comment3 UNKNOWN -comment3 setAccess 2 -comment2 UNKNOWN -comment2 setAccess 2 -comment1 UNKNOWN -comment1 setAccess 2 -sampleintern na2ca3al2f14 -sampleintern setAccess 2 -collimation UNKNOWN -collimation setAccess 2 -user UNKNOWN -user setAccess 2 -title UNKNOWN -title setAccess 2 -# Motor a9 -a9 sign 1.000000 -a9 SoftZero 0.000000 -a9 SoftLowerLim 0.000000 -a9 SoftUpperLim 20.000000 -a9 Fixed -1.000000 -a9 InterruptMode 0.000000 -a9 precision 0.010000 -a9 AccessCode 2.000000 -a9 movecount 10.000000 -# Motor a8 -a8 sign 1.000000 -a8 SoftZero 0.000000 -a8 SoftLowerLim -30.000000 -a8 SoftUpperLim 30.000000 -a8 Fixed -1.000000 -a8 InterruptMode 0.000000 -a8 precision 0.010000 -a8 AccessCode 2.000000 -a8 movecount 10.000000 -# Motor a7 -a7 sign 1.000000 -a7 SoftZero 0.000000 -a7 SoftLowerLim -30.000000 -a7 SoftUpperLim 30.000000 -a7 Fixed -1.000000 -a7 InterruptMode 0.000000 -a7 precision 0.010000 -a7 AccessCode 2.000000 -a7 movecount 10.000000 -# Motor a6 -a6 sign 1.000000 -a6 SoftZero 0.000000 -a6 SoftLowerLim -30.000000 -a6 SoftUpperLim 30.000000 -a6 Fixed -1.000000 -a6 InterruptMode 0.000000 -a6 precision 0.010000 -a6 AccessCode 2.000000 -a6 movecount 10.000000 -# Motor a5 -a5 sign 1.000000 -a5 SoftZero 0.000000 -a5 SoftLowerLim -30.000000 -a5 SoftUpperLim 30.000000 -a5 Fixed -1.000000 -a5 InterruptMode 0.000000 -a5 precision 0.010000 -a5 AccessCode 2.000000 -a5 movecount 10.000000 -# Motor a4 -a4 sign 1.000000 -a4 SoftZero 0.000000 -a4 SoftLowerLim -10.000000 -a4 SoftUpperLim 120.000000 -a4 Fixed -1.000000 -a4 InterruptMode 0.000000 -a4 precision 0.010000 -a4 AccessCode 2.000000 -a4 movecount 10.000000 -# Motor a3 -a3 sign 1.000000 -a3 SoftZero 0.000000 -a3 SoftLowerLim -180.000000 -a3 SoftUpperLim 360.000000 -a3 Fixed -1.000000 -a3 InterruptMode 0.000000 -a3 precision 0.010000 -a3 AccessCode 2.000000 -a3 movecount 10.000000 -# Motor a2 -a2 sign 1.000000 -a2 SoftZero 0.000000 -a2 SoftLowerLim 30.000000 -a2 SoftUpperLim 100.000000 -a2 Fixed -1.000000 -a2 InterruptMode 0.000000 -a2 precision 0.010000 -a2 AccessCode 2.000000 -a2 movecount 10.000000 -# Motor a1 -a1 sign 1.000000 -a1 SoftZero 0.000000 -a1 SoftLowerLim 0.000000 -a1 SoftUpperLim 120.000000 -a1 Fixed -1.000000 -a1 InterruptMode 0.000000 -a1 precision 0.010000 -a1 AccessCode 2.000000 -a1 movecount 10.000000 -banana CountMode monitor -banana preset 60.000000 -# Counter counter -counter SetPreset 60000.000000 -counter SetMode Monitor -# Motor twothetad -twothetad sign 1.000000 -twothetad SoftZero 0.000000 -twothetad SoftLowerLim -10.000000 -twothetad SoftUpperLim 120.000000 -twothetad Fixed -1.000000 -twothetad InterruptMode 0.000000 -twothetad precision 0.010000 -twothetad AccessCode 2.000000 -twothetad movecount 10.000000 -# Motor table -table sign 1.000000 -table SoftZero 0.000000 -table SoftLowerLim -180.000000 -table SoftUpperLim 360.000000 -table Fixed -1.000000 -table InterruptMode 0.000000 -table precision 0.010000 -table AccessCode 2.000000 -table movecount 10.000000 -# Motor monochi -monochi sign 1.000000 -monochi SoftZero 0.000000 -monochi SoftLowerLim -30.000000 -monochi SoftUpperLim 30.000000 -monochi Fixed -1.000000 -monochi InterruptMode 0.000000 -monochi precision 0.010000 -monochi AccessCode 2.000000 -monochi movecount 10.000000 -# Motor monophi -monophi sign 1.000000 -monophi SoftZero 0.000000 -monophi SoftLowerLim -30.000000 -monophi SoftUpperLim 30.000000 -monophi Fixed -1.000000 -monophi InterruptMode 0.000000 -monophi precision 0.010000 -monophi AccessCode 2.000000 -monophi movecount 10.000000 -# Motor curvem -curvem sign 1.000000 -curvem SoftZero 0.000000 -curvem SoftLowerLim 0.000000 -curvem SoftUpperLim 20.000000 -curvem Fixed -1.000000 -curvem InterruptMode 0.000000 -curvem precision 0.010000 -curvem AccessCode 2.000000 -curvem movecount 10.000000 -# Motor monoy -monoy sign 1.000000 -monoy SoftZero 0.000000 -monoy SoftLowerLim -30.000000 -monoy SoftUpperLim 30.000000 -monoy Fixed -1.000000 -monoy InterruptMode 0.000000 -monoy precision 0.010000 -monoy AccessCode 2.000000 -monoy movecount 10.000000 -# Motor monox -monox sign 1.000000 -monox SoftZero 0.000000 -monox SoftLowerLim -30.000000 -monox SoftUpperLim 30.000000 -monox Fixed -1.000000 -monox InterruptMode 0.000000 -monox precision 0.010000 -monox AccessCode 2.000000 -monox movecount 10.000000 -# Motor twothetam -twothetam sign 1.000000 -twothetam SoftZero 0.000000 -twothetam SoftLowerLim 30.000000 -twothetam SoftUpperLim 100.000000 -twothetam Fixed -1.000000 -twothetam InterruptMode 0.000000 -twothetam precision 0.010000 -twothetam AccessCode 2.000000 -twothetam movecount 10.000000 # Motor omegam omegam sign 1.000000 omegam SoftZero 0.000000 @@ -213,5 +6,226 @@ omegam SoftUpperLim 120.000000 omegam Fixed -1.000000 omegam InterruptMode 0.000000 omegam precision 0.010000 +omegam ignorefault 0.000000 omegam AccessCode 2.000000 omegam movecount 10.000000 +# Motor twothetam +twothetam sign 1.000000 +twothetam SoftZero 0.000000 +twothetam SoftLowerLim 30.000000 +twothetam SoftUpperLim 100.000000 +twothetam Fixed -1.000000 +twothetam InterruptMode 0.000000 +twothetam precision 0.010000 +twothetam ignorefault 0.000000 +twothetam AccessCode 2.000000 +twothetam movecount 10.000000 +# Motor monox +monox sign 1.000000 +monox SoftZero 0.000000 +monox SoftLowerLim -30.000000 +monox SoftUpperLim 30.000000 +monox Fixed -1.000000 +monox InterruptMode 0.000000 +monox precision 0.010000 +monox ignorefault 0.000000 +monox AccessCode 2.000000 +monox movecount 10.000000 +# Motor monoy +monoy sign 1.000000 +monoy SoftZero 0.000000 +monoy SoftLowerLim -30.000000 +monoy SoftUpperLim 30.000000 +monoy Fixed -1.000000 +monoy InterruptMode 0.000000 +monoy precision 0.010000 +monoy ignorefault 0.000000 +monoy AccessCode 2.000000 +monoy movecount 10.000000 +# Motor curvem +curvem sign 1.000000 +curvem SoftZero 0.000000 +curvem SoftLowerLim 0.000000 +curvem SoftUpperLim 20.000000 +curvem Fixed -1.000000 +curvem InterruptMode 0.000000 +curvem precision 0.010000 +curvem ignorefault 0.000000 +curvem AccessCode 2.000000 +curvem movecount 10.000000 +# Motor monophi +monophi sign 1.000000 +monophi SoftZero 0.000000 +monophi SoftLowerLim -30.000000 +monophi SoftUpperLim 30.000000 +monophi Fixed -1.000000 +monophi InterruptMode 0.000000 +monophi precision 0.010000 +monophi ignorefault 0.000000 +monophi AccessCode 2.000000 +monophi movecount 10.000000 +# Motor monochi +monochi sign 1.000000 +monochi SoftZero 0.000000 +monochi SoftLowerLim -30.000000 +monochi SoftUpperLim 30.000000 +monochi Fixed -1.000000 +monochi InterruptMode 0.000000 +monochi precision 0.010000 +monochi ignorefault 0.000000 +monochi AccessCode 2.000000 +monochi movecount 10.000000 +# Motor table +table sign 1.000000 +table SoftZero 0.000000 +table SoftLowerLim -180.000000 +table SoftUpperLim 360.000000 +table Fixed -1.000000 +table InterruptMode 0.000000 +table precision 0.010000 +table ignorefault 0.000000 +table AccessCode 2.000000 +table movecount 10.000000 +# Motor twothetad +twothetad sign 1.000000 +twothetad SoftZero 0.000000 +twothetad SoftLowerLim -10.000000 +twothetad SoftUpperLim 120.000000 +twothetad Fixed -1.000000 +twothetad InterruptMode 0.000000 +twothetad precision 0.010000 +twothetad ignorefault 0.000000 +twothetad AccessCode 2.000000 +twothetad movecount 10.000000 +# Counter counter +counter SetPreset 60000.000000 +counter SetMode Monitor +banana CountMode monitor +banana preset 60.000000 +# Motor a1 +a1 sign 1.000000 +a1 SoftZero 0.000000 +a1 SoftLowerLim 0.000000 +a1 SoftUpperLim 120.000000 +a1 Fixed -1.000000 +a1 InterruptMode 0.000000 +a1 precision 0.010000 +a1 ignorefault 0.000000 +a1 AccessCode 2.000000 +a1 movecount 10.000000 +# Motor a2 +a2 sign 1.000000 +a2 SoftZero 0.000000 +a2 SoftLowerLim 30.000000 +a2 SoftUpperLim 100.000000 +a2 Fixed -1.000000 +a2 InterruptMode 0.000000 +a2 precision 0.010000 +a2 ignorefault 0.000000 +a2 AccessCode 2.000000 +a2 movecount 10.000000 +# Motor a3 +a3 sign 1.000000 +a3 SoftZero 0.000000 +a3 SoftLowerLim -180.000000 +a3 SoftUpperLim 360.000000 +a3 Fixed -1.000000 +a3 InterruptMode 0.000000 +a3 precision 0.010000 +a3 ignorefault 0.000000 +a3 AccessCode 2.000000 +a3 movecount 10.000000 +# Motor a4 +a4 sign 1.000000 +a4 SoftZero 0.000000 +a4 SoftLowerLim -10.000000 +a4 SoftUpperLim 120.000000 +a4 Fixed -1.000000 +a4 InterruptMode 0.000000 +a4 precision 0.010000 +a4 ignorefault 0.000000 +a4 AccessCode 2.000000 +a4 movecount 10.000000 +# Motor a5 +a5 sign 1.000000 +a5 SoftZero 0.000000 +a5 SoftLowerLim -30.000000 +a5 SoftUpperLim 30.000000 +a5 Fixed -1.000000 +a5 InterruptMode 0.000000 +a5 precision 0.010000 +a5 ignorefault 0.000000 +a5 AccessCode 2.000000 +a5 movecount 10.000000 +# Motor a6 +a6 sign 1.000000 +a6 SoftZero 0.000000 +a6 SoftLowerLim -30.000000 +a6 SoftUpperLim 30.000000 +a6 Fixed -1.000000 +a6 InterruptMode 0.000000 +a6 precision 0.010000 +a6 ignorefault 0.000000 +a6 AccessCode 2.000000 +a6 movecount 10.000000 +# Motor a7 +a7 sign 1.000000 +a7 SoftZero 0.000000 +a7 SoftLowerLim -30.000000 +a7 SoftUpperLim 30.000000 +a7 Fixed -1.000000 +a7 InterruptMode 0.000000 +a7 precision 0.010000 +a7 ignorefault 0.000000 +a7 AccessCode 2.000000 +a7 movecount 10.000000 +# Motor a8 +a8 sign 1.000000 +a8 SoftZero 0.000000 +a8 SoftLowerLim -30.000000 +a8 SoftUpperLim 30.000000 +a8 Fixed -1.000000 +a8 InterruptMode 0.000000 +a8 precision 0.010000 +a8 ignorefault 0.000000 +a8 AccessCode 2.000000 +a8 movecount 10.000000 +# Motor a9 +a9 sign 1.000000 +a9 SoftZero 0.000000 +a9 SoftLowerLim 0.000000 +a9 SoftUpperLim 20.000000 +a9 Fixed -1.000000 +a9 InterruptMode 0.000000 +a9 precision 0.010000 +a9 ignorefault 0.000000 +a9 AccessCode 2.000000 +a9 movecount 10.000000 +title UNKNOWN +title setAccess 2 +user UNKNOWN +user setAccess 2 +collimation UNKNOWN +collimation setAccess 2 +sampleintern na2ca3al2f14 +sampleintern setAccess 2 +comment1 UNKNOWN +comment1 setAccess 2 +comment2 UNKNOWN +comment2 setAccess 2 +comment3 UNKNOWN +comment3 setAccess 2 +starttime 2005-10-19 11:11:44 +starttime setAccess 2 +adress UNKNOWN +adress setAccess 2 +phone UNKNOWN +phone setAccess 2 +fax UNKNOWN +fax setAccess 2 +email UNKNOWN +email setAccess 2 +sample_mur 0.000000 +sample_mur setAccess 2 +exe batchpath ./ +exe syspath ./ diff --git a/nxscript.c b/nxscript.c index 04d9c0e0..29d36937 100644 --- a/nxscript.c +++ b/nxscript.c @@ -29,6 +29,7 @@ #include "udpquieck.h" #include "nxdict.h" #include "nxscript.h" +#include "sicsdata.h" extern char *trim(char *str); @@ -342,6 +343,36 @@ static void putCounter(SConnection *pCon, SicsInterp *pSics, pNXScript self, return; } /*----------------------------------------------------------------------*/ +static void putSicsData(SConnection *pCon, SicsInterp *pSics, + pNXScript self, int argc, char *argv[]){ + + pSICSData data = NULL; + int status; + char buffer[256]; + + if(argc < 4){ + SCWrite(pCon,"ERROR: insufficient number of arguments to putSicsData", + eError); + return; + } + + /* + find data + */ + data = (pSICSData)FindCommandData(pSics,argv[3],"SICSData"); + if(data == NULL){ + snprintf(buffer,255,"ERROR: sicsdata %s not found!", argv[3]); + SCWrite(pCon,buffer,eError); + return; + } + + status = NXDputalias(self->fileHandle,self->dictHandle,argv[2],data->data); + if(status != NX_OK){ + sprintf(buffer,"ERROR: failed to write sicsdata to %s", argv[2]); + SCWrite(pCon,buffer,eError); + } +} +/*----------------------------------------------------------------------*/ static void updateHMDim(NXScript *self, pHistMem mem){ int iDim[MAXDIM]; int i, rank, timeLength, status; @@ -944,6 +975,9 @@ static int handlePut(SConnection *pCon, SicsInterp *pSics, pNXScript self, }else if(strcmp(argv[1],"putglobal") == 0){ /*===============*/ putGlobal(pCon,pSics,self,argc,argv); + }else if(strcmp(argv[1],"putsicsdata") == 0){ + /*===============*/ + putSicsData(pCon,pSics,self,argc,argv); } else { SCWrite(pCon,"ERROR: put command not recognised",eError); } diff --git a/tasscanub.c b/tasscanub.c index cf700a69..644f7828 100644 --- a/tasscanub.c +++ b/tasscanub.c @@ -889,9 +889,12 @@ static void ParseOutput(pTASdata pTAS, SConnection *pCon) } else { - sprintf(pWarn,"WARNING: ignored invalid token > %s < in output", - pToken); - SCWrite(pCon,pWarn,eWarning); + strtolower(pToken); + if(strcmp(pToken,"unknown") != 0) { + sprintf(pWarn,"WARNING: ignored invalid token > %s < in output", + pToken); + SCWrite(pCon,pWarn,eWarning); + } } } free(pText);