12 #include "../../libMagAOX/libMagAOX.hpp"
13 #include "../../magaox_git_version.h"
39 void key(
const std::string nkey )
56 if(
m_keys.size() != 1)
return;
60 if(!
ipRecv.find(
"state"))
return;
69 for(
auto && iput : m_inputs)
71 iput.second->state(ingr::putState::on);
74 for(
auto && oput : m_outputs)
76 oput.second->state(ingr::putState::on);
85 for(
auto && iput : m_inputs)
87 iput.second->state(ingr::putState::off);
90 for(
auto && oput : m_outputs)
92 oput.second->state(ingr::putState::off);
169 const pcf::IndiProperty &
ipRecv
188 static_cast<void>(_config);
200 size_t dot = key.find(
'.');
201 if(dot == std::string::npos)
return "";
203 return key.substr(0, dot);
208 size_t dot = key.find(
'.');
209 if(dot == std::string::npos)
return "";
211 return key.substr(dot+1);
218 nn->
key(
"pdu0.source");
219 m_nodes.insert({nn->name(), nn});
222 nn->name(
"fwtelsim");
223 nn->
key(
"usbdu0.fwtelsim");
224 m_nodes.insert({nn->name(), nn});
228 for(
auto kit=
it->second->m_keys.begin(); kit !=
it->second->m_keys.end(); ++kit)
231 pcf::IndiProperty * ip =
new pcf::IndiProperty;
234 ip->setDevice(devname);
235 ip->setName(propname);
279 const pcf::IndiProperty &
ipRecv
292 it->second->handleSetProperty(
ipRecv);
The base-class for MagAO-X applications.
int registerIndiPropertySet(pcf::IndiProperty &prop, const std::string &devName, const std::string &propName, int(*)(void *, const pcf::IndiProperty &))
Register an INDI property which is monitored for updates from others.
~instGraph() noexcept
D'tor, declared and defined for noexcept.
int setCallBack_nodeProperties(const pcf::IndiProperty &ipRecv)
virtual void setupConfig()
int loadConfigImpl(mx::app::appConfigurator &_config)
Implementation of loadConfig logic, separated for testing.
virtual int appStartup()
Startup function.
std::multimap< std::string, xigNode * > m_nodeHandleSets
std::map< std::string, xigNode * > m_nodes
virtual void loadConfig()
virtual int appLogic()
Implementation of the FSM for instGraph.
instGraph()
Default c'tor.
static int st_setCallBack_nodeProperties(void *app, const pcf::IndiProperty &ipRecv)
The static callback function to be registered for node properties.
friend class instGraph_test
ingr::instBeam * m_beam_source2fwtelsim
virtual int appShutdown()
Shutdown the app.
virtual void handleSetProperty(const pcf::IndiProperty &ipRecv)
std::set< std::string > m_keys
virtual void handleSetProperty(const pcf::IndiProperty &ipRecv)=0
void key(const std::string nkey)
The MagAO-X XXXXXX header file.
GeneratorWrapper< T > range(T const &start, T const &end, T const &step)
const pcf::IndiProperty & ipRecv
std::string deviceFromKey(const std::string &key)
std::string nameFromKey(const std::string &key)