7 #ifndef streamCircBuff_hpp
8 #define streamCircBuff_hpp
11 #include "../../libMagAOX/libMagAOX.hpp"
12 #include "../../magaox_git_version.h"
223 log<software_critical>({__FILE__, __LINE__, errno,0,
"Initializing S.M. semaphore"});
266 static_cast<void>(dummy);
279 static_cast<void>(dummy);
281 m_currSrc =
static_cast<char *
>(curr_src);
286 log<software_critical>({__FILE__, __LINE__, errno, 0,
"Error posting to semaphore"});
322 if(clock_gettime(CLOCK_REALTIME, &ts) < 0)
324 log<software_critical>({__FILE__,__LINE__,errno,0,
"clock_gettime"});
The base-class for MagAO-X applications.
stateCodes::stateCodeT state()
Get the current state code.
std::mutex m_indiMutex
Mutex for locking INDI communications.
timespec m_currImageTimestamp
The timestamp of the current image.
uint32_t m_width
The width of the image, once deinterlaced etc.
int recordFGTimings(bool force=false)
size_t m_typeSize
The size of the type, in bytes. Result of sizeof.
uint8_t m_dataType
The ImageStreamIO type code.
bool m_reconfig
Flag to set if a camera reconfiguration requires a framegrabber reset.
uint32_t m_height
The height of the image, once deinterlaced etc.
uint32_t m_width
The width of the images in the stream.
uint32_t m_height
The height of the images in the stream.
uint8_t m_dataType
The ImageStreamIO type code.
Class for application to keep a circular buffer of a stream and publish it to another stream.
~streamCircBuff() noexcept
D'tor, declared and defined for noexcept.
dev::frameGrabber< streamCircBuff > frameGrabberT
The base frameGrabber type.
dev::shmimMonitor< streamCircBuff > shmimMonitorT
The base shmimMonitor type.
static constexpr bool c_frameGrabber_flippable
app:dev config to tell framegrabber these images can not be flipped
int acquireAndCheckValid()
Implementation of the framegrabber acquireAndCheckValid interface.
int loadConfigImpl(mx::app::appConfigurator &_config)
Implementation of loadConfig logic, separated for testing.
virtual int appLogic()
Implementation of the FSM for streamCircBuff.
int allocate(const dev::shmimT &dummy)
int processImage(void *curr_src, const dev::shmimT &dummy)
int loadImageIntoStream(void *dest)
Implementation of the framegrabber loadImageIntoStream interface.
dev::telemeter< streamCircBuff > telemeterT
The telemeter type.
int recordTelem(const telem_fgtimings *)
virtual void loadConfig()
virtual int appShutdown()
Shutdown the app.
int configureAcquisition()
Implementation of the framegrabber configureAcquisition interface.
sem_t m_smSemaphore
Semaphore used to synchronize the fg thread and the sm thread.
virtual void setupConfig()
int reconfig()
Implementation of the framegrabber reconfig interface.
int startAcquisition()
Implementation of the framegrabber startAcquisition interface.
virtual int appStartup()
Startup function.
float fps()
Implementation of the framegrabber fps interface.
streamCircBuff()
Default c'tor.
#define FRAMEGRABBER_SETUP_CONFIG(cfig)
Call frameGrabberT::setupConfig with error checking for frameGrabber.
#define FRAMEGRABBER_APP_LOGIC
Call frameGrabberT::appLogic with error checking for frameGrabber.
#define FRAMEGRABBER_APP_SHUTDOWN
Call frameGrabberT::appShutdown with error checking for frameGrabber.
#define FRAMEGRABBER_UPDATE_INDI
Call frameGrabberT::updateINDI with error checking for frameGrabber.
#define FRAMEGRABBER_LOAD_CONFIG(cfig)
Call frameGrabberT::loadConfig with error checking for frameGrabber.
#define FRAMEGRABBER_APP_STARTUP
Call frameGrabberT::appStartup with error checking for frameGrabber.
@ OPERATING
The device is operating, other than homing.
std::unique_lock< std::mutex > lock(m_indiMutex)
#define SHMIMMONITOR_APP_SHUTDOWN
Call shmimMonitorT::appShutdown with error checking for shmimMonitor.
#define SHMIMMONITOR_APP_LOGIC
Call shmimMonitorT::appLogic with error checking for shmimMonitor.
#define SHMIMMONITOR_APP_STARTUP
Call shmimMonitorT::appStartup with error checking for shmimMonitor.
#define SHMIMMONITOR_LOAD_CONFIG(cfig)
Call shmimMonitorT::loadConfig with error checking for shmimMonitor.
#define SHMIMMONITOR_UPDATE_INDI
Call shmimMonitorT::updateINDI with error checking for shmimMonitor.
#define SHMIMMONITOR_SETUP_CONFIG(cfig)
Call shmimMonitorT::setupConfig with error checking for shmimMonitor.
A device base class which saves telemetry.
int checkRecordTimes(const telT &tel, telTs... tels)
Check the time of the last record for each telemetry type and make an entry if needed.
Log entry recording framegrabber timings.
#define TELEMETER_APP_LOGIC
Call telemeter::appLogic with error checking.
#define TELEMETER_LOAD_CONFIG(cfig)
Call telemeter::loadConfig with error checking.
#define TELEMETER_APP_STARTUP
Call telemeter::appStartup with error checking.
#define TELEMETER_SETUP_CONFIG(cfig)
Call telemeter::setupConfig with error checking.
#define TELEMETER_APP_SHUTDOWN
Call telemeter::appShutdown with error checking.