MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / exportToFile

Method exportToFile

Components/PanoramicDialog.cpp:42–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42bool
43SavedSpectrum::exportToFile(QString const &path)
44{
45 std::ofstream of(path.toStdString().c_str(), std::ofstream::binary);
46
47 if (!of.is_open())
48 return false;
49
50 of << "%\n";
51 of << "% Panoramic Spectrum file generated by SigDigger\n";
52 of << "%\n\n";
53
54 of << "freqMin = " << this->start << ";\n";
55 of << "freqMax = " << this->end << ";\n";
56 of << "PSD = [ ";
57
58 of << std::setprecision(std::numeric_limits<float>::digits10);
59
60 for (auto p : this->data)
61 of << p << " ";
62
63 of << "];\n";
64
65 return true;
66}
67
68////////////////////////// PanoramicDialogConfig ///////////////////////////////
69#define STRINGFY(x) #x

Callers 1

onExportMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected