2 #ifndef magAOXMaths_hpp
3 #define magAOXMaths_hpp
5 #include "../../libMagAOX/libMagAOX.hpp"
6 #include "../../magaox_git_version.h"
90 config.add(
"myVal",
"",
"myVal", argType::Required,
"",
"myVal",
false,
"string",
"The name of this app's value.");
91 config.add(
"otherDevName",
"",
"otherDevName", argType::Required,
"",
"otherDevName",
false,
"string",
"The name of the other app name.");
92 config.add(
"otherValName",
"",
"otherValName", argType::Required,
"",
"otherValName",
false,
"string",
"The name of the other val name.");
107 indi::addNumberElement<double>(
m_indiP_myVal,
"value", std::numeric_limits<double>::min(), std::numeric_limits<double>::max(), 1.0,
"%f",
"");
113 indi::addNumberElement<double>(
m_indiP_myVal_maths,
"value", std::numeric_limits<double>::min(), std::numeric_limits<double>::max(), 1.0,
"%f",
"");
114 indi::addNumberElement<double>(
m_indiP_myVal_maths,
"sqr", std::numeric_limits<double>::min(), std::numeric_limits<double>::max(), 1.0,
"%f",
"");
115 indi::addNumberElement<double>(
m_indiP_myVal_maths,
"sqrt", std::numeric_limits<double>::min(), std::numeric_limits<double>::max(), 1.0,
"%f",
"");
116 indi::addNumberElement<double>(
m_indiP_myVal_maths,
"abs", std::numeric_limits<double>::min(), std::numeric_limits<double>::max(), 1.0,
"%f",
"");
117 indi::addNumberElement<double>(
m_indiP_myVal_maths,
"prod", std::numeric_limits<double>::min(), std::numeric_limits<double>::max(), 1.0,
"%f",
"");
123 createStandardIndiNumber<double>(
m_indiP_setOtherVal,
"other_val", -1e50, 1e50, 0,
"%0.f");
176 if (
ipRecv.getName() == m_indiP_myVal.getName())
179 m_indiP_myVal[
"value"] =
ipRecv[
"value"].get<
double>();
180 m_indiP_myVal.setState (pcf::IndiProperty::Ok);
181 m_indiDriver->sendSetProperty (m_indiP_myVal);
192 m_indiP_otherVal =
ipRecv;
201 if (
ipRecv.getName() == m_indiP_setOtherVal.getName())
206 m_indiP_setOtherVal[
"target"] =
ipRecv[
"target"].get<
double>();
207 m_indiP_setOtherVal.setState (pcf::IndiProperty::Ok);
210 sendNewProperty(m_indiP_otherVal,
"value", m_indiP_setOtherVal[
"target"].get<double>());
The base-class for MagAO-X applications.
void updateIfChanged(pcf::IndiProperty &p, const std::string &el, const T &newVal, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
Update an INDI property element value if it has changed.
stateCodes::stateCodeT state()
Get the current state code.
int registerIndiPropertyNew(pcf::IndiProperty &prop, int(*)(void *, const pcf::IndiProperty &))
Register an INDI property which is exposed for others to request a New Property for.
indiDriver< MagAOXApp > * m_indiDriver
The INDI driver wrapper. Constructed and initialized by execute, which starts and stops communication...
pcf::IndiProperty m_indiP_myVal_maths
pcf::IndiProperty m_indiP_myVal
virtual int appStartup()
Checks if the device was found during loadConfig.
INDI_SETCALLBACK_DECL(magAOXMaths, m_indiP_otherVal)
virtual void setupConfig()
Setup the configuration system (called by MagAOXApp::setup())
magAOXMaths()
Default c'tor.
pcf::IndiProperty m_indiP_otherVal
INDI_NEWCALLBACK_DECL(magAOXMaths, m_indiP_setOtherVal)
std::string m_otherValName
virtual int appShutdown()
Do any needed shutdown tasks. Currently nothing in this app.
virtual void loadConfig()
Load the configuration system results (called by MagAOXApp::setup())
INDI_NEWCALLBACK_DECL(magAOXMaths, m_indiP_myVal)
virtual int appLogic()
Implementation of the FSM for the maths.
pcf::IndiProperty m_indiP_setOtherVal
std::string m_otherDevName
#define REG_INDI_NEWPROP_NOCB(prop, propName, type)
Register a NEW INDI property with the class, with no callback.
#define INDI_NEWCALLBACK(prop)
Get the name of the static callback wrapper for a new property.
#define REG_INDI_NEWPROP(prop, propName, type)
Register a NEW INDI property with the class, using the standard callback name.
#define REG_INDI_SETPROP(prop, devName, propName)
Register a SET INDI property with the class, using the standard callback name.
@ READY
The device is ready for operation, but is not operating.
const pcf::IndiProperty & ipRecv
INDI_SETCALLBACK_DEFN(adcTracker, m_indiP_teldata)(const pcf
INDI_NEWCALLBACK_DEFN(acesxeCtrl, m_indiP_windspeed)(const pcf
constexpr static logPrioT LOG_CRITICAL
The process can not continue and will shut down (fatal)
constexpr static logPrioT LOG_ERROR
An error has occured which the software will attempt to correct.
constexpr static logPrioT LOG_ALERT
This should only be used if some action is required by operators to keep the system safe.
constexpr static logPrioT LOG_EMERGENCY
Normal operations of the entire system should be shut down immediately.
constexpr static logPrioT LOG_WARNING
A condition has occurred which may become an error, but the process continues.
constexpr static logPrioT LOG_NOTICE
A normal but significant condition.