- Fixed a couple of compiler found bugs generated by the new C compiler
- Added support to tasinit for status display part of tas-application
This commit is contained in:
@ -1017,7 +1017,7 @@
|
|||||||
/* only manager may use this */
|
/* only manager may use this */
|
||||||
if(!SCMatchRights(pCon,usMugger))
|
if(!SCMatchRights(pCon,usMugger))
|
||||||
{
|
{
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
Arg2Text(argc-2,&argv[2],pError,79);
|
Arg2Text(argc-2,&argv[2],pError,79);
|
||||||
iRet = self->pDriv->Send(self->pDriv,pError,pBueffel,255);
|
iRet = self->pDriv->Send(self->pDriv,pError,pBueffel,255);
|
||||||
|
2
danu.dat
2
danu.dat
@ -1,3 +1,3 @@
|
|||||||
7634
|
7647
|
||||||
NEVER, EVER modify or delete this file
|
NEVER, EVER modify or delete this file
|
||||||
You'll risk eternal damnation and a reincarnation as a cockroach!|n
|
You'll risk eternal damnation and a reincarnation as a cockroach!|n
|
@ -561,7 +561,7 @@
|
|||||||
*/
|
*/
|
||||||
if(self->iStop == 1)
|
if(self->iStop == 1)
|
||||||
{
|
{
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -173,6 +173,7 @@
|
|||||||
int iRet, iCode, iFix;
|
int iRet, iCode, iFix;
|
||||||
char pBueffel[256], pError[132];
|
char pBueffel[256], pError[132];
|
||||||
static int iCount;
|
static int iCount;
|
||||||
|
static int callCount;
|
||||||
|
|
||||||
self = (pEVControl)pData;
|
self = (pEVControl)pData;
|
||||||
assert(self);
|
assert(self);
|
||||||
@ -229,6 +230,15 @@
|
|||||||
fDelta = - fDelta;
|
fDelta = - fDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* handle callback */
|
||||||
|
callCount++;
|
||||||
|
if(callCount >= 10)
|
||||||
|
{
|
||||||
|
sprintf(pBueffel,"%s = %f", self->pName, fPos);
|
||||||
|
InvokeCallBack(self->pCall, VALUECHANGE,pBueffel);
|
||||||
|
callCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* based on this: logic ! */
|
/* based on this: logic ! */
|
||||||
if(fDelta <= ObVal(self->pParam, TOLERANCE)) /* done */
|
if(fDelta <= ObVal(self->pParam, TOLERANCE)) /* done */
|
||||||
{
|
{
|
||||||
@ -548,6 +558,14 @@
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
/* deal with callbacks */
|
||||||
|
self->callCount++;
|
||||||
|
if(self->callCount >= 20)
|
||||||
|
{
|
||||||
|
sprintf(pBueffel,"%s = %F", self->pName, fPos);
|
||||||
|
InvokeCallBack(self->pCall,VALUECHANGE, pBueffel);
|
||||||
|
self->callCount = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(iRet == -1) /* pending */
|
else if(iRet == -1) /* pending */
|
||||||
{
|
{
|
||||||
@ -644,6 +662,16 @@
|
|||||||
pRes->pEnvir->IsInTolerance = EVIIsInTolerance;
|
pRes->pEnvir->IsInTolerance = EVIIsInTolerance;
|
||||||
pRes->pEnvir->HandleError = EVIErrHandler;
|
pRes->pEnvir->HandleError = EVIErrHandler;
|
||||||
|
|
||||||
|
/* callback interface */
|
||||||
|
pRes->pCall = CreateCallBackInterface();
|
||||||
|
if(!pRes->pCall)
|
||||||
|
{
|
||||||
|
free(pRes->pDrivInt);
|
||||||
|
DeleteDescriptor(pRes->pDes);
|
||||||
|
free(pRes);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* new parameter space */
|
/* new parameter space */
|
||||||
pRes->pParam = ObParCreate(7);
|
pRes->pParam = ObParCreate(7);
|
||||||
if(!pRes->pParam)
|
if(!pRes->pParam)
|
||||||
@ -711,6 +739,10 @@
|
|||||||
{
|
{
|
||||||
free(self->pEnvir);
|
free(self->pEnvir);
|
||||||
}
|
}
|
||||||
|
if(self->pCall)
|
||||||
|
{
|
||||||
|
DeleteCallBackInterface(self->pCall);
|
||||||
|
}
|
||||||
if(self->KillPrivate)
|
if(self->KillPrivate)
|
||||||
{
|
{
|
||||||
self->KillPrivate(self->pPrivate);
|
self->KillPrivate(self->pPrivate);
|
||||||
@ -892,6 +924,20 @@
|
|||||||
self->fTarget);
|
self->fTarget);
|
||||||
SCWrite(pCon,pBueffel, eValue);
|
SCWrite(pCon,pBueffel, eValue);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
/*-------------------------------------------------------------------------*/
|
||||||
|
static int EVCallBack(int iEvent, void *pEventData, void *pUserData)
|
||||||
|
{
|
||||||
|
char *pBuf = (char *)pEventData;
|
||||||
|
SConnection *pCon = (SConnection *)pUserData;
|
||||||
|
char pBueffel[132];
|
||||||
|
|
||||||
|
if(iEvent == VALUECHANGE)
|
||||||
|
{
|
||||||
|
SCWrite(pCon,pBuf,eValue);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
@ -913,6 +959,7 @@
|
|||||||
double dVal;
|
double dVal;
|
||||||
float fPos;
|
float fPos;
|
||||||
int iRet;
|
int iRet;
|
||||||
|
long lID;
|
||||||
|
|
||||||
self = (pEVControl)pData;
|
self = (pEVControl)pData;
|
||||||
assert(self);
|
assert(self);
|
||||||
@ -943,6 +990,21 @@
|
|||||||
SCWrite(pCon,pReply,eValue);
|
SCWrite(pCon,pReply,eValue);
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
|
/* install automatic notification */
|
||||||
|
else if(strcmp(argv[1],"interest") == 0)
|
||||||
|
{
|
||||||
|
lID = RegisterCallback(self->pCall, VALUECHANGE, EVCallBack,
|
||||||
|
pCon, NULL);
|
||||||
|
SCRegister(pCon,pSics, self->pCall,lID);
|
||||||
|
SCSendOK(pCon);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if(strcmp(argv[1],"uninterest") == 0)
|
||||||
|
{
|
||||||
|
RemoveCallback2(self->pCall,pCon);
|
||||||
|
SCSendOK(pCon);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
else if(strcmp(argv[1],"log") == 0) /* log commands */
|
else if(strcmp(argv[1],"log") == 0) /* log commands */
|
||||||
{
|
{
|
||||||
if(argc < 3)
|
if(argc < 3)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#line 208 "evcontroller.w"
|
#line 211 "evcontroller.w"
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
E N V I R O N M E N T C O N T R O L L E R
|
E N V I R O N M E N T C O N T R O L L E R
|
||||||
@ -14,7 +14,7 @@
|
|||||||
#define SICSEVCONTROL
|
#define SICSEVCONTROL
|
||||||
#include "varlog.h"
|
#include "varlog.h"
|
||||||
|
|
||||||
#line 130 "evcontroller.w"
|
#line 133 "evcontroller.w"
|
||||||
|
|
||||||
/*--------------------------- live & death --------------------------------*/
|
/*--------------------------- live & death --------------------------------*/
|
||||||
typedef struct __EVControl *pEVControl;
|
typedef struct __EVControl *pEVControl;
|
||||||
@ -44,6 +44,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#line 221 "evcontroller.w"
|
#line 224 "evcontroller.w"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#line 225 "evcontroller.w"
|
#line 228 "evcontroller.w"
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
Environment controller datastructure
|
Environment controller datastructure
|
||||||
@ -23,6 +23,8 @@
|
|||||||
pObjectDescriptor pDes;
|
pObjectDescriptor pDes;
|
||||||
pIDrivable pDrivInt;
|
pIDrivable pDrivInt;
|
||||||
pEVInterface pEnvir;
|
pEVInterface pEnvir;
|
||||||
|
pICallBack pCall;
|
||||||
|
int callCount;
|
||||||
pEVDriver pDriv;
|
pEVDriver pDriv;
|
||||||
EVMode eMode;
|
EVMode eMode;
|
||||||
float fTarget;
|
float fTarget;
|
||||||
@ -37,5 +39,5 @@
|
|||||||
void (*KillPrivate)(void *pData);
|
void (*KillPrivate)(void *pData);
|
||||||
} EVControl;
|
} EVControl;
|
||||||
|
|
||||||
#line 241 "evcontroller.w"
|
#line 244 "evcontroller.w"
|
||||||
|
|
||||||
|
@ -36,6 +36,8 @@ $\langle$evdata {\footnotesize ?}$\rangle\equiv$
|
|||||||
\mbox{}\verb@ pObjectDescriptor pDes;@\\
|
\mbox{}\verb@ pObjectDescriptor pDes;@\\
|
||||||
\mbox{}\verb@ pIDrivable pDrivInt;@\\
|
\mbox{}\verb@ pIDrivable pDrivInt;@\\
|
||||||
\mbox{}\verb@ pEVInterface pEnvir;@\\
|
\mbox{}\verb@ pEVInterface pEnvir;@\\
|
||||||
|
\mbox{}\verb@ pICallBack pCall;@\\
|
||||||
|
\mbox{}\verb@ int callCount;@\\
|
||||||
\mbox{}\verb@ pEVDriver pDriv;@\\
|
\mbox{}\verb@ pEVDriver pDriv;@\\
|
||||||
\mbox{}\verb@ EVMode eMode;@\\
|
\mbox{}\verb@ EVMode eMode;@\\
|
||||||
\mbox{}\verb@ float fTarget;@\\
|
\mbox{}\verb@ float fTarget;@\\
|
||||||
@ -63,7 +65,8 @@ the second field a pointer to an Drivable interface. Each environment
|
|||||||
controller needs to implement that in order to allow SICS drive the device
|
controller needs to implement that in order to allow SICS drive the device
|
||||||
to a new value. The third field is a pointer to an environment interface.
|
to a new value. The third field is a pointer to an environment interface.
|
||||||
This is needed in order to enable monitoring of the device when it has
|
This is needed in order to enable monitoring of the device when it has
|
||||||
reached its target value. The fourth field is a pointer to the driver for
|
reached its target value. Then there is a pointer to a callback
|
||||||
|
interface. The fifth field is a pointer to the driver for
|
||||||
the actual hardware. Next is the mode the device is in. Of course there
|
the actual hardware. Next is the mode the device is in. Of course there
|
||||||
must be floating point value which defines the current target value for the
|
must be floating point value which defines the current target value for the
|
||||||
device. pName is a pointer to a string representing the name of the
|
device. pName is a pointer to a string representing the name of the
|
||||||
|
@ -31,6 +31,8 @@ used by EVControl:
|
|||||||
pObjectDescriptor pDes;
|
pObjectDescriptor pDes;
|
||||||
pIDrivable pDrivInt;
|
pIDrivable pDrivInt;
|
||||||
pEVInterface pEnvir;
|
pEVInterface pEnvir;
|
||||||
|
pICallBack pCall;
|
||||||
|
int callCount;
|
||||||
pEVDriver pDriv;
|
pEVDriver pDriv;
|
||||||
EVMode eMode;
|
EVMode eMode;
|
||||||
float fTarget;
|
float fTarget;
|
||||||
@ -51,7 +53,8 @@ the second field a pointer to an Drivable interface. Each environment
|
|||||||
controller needs to implement that in order to allow SICS drive the device
|
controller needs to implement that in order to allow SICS drive the device
|
||||||
to a new value. The third field is a pointer to an environment interface.
|
to a new value. The third field is a pointer to an environment interface.
|
||||||
This is needed in order to enable monitoring of the device when it has
|
This is needed in order to enable monitoring of the device when it has
|
||||||
reached its target value. The fourth field is a pointer to the driver for
|
reached its target value. Then there is a pointer to a callback
|
||||||
|
interface. The fifth field is a pointer to the driver for
|
||||||
the actual hardware. Next is the mode the device is in. Of course there
|
the actual hardware. Next is the mode the device is in. Of course there
|
||||||
must be floating point value which defines the current target value for the
|
must be floating point value which defines the current target value for the
|
||||||
device. pName is a pointer to a string representing the name of the
|
device. pName is a pointer to a string representing the name of the
|
||||||
|
17
evdriver.i
17
evdriver.i
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#line 244 "evcontroller.w"
|
#line 247 "evcontroller.w"
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
Environment device driver datastructure
|
Environment device driver datastructure
|
||||||
@ -12,7 +12,7 @@
|
|||||||
#define DEVREDO 2
|
#define DEVREDO 2
|
||||||
|
|
||||||
|
|
||||||
#line 73 "evcontroller.w"
|
#line 76 "evcontroller.w"
|
||||||
|
|
||||||
typedef struct __EVDriver {
|
typedef struct __EVDriver {
|
||||||
int (*SetValue)(pEVDriver self, float fNew);
|
int (*SetValue)(pEVDriver self, float fNew);
|
||||||
@ -28,19 +28,8 @@
|
|||||||
void (*KillPrivate)(void *pData);
|
void (*KillPrivate)(void *pData);
|
||||||
} EVDriver;
|
} EVDriver;
|
||||||
|
|
||||||
#line 255 "evcontroller.w"
|
#line 258 "evcontroller.w"
|
||||||
|
|
||||||
/*-------------------- life & death of a driver --------------------------*/
|
/*-------------------- life & death of a driver --------------------------*/
|
||||||
pEVDriver CreateEVDriver(int argc, char *argv[]);
|
pEVDriver CreateEVDriver(int argc, char *argv[]);
|
||||||
void DeleteEVDriver(pEVDriver pDriv);
|
void DeleteEVDriver(pEVDriver pDriv);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2
hkl.c
2
hkl.c
@ -1393,7 +1393,7 @@ ente:
|
|||||||
iRet = GetCurrentPosition(self,pCon,fSet);
|
iRet = GetCurrentPosition(self,pCon,fSet);
|
||||||
if(iRet == 0)
|
if(iRet == 0)
|
||||||
{
|
{
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
angle2HKL(self,(double)fSet[0],(double)fSet[1],
|
angle2HKL(self,(double)fSet[0],(double)fSet[1],
|
||||||
(double)fSet[2],(double)fSet[3],fHKL);
|
(double)fSet[2],(double)fSet[3],fHKL);
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
self = (pLin2Ang)pData;
|
self = (pLin2Ang)pData;
|
||||||
if(!self)
|
if(!self)
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
fprintf(fd,"%s.length %f\n",name, self->length);
|
fprintf(fd,"%s.length %f\n",name, self->length);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -428,7 +428,7 @@ CreateSocketAdress(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(self->sockid);
|
iRet = close(self->sockid);
|
||||||
self->iType = 0;
|
self->iType = 0;
|
||||||
self->sockid = 0;
|
self->sockid = 0;
|
||||||
if(iRet < 0)
|
if(iRet < 0)
|
||||||
|
4
nread.c
4
nread.c
@ -153,7 +153,7 @@ extern VerifyChannel(mkChannel *self); /* defined in network.c */
|
|||||||
assert(self);
|
assert(self);
|
||||||
if(self->lMagic != NRMAGIC)
|
if(self->lMagic != NRMAGIC)
|
||||||
{
|
{
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find the entry to remove */
|
/* find the entry to remove */
|
||||||
@ -190,7 +190,7 @@ extern VerifyChannel(mkChannel *self); /* defined in network.c */
|
|||||||
if(pNew)
|
if(pNew)
|
||||||
{
|
{
|
||||||
/* create connection object */
|
/* create connection object */
|
||||||
pRes = SCreateConnection(self->pMain->pSics,pNew,iRet);
|
pRes = SCreateConnection(self->pMain->pSics,pNew,3);
|
||||||
if(!pRes)
|
if(!pRes)
|
||||||
{
|
{
|
||||||
SICSLogWrite("Failure to allocate new Connection",eInternal);
|
SICSLogWrite("Failure to allocate new Connection",eInternal);
|
||||||
|
10
nxamor.c
10
nxamor.c
@ -72,7 +72,7 @@
|
|||||||
iRet = NXDinitfromfile(AMORDICT,&hdict);
|
iRet = NXDinitfromfile(AMORDICT,&hdict);
|
||||||
if(iRet != NX_OK)
|
if(iRet != NX_OK)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot open dictionary file %s");
|
sprintf(pBueffel,"ERROR: cannot open dictionary file %s",AMORDICT);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -193,14 +193,14 @@
|
|||||||
iRet = NXopen(file,NXACC_RDWR,&hfil);
|
iRet = NXopen(file,NXACC_RDWR,&hfil);
|
||||||
if(iRet != NX_OK)
|
if(iRet != NX_OK)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot open file %s for writing");
|
sprintf(pBueffel,"ERROR: cannot open file %s for writing",file);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
iRet = NXDinitfromfile(AMORDICT,&hdict);
|
iRet = NXDinitfromfile(AMORDICT,&hdict);
|
||||||
if(iRet != NX_OK)
|
if(iRet != NX_OK)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot open dictionary file %s");
|
sprintf(pBueffel,"ERROR: cannot open dictionary file %s",AMORDICT);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -319,14 +319,14 @@
|
|||||||
iRet = NXopen(file,NXACC_RDWR,&hfil);
|
iRet = NXopen(file,NXACC_RDWR,&hfil);
|
||||||
if(iRet != NX_OK)
|
if(iRet != NX_OK)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot open file %s for writing");
|
sprintf(pBueffel,"ERROR: cannot open file %s for writing",file);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
iRet = NXDinitfromfile(AMORDICT,&hdict);
|
iRet = NXDinitfromfile(AMORDICT,&hdict);
|
||||||
if(iRet != NX_OK)
|
if(iRet != NX_OK)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot open dictionary file %s");
|
sprintf(pBueffel,"ERROR: cannot open dictionary file %s",AMORDICT);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -529,7 +529,7 @@
|
|||||||
self = (pC804Driv)pMot->pDriver;
|
self = (pC804Driv)pMot->pDriver;
|
||||||
assert(self);
|
assert(self);
|
||||||
|
|
||||||
sprintf(pCommand,"%1.1dTY\r",self->iMotor,iVal);
|
sprintf(pCommand,"%1.1dTY\r",self->iMotor);
|
||||||
iRet = SerialWriteRead(&self->pSerial,pCommand,pReply,79);
|
iRet = SerialWriteRead(&self->pSerial,pCommand,pReply,79);
|
||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
|
@ -344,7 +344,7 @@
|
|||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
pPriv->iError = BADINPUT;
|
pPriv->iError = BADINPUT;
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CookerSetPar(self,parname,fValue);
|
return CookerSetPar(self,parname,fValue);
|
||||||
|
1
scan.c
1
scan.c
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
S C A N
|
S C A N
|
||||||
|
|
||||||
|
22
sicsstat.tcl
22
sicsstat.tcl
@ -1,3 +1,5 @@
|
|||||||
|
scaninfo 9,en,2.800000,0.050000
|
||||||
|
scaninfo setAccess 0
|
||||||
sicsdatapath /data/koenneck/src/sics/tmp/
|
sicsdatapath /data/koenneck/src/sics/tmp/
|
||||||
sicsdatapath setAccess 1
|
sicsdatapath setAccess 1
|
||||||
arx2 4.290000
|
arx2 4.290000
|
||||||
@ -24,13 +26,13 @@ etam 0.000000
|
|||||||
etam setAccess 2
|
etam setAccess 2
|
||||||
wav 0.000000
|
wav 0.000000
|
||||||
wav setAccess 2
|
wav setAccess 2
|
||||||
den 0.100000
|
den 0.050000
|
||||||
den setAccess 2
|
den setAccess 2
|
||||||
dql 0.010000
|
dql 0.000000
|
||||||
dql setAccess 2
|
dql setAccess 2
|
||||||
dqk 0.000000
|
dqk 0.000000
|
||||||
dqk setAccess 2
|
dqk setAccess 2
|
||||||
dqh 0.010000
|
dqh 0.000000
|
||||||
dqh setAccess 2
|
dqh setAccess 2
|
||||||
dkf 0.000000
|
dkf 0.000000
|
||||||
dkf setAccess 2
|
dkf setAccess 2
|
||||||
@ -94,11 +96,11 @@ alf2 3.000000
|
|||||||
alf2 setAccess 2
|
alf2 setAccess 2
|
||||||
alf1 11.000000
|
alf1 11.000000
|
||||||
alf1 setAccess 2
|
alf1 setAccess 2
|
||||||
local Berty Chimney
|
local Mordahl Schlawadini
|
||||||
local setAccess 2
|
local setAccess 2
|
||||||
output a1,a2,a3,a4
|
output a1,a2,a3,a4
|
||||||
output setAccess 2
|
output setAccess 2
|
||||||
lastcommand sc qh 0 0 2 3 dqh 0.01 0.0 0.01 .1
|
lastcommand sc qh 2 0 0 3 dqh 0 0 0 .05 ti 2 np 9
|
||||||
lastcommand setAccess 2
|
lastcommand setAccess 2
|
||||||
user Billy Looser
|
user Billy Looser
|
||||||
user setAccess 2
|
user setAccess 2
|
||||||
@ -144,21 +146,21 @@ da 3.354000
|
|||||||
da setAccess 1
|
da setAccess 1
|
||||||
dm 3.354000
|
dm 3.354000
|
||||||
dm setAccess 1
|
dm setAccess 1
|
||||||
en 3.400000
|
en 3.000000
|
||||||
en setAccess 2
|
en setAccess 2
|
||||||
ql 2.040000
|
ql 0.000000
|
||||||
ql setAccess 2
|
ql setAccess 2
|
||||||
qk 0.000000
|
qk 0.000000
|
||||||
qk setAccess 2
|
qk setAccess 2
|
||||||
qh 0.040000
|
qh 2.000000
|
||||||
qh setAccess 2
|
qh setAccess 2
|
||||||
kf 1.964944
|
kf 1.964944
|
||||||
kf setAccess 2
|
kf setAccess 2
|
||||||
ef 8.000000
|
ef 8.000000
|
||||||
ef setAccess 2
|
ef setAccess 2
|
||||||
ki 2.345619
|
ki 2.304101
|
||||||
ki setAccess 2
|
ki setAccess 2
|
||||||
ei 11.400000
|
ei 11.000000
|
||||||
ei setAccess 2
|
ei setAccess 2
|
||||||
bz 1.000000
|
bz 1.000000
|
||||||
bz setAccess 2
|
bz setAccess 2
|
||||||
|
@ -650,7 +650,7 @@
|
|||||||
pPtr16 = (SQint16 *)pData;
|
pPtr16 = (SQint16 *)pData;
|
||||||
for(i = 0; i < iEnd; i++)
|
for(i = 0; i < iEnd; i++)
|
||||||
{
|
{
|
||||||
plData[i] = (HistInt)pPtr[i];
|
plData[i] = (HistInt)pPtr16[i];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
4
tas.h
4
tas.h
@ -106,8 +106,9 @@
|
|||||||
#define OUT 90
|
#define OUT 90
|
||||||
#define LOC 91
|
#define LOC 91
|
||||||
#define SWUNIT 92
|
#define SWUNIT 92
|
||||||
|
#define SINFO 93
|
||||||
|
|
||||||
#define MAXPAR 93
|
#define MAXPAR 94
|
||||||
#define MAXADD 20
|
#define MAXADD 20
|
||||||
|
|
||||||
/* --------------------- data structure -------------------------------*/
|
/* --------------------- data structure -------------------------------*/
|
||||||
@ -123,6 +124,7 @@ typedef struct {
|
|||||||
int addCount;
|
int addCount;
|
||||||
int iFileNO;
|
int iFileNO;
|
||||||
int iFast;
|
int iFast;
|
||||||
|
char scanVar[80];
|
||||||
}TASdata, *pTASdata;
|
}TASdata, *pTASdata;
|
||||||
|
|
||||||
|
|
||||||
|
6
tas.w
6
tas.w
@ -45,6 +45,7 @@ typedef struct {
|
|||||||
int addCount;
|
int addCount;
|
||||||
int iFileNO;
|
int iFileNO;
|
||||||
int iFast;
|
int iFast;
|
||||||
|
char scanVar[80];
|
||||||
}TASdata, *pTASdata;
|
}TASdata, *pTASdata;
|
||||||
@}
|
@}
|
||||||
\begin{description}
|
\begin{description}
|
||||||
@ -64,6 +65,8 @@ variables. This can be 0 for simple variables or 1 for a motor.
|
|||||||
\item[iFileNO] is the number of the current data file.
|
\item[iFileNO] is the number of the current data file.
|
||||||
\item[iFast] is a flag denoting a fast scan. In a fast scan there is
|
\item[iFast] is a flag denoting a fast scan. In a fast scan there is
|
||||||
no wait for the motors to finish driving.
|
no wait for the motors to finish driving.
|
||||||
|
\item[scanVar] memorizes the first scan variable with a step of greater
|
||||||
|
zero.
|
||||||
\end{description}
|
\end{description}
|
||||||
The constants for the parameters are defined in the header file.
|
The constants for the parameters are defined in the header file.
|
||||||
|
|
||||||
@ -189,8 +192,9 @@ These are mainly the interpreter interface functions:
|
|||||||
#define OUT 90
|
#define OUT 90
|
||||||
#define LOC 91
|
#define LOC 91
|
||||||
#define SWUNIT 92
|
#define SWUNIT 92
|
||||||
|
#define SINFO 93
|
||||||
|
|
||||||
#define MAXPAR 93
|
#define MAXPAR 94
|
||||||
#define MAXADD 20
|
#define MAXADD 20
|
||||||
|
|
||||||
/* --------------------- data structure -------------------------------*/
|
/* --------------------- data structure -------------------------------*/
|
||||||
|
@ -33,6 +33,7 @@ if { [info exists tasinit] == 0 } {
|
|||||||
Publish log User
|
Publish log User
|
||||||
Publish sz User
|
Publish sz User
|
||||||
Publish sw User
|
Publish sw User
|
||||||
|
Publish scaninfo Spy
|
||||||
}
|
}
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
@ -980,3 +981,4 @@ proc sw args {
|
|||||||
clientput [prsw]
|
clientput [prsw]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ int TASDrive(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
{
|
{
|
||||||
SCSetInterrupt(pCon,eContinue);
|
SCSetInterrupt(pCon,eContinue);
|
||||||
SCSetError(pCon,OKOK);
|
SCSetError(pCon,OKOK);
|
||||||
sprintf(pBueffel,"Driving %aborted");
|
sprintf(pBueffel,"Driving aborted");
|
||||||
SCWrite(pCon,pBueffel,eStatus);
|
SCWrite(pCon,pBueffel,eStatus);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -149,6 +149,7 @@ extern char *tasVariableOrder[] = {
|
|||||||
"output",
|
"output",
|
||||||
"local",
|
"local",
|
||||||
"swunit",
|
"swunit",
|
||||||
|
"scaninfo",
|
||||||
NULL};
|
NULL};
|
||||||
/*---------------------------------------------------------------------
|
/*---------------------------------------------------------------------
|
||||||
There is a special feauture in MAD where the count mode is determined
|
There is a special feauture in MAD where the count mode is determined
|
||||||
|
35
tasscan.c
35
tasscan.c
@ -466,7 +466,7 @@ static int TASScanPoint(pScanData self, int iPoint)
|
|||||||
*/
|
*/
|
||||||
m1 = GetMonitor(self->pCounterData,1,self->pCon);
|
m1 = GetMonitor(self->pCounterData,1,self->pCon);
|
||||||
m2 = GetMonitor(self->pCounterData,2,self->pCon);
|
m2 = GetMonitor(self->pCounterData,2,self->pCon);
|
||||||
m1 = GetMonitor(self->pCounterData,3,self->pCon);
|
m3 = GetMonitor(self->pCounterData,3,self->pCon);
|
||||||
cnts = GetCounts(self->pCounterData,self->pCon);
|
cnts = GetCounts(self->pCounterData,self->pCon);
|
||||||
fVal = GetCountTime(self->pCounterData, self->pCon);
|
fVal = GetCountTime(self->pCounterData, self->pCon);
|
||||||
sprintf(pWork,"%8d %8d %9.4f %8d %8d ",m1,m2,fVal, cnts, m3);
|
sprintf(pWork,"%8d %8d %9.4f %8d %8d ",m1,m2,fVal, cnts, m3);
|
||||||
@ -576,7 +576,7 @@ static int TASScanDrive(pScanData self, int iPoint)
|
|||||||
status = TASCalc(pTAS,self->pCon,tasMask,
|
status = TASCalc(pTAS,self->pCon,tasMask,
|
||||||
tasTargets, tasTargetMask);
|
tasTargets, tasTargetMask);
|
||||||
if(!status)
|
if(!status)
|
||||||
return;
|
return 0;
|
||||||
TASStart(pTAS,self->pCon,
|
TASStart(pTAS,self->pCon,
|
||||||
self->pSics,tasTargets,tasTargetMask);
|
self->pSics,tasTargets,tasTargetMask);
|
||||||
/*
|
/*
|
||||||
@ -974,7 +974,7 @@ static int EnterScanVar(pTASdata pTAS, char *name, float fCenter,
|
|||||||
{
|
{
|
||||||
int iPtr;
|
int iPtr;
|
||||||
char pIncrement[30], pError[132];
|
char pIncrement[30], pError[132];
|
||||||
float fIncrement, fStart;
|
float fIncrement, fStart, fTemp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
get increment
|
get increment
|
||||||
@ -996,6 +996,18 @@ static int EnterScanVar(pTASdata pTAS, char *name, float fCenter,
|
|||||||
*/
|
*/
|
||||||
fStart = fCenter - (pTAS->pScan->iNP/2) * fIncrement;
|
fStart = fCenter - (pTAS->pScan->iNP/2) * fIncrement;
|
||||||
|
|
||||||
|
/*
|
||||||
|
If step > 0 save it for scaninfo
|
||||||
|
*/
|
||||||
|
if(fIncrement < 0)
|
||||||
|
fTemp = -fIncrement;
|
||||||
|
else
|
||||||
|
fTemp = fIncrement;
|
||||||
|
if(fTemp > .001 && strlen(pTAS->scanVar) < 2)
|
||||||
|
{
|
||||||
|
sprintf(pTAS->scanVar,"%s,%f,%f",name,fStart,fIncrement);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
put it in
|
put it in
|
||||||
*/
|
*/
|
||||||
@ -1272,6 +1284,7 @@ int TASScan(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
clear out old scan
|
clear out old scan
|
||||||
*/
|
*/
|
||||||
ClearScanVar(pTAS->pScan);
|
ClearScanVar(pTAS->pScan);
|
||||||
|
pTAS->scanVar[0] = '\0';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
at this stage all simple variables have been set. Now we get the values
|
at this stage all simple variables have been set. Now we get the values
|
||||||
@ -1292,6 +1305,22 @@ int TASScan(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
if(!status)
|
if(!status)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
/*
|
||||||
|
check if there is something to scan
|
||||||
|
*/
|
||||||
|
if(pTAS->pScan->iScanVar < 1)
|
||||||
|
{
|
||||||
|
SCWrite(pCon,"ERROR: nothing to scan",eError);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
now there is enough information to set the scaninfo variable which
|
||||||
|
is needed to help the status display.
|
||||||
|
*/
|
||||||
|
sprintf(pWork,"%d,%s",pTAS->pScan->iNP,pTAS->scanVar);
|
||||||
|
VarSetText(pTAS->tasPar[SINFO],pWork,0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
parse the output variable in order to get additional stuff to write
|
parse the output variable in order to get additional stuff to write
|
||||||
*/
|
*/
|
||||||
|
@ -422,7 +422,7 @@ typedef enum {eStart, eRegel, eHalted} eVeloMode;
|
|||||||
strcpy(pBueffel,pHelp);
|
strcpy(pBueffel,pHelp);
|
||||||
sprintf(pHelp,"State: %s\n",sStatus.rm);
|
sprintf(pHelp,"State: %s\n",sStatus.rm);
|
||||||
strcat(pBueffel,pHelp);
|
strcat(pBueffel,pHelp);
|
||||||
sprintf(pHelp,"Current: %f\n",sStatus.pwr);
|
sprintf(pHelp,"Current: %d\n",sStatus.pwr);
|
||||||
strcat(pBueffel,pHelp);
|
strcat(pBueffel,pHelp);
|
||||||
sprintf(pHelp,"Rotor T: %d, Housing T: %d\n",sStatus.rot_temp,
|
sprintf(pHelp,"Rotor T: %d, Housing T: %d\n",sStatus.rot_temp,
|
||||||
sStatus.cont_temp);
|
sStatus.cont_temp);
|
||||||
|
Reference in New Issue
Block a user