cacao  Release 0.1.03-dev
Compute And Control For Adaptive Optics
AOloopControl_RTstreamLOG.c File Reference

Logging of real-time streams. More...

#include <malloc.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <ncurses.h>
#include <termios.h>
#include <fcntl.h>
#include "CommandLineInterface/CLIcore.h"
#include "00CORE/00CORE.h"
#include "COREMOD_memory/COREMOD_memory.h"
#include "COREMOD_iofits/COREMOD_iofits.h"
#include "ImageStreamIO/ImageStruct.h"
#include "AOloopControl/AOloopControl.h"
Include dependency graph for AOloopControl_RTstreamLOG.c:

Macros

#define _GNU_SOURCE
 

Functions

errno_t AOloopControl_RTstreamLOG_init (int loop)
 
errno_t AOloopControl_RTstreamLOG_setup (long loop, long rtlindex, char *streamname)
 
void AOloopControl_RTstreamLOG_update (long loop, long rtlindex, struct timespec tnow)
 
int AOloopControl_RTstreamLOG_printstatus (int loop)
 
static int print_header_line (const char *str, char c, int wcol)
 
int AOloopControl_RTstreamLOG_GUI (int loop)
 
int AOloopControl_RTstreamLOG_set_saveON (int loop, int rtlindex)
 
int AOloopControl_RTstreamLOG_set_saveOFF (int loop, int rtlindex)
 
int AOloopControl_RTstreamLOG_set_ON (int loop, int rtlindex)
 
int AOloopControl_RTstreamLOG_set_OFF (int loop, int rtlindex)
 
int AOloopControl_RTstreamLOG_saveloop (int loop, char *dirname)
 

Variables

AOLOOPCONTROL_CONFAOconf
 CLI function for AOloopControl_setframesAve. More...
 
AOloopControl_var aoloopcontrol_var
 

Detailed Description

Logging of real-time streams.

Real-time stream logging

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Function Documentation

◆ AOloopControl_RTstreamLOG_GUI()

int AOloopControl_RTstreamLOG_GUI ( int  loop)

◆ AOloopControl_RTstreamLOG_init()

errno_t AOloopControl_RTstreamLOG_init ( int  loop)

◆ AOloopControl_RTstreamLOG_printstatus()

int AOloopControl_RTstreamLOG_printstatus ( int  loop)

◆ AOloopControl_RTstreamLOG_saveloop()

int AOloopControl_RTstreamLOG_saveloop ( int  loop,
char *  dirname 
)

Purpose

Monitors multiple real-time AO loop buffers and saves them to disk

Arguments

Loop index and save directory on disk

Use

This function runs in a dedicated in a dedicated tmux session.
It is controlled by a ncurses-based GUI.

Details

Each real-time process maintains, for each streams, small alternating buffers where data is written at high speed. Timing/indexing buffers are also written.

This function monitors the small buffers. When a small buffer is ready/filled, it is included in a larger buffer which can be saved to disk.

The routine is designed to only occupy two threads: one to monitor, one to save

Takes timing data from the processes that create the data to achieve high performance timing

Initialization

Intialize :

  • time conversion information
  • AOloopControl memory
  • save thread message array
  • processinfo

◆ AOloopControl_RTstreamLOG_set_OFF()

int AOloopControl_RTstreamLOG_set_OFF ( int  loop,
int  rtlindex 
)

◆ AOloopControl_RTstreamLOG_set_ON()

int AOloopControl_RTstreamLOG_set_ON ( int  loop,
int  rtlindex 
)

◆ AOloopControl_RTstreamLOG_set_saveOFF()

int AOloopControl_RTstreamLOG_set_saveOFF ( int  loop,
int  rtlindex 
)

◆ AOloopControl_RTstreamLOG_set_saveON()

int AOloopControl_RTstreamLOG_set_saveON ( int  loop,
int  rtlindex 
)

◆ AOloopControl_RTstreamLOG_setup()

errno_t AOloopControl_RTstreamLOG_setup ( long  loop,
long  rtlindex,
char *  streamname 
)

PURPOSE

Setup RT stream for logging

Creates required buffers

◆ AOloopControl_RTstreamLOG_update()

void AOloopControl_RTstreamLOG_update ( long  loop,
long  rtlindex,
struct timespec  tnow 
)

Purpose

Write single entry in log buffer

This function is called by the process writing to the stream to minimize IPC need and reduce logging latency

◆ print_header_line()

static int print_header_line ( const char *  str,
char  c,
int  wcol 
)
static

Variable Documentation

◆ AOconf

CLI function for AOloopControl_setframesAve.

◆ aoloopcontrol_var

AOloopControl_var aoloopcontrol_var