12 #include <mx/improc/eigenCube.hpp>
13 #include <mx/improc/eigenImage.hpp>
15 #include "../../libMagAOX/libMagAOX.hpp"
16 #include "../../magaox_git_version.h"
104 mx::sigproc::circularBufferIndex<float, cbIndexT>
m_rms;
106 mx::sigproc::circularBufferIndex<float, cbIndexT>
m_mean;
192 config.add(
"rms.fpsSource",
"",
"rms.fpsSource", argType::Required,
"rms",
"fpsSource",
false,
"string",
"Device name for getting fps. This device should have *.fps.current.");
257 if(
m_rms.size() > 0 )
265 for(
size_t n=0; n < 1.0*
m_fps; ++n)
280 for(
size_t n=0; n < 2.0*
m_fps; ++n)
294 for(
size_t n=0; n < 5.0*
m_fps; ++n)
308 for(
size_t n=0; n < 10.0*
m_fps; ++n)
330 log<software_error>({__FILE__, __LINE__});
335 log<software_error>({__FILE__, __LINE__});
354 static_cast<void>(dummy);
380 m_rms.maxEntries(cbSz);
392 static_cast<void>(dummy);
413 m_rms.nextEntry(rms);
422 static_cast<void>(dummy);
438 static_cast<void>(dummy);
455 if(
ipRecv.getName() != m_indiP_fpsSource.getName())
457 log<software_error>({__FILE__, __LINE__,
"Invalid INDI property."});
461 if(
ipRecv.find(
"current") !=
true )
468 realT fps =
ipRecv[
"current"].get<
float>();
474 std::cout <<
"Got fps: " << m_fps <<
"\n";
475 refShmimMonitorT::m_restart =
true;
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.
static int log(const typename logT::messageT &msg, logPrioT level=logPrio::LOG_DEFAULT)
Make a log entry.
int createROIndiNumber(pcf::IndiProperty &prop, const std::string &propName, const std::string &propLabel="", const std::string &propGroup="")
Create a ReadOnly INDI Number property.
int registerIndiPropertyReadOnly(pcf::IndiProperty &prop)
Register an INDI property which is read only.
std::mutex m_indiMutex
Mutex for locking INDI communications.
int appStartup()
Startup function.
uint32_t m_width
The width of the images in the stream.
int setupConfig(mx::app::appConfigurator &config)
Setup the configuration system.
int updateINDI()
Update the INDI properties for this device controller.
int appLogic()
Checks the shmimMonitor thread.
uint32_t m_height
The height of the images in the stream.
int appShutdown()
Shuts down the shmimMonitor thread.
int loadConfig(mx::app::appConfigurator &config)
load the configuration system results
bool m_getExistingFirst
If set to true by derivedT, any existing image will be grabbed and sent to processImage before waitin...
int processImage(void *curr_src, const refShmimT &dummy)
mx::sigproc::circularBufferIndex< float, cbIndexT > m_rms
dev::shmimMonitor< refRMS, maskShmimT > maskShmimMonitorT
virtual int appShutdown()
Shutdown the app.
std::string m_fpsSource
Device name for getting fps. This device should have *.fps.current.
~refRMS() noexcept
D'tor, declared and defined for noexcept.
int allocate(const refShmimT &dummy)
virtual int appStartup()
Startup function.
virtual int appLogic()
Implementation of the FSM for refRMS.
float realT
Floating point type in which to do all calculations.
mx::sigproc::circularBufferIndex< float, cbIndexT > m_mean
INDI_SETCALLBACK_DECL(refRMS, m_indiP_fpsSource)
mx::improc::eigenImage< realT > m_currRef
virtual void setupConfig()
virtual void loadConfig()
float m_fps
Current FPS from the FPS source.
mx::improc::eigenImage< realT > m_mask
pcf::IndiProperty m_indiP_refrms
int loadConfigImpl(mx::app::appConfigurator &_config)
Implementation of loadConfig logic, separated for testing.
dev::shmimMonitor< refRMS, refShmimT > refShmimMonitorT
pcf::IndiProperty m_indiP_fpsSource
#define REG_INDI_SETPROP(prop, devName, propName)
Register a SET INDI property with the class, using the standard callback name.
@ OPERATING
The device is operating, other than homing.
int addNumberElement(pcf::IndiProperty &prop, const std::string &name, const T &min, const T &max, const T &step, const std::string &format, const std::string &label="")
Add a standard INDI Number element.
const pcf::IndiProperty & ipRecv
INDI_SETCALLBACK_DEFN(adcTracker, m_indiP_teldata)(const pcf
std::unique_lock< std::mutex > lock(m_indiMutex)
static std::string indiPrefix()
static std::string configSection()
static std::string indiPrefix()
static std::string configSection()