From b12e8962862427e7b822767b1becbb9064153e88 Mon Sep 17 00:00:00 2001 From: koennecke Date: Wed, 22 Jun 2005 07:10:09 +0000 Subject: [PATCH] - Adding first working version of the McStas SICS connection to cvs --- polterwrite.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/polterwrite.c b/polterwrite.c index fdb872a..14159dd 100644 --- a/polterwrite.c +++ b/polterwrite.c @@ -22,6 +22,7 @@ #include "motor.h" #include "sicsvar.h" #include "polterwrite.h" +#include "sicsvar.h" /* diaphragm1 - chopper @@ -152,20 +153,31 @@ static void writeDiaphragm2(NXhandle hfil, NXdict hdict, static void writeSample(NXhandle hfil, NXdict hdict, SConnection *pCon) { + pSicsVariable active = NULL; + int iActive; SNXSPutVariable(pServ->pSics,pCon,hfil,hdict,"sdist","dia2_sample"); SNXSPutVariable(pServ->pSics,pCon,hfil,hdict,"chopperdist","chopper_sample"); SNXSPutVariable(pServ->pSics,pCon,hfil,hdict,"saname","sample"); SNXSPutVariable(pServ->pSics,pCon,hfil,hdict,"senvir","environment"); - /* - SNXSPutEVVar(hfil,hdict,"temperature",pCon,"stemp","stddev"); - SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "srsu", "rsu"); - SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "srsu0", "rsu"); - SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "srsl", "rsl"); - SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "srsl0", "rsl"); - SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "srsa", "rsa"); - SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "srsa0", "rsa"); - */ + + if(FindCommandData(pServ->pSics,"temperature","Environment Controller") + != NULL){ + SNXSPutEVVar(hfil,hdict,"temperature",pCon,"stemp","stddev"); + } + active = FindCommandData(pServ->pSics,"activetable","SicsVariable"); + if(active != NULL){ + VarGetInt(active,&iActive); + if(iActive == 1){ + SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "srsu", "rsu"); + SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "srsu0", "rsu"); + SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "srsl", "rsl"); + SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "srsl0", "rsl"); + SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "srsa", "rsa"); + SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "srsa0", "rsa"); + } + } + SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "sshu", "shu"); SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "sshu0", "shu"); SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "sshl", "shl");