#include <stdMotionNode.hpp>


Public Member Functions | |
| stdMotionNode (const std::string &name, ingr::instGraphXML *parentGraph) | |
| Only c'tor. Must be constructed with node name and a parent graph. | |
| virtual void | device (const std::string &dev) |
| Set the device name. This can only be done once. | |
| virtual void | presetPrefix (const std::string &pp) |
| const std::string & | presetPrefix () |
| const std::string & | curLabel () |
| Get the current label text. | |
| void | presetPutName (const std::vector< std::string > &ppp) |
| const std::vector< std::string > & | presetPutName () |
| void | presetDir (const ingr::ioDir &dir) |
| const ingr::ioDir & | presetDir () |
| void | trackingReqKey (const std::string &tk) |
| const std::string & | trackingReqKey () |
| void | trackingReqElement (const std::string &te) |
| const std::string & | trackingReqElement () |
| void | trackerKey (const std::string &tk) |
| const std::string & | trackerKey () |
| void | trackerElement (const std::string &te) |
| const std::string & | trackerElement () |
| virtual int | handleSetProperty (const pcf::IndiProperty &ipRecv) |
| INDI SetProperty callback. | |
| virtual void | togglePutsOn () |
| Change the state of all inputs and all outputs to on. | |
| virtual void | togglePutsOff () |
| Change the state of all inputs and all outputs to off. | |
| void | loadConfig (mx::app::appConfigurator &config) |
| virtual void | device (const std::string &dev) |
| Set the device name. | |
| const std::string & | device () const |
| Get the device name. | |
| virtual void | fsmPropName (const std::string &pn) |
| Set the fsm property name. | |
| const std::string & | fsmPropName () const |
| Get the fsm property name. | |
| virtual void | fsmElName (const std::string &en) |
| Set the fsm element name. | |
| const std::string & | fsmElName () const |
| Get the fsm element name. | |
| const std::string & | fsmKey () const |
| Get the FSM unique key. | |
| fsmNodeActionT | fsmAction () const |
| Get the action. | |
| void | fsmAction (fsmNodeActionT act) |
| Set the action. | |
| const std::vector< stateCodeT > & | targetStates () const |
| Get the target states. | |
| virtual int | handleSetProperty (bool &actionTaken, const pcf::IndiProperty &ipRecv) |
| INDI SetProperty callback with indication if action was taken. | |
| virtual void | updateGUI () |
| std::string | name () |
| Get the name of this node. | |
| const std::set< std::string > & | keys () |
| Get the set holding the INDI keys for this node. | |
| void | key (const std::string &nkey) |
| Add a key to the set. | |
| ingr::instNode * | node () |
| Get the pointer to the underlying node. | |
Protected Member Functions | |
| void | loadConfigDerived (mx::app::appConfigurator &config) |
| Load this specific node's settings from an application configuration of a derived class. | |
Protected Attributes | |
| std::string | m_presetPrefix |
| The prefix for preset naes. Usually either "preset" or "filter", to which "Name" is appended. | |
| std::string | m_presetKey |
The INDI key (device.property) for the presets. This is, say, fwpupil.filterName. It is set automatically. | |
| std::string | m_curVal |
| The current value of the preset property. Corresponds to the element name of the selected preset. | |
| std::string | m_curLabel |
| The current value of the put label. | |
| std::vector< std::string > | m_presetPutName { "out" } |
| ingr::ioDir | m_presetDir { ingr::ioDir::output } |
| This sets whether the multi-put selector is on the input or the output (default) | |
| std::set< std::string > | m_alwaysOn |
| Contains the names of any puts which are always on if any are on. | |
| std::set< std::string > | m_noAutoOn |
| Contains the names of any puts which are not automatically turned on if they are off. | |
| std::string | m_trackingReqKey |
| The INDI key (device.property) for the switch denoting that this stage should be or should not be tracking. | |
| std::string | m_trackingReqElement |
| The element of the INDI property denoted by m_trackingReqKey to follow. | |
| std::string | m_trackerKey |
| The INDI key (device.property) for the switch denoting that this stage is tracking. | |
| std::string | m_trackerElement |
| The element of the INDI property denoted by m_trackerKey to follow. | |
| bool | m_trackingReq { false } |
| Flag indicating if the stage should be (true) or should not be (false, default) tracking. | |
| bool | m_tracking { false } |
| Flag indicating whether or not the stage is currently tracking (default false). | |
| std::string | m_device |
| The INDI device name. Defaults to the node name set on construction. | |
| std::string | m_fsmPropName { "fsm" } |
| The INDI property name for the FSM, normally "fsm". | |
| std::string | m_fsmElName { "state" } |
| The INDI property element name for the FSM, normally "state". | |
| std::string | m_fsmKey |
The unique INDI key, <device>.<fsmPropName>, for the FSM state INDI property. | |
| fsmNodeActionT | m_fsmAction { fsmNodeActionT::passive } |
| std::vector< stateCodeT > | m_targetStates |
| stateCodeT | m_state { -999 } |
| The numerical code of the current state. | |
| std::string | m_stateStr |
| The string name of the current state. | |
| bool | m_stateOnTarget { false } |
| Flag indicating if the current state matches any of the target states. | |
| std::set< std::string > | m_keys |
| The INDI keys (device.property) which this node subscribes to. | |
| ingr::instGraphXML * | m_parentGraph { nullptr } |
| The parent instGraph that this node is a part of. | |
| ingr::instNode * | m_node { nullptr } |
| The underlying instGraph node. | |
| int | m_changes { 0 } |
| Counter that can be incremented when changes are detected. Set to 0 when graph is updated. | |
Private Types | |
| typedef MagAOX::app::stateCodes::stateCodeT | stateCodeT |
The key assumption of this node is that it should be in a valid, not-none, preset position for its ioputs to be on. It also supports triggering an alternate on state, which is used for stages which have a continuous tracking mode (k-mirror and ADC).
The preset is specified by an INDI property with signature <device>.<presetPrefix>Name where device and presetPrefix are part of the configuration. This INDI property is a switch vector.
The device and prefix can only be set once.
Definition at line 24 of file stdMotionNode.hpp.
|
privateinherited |
Definition at line 71 of file fsmNode.hpp.
|
inline |
Only c'tor. Must be constructed with node name and a parent graph.
| [in] | parentGraph | the name of this node [in] the graph which this node belongs to |
Definition at line 130 of file stdMotionNode.hpp.
|
inline |
Get the current label text.
Definition at line 176 of file stdMotionNode.hpp.
References m_curLabel.
Referenced by SCENARIO().
|
inline |
Get the device name.
Definition at line 110 of file fsmNode.hpp.
Referenced by loadConfig().
|
inlinevirtual |
Set the device name. This can only be done once.
| [in] | dev |
Reimplemented from fsmNode.
Definition at line 135 of file stdMotionNode.hpp.
References fsmNode::device(), xigNode::key(), fsmNode::m_device, m_presetKey, and m_presetPrefix.
Referenced by SCENARIO(), and SCENARIO().
|
inlinevirtual |
Set the device name.
Derived classes may implement this to add extra logic. The device name defaults to the node name on construction.
| [in] | dev | the new device name |
Reimplemented from fsmNode.
Definition at line 104 of file fsmNode.hpp.
|
inherited |
Get the action.
Definition at line 295 of file fsmNode.hpp.
References fsmNode::m_fsmAction.
Referenced by SCENARIO().
|
inherited |
|
inlineinherited |
Get the fsm element name.
Definition at line 285 of file fsmNode.hpp.
References fsmNode::m_fsmElName.
Referenced by fsmNode::loadConfigDerived().
|
inlinevirtualinherited |
Set the fsm element name.
Derived classes may implement this to add extra logic. The fsm element name defaults to "state"
This can be called at any time
| [in] | en | the new element name |
Definition at line 271 of file fsmNode.hpp.
References fsmNode::m_fsmElName, and xigNode::name().
|
inherited |
Get the FSM unique key.
Definition at line 290 of file fsmNode.hpp.
References fsmNode::m_fsmKey.
Referenced by SCENARIO().
|
inlineinherited |
Get the fsm property name.
Definition at line 266 of file fsmNode.hpp.
References fsmNode::m_fsmPropName.
Referenced by fsmNode::loadConfigDerived().
|
inlinevirtualinherited |
Set the fsm property name.
Derived classes may implement this to add extra logic. The fsm property name defaults to "fsm"
This can only be called before device is set
| [in] | pn | the new property name |
Definition at line 233 of file fsmNode.hpp.
References fsmNode::m_device, fsmNode::m_fsmPropName, and xigNode::name().
|
inlinevirtualinherited |
INDI SetProperty callback with indication if action was taken.
The possible actions are determined by m_fsmAction. If the action was taken then the caller should return without further processing.
| ipRecv | < [out] indicates if action taken (true). [in] the received INDI property to handle |
Definition at line 381 of file fsmNode.hpp.
References active, xigNode::m_changes, fsmNode::m_fsmAction, fsmNode::m_fsmElName, fsmNode::m_fsmKey, xigNode::m_node, xigNode::m_parentGraph, fsmNode::m_state, fsmNode::m_stateOnTarget, fsmNode::m_stateStr, fsmNode::m_targetStates, MagAOX::app::stateCodes::str2CodeFast(), threshOff, xigNode::togglePutsOff(), and xigNode::togglePutsOn().
|
inlinevirtual |
INDI SetProperty callback.
| [in] | ipRecv | the received INDI property to handle |
Reimplemented from fsmNode.
Definition at line 251 of file stdMotionNode.hpp.
References fsmNode::handleSetProperty(), xigNode::m_changes, m_curVal, xigNode::m_node, m_presetKey, fsmNode::m_state, m_trackerElement, m_trackerKey, m_tracking, m_trackingReq, m_trackingReqElement, m_trackingReqKey, MagAOX::app::stateCodes::OPERATING, MagAOX::app::stateCodes::READY, togglePutsOff(), and togglePutsOn().
Referenced by SCENARIO().
|
inlineinherited |
Add a key to the set.
Definition at line 116 of file xigNode.hpp.
References xigNode::m_keys.
Referenced by fsmNode::device(), device(), presetPrefix(), indiPropNode::propKey(), pwrOnOffNode::pwrKey(), SCENARIO(), trackerKey(), and trackingReqKey().
|
inlineinherited |
Get the set holding the INDI keys for this node.
Definition at line 111 of file xigNode.hpp.
References xigNode::m_keys.
Referenced by SCENARIO().
|
inline |
| [in] | config | the application configurator loaded with this node's options |
Definition at line 572 of file stdMotionNode.hpp.
References device(), m_alwaysOn, m_noAutoOn, xigNode::m_parentGraph, xigNode::name(), presetDir(), presetPrefix(), presetPutName(), trackerElement(), trackerKey(), trackingReqElement(), trackingReqKey(), and XIGN_EXCEPTION.
Referenced by SCENARIO().
|
inlineprotectedinherited |
Load this specific node's settings from an application configuration of a derived class.
Does not cerifies that the named node is an fsmNode.
| [in] | config | the application configurator loaded with this node's options |
Definition at line 336 of file fsmNode.hpp.
References fsmNode::device(), fsmNode::fsmElName(), fsmNodeActionT2String(), fsmNodeActionTFromString(), fsmNode::fsmPropName(), fsmNode::m_fsmAction, xigNode::m_node, xigNode::m_parentGraph, fsmNode::m_targetStates, xigNode::name(), MagAOX::app::stateCodes::str2Code(), fsmNode::targetStates(), unknown, and XIGN_EXCEPTION.
Referenced by fsmNode::loadConfig(), and indiPropNode::loadConfig().
|
inlineinherited |
Get the name of this node.
Definition at line 106 of file xigNode.hpp.
References xigNode::m_node.
Referenced by xigNode::xigNode(), fsmNode::device(), fsmNode::fsmElName(), fsmNode::fsmPropName(), fsmNode::loadConfig(), indiPropNode::loadConfig(), pwrOnOffNode::loadConfig(), staticNode::loadConfig(), loadConfig(), fsmNode::loadConfigDerived(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), TEST_CASE(), TEST_CASE(), togglePutsOff(), and togglePutsOn().
|
inlineinherited |
Get the pointer to the underlying node.
Definition at line 121 of file xigNode.hpp.
References xigNode::m_node.
Referenced by SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), TEST_CASE(), and TEST_CASE().
|
inline |
Definition at line 196 of file stdMotionNode.hpp.
References m_presetDir.
Referenced by loadConfig().
|
inline |
| [in] | dir |
Definition at line 191 of file stdMotionNode.hpp.
References m_presetDir.
Referenced by SCENARIO().
|
inline |
Definition at line 171 of file stdMotionNode.hpp.
References m_presetPrefix.
Referenced by loadConfig().
|
inlinevirtual |
| [in] | pp |
Definition at line 148 of file stdMotionNode.hpp.
References xigNode::key(), fsmNode::m_device, m_presetKey, and m_presetPrefix.
Referenced by SCENARIO(), and SCENARIO().
|
inline |
Definition at line 186 of file stdMotionNode.hpp.
References m_presetPutName.
Referenced by loadConfig().
|
inline |
| [in] | ppp |
Definition at line 181 of file stdMotionNode.hpp.
References m_presetPutName.
Referenced by SCENARIO().
|
inherited |
Get the target states.
Definition at line 305 of file fsmNode.hpp.
References fsmNode::m_targetStates.
Referenced by fsmNode::loadConfigDerived(), and SCENARIO().
|
inlinevirtual |
Change the state of all inputs and all outputs to off.
Reimplemented from xigNode.
Definition at line 512 of file stdMotionNode.hpp.
References m_alwaysOn, m_curLabel, m_noAutoOn, xigNode::m_node, xigNode::m_parentGraph, m_presetDir, m_presetPutName, m_tracking, m_trackingReq, and xigNode::name().
Referenced by handleSetProperty().
|
inlinevirtual |
Change the state of all inputs and all outputs to on.
Reimplemented from xigNode.
Definition at line 368 of file stdMotionNode.hpp.
References m_alwaysOn, m_curLabel, m_curVal, m_noAutoOn, xigNode::m_node, xigNode::m_parentGraph, m_presetDir, m_presetPutName, fsmNode::m_state, m_tracking, m_trackingReq, xigNode::name(), MagAOX::app::stateCodes::READY, and xigNode::togglePutsOn().
Referenced by handleSetProperty().
|
inline |
Definition at line 246 of file stdMotionNode.hpp.
References m_trackerElement.
Referenced by loadConfig().
|
inline |
| [in] | te |
Definition at line 241 of file stdMotionNode.hpp.
References m_trackerElement.
Referenced by SCENARIO(), and SCENARIO().
|
inline |
Definition at line 236 of file stdMotionNode.hpp.
References m_trackerKey.
Referenced by loadConfig().
|
inline |
| [in] | tk |
Definition at line 226 of file stdMotionNode.hpp.
References xigNode::key(), and m_trackerKey.
Referenced by SCENARIO(), and SCENARIO().
|
inline |
Definition at line 221 of file stdMotionNode.hpp.
References m_trackingReqElement.
Referenced by loadConfig().
|
inline |
| [in] | te |
Definition at line 216 of file stdMotionNode.hpp.
References m_trackingReqElement.
Referenced by SCENARIO(), and SCENARIO().
|
inline |
Definition at line 211 of file stdMotionNode.hpp.
References m_trackingReqKey.
Referenced by loadConfig().
|
inline |
| [in] | tk |
Definition at line 201 of file stdMotionNode.hpp.
References xigNode::key(), and m_trackingReqKey.
Referenced by SCENARIO(), and SCENARIO().
|
inlinevirtualinherited |
Definition at line 456 of file fsmNode.hpp.
|
protected |
Contains the names of any puts which are always on if any are on.
Definition at line 49 of file stdMotionNode.hpp.
Referenced by loadConfig(), togglePutsOff(), and togglePutsOn().
|
protectedinherited |
Counter that can be incremented when changes are detected. Set to 0 when graph is updated.
Definition at line 39 of file xigNode.hpp.
Referenced by fsmNode::handleSetProperty(), indiPropNode::handleSetProperty(), and handleSetProperty().
|
protected |
The current value of the put label.
Definition at line 38 of file stdMotionNode.hpp.
Referenced by curLabel(), togglePutsOff(), and togglePutsOn().
|
protected |
The current value of the preset property. Corresponds to the element name of the selected preset.
Definition at line 35 of file stdMotionNode.hpp.
Referenced by handleSetProperty(), and togglePutsOn().
|
protectedinherited |
The INDI device name. Defaults to the node name set on construction.
Definition at line 74 of file fsmNode.hpp.
Referenced by fsmNode::device(), fsmNode::device(), device(), fsmNode::fsmPropName(), and presetPrefix().
|
protectedinherited |
Definition at line 80 of file fsmNode.hpp.
Referenced by fsmNode::fsmAction(), fsmNode::fsmAction(), fsmNode::handleSetProperty(), and fsmNode::loadConfigDerived().
|
protectedinherited |
The INDI property element name for the FSM, normally "state".
Definition at line 76 of file fsmNode.hpp.
Referenced by fsmNode::fsmElName(), fsmNode::fsmElName(), and fsmNode::handleSetProperty().
|
protectedinherited |
The unique INDI key, <device>.<fsmPropName>, for the FSM state INDI property.
Definition at line 78 of file fsmNode.hpp.
Referenced by fsmNode::device(), fsmNode::fsmKey(), and fsmNode::handleSetProperty().
|
protectedinherited |
The INDI property name for the FSM, normally "fsm".
Definition at line 75 of file fsmNode.hpp.
Referenced by fsmNode::device(), fsmNode::fsmPropName(), and fsmNode::fsmPropName().
|
protectedinherited |
The INDI keys (device.property) which this node subscribes to.
Definition at line 33 of file xigNode.hpp.
Referenced by xigNode::key(), and xigNode::keys().
|
protected |
Contains the names of any puts which are not automatically turned on if they are off.
Definition at line 52 of file stdMotionNode.hpp.
Referenced by loadConfig(), togglePutsOff(), and togglePutsOn().
|
protectedinherited |
The underlying instGraph node.
Definition at line 37 of file xigNode.hpp.
Referenced by indiPropNode::indiPropNode(), pwrOnOffNode::pwrOnOffNode(), xigNode::xigNode(), fsmNode::handleSetProperty(), indiPropNode::handleSetProperty(), handleSetProperty(), fsmNode::loadConfigDerived(), xigNode::name(), xigNode::node(), pwrOnOffNode::toggleOff(), pwrOnOffNode::toggleOn(), staticNode::togglePutsAll(), togglePutsOff(), xigNode::togglePutsOff(), togglePutsOn(), and xigNode::togglePutsOn().
|
protectedinherited |
The parent instGraph that this node is a part of.
Definition at line 35 of file xigNode.hpp.
Referenced by indiPropNode::indiPropNode(), pwrOnOffNode::pwrOnOffNode(), xigNode::xigNode(), fsmNode::handleSetProperty(), indiPropNode::handleSetProperty(), fsmNode::loadConfig(), indiPropNode::loadConfig(), pwrOnOffNode::loadConfig(), staticNode::loadConfig(), loadConfig(), fsmNode::loadConfigDerived(), pwrOnOffNode::toggleOff(), pwrOnOffNode::toggleOn(), togglePutsOff(), and togglePutsOn().
|
protected |
This sets whether the multi-put selector is on the input or the output (default)
If this is a multi-put node (m_presetPutName.size() > 1) then the value of the preset switch controls which input or output is on, with the others off.
Definition at line 46 of file stdMotionNode.hpp.
Referenced by presetDir(), presetDir(), togglePutsOff(), and togglePutsOn().
|
protected |
The INDI key (device.property) for the presets. This is, say, fwpupil.filterName. It is set automatically.
Definition at line 32 of file stdMotionNode.hpp.
Referenced by device(), handleSetProperty(), and presetPrefix().
|
protected |
The prefix for preset naes. Usually either "preset" or "filter", to which "Name" is appended.
Definition at line 29 of file stdMotionNode.hpp.
Referenced by device(), presetPrefix(), and presetPrefix().
|
protected |
Definition at line 40 of file stdMotionNode.hpp.
Referenced by presetPutName(), presetPutName(), togglePutsOff(), and togglePutsOn().
|
protectedinherited |
The numerical code of the current state.
Definition at line 84 of file fsmNode.hpp.
Referenced by fsmNode::handleSetProperty(), handleSetProperty(), and togglePutsOn().
|
protectedinherited |
Flag indicating if the current state matches any of the target states.
Definition at line 87 of file fsmNode.hpp.
Referenced by fsmNode::handleSetProperty().
|
protectedinherited |
The string name of the current state.
Definition at line 85 of file fsmNode.hpp.
Referenced by fsmNode::handleSetProperty().
|
protectedinherited |
Definition at line 82 of file fsmNode.hpp.
Referenced by fsmNode::handleSetProperty(), fsmNode::loadConfigDerived(), and fsmNode::targetStates().
|
protected |
The element of the INDI property denoted by m_trackerKey to follow.
Definition at line 64 of file stdMotionNode.hpp.
Referenced by handleSetProperty(), trackerElement(), and trackerElement().
|
protected |
The INDI key (device.property) for the switch denoting that this stage is tracking.
Definition at line 61 of file stdMotionNode.hpp.
Referenced by handleSetProperty(), trackerKey(), and trackerKey().
|
protected |
Flag indicating whether or not the stage is currently tracking (default false).
Definition at line 70 of file stdMotionNode.hpp.
Referenced by handleSetProperty(), togglePutsOff(), and togglePutsOn().
|
protected |
Flag indicating if the stage should be (true) or should not be (false, default) tracking.
Definition at line 67 of file stdMotionNode.hpp.
Referenced by handleSetProperty(), togglePutsOff(), and togglePutsOn().
|
protected |
The element of the INDI property denoted by m_trackingReqKey to follow.
Definition at line 58 of file stdMotionNode.hpp.
Referenced by handleSetProperty(), trackingReqElement(), and trackingReqElement().
|
protected |
The INDI key (device.property) for the switch denoting that this stage should be or should not be tracking.
Definition at line 55 of file stdMotionNode.hpp.
Referenced by handleSetProperty(), trackingReqKey(), and trackingReqKey().