Helper class for the volt_distr node. More...
#include <volt_distr_creator.h>
Public Member Functions | |
void | add (const neuro_recv::dish_state &d) |
Adds the values of a dish state to the distribution. | |
boost::array< double, 60 > | getPercents () |
Gets the percentage of negative dishes for each channel. | |
void | setDoTruncateVolts (int i) |
void | toFile (const std::string &file_path) |
Saves the distrubution data to file in CSV format. | |
VoltDistrCreator () | |
Private Attributes | |
bool | do_truncate_volts_ |
std::ofstream | log_file_ |
boost::array< int, 60 > | negatives_ |
int | total_dishes_ |
std::map< double, std::vector < int > > | volts_ |
Helper class for the volt_distr node.
Creates a distribution of recorded voltages on each channel.
Definition at line 38 of file volt_distr_creator.h.
Definition at line 10 of file volt_distr_creator.cpp.
void VoltDistrCreator::add | ( | const neuro_recv::dish_state & | d | ) |
Adds the values of a dish state to the distribution.
The class maintains a histogram of voltages, as well as a count of negative voltages, for each channel.
d | the dish state being added |
Definition at line 25 of file volt_distr_creator.cpp.
boost::array< double, 60 > VoltDistrCreator::getPercents | ( | ) |
Gets the percentage of negative dishes for each channel.
Definition at line 98 of file volt_distr_creator.cpp.
void VoltDistrCreator::setDoTruncateVolts | ( | int | i | ) | [inline] |
Definition at line 47 of file volt_distr_creator.h.
void VoltDistrCreator::toFile | ( | const std::string & | file_path | ) |
Saves the distrubution data to file in CSV format.
file_path | the path of the file to be saved |
Definition at line 64 of file volt_distr_creator.cpp.
bool VoltDistrCreator::do_truncate_volts_ [private] |
Definition at line 52 of file volt_distr_creator.h.
std::ofstream VoltDistrCreator::log_file_ [private] |
Definition at line 51 of file volt_distr_creator.h.
boost::array<int, 60> VoltDistrCreator::negatives_ [private] |
Definition at line 53 of file volt_distr_creator.h.
int VoltDistrCreator::total_dishes_ [private] |
Definition at line 54 of file volt_distr_creator.h.
std::map<double, std::vector<int> > VoltDistrCreator::volts_ [private] |
Definition at line 50 of file volt_distr_creator.h.