PSI sics-cvs-psi-2006
This commit is contained in:
25
interface.w
25
interface.w
@@ -45,11 +45,13 @@ Let's start with the objectdescriptor:
|
||||
#ifndef SICSDESCRIPTOR
|
||||
#define SICSDESCRIPTOR
|
||||
#include <stdio.h>
|
||||
#include <ifile.h>
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
int (*SaveStatus)(void *self, char *name,FILE *fd);
|
||||
void *(*GetInterface)(void *self, int iInterfaceID);
|
||||
IPair *pKeys;
|
||||
} ObjectDescriptor, *pObjectDescriptor;
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@@ -126,9 +128,12 @@ environment controllers fit this bill as well.
|
||||
int (*CheckStatus)(void *self, SConnection *pCon);
|
||||
float (*GetValue)(void *self, SConnection *pCon);
|
||||
int iErrorCount;
|
||||
int drivableStatus;
|
||||
} IDrivable, *pIDrivable;
|
||||
|
||||
pIDrivable GetDrivableInterface(void *pObject);
|
||||
int GetDrivablePosition(void *pObject, SConnection *pCon,
|
||||
float *fPos);
|
||||
|
||||
@}
|
||||
The first member of this structure is an ID which can be used in order to
|
||||
@@ -170,6 +175,10 @@ the existence of a drivable interface. If it exists a pointer to it will be
|
||||
returned. NEVER free this pointer. If no drivable interface exists, NULL
|
||||
will be returned.
|
||||
|
||||
{\bf GetDrivablePosition retrieves the position of the drivabel
|
||||
object. If the device is a motor corrections for zero points and signs
|
||||
will be applied. Returns 1 on success and 0 on failure}
|
||||
|
||||
\subsubsection{The Countable Interface}
|
||||
This is an interface for interacting with anything which counts.
|
||||
|
||||
@@ -230,7 +239,7 @@ function:
|
||||
@d callfunc @{
|
||||
typedef void (*KillFuncIT)(void *pData);
|
||||
typedef int (*SICSCallBack)(int iEvent, void *pEventData,
|
||||
void *pUserData);
|
||||
void *pUserData, commandContext cc);
|
||||
@}
|
||||
|
||||
The callback function is meant to return 0 for failure or 1 for success.
|
||||
@@ -258,7 +267,8 @@ interface:
|
||||
int InvokeCallBack(pICallBack pInterface, int iEvent, void *pEventData);
|
||||
|
||||
/* callback client side */
|
||||
long RegisterCallback(pICallBack pInterface, int iEvent, SICSCallBack pFunc,
|
||||
long RegisterCallback(pICallBack pInterface, commandContext comCon,
|
||||
int iEvent, SICSCallBack pFunc,
|
||||
void *pUserData, KillFuncIT pKill);
|
||||
int RemoveCallback(pICallBack pInterface, long iID);
|
||||
int RemoveCallback2(pICallBack pInterface, void *pUserData);
|
||||
@@ -354,6 +364,16 @@ The environment interface has just one function associated with it:
|
||||
|
||||
@o obdes.h -d @{
|
||||
@<obdes@>
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* Additional properties used by the ANSTO site to provide more information
|
||||
* about each object instance, especially devices.
|
||||
*/
|
||||
void SetDescriptorKey(pObjectDescriptor self, char *keyName, char *value);
|
||||
void SetDescriptorGroup(pObjectDescriptor self, char *group);
|
||||
void SetDescriptorDescription(pObjectDescriptor self, char *description);
|
||||
char * GetDescriptorKey(pObjectDescriptor self, char *keyName);
|
||||
char * GetDescriptorGroup(pObjectDescriptor self);
|
||||
char * GetDescriptorDescription(pObjectDescriptor self);
|
||||
@}
|
||||
|
||||
@o interface.h -d @{
|
||||
@@ -373,6 +393,7 @@ The environment interface has just one function associated with it:
|
||||
|
||||
#ifndef SICSINTERFACES
|
||||
#define SICSINTERFACES
|
||||
#include "commandcontext.h"
|
||||
|
||||
/* interface ID's used to recognize an interface */
|
||||
#define DRIVEID 513
|
||||
|
||||
Reference in New Issue
Block a user