SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
timeseriesparse.h File Reference

Slice BQ Phase 6.7.3 — shared CSV / TSV / .dat row parser. More...

#include <QChar>
#include <QString>
#include <vector>
Include dependency graph for timeseriesparse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmmvis::io::SwmmDatState
 State carried across lines when reading a SWMM .dat timeseries file. More...
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::io
 

Functions

QChar openswmmvis::io::guessDelimiter (const QString &sampleLine)
 Guess the per-row delimiter from a sample line.
 
bool openswmmvis::io::tryParseTimestamp (const QString &s, double &jOut, double fallbackBase)
 Try to parse s as a timestamp into a SWMM Julian date.
 
bool openswmmvis::io::parseRow (const QString &line, QChar delim, double &timeJulianOut, std::vector< double > &valuesOut, double hoursSinceStartFallbackBase)
 Parse one delimited row into a timestamp + N value cells.
 
bool openswmmvis::io::parseSwmmDatLine (const QString &line, SwmmDatState &state, double &timeJulianOut, double &valueOut)
 Parse one line of a SWMM .dat timeseries file.
 

Detailed Description

Slice BQ Phase 6.7.3 — shared CSV / TSV / .dat row parser.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

Extracted from ObservedCsvRunLayer::parseRow_ so the same parser drives:

  • file import (ObservedCsvRunLayer, TimeseriesProvider ExternalFile mode)
  • clipboard paste into the TimeseriesEditorDialog grid

Supported time formats (tried in order, mirrors legacy + ObservedCsvRunLayer):

  • ISO 8601: yyyy-MM-ddTHH:mm:ss, yyyy-MM-dd HH:mm[:ss], yyyy-MM-dd
  • SWMM .dat / US: MM/dd/yyyy [HH:mm[:ss]]
  • European: dd/MM/yyyy HH:mm
  • 12-hour US AM/PM: M/d/yyyy h:mm[:ss] AM|PM (PCSWMM .tsf; single-digit month/day/hour accepted, 24-hour siblings included)
  • Hours-since-start: numeric fallback (only when fallbackBase is finite)

Auto-detected delimiters: tab, comma, semicolon (highest-count wins; defaults to comma when none are present).