- Connections write timeouts were incorrectly handled in asynnetc. Fixed.

- Implemented the desired run/drive behaviour: drive waits for what it started
  run starts, and success waits for everything to finish. This required
  changes to a lot of files.
- Fixed a bug in remob which supressed required messages
This commit is contained in:
koennecke
2009-04-17 12:52:01 +00:00
parent 50b0a5c4a7
commit 99d2485d22
39 changed files with 422 additions and 200 deletions

189
devexec.h
View File

@ -1,5 +1,5 @@
#line 197 "devexec.w"
#line 202 "devexec.w"
/*----------------------------------------------------------------------------
@ -28,7 +28,7 @@
#include "obdes.h"
#include "task.h"
typedef struct __EXELIST *pExeList;
typedef struct __EXELIST *pExeList;
/* Returncodes */
@ -37,140 +37,145 @@ typedef struct __EXELIST *pExeList;
#define DEVERROR 2
#define DEVBUSY 3
/* run level codes */
#define RUNRUN 0
#define RUNDRIVE 1
/*------------------------------------------------------------------------
B I R T H & D E A T H
*/
pExeList CreateExeList(pTaskMan pTask);
void DeleteExeList(void *self);
pExeList CreateExeList(pTaskMan pTask);
void DeleteExeList(void *self);
/* ================= Functions to talk to the above ====================== */
#line 43 "devexec.w"
int StartDevice(pExeList self, char *name, pObjectDescriptor pDes,
void *pData, SConnection * pCon, float fNew);
int StartMotor(pExeList self, SicsInterp * pSics, SConnection * pCon,
char *name, float fNew);
int StartCounter(pExeList self, SicsInterp * pSics, SConnection * pCon,
char *name);
int StartDevice(pExeList self, char *name, pObjectDescriptor pDes,
void *pData, SConnection *pCon, int level, float fNew);
int StartMotor(pExeList self, SicsInterp *pSics, SConnection *pCon,
char *name, int level, float fNew);
int StartCounter(pExeList self, SicsInterp *pSics, SConnection *pCon,
int level, char *name);
#line 241 "devexec.w"
#line 249 "devexec.w"
/*------------------------------------------------------------------------*/
#line 88 "devexec.w"
#line 89 "devexec.w"
int CheckExeList(pExeList self);
int CheckExeList(pExeList self);
/*
checks the entries for success and deletes entries which have finished
operation. If there are none left, the pOwner will be set to NULL.
*/
int Wait4Success(pExeList self);
checks the entries for success and deletes entries which have finished
operation. If there are none left, the pOwner will be set to NULL.
*/
int Wait4Success(pExeList self);
long GetDevexecID(pExeList self);
long GetDevexecID(pExeList self);
int DevExecTask(void *pEL);
void DevExecSignal(void *pEL, int iSignal, void *pSigData);
int DevExecLevelRunning(pExeList self, int level);
int DevExecTask(void *pEL);
void DevExecSignal(void *pEL, int iSignal, void *pSigData);
#line 243 "devexec.w"
#line 251 "devexec.w"
/*
Waits for execution to finish. returns 1 on Success, 0 if problems
ocurred. Than the Interrupt code shall be checked and acted upon
accordingly.
*/
Waits for execution to finish. returns 1 on Success, 0 if problems
ocurred. Than the Interrupt code shall be checked and acted upon
accordingly.
*/
/*-------------------------------------------------------------------------*/
SConnection *GetExeOwner(pExeList self);
SConnection *GetExeOwner(pExeList self);
/*-------------------------------------------------------------------------*/
int isInRunMode(pExeList self);
int isInRunMode(pExeList self);
/*--------------------------------------------------------------------------*/
int ListPending(pExeList self, SConnection * pCon);
int ListPending(pExeList self, SConnection *pCon);
/*
lists the Operations still pending on pCon.
*/
lists the Operations still pending on pCon.
*/
/*-------------------------------------------------------------------------*/
#line 137 "devexec.w"
#line 142 "devexec.w"
int StopExe(pExeList self, char *name);
int StopExeWait(pExeList self);
int StopExe(pExeList self, char *name);
int StopExeWait(pExeList self);
/*
will stop the entry name and its subentries from executing.
If ALL is specified as name, everything will be stopped and
the Executor cleared.
StopExeWait will stop all running things and wait for the stop
to complete.
*/
int StopByData(pExeList self, void *data);
will stop the entry name and its subentries from executing.
If ALL is specified as name, everything will be stopped and
the Executor cleared.
StopExeWait will stop all running things and wait for the stop
to complete.
*/
int StopByData(pExeList self, void *data);
/* stop the entry with the given data from execution */
/*------------------------------------------------------------------------*/
void ClearExecutor(pExeList self);
void ClearExecutor(pExeList self);
/*
clears the executor without sending commands to the devices.
*/
clears the executor without sending commands to the devices.
*/
/*-----------------------------------------------------------------------*/
int IsCounting(pExeList self);
int PauseExecution(pExeList self);
int ContinueExecution(pExeList self);
int IsCounting(pExeList self);
int PauseExecution(pExeList self);
int ContinueExecution(pExeList self);
#line 261 "devexec.w"
#line 269 "devexec.w"
/*-------------------------- Commands ------------------------------------*/
int DevexecAction(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
int StopCommand(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
int DevexecAction(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
int StopCommand(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*
implements the stop command
*/
int ListExe(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
implements the stop command
*/
int ListExe(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*
lists all currently executing objects
*/
int SicsIdle(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
lists all currently executing objects
*/
int SicsIdle(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*
prints the seconds since the device executor was running the last time
*/
prints the seconds since the device executor was running the last time
*/
int Success(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
int Success(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*
waits until completion of all pending operations. Used in
connection with non blocking operation such as motors started
with run.
*/
int PauseAction(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
waits until completion of all pending operations. Used in
connection with non blocking operation such as motors started
with run.
*/
int PauseAction(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*
pauses execution
*/
int ContinueAction(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
pauses execution
*/
int ContinueAction(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*
continues execution
*/
continues execution
*/
/*--------------------------- Locking ---------------------------------*/
#line 185 "devexec.w"
void LockDeviceExecutor(pExeList self);
void UnlockDeviceExecutor(pExeList self);
#line 301 "devexec.w"
#line 190 "devexec.w"
void LockDeviceExecutor(pExeList self);
void UnlockDeviceExecutor(pExeList self);
#line 309 "devexec.w"
/* -------------------------- Executor management -------------------------*/
pExeList GetExecutor(void);
void SetExecutor(pExeList pExe);
pExeList GetExecutor(void);
void SetExecutor(pExeList pExe);
/*----------------------- Logging -----------------------------------------*/
void DevexecLog(char *op, char *device);
#endif
void DevexecLog(char *op, char *device);
#endif