- Reworked the connection object and the IO system
- Reworked the support for TRICS - Added a second generation motor
This commit is contained in:
19
sicvar.c
19
sicvar.c
@@ -345,8 +345,7 @@
|
||||
}
|
||||
}
|
||||
/*--------------------------------------------------------------------*/
|
||||
static int VarInterestCallback(int iEvent, void *pEvent, void *pUser,
|
||||
commandContext cc)
|
||||
static int VarInterestCallback(int iEvent, void *pEvent, void *pUser)
|
||||
{
|
||||
SConnection *pCon;
|
||||
char pBueffel[512];
|
||||
@@ -360,7 +359,13 @@
|
||||
|
||||
pVar = (pSicsVariable)pEvent;
|
||||
pCon = (SConnection *)pUser;
|
||||
SCPushContext2(pCon,cc);
|
||||
|
||||
/* check kill conditions */
|
||||
if(pCon == NULL || !SCisConnected(pCon))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch(pVar->eType)
|
||||
{
|
||||
case veInt:
|
||||
@@ -386,7 +391,6 @@
|
||||
status = 1;
|
||||
break;
|
||||
}
|
||||
SCPopContext(pCon);
|
||||
return status;
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -536,17 +540,16 @@ static int VarSetFromText(pSicsVariable self, SConnection *pCon, char *text)
|
||||
}
|
||||
else if(strcmp(pCurrent->text,"interest") == 0) /* interest */
|
||||
{
|
||||
lID = RegisterCallback(pVar->pCall, SCGetContext(pCon),
|
||||
lID = RegisterCallback(pVar->pCall,
|
||||
VALUECHANGE, VarInterestCallback,
|
||||
pCon, NULL);
|
||||
SCRegister(pCon,pInterp, pVar->pCall,lID);
|
||||
SCCopyConnection(pCon), SCDeleteConnection);
|
||||
DeleteTokenList(pList);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
}
|
||||
else if(strcmp(pCurrent->text,"uninterest") == 0)
|
||||
{
|
||||
RemoveCallback2(pVar->pCall,pCon);
|
||||
RemoveCallbackCon(pVar->pCall,pCon);
|
||||
DeleteTokenList(pList);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user