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
openswmmvis::core Namespace Reference

Functions

QDateTime swmmDateTimeToQDateTime (double value)
 SWMM DateTime double → UTC-labelled QDateTime (wall clock).
 
double qDateTimeToSwmmDateTime (const QDateTime &dt)
 QDateTime → SWMM DateTime double.
 
QString swmmDateTimeDisplayFormat ()
 Canonical date-time format for display and editing: MM/dd/yyyy HH:mm.
 

Function Documentation

◆ qDateTimeToSwmmDateTime()

double openswmmvis::core::qDateTimeToSwmmDateTime ( const QDateTime &  dt)
inline

QDateTime → SWMM DateTime double.

Reads the calendar components directly (no timezone conversion) and encodes via the engine. Sub-second input is rounded to the nearest second to match the engine's integer-second resolution, so e.g. 00:14:59.750 encodes to the same double as 00:15:00. Returns NaN for an invalid QDateTime.

Here is the caller graph for this function:

◆ swmmDateTimeDisplayFormat()

QString openswmmvis::core::swmmDateTimeDisplayFormat ( )
inline

Canonical date-time format for display and editing: MM/dd/yyyy HH:mm.

The same MM/DD/YYYY HH:MM a SWMM .inp writes, so what a user reads in the GUI matches what they read in the file. Suitable for QDateTime::toString() and QDateTimeEdit::setDisplayFormat().

Minute resolution — SWMM's own storage is whole seconds and the engine's [TIMESERIES] writer emits HH:MM:SS, so a displayed value can hide a non-zero seconds field. Editors built on this must therefore preserve the seconds they were handed (a QDateTimeEdit does: the sections omitted from the display format keep their value), or they silently truncate — the defect class GH #1 was about.

Here is the caller graph for this function:

◆ swmmDateTimeToQDateTime()

QDateTime openswmmvis::core::swmmDateTimeToQDateTime ( double  value)
inline

SWMM DateTime double → UTC-labelled QDateTime (wall clock).

Delegates decoding to the engine, which rounds to the nearest second and clamps end-of-day. Returns an invalid QDateTime when value is not finite or decodes to an invalid calendar date.

Here is the caller graph for this function: