A class to provide VisAO functionality to the adopt motor controller. More...
#include <VisAOSimpleMotorCtrl.h>
Public Types | |
enum | control_modes { CMODE_NONE, CMODE_REMOTE, CMODE_LOCAL, CMODE_SCRIPT, CMODE_AUTO, CMODE_max } |
The control modes. | |
Public Member Functions | |
VisAOSimpleMotorCtrl (std::string name, const std::string &conffile) throw (AOException) | |
Standard adopt style config file constructor. | |
VisAOSimpleMotorCtrl (int argc, char **argv) throw (AOException) | |
Standard adopt style command line constructor. | |
virtual int | request_control (int cmode) |
Calls request_control(cmode, 0). | |
virtual int | request_control (int cmode, bool override) |
Attempts to change the control type. More... | |
double | getAbortPos () |
Exposes the abort Position (_abortPos) for use in PosReqChanged (which is static) | |
Static Public Member Functions | |
static int | CModeReqChanged (void *pt, Variable *msgb) |
RTDB handler for a control mode change request from the AO Supervisor. | |
static int | VisAO_PosReqChanged (void *pt, Variable *msgb) |
RTDB handler for a position change by the AO Supervisor. More... | |
static int | VisAO_PosLocalReqChanged (void *pt, Variable *msgb) |
RTDB handler for a position change by the AO Supervisor. More... | |
static int | VisAO_PosScriptReqChanged (void *pt, Variable *msgb) |
RTDB handler for a position change by the AO Supervisor. More... | |
Static Public Attributes | |
static int | control_mode = VisAOSimpleMotorCtrl::CMODE_REMOTE |
The current control mode. More... | |
static int | default_control_mode = -1 |
The default control mode. More... | |
Protected Member Functions | |
void | SetupVars () |
Virtual function to setup variables in RTDB. | |
virtual SimpleMotor * | CreateMotor () |
Overridden to test if this is a VisAOFilterWheel. More... | |
virtual void | updatePos (bool force=false) |
Update position variables in RTDB. | |
std::string | GetPosName (double pos) |
Get the position name from wheel position. | |
int | GetType (double pos) |
Get the position type from the wheel position. | |
Protected Attributes | |
RTDBvar | var_cmode_cur |
The current control mode in the RTDB. | |
RTDBvar | var_cmode_req |
The requested control mode in the RTDB. | |
double | cur_pos |
map< std::string, float >::iterator | cpos_it |
An iterator for accessing the custom pos list. | |
multimap< int, float > | _customTypes |
Custom filter types list. | |
multimap< int, float >::iterator | ctype_it |
An iterator for accessing the custom pos list. | |
Uses the control logic unchanged from SimpleMotorCtrl, and adds the VisAOApp_base command fifos for local and script control using a signal thread. No remote fifo is provided, as remote control is via the RTDB. Intercepts the PosReqChanged notification to test if in remote control, and provides the facility for changing control mode from RTDB.
Definition at line 39 of file VisAOSimpleMotorCtrl.h.
|
protectedvirtual |
Handle notifications if it is. If not this behaves as a standard adopt SimpleMotorCtrl.
Definition at line 69 of file VisAOSimpleMotorCtrl.cpp.
References VisAO_PosLocalReqChanged(), VisAO_PosReqChanged(), and VisAO_PosScriptReqChanged().
cmode | The requested control mode |
override | If not true, forces the change no matter what current mode is. |
control_mode | if successful. |
-1 | if unsuccessful. |
Definition at line 164 of file VisAOSimpleMotorCtrl.cpp.
References control_mode, and var_cmode_cur.
|
static |
After checking if control_mode == CMODE_REMOTE, just calls SimpleMotorCtrl::PosReqChanged.
Definition at line 229 of file VisAOSimpleMotorCtrl.cpp.
References control_mode, getAbortPos(), and VisAO::threadMutex.
Referenced by CreateMotor().
|
static |
After checking if control_mode == CMODE_LOCAL, just calls SimpleMotorCtrl::PosReqChanged.
Definition at line 264 of file VisAOSimpleMotorCtrl.cpp.
References control_mode, getAbortPos(), and VisAO::threadMutex.
Referenced by CreateMotor().
|
static |
After checking if control_mode == CMODE_SCRIPT, just calls SimpleMotorCtrl::PosReqChanged.
Definition at line 299 of file VisAOSimpleMotorCtrl.cpp.
References control_mode, getAbortPos(), and VisAO::threadMutex.
Referenced by CreateMotor().
|
static |
Is static so it can be used by static RTDB handlers.
Definition at line 84 of file VisAOSimpleMotorCtrl.h.
Referenced by request_control(), SetupVars(), VisAO_PosLocalReqChanged(), VisAO_PosReqChanged(), and VisAO_PosScriptReqChanged().
|
static |
If not -1, then this mode is always returned to, instead of NONE.
Definition at line 89 of file VisAOSimpleMotorCtrl.h.