3 * @brief Declarations for actuator control
15 * Maximum number of actuators program can be compiled with
16 * (If you get an error "Increase ACTUATORS_MAX from %d" this is what it refers to)
18 #define ACTUATORS_MAX 5
19 extern int g_num_actuators; // in actuator.c
23 /** Control structure for Actuator setting **/
26 //TODO: Add functionality as needed
27 // Currently implements a simple piecewise step increase
28 // Would be cool to have a function specified as a string... eg: "1.0 + 0.5*s^2" with "s" the step number, and then give "stepwait" and "steps"
29 // ... But that, like so many things, is probably overkill
30 /** Current value of Actuator **/
32 /** Time to maintain Actuator at each value **/
34 /** Amount to increase/decrease Actuator on each step **/
36 /** Number of steps still to perform **/
37 int steps; // Note that after it is first set, this will be decremented until it is zero
43 /** ID number of the actuator **/
45 /** User ID number **/
49 /** Control parameters for the Actuator **/
50 ActuatorControl control;
51 /** Flag indicates if ActuatorControl has been changed **/
53 /** DataFile to store actuator settings **/
55 /** Thread the Actuator is controlled by **/
57 /** Mutex around ActuatorControl **/
58 pthread_mutex_t mutex;
59 /** Used to wake up Actuator control thread **/
61 /** Indicates whether the Actuator is running **/
63 /** Initialisation function **/
67 /** Sanity check function **/
69 /** Cleanup function **/
74 extern void Actuator_Init(); // One off initialisation of *all* Actuators
76 extern void Actuator_SetModeAll(ControlModes mode, void *arg);
77 extern void Actuator_SetMode(Actuator * a, ControlModes mode, void *arg);
79 extern void * Actuator_Loop(void * args); // Main loop for a thread that handles an Actuator
80 extern void Actuator_SetValue(Actuator * a, double value); // Set an actuator by value
81 extern void Actuator_SetControl(Actuator * a, ActuatorControl * c); // Set the control for an Actuator
82 extern Actuator * Actuator_Identify(const char * str); // Identify a Sensor from a string Id
84 extern void Actuator_Handler(FCGIContext *context, char * params); // Handle a FCGI request for Actuator control
85 extern const char * Actuator_GetName(int id);