From b335751bdedef561c8778b0aaa7eb2b4ec64f7c8 Mon Sep 17 00:00:00 2001 From: koennecke Date: Tue, 30 Jan 2007 04:49:26 +0000 Subject: [PATCH] - Yet another fix for eclipse commit problems --- mcstas/dmc/README | 36 ++++++++++++++++++++++++++++++++++++ sicshipadaba.c | 20 ++++++++++++++++++-- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 mcstas/dmc/README diff --git a/mcstas/dmc/README b/mcstas/dmc/README new file mode 100644 index 00000000..8f60f950 --- /dev/null +++ b/mcstas/dmc/README @@ -0,0 +1,36 @@ + + VIRTUAL DMC + + This is the SICS-McStas virtual instrument DMC modelled after the real + powder diffcractometer DMC at SINQ: + + http://sinq.web.psi.ch/sinq/instr/dmc/dmc.html + + The McStas simulation used for this system has been verified against + the real instrument. The basic usage is to start the SICServer with: + + ./SICServer vdmc.tcl + + in this directory. Then you can connect to SICS at localhost/2911 + with any SICS client and start issuing commands. + + In order to save simulation time, the simulation works with + neutron data files presimulated for four wavelength up to the sample. + This is why you get your wavelength coerced to the nearest + precalculated value. + + If you desire to "measure" your own sample on virtual DMC, you first + have to create a LazyPulverix output file. You then can proceed to + load the sample into SICS with the SICS command: + + sample load path-to-lazy-pulverix-outputfile + + The command: + + sample list + + tells you which samples virtual DMC already knows about. + + Questions and comments to: Mark.Koennecke@psi.ch + + diff --git a/sicshipadaba.c b/sicshipadaba.c index 6a088030..961116cd 100644 --- a/sicshipadaba.c +++ b/sicshipadaba.c @@ -24,7 +24,7 @@ #include #include #include "protocol.h" -#include "splitter.h" +#include /*== there can be only hipadaba in SICS, some globals to care for that == */ static pHdb root = NULL; @@ -363,7 +363,7 @@ static int SICSScriptReadCallback(void *userData, void *callData, pHdb node, * something = anything * as well as a plain value alone */ - data = Tcl_GetStringResult(InterpGetTcl(pServ->pSics)); + data = (char *)Tcl_GetStringResult(InterpGetTcl(pServ->pSics)); if(data == NULL){ SCWrite(pCon,"ERROR: no result returned from script",eError); return 0; @@ -632,6 +632,7 @@ pHdbCallback MakeIntFixedCallback(int *data, int length){ pHdb MakeSICSHdbPar(char *name, int priv, hdbValue v){ pHdb result = NULL; pHdbCallback pHcb = NULL; + char pPriv[20]; result = MakeHipadabaNode(name,v.dataType,v.arrayLength); if(result == NULL){ @@ -652,6 +653,21 @@ pHdb MakeSICSHdbPar(char *name, int priv, hdbValue v){ return NULL; } AppendHipadabaCallback(result,HCBSET,pHcb); + switch(priv){ + case 0: + strcpy(pPriv,"internal"); + break; + case 1: + strcpy(pPriv,"manager"); + break; + case 2: + strcpy(pPriv,"user"); + break; + case 3: + strcpy(pPriv,"spy"); + break; + } + SetHdbProperty(result,"priv",pPriv); return result; }