| 40 | } |
| 41 | |
| 42 | bool |
| 43 | SavedSpectrum::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 |