17 #include <QtCore/qdir.h>
20 const std::vector<double>
tabFreq = {31.5, 63.0, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0};
21 const std::vector<double>
dAWeighting = {-39.5, -26.2, -16.1, -8.6, -3.2, 0.0, 1.2, 1.0, -1.1};
22 const char*
SEP =
";";
29 QDir::toNativeSeparators(
"C:/projects/tympan_tools/17534-3/output/results_17534_format.csv");
31 ofs.open(qFileName.toStdString().c_str(), std::ios_base::out);
34 ofs.setf(std::ios::fixed, std::ios::floatfield);
37 for (
auto& currentPathResults : pathsResults)
39 ofs <<
"Path id : " <<
SEP << currentPathResults.path_id <<
"\n";
40 ofs <<
"Path type : " <<
SEP << currentPathResults.pathType <<
"\n";
46 ofs <<
"f" <<
SEP <<
"Hz" <<
SEP;
47 for (
int col = 0; col <
tabFreq.size(); col++)
60 ofs <<
"alpha-atm" <<
SEP <<
"dB/km" <<
SEP;
61 for (
int col = 0; col <
tabFreq.size(); col++)
74 printQuantity(ofs, currentPathResults.Agr_s + currentPathResults.Agr_r + currentPathResults.Agr_m,
83 printQuantity(ofs, currentPathResults.Abar_left,
"Abar_left");
84 printQuantity(ofs, currentPathResults.Abar_right,
"Abar_right");
105 ofs << quantity <<
SEP <<
"dB" <<
SEP;
106 for (
int col = 0; col <
tabFreq.size(); col++)
116 ofs << quantity <<
SEP <<
"dB" <<
SEP;
117 for (
int col = 0; col <
tabFreq.size(); col++)
125 ofs <<
"A-weighting" <<
SEP <<
"dB" <<
SEP;
126 for (
int col = 0; col <
tabFreq.size(); col++)
133 ofs << quantity <<
"A" <<
SEP <<
"dBA" <<
SEP;
134 for (
int col = 0; col <
tabFreq.size(); col++)
const std::streamsize PRECISION
const std::vector< double > tabFreq
const std::vector< double > dAWeighting
Class for the definition of atmospheric conditions.
OSpectreOctave get_absorption_spectrum_oct() const
Get absorption spectrum for octave band computation.
double valGlobDBA() const
Compute the global value dB[A] of a one-third Octave spectrum.
double valGlobDBLin() const
Compute the global value dB[Lin] of a one-third Octave spectrum.
double * getTabValReel() override
Get an array of the real values of the spectrum.
static void printQuantity(std::ofstream &ofs, const OSpectreOctave Att, const char *quantity)
static void printLevel(std::ofstream &ofs, const OSpectreOctave L, const char *quantity)
static void exportResults17534(const std::vector< PathResults > pathsResults, const OSpectreOctave &SLp, const AtmosphericConditions &atmos)