- Changes to SLS magnet controller

- Added nxscript putsicsdata to nxscript
This commit is contained in:
koennecke
2005-10-20 12:40:58 +00:00
parent cfb098aebb
commit 39877fc11a
10 changed files with 283 additions and 223 deletions

View File

@ -66,6 +66,7 @@
#include "chadapter.h"
#include "status.h"
#include "site.h"
#include "commandlog.h"
/*--------------------- Functions needed to implement interfaces -----------*/
static long EVIDrive(void *pData, SConnection *pCon, float fVal)
{
@ -176,7 +177,7 @@
static int EVIStatus(void *pData, SConnection *pCon)
{
pEVControl self = NULL;
float fPos, fDelta;
float fPos, fDelta = .0;
int iRet, iCode, iFix;
char pBueffel[256], pError[132];
static int callCount;
@ -196,7 +197,6 @@
/* get the current position */
iRet = self->pDriv->GetValues(self->pDriv,&self->fTarget,&fPos,&fDelta);
if(iRet == 0)
{
self->pDriv->GetError(self->pDriv,&iCode, pError,131);
@ -241,7 +241,7 @@
if(callCount >= 10)
{
sprintf(pBueffel,"%s = %g", self->pName, fPos);
InvokeCallBack(self->pCall, VALUECHANGE,pBueffel);
InvokeCallBack(self->pCall, VALUECHANGE,pBueffel);
callCount = 0;
}
@ -362,7 +362,7 @@ static void ErrWrite(char *txt, SCStore *conn)
/*-----------------------------------------------------------------------*/
static void ErrReport(pEVControl self)
{
float fPos, fDelta;
float fPos =.0, fDelta =.0;
char pBueffel[256];
self->pDriv->GetValues(self->pDriv,&self->fTarget,&fPos,&fDelta);
@ -550,7 +550,7 @@ static void ErrReport(pEVControl self)
pEVControl self = NULL;
float fPos, fDelta;
int iRet, iCode, iStat;
char pError[10], pBueffel[512];
char pError[132], pBueffel[512];
pExeList pExe = NULL;
SConnection *pCon = NULL;
float tol;
@ -607,7 +607,9 @@ static void ErrReport(pEVControl self)
/* break down of connection to a environment device has to be
considered a problem as well
*/
self->pDriv->GetError(self->pDriv, &iCode,pError,9);
memset(pError,0,132*sizeof(char));
self->pDriv->GetError(self->pDriv, &iCode,pError,131);
WriteToCommandLog("emon>> ",pError);
iStat = self->pDriv->TryFixIt(self->pDriv, iCode);
if( (iStat == DEVOK) || (iStat == DEVREDO) )
{