various changes
This commit is contained in:
30
statemon.c
30
statemon.c
@ -125,9 +125,13 @@ static int StateInterest(int iEvent, void *pEvent, void *pUser)
|
||||
snprintf(buffer, 255, "SUID MSG FINISH = %s", device);
|
||||
SCWrite(pStateMonDummyCon, buffer, eError);
|
||||
}
|
||||
pVar = (pSicsVariable)FindCommandData(pServ->pSics,SICS_SUID,"SicsVariable");
|
||||
pVar =
|
||||
(pSicsVariable) FindCommandData(pServ->pSics, SICS_SUID,
|
||||
"SicsVariable");
|
||||
if (pVar == NULL) {
|
||||
SCWrite(pStateMonDummyCon,"ERROR: StateMon.c: Could not find SUID SicsVariable",eError);
|
||||
SCWrite(pStateMonDummyCon,
|
||||
"ERROR: StateMon.c: Could not find SUID SicsVariable",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
(pVar->iVal)++;
|
||||
@ -141,6 +145,22 @@ static int StateInterest(int iEvent, void *pEvent, void *pUser)
|
||||
snprintf(buffer, 255, "FINISH = %s", device);
|
||||
SCWrite(pCon, buffer, eWarning);
|
||||
}
|
||||
if (iEvent == STPAUSE) {
|
||||
snprintf(buffer, 255, "PAUSE = %s", device);
|
||||
SCWrite(pCon, buffer, eWarning);
|
||||
}
|
||||
if (iEvent == STCONTINUE) {
|
||||
snprintf(buffer, 255, "CONTINUE = %s", device);
|
||||
SCWrite(pCon, buffer, eWarning);
|
||||
}
|
||||
if (iEvent == STBUSY) {
|
||||
snprintf(buffer, 255, "BUSY = %s", device);
|
||||
SCWrite(pCon, buffer, eWarning);
|
||||
}
|
||||
if (iEvent == STIDLE) {
|
||||
snprintf(buffer, 255, "IDLE = %s", device);
|
||||
SCWrite(pCon, buffer, eWarning);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -324,9 +344,11 @@ int StateMonFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
}
|
||||
/* Make dummy connection for SUID (instrument state id) */
|
||||
pStateMonDummyCon = SCCreateDummyConnection(pSics);
|
||||
lID = RegisterCallback(pNew->pCall, STSTART, StateInterest, pStateMonDummyCon, NULL);
|
||||
lID = RegisterCallback(pNew->pCall, STSTART, StateInterest,
|
||||
pStateMonDummyCon, NULL);
|
||||
SCRegister(pStateMonDummyCon, pSics, pNew->pCall, lID);
|
||||
lID = RegisterCallback(pNew->pCall, STEND, StateInterest, pStateMonDummyCon, NULL);
|
||||
lID = RegisterCallback(pNew->pCall, STEND, StateInterest,
|
||||
pStateMonDummyCon, NULL);
|
||||
SCRegister(pStateMonDummyCon, pSics, pNew->pCall, lID);
|
||||
pRes = VarCreate(usInternal, veInt, SICS_SUID);
|
||||
AddCommand(pSics, SICS_SUID, VarWrapper, (KillFunc) VarKill, pRes);
|
||||
|
Reference in New Issue
Block a user