3 * @purpose Declarations for actuator control
12 //NOTE: Functionality is very similar to Sensor stuff
13 // BUT it's probably very unwise to try and generalise Sensors and Actuators to the same thing (ie: Device)
14 // Might be OK in C++ but not easy in C
16 /** Number of actuators **/
17 #define NUMACTUATORS 2
19 /** List of actuator ids (should be of size NUMACTUATORS) **/
26 /** Human readable names for the Actuators **/
27 extern const char * g_actuator_names[NUMACTUATORS];
29 /** Control structure for Actuator setting **/
32 //TODO: Add functionality as needed
33 /** Simple value for Actuator **/
39 /** ID number of the actuator **/
41 /** Control parameters for the Actuator **/
42 ActuatorControl control;
43 /** Flag indicates if ActuatorControl has been changed **/
45 /** DataFile to store actuator settings **/
47 /** Thread the Actuator is controlled by **/
49 /** Mutex around ActuatorControl **/
50 pthread_mutex_t mutex;
51 /** Used to wake up Actuator control thread **/
53 /** Indicates whether the Actuator is running **/
58 extern void Actuator_Init(); // One off initialisation of *all* Actuators
61 extern void Actuator_StartAll(const char * experiment_name); // Start all Actuators
62 extern void Actuator_StopAll(); // Stop all Actuators
64 extern void Actuator_Start(Actuator * a, const char * experiment_name); // Start a Actuator
65 extern void Actuator_Stop(Actuator * a); // Stop an Actuator
68 extern void * Actuator_Loop(void * args); // Main loop for a thread that handles an Actuator
69 extern void Actuator_SetValue(Actuator * a, double value); // Set an actuator by value
70 extern void Actuator_SetControl(Actuator * a, ActuatorControl * c); // Set the control for an Actuator
71 extern Actuator * Actuator_Identify(const char * str); // Identify a Sensor from a string Id
73 extern void Actuator_Handler(FCGIContext *context, char * params); // Handle a FCGI request for Actuator control