- allow scriptcontext objects to be dynamic

- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
zolliker
2009-02-19 13:30:32 +00:00
parent 981534624f
commit 35f2b6b810
33 changed files with 753 additions and 310 deletions

View File

@ -788,6 +788,40 @@ int StopExe(pExeList self, char *name)
return 0;
}
/*-------------------------------------------------------------------------*/
int StopByData(pExeList self, void *data)
{
int iRet;
pDevEntry pDev = NULL;
pIDrivable pDrivInt = NULL;
pICountable pCountInt = NULL;
iRet = LLDnodePtr2First(self->iList);
while (iRet != 0) {
pDev = (pDevEntry) LLDnodePtr(self->iList);
if (pDev) {
if (pDev->pData == data) {
pDrivInt = pDev->pDescriptor->GetInterface(pDev->pData, DRIVEID);
pCountInt = pDev->pDescriptor->GetInterface(pDev->pData, COUNTID);
if (pDrivInt) {
pDrivInt->Halt(pDev->pData);
} else if (pCountInt) {
pCountInt->Halt(pDev->pData);
}
ExeInterest(self, pDev, "finished");
DevexecLog("FINISHED", pDev->name);
DeleteDevEntry(pDev);
LLDnodeDelete(self->iList);
self->iStatus = DEVDONE;
SCWrite(self->pOwner, "", eFinish);
return 1;
}
}
iRet = LLDnodePtr2Next(self->iList);
}
return 0;
}
/*-------------------------------------------------------------------------*/
int StopExeWait(pExeList self)
{
@ -795,7 +829,6 @@ int StopExeWait(pExeList self)
Wait4Success(self);
return 1;
}
/*--------------------------------------------------------------------------*/
int PauseExecution(pExeList self)
{
@ -1006,7 +1039,6 @@ int SicsIdle(SConnection * pCon, SicsInterp * pSics, void *pData,
Usage:
Success
*/
int Success(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[])
{
@ -1020,6 +1052,8 @@ int Success(SConnection * pCon, SicsInterp * pSics, void *pData,
if (SCGetInterrupt(pCon) == eAbortOperation) {
SCSetInterrupt(pCon, eContinue);
iRet = 0;
} else {
iRet = 1;
}
} else if (iRet == DEVDONE) {
SCWrite(pCon, "All done", eValue);
@ -1031,7 +1065,6 @@ int Success(SConnection * pCon, SicsInterp * pSics, void *pData,
SetStatus(eEager);
return iRet;
}
/*-------------------------------------------------------------------------*/
int PauseAction(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[])