myWRIO
C++ framework for NationalInstruments myRIO
myRIO::Log Class Reference

Easily print data to a log file. More...

#include <Log.h>

Public Member Functions

 Log (std::string filename, char sep=' ')
 A simple constructor for a Log. More...
 
 ~Log ()
 
void println (long time, double angle)
 
void println (long time, double angle, double pidOutput)
 
void println (long time, double sp, double csp, double spd)
 
void println (long time, double sp, double csp, long enc, long filtered)
 
void close ()
 

Private Attributes

std::ofstream file
 
char sep
 The separator between each value on a line (ex a space, a column..) More...
 

Detailed Description

Easily print data to a log file.

Examples
example_log.cpp, example_motor_pid_encoder.cpp, and project_pendulum.cpp.

Definition at line 13 of file Log.h.

Constructor & Destructor Documentation

◆ Log()

Log::Log ( std::string  filename,
char  sep = ' ' 
)

A simple constructor for a Log.

Path of the resulting file: /home/filename

Parameters
filenameThe filename to give. You can pass an extension if you want.
sepThe separator between each data on a line

Definition at line 12 of file Log.cpp.

◆ ~Log()

Log::~Log ( )

Definition at line 36 of file Log.cpp.

Member Function Documentation

◆ close()

void Log::close ( )

Definition at line 32 of file Log.cpp.

◆ println() [1/4]

void Log::println ( long  time,
double  angle 
)
Examples
example_log.cpp, and example_motor_pid_encoder.cpp.

Definition at line 16 of file Log.cpp.

◆ println() [2/4]

void Log::println ( long  time,
double  angle,
double  pidOutput 
)

Definition at line 20 of file Log.cpp.

◆ println() [3/4]

void Log::println ( long  time,
double  sp,
double  csp,
double  spd 
)

Definition at line 24 of file Log.cpp.

◆ println() [4/4]

void Log::println ( long  time,
double  sp,
double  csp,
long  enc,
long  filtered 
)

Definition at line 28 of file Log.cpp.

Member Data Documentation

◆ file

std::ofstream myRIO::Log::file
private

Definition at line 23 of file Log.h.

◆ sep

char myRIO::Log::sep
private

The separator between each value on a line (ex a space, a column..)

Definition at line 24 of file Log.h.


The documentation for this class was generated from the following files: