Added create drive command to site ansto

r1037 | ffr | 2006-08-01 17:03:00 +1000 (Tue, 01 Aug 2006) | 2 lines
This commit is contained in:
Ferdi Franceschini
2006-08-01 17:03:00 +10:00
committed by Douglas Clowes
parent 2fe58f2839
commit 3da52afb10
2 changed files with 25 additions and 16 deletions

View File

@ -63,9 +63,7 @@ typedef struct {
prs232 controller;
char *host;
int iPort;
int iChannel;
void *pData;
int finishCount;
float dummy_threshold;
} BeamMon;
/** \brief Returns the counter status,
@ -171,13 +169,22 @@ static int MonTryAndFixIt(CounterDriver *cntrData, int iCode) {
static int MonSet(CounterDriver *cntrData, char *name, int iCter, float FVal) {
BeamMon *self = NULL;
self = (BeamMon *) cntrData;
self = cntrData->pData;
if(strcmp(name,"threshold") == 0){
//TODO set threshold
self->dummy_threshold = FVal;
}
}
static int MonGet(CounterDriver *cntrData, char *name, int iCter, float *fVal) {
BeamMon *self = NULL;
self = (BeamMon *) cntrData;
self = cntrData->pData;
if(strcmp(name,"threshold") == 0){
//TODO get threshold
*fVal = self->dummy_threshold;
}
*fVal = 123456789.0;
}
@ -240,7 +247,7 @@ static void KillMon(pCounterDriver self) {
eError);
return NULL;
}
pCntDriv = CreateCounterDriver(name, "MONITOR");
pCntDriv = CreateCounterDriver(name, "anstomonitor");
if(!pCntDriv) {
free(newCtr);
return NULL;
@ -271,6 +278,7 @@ static void KillMon(pCounterDriver self) {
strncpy(buffer,pPtr, 131);
newCtr->controller = MonConnect(pCon, buffer, port);
newCtr->dummy_threshold = 1.7e6;
return pCntDriv;
}

View File

@ -24,6 +24,9 @@
/* Added code for new LH45 and Lakeshore 340 drivers */
#include "lh45.h"
#include "lakeshore340.h"
/*@observer@*//*@null@*/ pCounterDriver CreateMonCounter(/*@observer@*/SConnection *pCon, /*@observer@*/char *name, char *params);
/*
from tcpdornier.c
*/
@ -104,17 +107,15 @@ static void RemoveCommands(SicsInterp *pSics){
static pCounterDriver CreateCounterDriverAnsto(SConnection *pCon,
int argc,
char *argv[]){
pCounterDriver pNew = NULL;
if(strcmp(argv[2],"nitio10") == 0){
if(argc < 4){
SCWrite(pCon,
"ERROR:SITE: Insufficient arguments for NITIO10 counter",
eError);
return NULL;
}
/* pNew = CreateCtrNitio10(pCon,argv[1],argc-3,&argv[3]);*/
pCounterDriver pDriver = NULL;
strtolower(argv[2]);
if(strcmp(argv[2],"anstomonitor") == 0) {
pDriver = CreateMonCounter(pCon, argv[1], argv[3]);
}
return pNew;
if(!pDriver){
return NULL;
}
return pDriver;
}
/*-------------------------------------------------------------------*/
static HistDriver *CreateHistMem(char *name, pStringDict pOptions){