- Reworked the connection object and the IO system
- Reworked the support for TRICS - Added a second generation motor
This commit is contained in:
29
velo.c
29
velo.c
@@ -180,7 +180,7 @@ static void VSListForbidden(pVelSel self, SConnection *pCon){
|
||||
self->pDriv->GetError(self->pDriv, &iCode, pError, 131);
|
||||
sprintf(pBueffel,"WARNING: trying to fix: %s",
|
||||
pError);
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eLog);
|
||||
iTest = self->pDriv->TryAndFixIt(self->pDriv,iCode);
|
||||
switch(iTest)
|
||||
{
|
||||
@@ -291,7 +291,7 @@ static void VSListForbidden(pVelSel self, SConnection *pCon){
|
||||
case VELOOK:
|
||||
case VELOREDO:
|
||||
sprintf(pBueffel,"WARNING: problem %s fixed",pError);
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eLog);
|
||||
break;
|
||||
case VELOFAIL:
|
||||
sprintf(pBueffel,"ERROR: %s", pError);
|
||||
@@ -923,12 +923,15 @@ static void VSListForbidden(pVelSel self, SConnection *pCon){
|
||||
{
|
||||
free(pCB->pName);
|
||||
}
|
||||
if(pCB->pCon)
|
||||
{
|
||||
SCDeleteConnection(pCB->pCon);
|
||||
}
|
||||
free(pCB);
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
static int RotationInterest(int iEvent, void *pData, void *pUser,
|
||||
commandContext cc)
|
||||
static int RotationInterest(int iEvent, void *pData, void *pUser)
|
||||
{
|
||||
CBData *pDat = NULL;
|
||||
float *fVal = NULL;
|
||||
@@ -938,16 +941,20 @@ static void VSListForbidden(pVelSel self, SConnection *pCon){
|
||||
pDat = (CBData *)pUser;
|
||||
assert(fVal);
|
||||
assert(pData);
|
||||
|
||||
|
||||
if(!SCisConnected(pDat->pCon)){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(iEvent == ROTSTART)
|
||||
{
|
||||
sprintf(pBueffel,"%s Starting",pDat->pName);
|
||||
SCWriteInContext(pDat->pCon,pBueffel,eWarning,cc);
|
||||
SCWrite(pDat->pCon,pBueffel,eWarning);
|
||||
}
|
||||
else if(iEvent == ROTMOVE)
|
||||
{
|
||||
sprintf(pBueffel,"%s.rpm = %f",pDat->pName, *fVal);
|
||||
SCWriteInContext(pDat->pCon,pBueffel,eWarning,cc);
|
||||
SCWrite(pDat->pCon,pBueffel,eWarning);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -1013,14 +1020,12 @@ static void VSListForbidden(pVelSel self, SConnection *pCon){
|
||||
SCWrite(pCon,"ERROR: no memory in velo.c ",eError);
|
||||
return 0;
|
||||
}
|
||||
pCB->pCon = pCon;
|
||||
pCB->pCon = SCCopyConnection(pCon);
|
||||
pCB->pName = strdup(argv[0]);
|
||||
lID = RegisterCallback(self->pCall, SCGetContext(pCon), ROTSTART, RotationInterest,
|
||||
lID = RegisterCallback(self->pCall,ROTSTART, RotationInterest,
|
||||
pCB, KillCB);
|
||||
SCRegister(pCon,pSics, self->pCall,lID);
|
||||
lID = RegisterCallback(self->pCall, SCGetContext(pCon), ROTMOVE, RotationInterest,
|
||||
lID = RegisterCallback(self->pCall, ROTMOVE, RotationInterest,
|
||||
pCB, NULL);
|
||||
SCRegister(pCon,pSics, self->pCall,lID);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user