API
 
Loading...
Searching...
No Matches
stdMotionNode Class Reference

#include <stdMotionNode.hpp>

Inheritance diagram for stdMotionNode:
Inheritance graph
Collaboration diagram for stdMotionNode:
Collaboration graph

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< stateCodeTm_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
 

Detailed Description

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.

Member Typedef Documentation

◆ stateCodeT

Definition at line 71 of file fsmNode.hpp.

Constructor & Destructor Documentation

◆ stdMotionNode()

stdMotionNode::stdMotionNode ( const std::string &  name,
ingr::instGraphXML *  parentGraph 
)
inline

Only c'tor. Must be constructed with node name and a parent graph.

Parameters
[in]parentGraphthe name of this node [in] the graph which this node belongs to

Definition at line 130 of file stdMotionNode.hpp.

Member Function Documentation

◆ curLabel()

const std::string & stdMotionNode::curLabel ( )
inline

Get the current label text.

Returns
the current value of m_curLabel.

Definition at line 176 of file stdMotionNode.hpp.

References m_curLabel.

Referenced by SCENARIO().

◆ device() [1/3]

const std::string & fsmNode::device ( ) const
inline

Get the device name.

Returns
the current value of m_device

Definition at line 110 of file fsmNode.hpp.

Referenced by loadConfig().

◆ device() [2/3]

void stdMotionNode::device ( const std::string &  dev)
inlinevirtual

Set the device name. This can only be done once.

Exceptions
Parameters
[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().

◆ device() [3/3]

void fsmNode::device ( const std::string &  dev)
inlinevirtual

Set the device name.

Derived classes may implement this to add extra logic. The device name defaults to the node name on construction.

Parameters
[in]devthe new device name

Reimplemented from fsmNode.

Definition at line 104 of file fsmNode.hpp.

◆ fsmAction() [1/2]

fsmNodeActionT fsmNode::fsmAction ( ) const
inherited

Get the action.

Returns
the current value of m_fsmAction

Definition at line 295 of file fsmNode.hpp.

References fsmNode::m_fsmAction.

Referenced by SCENARIO().

◆ fsmAction() [2/2]

void fsmNode::fsmAction ( fsmNodeActionT  act)
inherited

Set the action.

Definition at line 300 of file fsmNode.hpp.

References fsmNode::m_fsmAction.

◆ fsmElName() [1/2]

const std::string & fsmNode::fsmElName ( ) const
inlineinherited

Get the fsm element name.

Returns
the current value of m_fsmElName

Definition at line 285 of file fsmNode.hpp.

References fsmNode::m_fsmElName.

Referenced by fsmNode::loadConfigDerived().

◆ fsmElName() [2/2]

void fsmNode::fsmElName ( const std::string &  en)
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

Parameters
[in]enthe new element name

Definition at line 271 of file fsmNode.hpp.

References fsmNode::m_fsmElName, and xigNode::name().

◆ fsmKey()

const std::string & fsmNode::fsmKey ( ) const
inherited

Get the FSM unique key.

Returns
the current value of m_fsmKey

Definition at line 290 of file fsmNode.hpp.

References fsmNode::m_fsmKey.

Referenced by SCENARIO().

◆ fsmPropName() [1/2]

const std::string & fsmNode::fsmPropName ( ) const
inlineinherited

Get the fsm property name.

Returns
the current value of m_fsmPropName

Definition at line 266 of file fsmNode.hpp.

References fsmNode::m_fsmPropName.

Referenced by fsmNode::loadConfigDerived().

◆ fsmPropName() [2/2]

void fsmNode::fsmPropName ( const std::string &  pn)
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

Parameters
[in]pnthe new property name

Definition at line 233 of file fsmNode.hpp.

References fsmNode::m_device, fsmNode::m_fsmPropName, and xigNode::name().

◆ handleSetProperty() [1/2]

int fsmNode::handleSetProperty ( bool &  actionTaken,
const pcf::IndiProperty &  ipRecv 
)
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.

Parameters
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().

◆ handleSetProperty() [2/2]

int stdMotionNode::handleSetProperty ( const pcf::IndiProperty &  ipRecv)
inlinevirtual

◆ key()

void xigNode::key ( const std::string &  nkey)
inlineinherited

◆ keys()

const std::set< std::string > & xigNode::keys ( )
inlineinherited

Get the set holding the INDI keys for this node.

Returns
a const reference to m_keys

Definition at line 111 of file xigNode.hpp.

References xigNode::m_keys.

Referenced by SCENARIO().

◆ loadConfig()

void stdMotionNode::loadConfig ( mx::app::appConfigurator &  config)
inline
Parameters
[in]configthe 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().

◆ loadConfigDerived()

void fsmNode::loadConfigDerived ( mx::app::appConfigurator &  config)
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.

Parameters
[in]configthe 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().

◆ name()

◆ node()

ingr::instNode * xigNode::node ( )
inlineinherited

Get the pointer to the underlying node.

Returns
the node pointer, which can not be nullptr after construction

Definition at line 121 of file xigNode.hpp.

References xigNode::m_node.

Referenced by SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), TEST_CASE(), and TEST_CASE().

◆ presetDir() [1/2]

const ingr::ioDir & stdMotionNode::presetDir ( )
inline

Definition at line 196 of file stdMotionNode.hpp.

References m_presetDir.

Referenced by loadConfig().

◆ presetDir() [2/2]

void stdMotionNode::presetDir ( const ingr::ioDir &  dir)
inline
Parameters
[in]dir

Definition at line 191 of file stdMotionNode.hpp.

References m_presetDir.

Referenced by SCENARIO().

◆ presetPrefix() [1/2]

const std::string & stdMotionNode::presetPrefix ( )
inline

Definition at line 171 of file stdMotionNode.hpp.

References m_presetPrefix.

Referenced by loadConfig().

◆ presetPrefix() [2/2]

void stdMotionNode::presetPrefix ( const std::string &  pp)
inlinevirtual
Parameters
[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().

◆ presetPutName() [1/2]

const std::vector< std::string > & stdMotionNode::presetPutName ( )
inline

Definition at line 186 of file stdMotionNode.hpp.

References m_presetPutName.

Referenced by loadConfig().

◆ presetPutName() [2/2]

void stdMotionNode::presetPutName ( const std::vector< std::string > &  ppp)
inline
Parameters
[in]ppp

Definition at line 181 of file stdMotionNode.hpp.

References m_presetPutName.

Referenced by SCENARIO().

◆ targetStates()

const std::vector< fsmNode::stateCodeT > & fsmNode::targetStates ( ) const
inherited

Get the target states.

Returns
the current value of m_targetStates

Definition at line 305 of file fsmNode.hpp.

References fsmNode::m_targetStates.

Referenced by fsmNode::loadConfigDerived(), and SCENARIO().

◆ togglePutsOff()

void stdMotionNode::togglePutsOff ( )
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().

◆ togglePutsOn()

void stdMotionNode::togglePutsOn ( )
inlinevirtual

◆ trackerElement() [1/2]

const std::string & stdMotionNode::trackerElement ( )
inline

Definition at line 246 of file stdMotionNode.hpp.

References m_trackerElement.

Referenced by loadConfig().

◆ trackerElement() [2/2]

void stdMotionNode::trackerElement ( const std::string &  te)
inline
Parameters
[in]te

Definition at line 241 of file stdMotionNode.hpp.

References m_trackerElement.

Referenced by SCENARIO(), and SCENARIO().

◆ trackerKey() [1/2]

const std::string & stdMotionNode::trackerKey ( )
inline

Definition at line 236 of file stdMotionNode.hpp.

References m_trackerKey.

Referenced by loadConfig().

◆ trackerKey() [2/2]

void stdMotionNode::trackerKey ( const std::string &  tk)
inline
Parameters
[in]tk

Definition at line 226 of file stdMotionNode.hpp.

References xigNode::key(), and m_trackerKey.

Referenced by SCENARIO(), and SCENARIO().

◆ trackingReqElement() [1/2]

const std::string & stdMotionNode::trackingReqElement ( )
inline

Definition at line 221 of file stdMotionNode.hpp.

References m_trackingReqElement.

Referenced by loadConfig().

◆ trackingReqElement() [2/2]

void stdMotionNode::trackingReqElement ( const std::string &  te)
inline
Parameters
[in]te

Definition at line 216 of file stdMotionNode.hpp.

References m_trackingReqElement.

Referenced by SCENARIO(), and SCENARIO().

◆ trackingReqKey() [1/2]

const std::string & stdMotionNode::trackingReqKey ( )
inline

Definition at line 211 of file stdMotionNode.hpp.

References m_trackingReqKey.

Referenced by loadConfig().

◆ trackingReqKey() [2/2]

void stdMotionNode::trackingReqKey ( const std::string &  tk)
inline
Parameters
[in]tk

Definition at line 201 of file stdMotionNode.hpp.

References xigNode::key(), and m_trackingReqKey.

Referenced by SCENARIO(), and SCENARIO().

◆ updateGUI()

void fsmNode::updateGUI ( )
inlinevirtualinherited

Definition at line 456 of file fsmNode.hpp.

Member Data Documentation

◆ m_alwaysOn

std::set<std::string> stdMotionNode::m_alwaysOn
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().

◆ m_changes

int xigNode::m_changes { 0 }
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().

◆ m_curLabel

std::string stdMotionNode::m_curLabel
protected

The current value of the put label.

Definition at line 38 of file stdMotionNode.hpp.

Referenced by curLabel(), togglePutsOff(), and togglePutsOn().

◆ m_curVal

std::string stdMotionNode::m_curVal
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().

◆ m_device

std::string fsmNode::m_device
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().

◆ m_fsmAction

fsmNodeActionT fsmNode::m_fsmAction { fsmNodeActionT::passive }
protectedinherited

◆ m_fsmElName

std::string fsmNode::m_fsmElName { "state" }
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().

◆ m_fsmKey

std::string fsmNode::m_fsmKey
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().

◆ m_fsmPropName

std::string fsmNode::m_fsmPropName { "fsm" }
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().

◆ m_keys

std::set<std::string> xigNode::m_keys
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().

◆ m_noAutoOn

std::set<std::string> stdMotionNode::m_noAutoOn
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().

◆ m_node

◆ m_parentGraph

◆ m_presetDir

ingr::ioDir stdMotionNode::m_presetDir { ingr::ioDir::output }
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().

◆ m_presetKey

std::string stdMotionNode::m_presetKey
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().

◆ m_presetPrefix

std::string stdMotionNode::m_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().

◆ m_presetPutName

std::vector<std::string> stdMotionNode::m_presetPutName { "out" }
protected

Definition at line 40 of file stdMotionNode.hpp.

Referenced by presetPutName(), presetPutName(), togglePutsOff(), and togglePutsOn().

◆ m_state

stateCodeT fsmNode::m_state { -999 }
protectedinherited

The numerical code of the current state.

Definition at line 84 of file fsmNode.hpp.

Referenced by fsmNode::handleSetProperty(), handleSetProperty(), and togglePutsOn().

◆ m_stateOnTarget

bool fsmNode::m_stateOnTarget { false }
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().

◆ m_stateStr

std::string fsmNode::m_stateStr
protectedinherited

The string name of the current state.

Definition at line 85 of file fsmNode.hpp.

Referenced by fsmNode::handleSetProperty().

◆ m_targetStates

std::vector<stateCodeT> fsmNode::m_targetStates
protectedinherited

◆ m_trackerElement

std::string stdMotionNode::m_trackerElement
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().

◆ m_trackerKey

std::string stdMotionNode::m_trackerKey
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().

◆ m_tracking

bool stdMotionNode::m_tracking { false }
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().

◆ m_trackingReq

bool stdMotionNode::m_trackingReq { false }
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().

◆ m_trackingReqElement

std::string stdMotionNode::m_trackingReqElement
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().

◆ m_trackingReqKey

std::string stdMotionNode::m_trackingReqKey
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().


The documentation for this class was generated from the following file: