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
timeseriesseriescommands.h File Reference

QUndoCommands that create, replace, and delete WHOLE time series. More...

#include "timeseries/timeseriesprovider.h"
#include <QString>
#include <QUndoCommand>
#include <QVector>
Include dependency graph for timeseriesseriescommands.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmmvis::timeseries::AddTimeseriesCommand
 Create an inline series and flush it to the engine. More...
 
class  openswmmvis::timeseries::SetTimeseriesPointsCommand
 Replace every point (and the description) of an existing series. More...
 
class  openswmmvis::timeseries::DeleteTimeseriesCommand
 Delete a series from both the registry and the engine. More...
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::timeseries
 

Detailed Description

QUndoCommands that create, replace, and delete WHOLE time series.

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

Separate from timeseriesundocommands.h on purpose. Those commands mutate one already-existing TimeseriesProvider and nothing else, so they compile as a leaf against Qt alone — which is what tests/unit/test_timeseries_undocommands.cpp relies on. Whole-series lifecycle needs the registry AND the engine (a series must exist in the engine before a rain gage can point at it), so it lives here rather than dragging that dependency into the leaf.

Three constraints shape these commands:

  1. They key on the series NAME, never on a TimeseriesProvider*. TimeseriesRegistry::remove() uses deleteLater(), so a stored pointer can dangle before undo runs.
  2. TimeseriesRegistry::remove() drops the provider but does NOT delete the engine's table, and saveToEngine() never deletes rows either. Undoing a create must therefore delete the engine row explicitly, or the series survives invisibly and reappears in the written INP.
  3. Every redo() must tolerate re-entry: QUndoStack::beginMacro runs a child's redo() at push time, and again on each later redo.