Class for output file stream container for double values. More...
#include "satellite-output-fstream-double-container.h"
Public Types | |
enum | FigureUnitConversion_t { RAW , DECIBEL , DECIBEL_AMPLITUDE } |
Public Member Functions | |
SatOutputFileStreamDoubleContainer () | |
Constructor. More... | |
SatOutputFileStreamDoubleContainer (std::string filename, std::ios::openmode filemode, uint32_t valuesInRow) | |
Constructor. More... | |
~SatOutputFileStreamDoubleContainer () | |
Destructor. More... | |
void | AddToContainer (std::vector< double > newItem) |
Function for adding the values to container. More... | |
void | DoDispose () |
Do needed dispose actions. More... | |
void | EnableFigureOutput (std::string title, std::string legendY, std::string legendX, std::string keyPosition, FigureUnitConversion_t figureUnitConversionType, Gnuplot2dDataset::Style style) |
Function for enabling the figure output. More... | |
void | WriteContainerToFile () |
Function for writing the container contents to file. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
NS-3 function for type id. More... | |
Private Member Functions | |
void | ClearContainer () |
Function for clearing the container. More... | |
double | ConvertValue (double value) |
Function for converting the container data samples. More... | |
Gnuplot | GetGnuplot () |
Function for creating Gnuplots. More... | |
Gnuplot2dDataset | GetGnuplotDataset () |
Function for creating Gnuplot datasets. More... | |
void | OpenStream () |
Function for opening the output file stream. More... | |
void | PrintFigure () |
Function for printing the container contents into a figure. More... | |
void | Reset () |
Function for resetting the variables. More... | |
void | ResetStream () |
Function for resetting the stream. More... | |
Private Attributes | |
std::vector< std::vector< double > > | m_container |
Container for value rows. More... | |
FigureUnitConversion_t | m_figureUnitConversionType |
Describes which unit conversion should be used with the figure. More... | |
std::ios::openmode | m_fileMode |
File mode. More... | |
std::string | m_fileName |
File name. More... | |
std::string | m_keyPosition |
Figure legend position. More... | |
std::string | m_legendX |
Figure X-axis title. More... | |
std::string | m_legendY |
Figure Y-axis title. More... | |
std::ofstream * | m_outputFileStream |
Pointer to output file stream. More... | |
SatOutputFileStreamWrapper * | m_outputFileStreamWrapper |
Pointer to output file stream wrapper. More... | |
bool | m_printFigure |
Enable / disable printing of container contents into a figure. More... | |
Gnuplot2dDataset::Style | m_style |
2D dataset figure style More... | |
std::string | m_title |
Figure title. More... | |
uint32_t | m_valuesInRow |
Number of values in a row. More... | |
Class for output file stream container for double values.
The class implements storing the values and writing the stored values into a file. A figure output in two dimensions is also supported.
Definition at line 42 of file satellite-output-fstream-double-container.h.
Enumerator | |
---|---|
RAW | |
DECIBEL | |
DECIBEL_AMPLITUDE |
Definition at line 45 of file satellite-output-fstream-double-container.h.
ns3::SatOutputFileStreamDoubleContainer::SatOutputFileStreamDoubleContainer | ( | std::string | filename, |
std::ios::openmode | filemode, | ||
uint32_t | valuesInRow | ||
) |
Constructor.
filename | file name |
filemode | file mode |
valuesInRow | number of values in a row |
Definition at line 41 of file satellite-output-fstream-double-container.cc.
References m_fileMode, m_fileName, and m_valuesInRow.
ns3::SatOutputFileStreamDoubleContainer::SatOutputFileStreamDoubleContainer | ( | ) |
Constructor.
Definition at line 63 of file satellite-output-fstream-double-container.cc.
ns3::SatOutputFileStreamDoubleContainer::~SatOutputFileStreamDoubleContainer | ( | ) |
Destructor.
Definition at line 79 of file satellite-output-fstream-double-container.cc.
References Reset().
void ns3::SatOutputFileStreamDoubleContainer::AddToContainer | ( | std::vector< double > | newItem | ) |
Function for adding the values to container.
Definition at line 160 of file satellite-output-fstream-double-container.cc.
References m_container, and m_valuesInRow.
|
private |
Function for clearing the container.
Definition at line 207 of file satellite-output-fstream-double-container.cc.
References m_container, and m_valuesInRow.
Referenced by Reset().
|
private |
Function for converting the container data samples.
value | original data sample value |
Definition at line 257 of file satellite-output-fstream-double-container.cc.
References DECIBEL, DECIBEL_AMPLITUDE, m_figureUnitConversionType, and RAW.
Referenced by GetGnuplotDataset().
void ns3::SatOutputFileStreamDoubleContainer::DoDispose | ( | void | ) |
Do needed dispose actions.
Definition at line 87 of file satellite-output-fstream-double-container.cc.
References Reset().
void ns3::SatOutputFileStreamDoubleContainer::EnableFigureOutput | ( | std::string | title, |
std::string | legendY, | ||
std::string | legendX, | ||
std::string | keyPosition, | ||
FigureUnitConversion_t | figureUnitConversionType, | ||
Gnuplot2dDataset::Style | style | ||
) |
Function for enabling the figure output.
title | title text |
legendY | Y-axis title |
legendX | X-axis title |
keyPosition | Legend position |
figureUnitConversionType | Conversion type for units in the figure |
style | 2D dataset figure style |
Definition at line 303 of file satellite-output-fstream-double-container.cc.
References m_figureUnitConversionType, m_keyPosition, m_legendX, m_legendY, m_printFigure, m_style, and m_title.
|
private |
Function for creating Gnuplots.
Definition at line 289 of file satellite-output-fstream-double-container.cc.
References m_fileName, m_keyPosition, m_legendX, m_legendY, and m_title.
Referenced by PrintFigure().
|
private |
Function for creating Gnuplot datasets.
Definition at line 227 of file satellite-output-fstream-double-container.cc.
References ConvertValue(), m_container, m_style, m_title, and m_valuesInRow.
Referenced by PrintFigure().
|
static |
NS-3 function for type id.
Definition at line 33 of file satellite-output-fstream-double-container.cc.
|
private |
Function for opening the output file stream.
Definition at line 173 of file satellite-output-fstream-double-container.cc.
References ns3::SatOutputFileStreamWrapper::GetStream(), m_fileMode, m_fileName, m_outputFileStream, and m_outputFileStreamWrapper.
Referenced by WriteContainerToFile().
|
private |
Function for printing the container contents into a figure.
Definition at line 135 of file satellite-output-fstream-double-container.cc.
References GetGnuplot(), GetGnuplotDataset(), and m_fileName.
Referenced by WriteContainerToFile().
|
private |
Function for resetting the variables.
Definition at line 182 of file satellite-output-fstream-double-container.cc.
References ClearContainer(), and ResetStream().
Referenced by ~SatOutputFileStreamDoubleContainer(), DoDispose(), and WriteContainerToFile().
|
private |
Function for resetting the stream.
Definition at line 191 of file satellite-output-fstream-double-container.cc.
References m_fileMode, m_fileName, m_outputFileStream, and m_outputFileStreamWrapper.
Referenced by Reset().
void ns3::SatOutputFileStreamDoubleContainer::WriteContainerToFile | ( | ) |
Function for writing the container contents to file.
Definition at line 96 of file satellite-output-fstream-double-container.cc.
References m_container, m_outputFileStream, m_printFigure, m_valuesInRow, OpenStream(), PrintFigure(), and Reset().
|
private |
Container for value rows.
Definition at line 167 of file satellite-output-fstream-double-container.h.
Referenced by AddToContainer(), ClearContainer(), GetGnuplotDataset(), and WriteContainerToFile().
|
private |
Describes which unit conversion should be used with the figure.
Definition at line 212 of file satellite-output-fstream-double-container.h.
Referenced by ConvertValue(), and EnableFigureOutput().
|
private |
File mode.
Definition at line 177 of file satellite-output-fstream-double-container.h.
Referenced by SatOutputFileStreamDoubleContainer(), OpenStream(), and ResetStream().
|
private |
File name.
Definition at line 172 of file satellite-output-fstream-double-container.h.
Referenced by SatOutputFileStreamDoubleContainer(), GetGnuplot(), OpenStream(), PrintFigure(), and ResetStream().
|
private |
Figure legend position.
Definition at line 207 of file satellite-output-fstream-double-container.h.
Referenced by EnableFigureOutput(), and GetGnuplot().
|
private |
Figure X-axis title.
Definition at line 202 of file satellite-output-fstream-double-container.h.
Referenced by EnableFigureOutput(), and GetGnuplot().
|
private |
Figure Y-axis title.
Definition at line 197 of file satellite-output-fstream-double-container.h.
Referenced by EnableFigureOutput(), and GetGnuplot().
|
private |
Pointer to output file stream.
Definition at line 162 of file satellite-output-fstream-double-container.h.
Referenced by OpenStream(), ResetStream(), and WriteContainerToFile().
|
private |
Pointer to output file stream wrapper.
Definition at line 157 of file satellite-output-fstream-double-container.h.
Referenced by OpenStream(), and ResetStream().
|
private |
Enable / disable printing of container contents into a figure.
Definition at line 187 of file satellite-output-fstream-double-container.h.
Referenced by EnableFigureOutput(), and WriteContainerToFile().
|
private |
2D dataset figure style
Definition at line 217 of file satellite-output-fstream-double-container.h.
Referenced by EnableFigureOutput(), and GetGnuplotDataset().
|
private |
Figure title.
Definition at line 192 of file satellite-output-fstream-double-container.h.
Referenced by EnableFigureOutput(), GetGnuplot(), and GetGnuplotDataset().
|
private |
Number of values in a row.
Definition at line 182 of file satellite-output-fstream-double-container.h.
Referenced by SatOutputFileStreamDoubleContainer(), AddToContainer(), ClearContainer(), GetGnuplotDataset(), and WriteContainerToFile().