From fc94ead280b9009431bb030c6eda7587367f1d43 Mon Sep 17 00:00:00 2001 From: koennecke Date: Thu, 29 Mar 2012 08:41:06 +0000 Subject: [PATCH] - Fixes to make SL6 work - New NeXus libraries - Added new raw binary transfer mode for mass data - Added a check script option to configurable virtual motor --- dumprot.c | 2 +- make_gen | 3 ++- psi.c | 12 ++++++++++++ rebin.c | 6 +++--- sanslirebin.c | 3 ++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/dumprot.c b/dumprot.c index 470001d..1235608 100644 --- a/dumprot.c +++ b/dumprot.c @@ -13,7 +13,7 @@ int DumProtHandler(Ascon *a) { Tcl_Interp *pTcl = InterpGetTcl(pServ->pSics); - int ret, l; + int ret, l = -1; char *result = NULL; int iRet = 1; diff --git a/make_gen b/make_gen index 95742bc..08fdb8d 100644 --- a/make_gen +++ b/make_gen @@ -23,7 +23,8 @@ OBJ=psi.o buffer.o ruli.o sps.o pimotor.o charbychar.o\ dgrambroadcast.o sinq.o tabledrive.o julcho.o sinqhttpopt.o\ ritastorage.o poldizug.o audinelib.o delcam.o el737hpdrivsps.o \ rebin.o sanslirebin.o lmd200.o slsvme.o julprot.o sinqhttpprot.o \ - pmacprot.o pfeifferprot.o termprot.o phytron.o autowin.o eigera2.o + pmacprot.o pfeifferprot.o termprot.o phytron.o autowin.o eigera2.o \ + tclClock.o tclDate.o tclUnixTime.o .SECONDARY.: sanslirebin.c diff --git a/psi.c b/psi.c index 9d5880e..2635016 100644 --- a/psi.c +++ b/psi.c @@ -80,6 +80,11 @@ void SiteInit(void) static pSite sitePSI = NULL; +/* + * from tclClock.c + */ +int Tcl_ClockObjCmd (ClientData client, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + /*----------------------------------------------------------------------*/ static void AddPsiCommands(SicsInterp * pInter) { @@ -126,6 +131,13 @@ static void AddPsiCommands(SicsInterp * pInter) SCMD("SerialInit", SerialInit); SCMD("MakeEiger", InitEiger); PCMD("cnvrt", CnvrtAction); + + /* + * Tcl 8.5 has implemented the clock command in tcl rather then C. + * This includes the same command, backported from Tcl 8.4 + */ + Tcl_CreateObjCommand(InterpGetTcl(pServ->pSics), "clock", Tcl_ClockObjCmd, NULL, NULL); + /* SCMD("MakeDifrac",MakeDifrac); */ diff --git a/rebin.c b/rebin.c index 4298e73..55a900b 100644 --- a/rebin.c +++ b/rebin.c @@ -24,7 +24,7 @@ static int checkPoint(pNXDS target, double x, double y) } /*--------------------------------------------------------------------------*/ -static void addNXDatasetValue(pNXDS target, int iPos[], double value) +static void addNXDatasetValue(pNXDS target, int64_t iPos[], double value) { double val; @@ -35,7 +35,7 @@ static void addNXDatasetValue(pNXDS target, int iPos[], double value) /*---------------------------------------------------------------------------*/ static void roundPoint(pNXDS target, double x, double y, double value) { - int iDim[2]; + int64_t iDim[2]; iDim[0] = (int) floor(x + .5); iDim[1] = (int) floor(y + 0.5); @@ -63,7 +63,7 @@ static double dist(double x1, double y1, double x2, double y2) static void distribute(pNXDS target, double x, double y, double value) { double lldist, lrdist, uldist, urdist, totalDist, ix, iy, frac; - int iPos[2]; + int64_t iPos[2]; ix = floor(x); iy = floor(y); diff --git a/sanslirebin.c b/sanslirebin.c index 7b090fa..c881612 100644 --- a/sanslirebin.c +++ b/sanslirebin.c @@ -97,8 +97,9 @@ int SansliRebin(SConnection * pCon, SicsInterp * pSics, void *pData, { pSICSData target = NULL, hmData = NULL; pNXDS dataset = NULL, weights = NULL; - int iDim[2], ix, iy, pos, ival, xDetDim[2], yDetDim[2], nDetX, nDetY, + int ix, iy, pos, ival, xDetDim[2], yDetDim[2], nDetX, nDetY, posIdx; + int64_t iDim[2]; long totalCounts = 0; double x, y, val, *xPos = NULL, *yPos = NULL, corrSum = .0, doubleCounts, sumFrac; double low, frac;