- Added Sycamore protocol and command context to SICS
- Added sinfo to SICS - Added driver for TCP/IP Astrium velocity selector - Added driver for TCP/IP Astrium chopper controller SKIPPED: psi/amor2t.c psi/amorstat.c psi/dornier2.c psi/ecb.c psi/el734hp.c psi/fowrite.c psi/libpsi.a psi/make_gen psi/nextrics.c psi/pardef.c psi/pimotor.c psi/pipiezo.c psi/polterwrite.c psi/psi.c psi/scontroller.c psi/serial.c psi/tasinit.c psi/tasscan.c psi/tcpdocho.c psi/tcpdornier.c psi/tricssupport.c psi/velodornier.c
This commit is contained in:
@@ -173,6 +173,16 @@
|
||||
eError);
|
||||
return -999.;
|
||||
}
|
||||
|
||||
static void notifyStatus(pEVControl self, SConnection *pCon, int status) {
|
||||
if (self->pDrivInt->drivableStatus!=status) {
|
||||
((SConnection *)pCon)->conEventType=STATUS;
|
||||
((SConnection *)pCon)->conStatus=status;
|
||||
SCWrite(pCon, "", eEvent);
|
||||
self->pDrivInt->drivableStatus=status;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int EVIStatus(void *pData, SConnection *pCon)
|
||||
{
|
||||
@@ -191,6 +201,7 @@
|
||||
/* go to idle when stopped */
|
||||
if(self->iStop)
|
||||
{
|
||||
notifyStatus(self, pCon, HWIdle);
|
||||
return HWIdle;
|
||||
}
|
||||
|
||||
@@ -209,16 +220,19 @@
|
||||
case DEVFAULT:
|
||||
sprintf(pBueffel,"ERROR: %s",pError);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
notifyStatus(self, pCon, HWFault);
|
||||
return HWFault;
|
||||
case DEVREDO:
|
||||
sprintf(pBueffel,"WARNING: Fixing problem %s",pError);
|
||||
SCWrite(pCon,pBueffel,eWarning);
|
||||
notifyStatus(self, pCon, HWBusy);
|
||||
return HWBusy;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(iRet == -1 ) /* pending */
|
||||
{
|
||||
notifyStatus(self, pCon, HWBusy);
|
||||
return HWBusy;
|
||||
}
|
||||
|
||||
@@ -228,6 +242,7 @@
|
||||
self->pName);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
self->eMode = EVIdle;
|
||||
notifyStatus(self, pCon, HWFault);
|
||||
return HWFault;
|
||||
}
|
||||
|
||||
@@ -254,6 +269,7 @@
|
||||
self->pName);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
self->eMode = EVMonitor;
|
||||
notifyStatus(self, pCon, HWIdle);
|
||||
return HWIdle;
|
||||
}
|
||||
tol = ObVal(self->pParam, TOLERANCE);
|
||||
@@ -272,13 +288,16 @@
|
||||
self->pName, (self->lastt + tmo - now)*1.0);
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
}
|
||||
notifyStatus(self, pCon, HWBusy);
|
||||
return HWBusy;
|
||||
}
|
||||
if (now > self->lastt + tmo)
|
||||
{
|
||||
self->eMode = EVMonitor;
|
||||
notifyStatus(self, pCon, HWIdle);
|
||||
return HWIdle;
|
||||
}
|
||||
notifyStatus(self, pCon, HWBusy);
|
||||
return HWBusy;
|
||||
}
|
||||
else
|
||||
@@ -289,6 +308,7 @@
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
self->lastt -= now;
|
||||
}
|
||||
notifyStatus(self, pCon, HWBusy);
|
||||
return HWBusy;
|
||||
}
|
||||
}
|
||||
@@ -1009,7 +1029,8 @@ static void ErrReport(pEVControl self)
|
||||
return 1;
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
static int EVCallBack(int iEvent, void *pEventData, void *pUserData)
|
||||
static int EVCallBack(int iEvent, void *pEventData, void *pUserData,
|
||||
commandContext cc)
|
||||
{
|
||||
char *pBuf = (char *)pEventData;
|
||||
SConnection *pCon = (SConnection *)pUserData;
|
||||
@@ -1017,7 +1038,8 @@ static void ErrReport(pEVControl self)
|
||||
|
||||
if(iEvent == VALUECHANGE)
|
||||
{
|
||||
SCWrite(pCon,pBuf,eValue);
|
||||
pCon->conEventType=POSITION;
|
||||
SCWriteInContext(pCon,pBuf,eEvent,cc);
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
@@ -1075,7 +1097,8 @@ static void ErrReport(pEVControl self)
|
||||
/* install automatic notification */
|
||||
else if(strcmp(argv[1],"interest") == 0)
|
||||
{
|
||||
lID = RegisterCallback(self->pCall, VALUECHANGE, EVCallBack,
|
||||
lID = RegisterCallback(self->pCall, SCGetContext(pCon),
|
||||
VALUECHANGE, EVCallBack,
|
||||
pCon, NULL);
|
||||
SCRegister(pCon,pSics, self->pCall,lID);
|
||||
SCSendOK(pCon);
|
||||
@@ -1414,13 +1437,14 @@ int RemoveEVController(SConnection *pCon, char *name) {
|
||||
SCWrite(pCon,"ERROR: cannot delete while running",eError);
|
||||
return 0;
|
||||
}
|
||||
if (!FindCommandData(pServ->pSics, name, "Environment Controller")) {
|
||||
SCPrintf(pCon,eError,"ERROR: no environment controller %s found",name);
|
||||
EVUnregister(FindEMON(pServ->pSics),name);
|
||||
iRet = RemoveCommand(pServ->pSics,name);
|
||||
if(!iRet)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: %s not found, NOT deleted",name);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EVUnregister(FindEMON(pServ->pSics),name);
|
||||
RemoveCommand(pServ->pSics,name);
|
||||
return 1;
|
||||
}
|
||||
/*-------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user