7 #ifndef streamCircBuff_hpp
8 #define streamCircBuff_hpp
11 #include "../../libMagAOX/libMagAOX.hpp"
12 #include "../../magaox_git_version.h"
219 log<software_critical>({__FILE__, __LINE__, errno,0,
"Initializing S.M. semaphore"});
264 log<software_error>({__FILE__, __LINE__});
269 log<software_error>({__FILE__, __LINE__});
286 static_cast<void>(dummy);
296 static_cast<void>(dummy);
298 m_currSrc =
static_cast<char *
>(curr_src);
303 log<software_critical>({__FILE__, __LINE__, errno, 0,
"Error posting to semaphore"});
340 if(clock_gettime(CLOCK_REALTIME, &ts) < 0)
342 log<software_critical>({__FILE__,__LINE__,errno,0,
"clock_gettime"});
The base-class for MagAO-X applications.
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.
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 appShutdown()
Shuts down the framegrabber thread.
int recordFGTimings(bool force=false)
void loadConfig(mx::app::appConfigurator &config)
load the configuration system results
void setupConfig(mx::app::appConfigurator &config)
Setup the configuration system.
size_t m_typeSize
The size of the type, in bytes. Result of sizeof.
int updateINDI()
Update the INDI properties for this device controller.
uint8_t m_dataType
The ImageStreamIO type code.
int appLogic()
Checks the framegrabber thread.
int appStartup()
Startup function.
uint32_t m_height
The height of the image, once deinterlaced etc.
int appStartup()
Startup function.
uint32_t m_width
The width of the images in the stream.
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.
uint8_t m_dataType
The ImageStreamIO type code.
void setupConfig(mx::app::appConfigurator &config)
Setup the configuration system.
void loadConfig(mx::app::appConfigurator &config)
load the configuration system results
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.
@ OPERATING
The device is operating, other than homing.
A device which saves telemetry.
int appShutdown()
Perform telemeter application shutdown.
int loadConfig(appConfigurator &config)
Load the device section from an application configurator.
int appLogic()
Perform telemeter application logic.
int setupConfig(appConfigurator &config)
Setup an application configurator for the device section.
int appStartup()
Starts the telemetry log thread.
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.