tico 0.1
Mechanical Watch Terminal Timegrapher
Macros | Functions | Variables
printing.c File Reference
#include "printing.h"
#include "modsigned.h"
#include "mydefs.h"
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for printing.c:

Macros

#define COLOR_CYAN   "\033[96m"
 
#define COLOR_RED   "\033[31m"
 
#define COLOR_GREEN   "\033[32m"
 
#define COLOR_RESET   "\033[0m"
 
#define CURSOR_SAVE   "\033[s"
 
#define CURSOR_RESTORE   "\033[u"
 
#define CLEAR_LINE   "\033[0K"
 
#define CURSOR_ROW12   "\033[12;0H"
 
#define CURSOR_ROW2   "\033[2;0H"
 
#define CURSOR_COL_FMT   "\033[%dG"
 

Functions

void printmsg (const char *fmt,...)
 
void print (const char *fmt,...)
 
void printheader (double fittedRate, unsigned int everyline, double beatError, double seconds)
 
void printspaces (int maxpos, size_t hexvalue, size_t mod, size_t acolumns, double avgPos, size_t correlationThreshold)
 Prints spaces to visually represent the position of the maximum correlation in the capture output, based on the provided parameters. More...
 

Variables

volatile unsigned int columns
 

Macro Definition Documentation

◆ CLEAR_LINE

#define CLEAR_LINE   "\033[0K"

◆ COLOR_CYAN

#define COLOR_CYAN   "\033[96m"

◆ COLOR_GREEN

#define COLOR_GREEN   "\033[32m"

◆ COLOR_RED

#define COLOR_RED   "\033[31m"

◆ COLOR_RESET

#define COLOR_RESET   "\033[0m"

◆ CURSOR_COL_FMT

#define CURSOR_COL_FMT   "\033[%dG"

◆ CURSOR_RESTORE

#define CURSOR_RESTORE   "\033[u"

◆ CURSOR_ROW12

#define CURSOR_ROW12   "\033[12;0H"

◆ CURSOR_ROW2

#define CURSOR_ROW2   "\033[2;0H"

◆ CURSOR_SAVE

#define CURSOR_SAVE   "\033[s"

Function Documentation

◆ print()

void print ( const char *  fmt,
  ... 
)

◆ printheader()

void printheader ( double  fittedRate,
unsigned int  everyline,
double  beatError,
double  seconds 
)

◆ printmsg()

void printmsg ( const char *  fmt,
  ... 
)

◆ printspaces()

void printspaces ( int  maxpos,
size_t  hexvalue,
size_t  mod,
size_t  acolumns,
double  avgPos,
size_t  correlationThreshold 
)

Prints spaces to visually represent the position of the maximum correlation in the capture output, based on the provided parameters.

Parameters
maxposThe position of the maximum correlation.
hexvalueThe hexadecimal value representing the correlation strength.
modThe modulus used for calculating the width of the spaces.
acolumnsThe total number of columns available for printing.
avgPosThe average position of the correlation.
correlationThresholdThe threshold for determining the color of the output.

Variable Documentation

◆ columns

volatile unsigned int columns
extern