![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Time-series data export (CSV / SWMM .dat) for the Comparison Plot Dialog. More...
#include <QString>#include <QStringList>#include <QVector>#include <vector>Go to the source code of this file.
Classes | |
| struct | openswmmvis::plot::ExportSeries |
| One series to export — name becomes the CSV column header / .dat comment line. Times are SWMM Julian doubles (see core/swmmdatetime.h). More... | |
Namespaces | |
| namespace | openswmmvis |
| namespace | openswmmvis::plot |
Functions | |
| QString | openswmmvis::plot::seriesToCsvText (const QVector< ExportSeries > &series) |
| Build wide-format CSV text: column 0 = ISO timestamp, one column per series. Rows are the sorted union of all series' timestamps; a cell is empty where its series has no sample (or a non-finite value) at that time. | |
| QString | openswmmvis::plot::seriesToDatText (const ExportSeries &series) |
| Build SWMM .dat text for a single series: ";name" comment line followed by "MM/dd/yyyy HH:mm:ss value" rows. Non-finite values are skipped (SWMM cannot parse them). | |
| bool | openswmmvis::plot::writeSeriesCsv (const QString &path, const QVector< ExportSeries > &series, QString *errorOut=nullptr) |
Write CSV to path. Returns false and populates errorOut on failure. | |
| QStringList | openswmmvis::plot::writeSeriesDat (const QString &path, const QVector< ExportSeries > &series, QString *errorOut=nullptr) |
Write .dat file(s). A single series writes exactly path; multiple series write one file each, named "<base>_<sanitized series name>.dat" beside path. Returns the list of files written (empty on failure, with errorOut populated). | |
| QString | openswmmvis::plot::sanitizedFileToken (const QString &name) |
| Reduce a series name to a filesystem-safe token for the multi-series .dat fan-out (non [A-Za-z0-9_-] runs collapse to '_'). | |
Time-series data export (CSV / SWMM .dat) for the Comparison Plot Dialog.
Pure model-layer code (Qt Core only — no widgets) so the formats are unit-testable. Both formats round-trip through the app's own readers:
ObservedCsvRunLayer (via io::parseRow) re-loads directly.ObservedCsvRunLayer.A .dat file carries exactly one series, so exporting N > 1 series to .dat fans out to one file per series with the series name appended to the chosen base name.