10#include <instGraph/instGraphXML.hpp>
12#include "../../INDI/libcommon/IndiProperty.hpp"
14std::string
xign_exception(
const std::string &src,
const std::string &expl,
const std::string &file,
int line )
16 std::string msg = src +
": " + expl;
19 msg +=
" " + std::to_string( line );
24#define XIGN_EXCEPTION( src, expl ) xign_exception( src, expl, __FILE__, __LINE__ )
49 ingr::instGraphXML *parentGraph );
61 const std::set<std::string> &
keys();
64 void key(
const std::string &nkey );
70 ingr::instNode *
node();
85#ifdef XWC_XIGNODE_TEST
87 void setParentGraphNull()
94inline xigNode::xigNode(
const std::string &name, ingr::instGraphXML *parentGraph ) : m_parentGraph( parentGraph )
98 std::string msg =
XIGN_EXCEPTION(
"xigNode::loadConfig",
"parent graph is null" );
99 throw std::runtime_error( msg );
128 for(
auto &&iput :
m_node->inputs() )
131 iput.second->state( ingr::putState::on );
134 for(
auto &&oput :
m_node->outputs() )
137 oput.second->state( ingr::putState::on );
143 for(
auto &&iput :
m_node->inputs() )
146 iput.second->state( ingr::putState::off );
149 for(
auto &&oput :
m_node->outputs() )
152 oput.second->state( ingr::putState::off );
Implementation of basic instGraph node interface for MagAO-X.
virtual int handleSetProperty(const pcf::IndiProperty &ipRecv)=0
INDI SetProperty callback.
void key(const std::string &nkey)
Add a key to the set.
ingr::instNode * m_node
The underlying instGraph node.
virtual void togglePutsOn()
Change the state of all inputs and all outputs to on.
int m_changes
Counter that can be incremented when changes are detected. Set to 0 when graph is updated.
std::set< std::string > m_keys
The INDI keys (device.property) which this node subscribes to.
ingr::instGraphXML * m_parentGraph
The parent instGraph that this node is a part of.
ingr::instNode * node()
Get the pointer to the underlying node.
std::string name()
Get the name of this node.
virtual void togglePutsOff()
Change the state of all inputs and all outputs to off.
const std::set< std::string > & keys()
Get the set holding the INDI keys for this node.
#define XIGN_EXCEPTION(src, expl)
std::string xign_exception(const std::string &src, const std::string &expl, const std::string &file, int line)