- Added triple axis scan command.

- Introduced simulation mode to simdriv and simcter, i.e they never fail and
  finish at once.
- Started defining MAD compatibility commands in Tcl
- Fixed a bug in FOCUS_src which caused it to leak sockets.
- Introduced setsockopt SO_REUSEADDR to all new sockets in sinqhm in order
  to loose the next sinqhm error.
This commit is contained in:
cvs
2000-12-05 09:05:03 +00:00
parent e83d3e6946
commit 876396bb7e
22 changed files with 2000 additions and 58 deletions

View File

@@ -21,6 +21,8 @@
#include "sicsvar.h"
#include "counter.h"
#include "motor.h"
#include "scan.h"
#include "scan.i"
#include "tas.h"
/*
@@ -132,6 +134,20 @@ extern char *tasVariableOrder[] = {
"mrx2",
"arx1",
"arx2",
"instrument",
"title",
"user",
"lastcommand",
"alf1",
"alf2",
"alf3",
"alf4",
"bet1",
"bet2",
"bet3",
"bet4",
"output",
"local",
NULL};
/*---------------------------------------------------------------------
There is a special feauture in MAD where the count mode is determined
@@ -148,7 +164,8 @@ static int MonitorCallback(int iEvent, void *pEvent, void *pUser)
if(iEvent != VALUECHANGE)
return 0;
SetCounterMode(self->counter,ePreset);
SetCounterMode(self->pScan->pCounterData,ePreset);
SetCounterPreset(self->pScan->pCounterData,self->tasPar[MN]->fVal);
return 1;
}
@@ -160,7 +177,8 @@ static int TimerCallback(int iEvent, void *pEvent, void *pUser)
if(iEvent != VALUECHANGE)
return 0;
SetCounterMode(self->counter,eTimer);
SetCounterMode(self->pScan->pCounterData,eTimer);
SetCounterPreset(self->pScan->pCounterData,self->tasPar[TI]->fVal);
return 1;
}
/*-----------------------------------------------------------------------
@@ -186,6 +204,13 @@ int TASFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
pSicsVariable pVar = NULL;
CommandList *pCom = NULL;
/* check arguments*/
if(argc < 2)
{
SCWrite(pCon,"ERROR: insufficient paarameters to MakeTAS",eError);
return 0;
}
/* create a new data structure */
pNew = (pTASdata)malloc(sizeof(TASdata));
if(!pNew)
@@ -203,6 +228,7 @@ int TASFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
free(pNew);
return 0;
}
pNew->iPOL = -1;
/* connect to all the variables */
iPtr = 0; iError = 0;
@@ -227,15 +253,15 @@ int TASFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
return 0;
}
/* connect to the counter */
pCom = FindCommand(pSics,"counter");
/* connect to the scan object */
pCom = FindCommand(pSics,argv[1]);
if(!pCom)
{
SCWrite(pCon,"ERROR: no neutron counter for TAS found",eError);
SCWrite(pCon,"ERROR: no scan routine for TAS found",eError);
TASKill(pNew);
return 0;
}
pNew->counter = pCom->pData;
pNew->pScan = (pScanData)pCom->pData;
/*
Install the callbacks for TI and MN. Sloppy error checking because
@@ -260,7 +286,6 @@ int TASFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
TASKill(pNew);
return 0;
}
/*
iError = AddCommand(pSics,"sc",TASScan,NULL,pNew);
if(!iError)
{
@@ -268,6 +293,7 @@ int TASFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
TASKill(pNew);
return 0;
}
/*
iError = AddCommand(pSics,"set",TASSet,NULL,pNew);
if(!iError)
{