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::ui::TimeseriesEditorDialog Class Reference

#include <timeserieseditordialog.h>

Inheritance diagram for openswmmvis::ui::TimeseriesEditorDialog:
Collaboration diagram for openswmmvis::ui::TimeseriesEditorDialog:

Public Types

enum class  Mode {
  Edit ,
  CreateNew
}
 Editing mode. Edit is the default — the dialog is bound to one or more existing providers. CreateNew opens a create-card (name + source-mode) at the top of the dialog; the dialog transitions to Edit after the user clicks Create. Used by Slice BM.0-Add-New. More...
 

Public Member Functions

 TimeseriesEditorDialog (openswmmvis::timeseries::TimeseriesRegistry *registry, QUndoStack *undoStack, openswmmvis::timeseries::TimeseriesProvider *initialSelection=nullptr, QWidget *parent=nullptr)
 Sole public constructor (Phase 6.7.3-CRUD). Builds the three-pane editor (left = list of all series in registry, middle = grid, right = chart). If initialSelection is non-null AND is a member of the registry, it's selected on open; otherwise the dialog opens with no series bound and the list pane drives further selection.
 
 ~TimeseriesEditorDialog () override
 
QString currentName () const
 Name of the first provider currently bound to the dialog. Empty before a CreateNew commits. Exposed for pickTimeseries and for tests.
 
Mode mode () const noexcept
 Current mode.
 
TimeseriesTableModeltableModel () const noexcept
 The grid model. Exposed for tests.
 
TimeseriesEditChartViewchartView () const noexcept
 The chart view. Exposed for tests.
 
QString pendingName () const
 Text in the create-card name field, or empty in Edit mode.
 
bool isCreateEnabled () const
 True iff the Create button is currently enabled.
 
void submitCreateNew ()
 Programmatically click the create-card's Create button (test hook).
 
void setProjectAnchor (const QString &dir)
 Slice IO-11d — set the directory used to display external-file paths in relative form. Typically the parent dir of the active project's .inp. Empty disables relativisation (legacy behaviour). The provider stores absolute paths regardless; this only affects what the dialog shows in the read-only path field.
 
QString projectAnchor () const
 
int linkExternalFile (const QString &path, const QString &columnSelector=QString())
 Bind the editor's first provider to an external file (CSV/TSV/.dat). Flips source mode to ExternalFile, populates the read-through point cache by parsing the file via the shared TimeseriesParse helper, and refreshes the source-mode card UI. Returns the number of points loaded.
 

Static Public Member Functions

static TimeseriesEditorDialogcreateNew (openswmmvis::timeseries::TimeseriesRegistry *registry, QUndoStack *undoStack, QWidget *parent=nullptr)
 Slice BM.0-Add-New factory: build the dialog in CreateNew mode on top of a registry. The dialog renders a create-card (name field + uniqueness validator + source-mode combo). Clicking Create calls registry->create(name), binds the returned provider to the grid + chart, hides the card, and transitions to Edit mode. Closing the dialog before Create adds nothing.
 
static QString pickTimeseries (openswmmvis::timeseries::TimeseriesRegistry *registry, QUndoStack *undoStack, const QString &initialName, QWidget *parent=nullptr)
 Modal pick / create / edit entry point for callers that round-trip a time series selection inline (e.g. the NodeCompoundEditDialog inflow picker). Empty initialName → CreateNew mode; otherwise → Edit mode bound to that series. After the user closes the dialog, the registry is flushed back to the engine (saveToEngine) so engine state matches the edited points. Returns the name of the series currently bound to the dialog on close, or empty if no commit happened.
 

Protected Member Functions

void closeEvent (QCloseEvent *e) override
 Step F + Step E.2 — dispose any ExternalFile-mode point cache on the way out so the registry doesn't carry it around after the editor closes, and persist dialog geometry + splitter sizes.
 

Member Enumeration Documentation

◆ Mode

Editing mode. Edit is the default — the dialog is bound to one or more existing providers. CreateNew opens a create-card (name + source-mode) at the top of the dialog; the dialog transitions to Edit after the user clicks Create. Used by Slice BM.0-Add-New.

Enumerator
Edit 
CreateNew 

Constructor & Destructor Documentation

◆ TimeseriesEditorDialog()

openswmmvis::ui::TimeseriesEditorDialog::TimeseriesEditorDialog ( openswmmvis::timeseries::TimeseriesRegistry registry,
QUndoStack *  undoStack,
openswmmvis::timeseries::TimeseriesProvider initialSelection = nullptr,
QWidget *  parent = nullptr 
)
explicit

Sole public constructor (Phase 6.7.3-CRUD). Builds the three-pane editor (left = list of all series in registry, middle = grid, right = chart). If initialSelection is non-null AND is a member of the registry, it's selected on open; otherwise the dialog opens with no series bound and the list pane drives further selection.

The registry is required — callers that want a quick modal pick or create flow use pickTimeseries / createNew.

Here is the call graph for this function:

◆ ~TimeseriesEditorDialog()

openswmmvis::ui::TimeseriesEditorDialog::~TimeseriesEditorDialog ( )
overridedefault

Member Function Documentation

◆ chartView()

TimeseriesEditChartView * openswmmvis::ui::TimeseriesEditorDialog::chartView ( ) const
inlinenoexcept

The chart view. Exposed for tests.

◆ closeEvent()

void openswmmvis::ui::TimeseriesEditorDialog::closeEvent ( QCloseEvent *  e)
overrideprotected

Step F + Step E.2 — dispose any ExternalFile-mode point cache on the way out so the registry doesn't carry it around after the editor closes, and persist dialog geometry + splitter sizes.

◆ createNew()

TimeseriesEditorDialog * openswmmvis::ui::TimeseriesEditorDialog::createNew ( openswmmvis::timeseries::TimeseriesRegistry registry,
QUndoStack *  undoStack,
QWidget *  parent = nullptr 
)
static

Slice BM.0-Add-New factory: build the dialog in CreateNew mode on top of a registry. The dialog renders a create-card (name field + uniqueness validator + source-mode combo). Clicking Create calls registry->create(name), binds the returned provider to the grid + chart, hides the card, and transitions to Edit mode. Closing the dialog before Create adds nothing.

Caller owns the returned dialog (use Qt::WA_DeleteOnClose for fire-and-forget modeless use).

◆ currentName()

QString openswmmvis::ui::TimeseriesEditorDialog::currentName ( ) const

Name of the first provider currently bound to the dialog. Empty before a CreateNew commits. Exposed for pickTimeseries and for tests.

Here is the caller graph for this function:

◆ isCreateEnabled()

bool openswmmvis::ui::TimeseriesEditorDialog::isCreateEnabled ( ) const

True iff the Create button is currently enabled.

◆ linkExternalFile()

int openswmmvis::ui::TimeseriesEditorDialog::linkExternalFile ( const QString &  path,
const QString &  columnSelector = QString() 
)

Bind the editor's first provider to an external file (CSV/TSV/.dat). Flips source mode to ExternalFile, populates the read-through point cache by parsing the file via the shared TimeseriesParse helper, and refreshes the source-mode card UI. Returns the number of points loaded.

Parameters
pathAbsolute path to the file.
columnSelectorOptional column-name match. Empty = first column. Exposed both for tests and for programmatic linking (Object Browser hook could call this on drop-from-finder, etc.).

◆ mode()

Mode openswmmvis::ui::TimeseriesEditorDialog::mode ( ) const
inlinenoexcept

Current mode.

◆ pendingName()

QString openswmmvis::ui::TimeseriesEditorDialog::pendingName ( ) const

Text in the create-card name field, or empty in Edit mode.

◆ pickTimeseries()

QString openswmmvis::ui::TimeseriesEditorDialog::pickTimeseries ( openswmmvis::timeseries::TimeseriesRegistry registry,
QUndoStack *  undoStack,
const QString &  initialName,
QWidget *  parent = nullptr 
)
static

Modal pick / create / edit entry point for callers that round-trip a time series selection inline (e.g. the NodeCompoundEditDialog inflow picker). Empty initialName → CreateNew mode; otherwise → Edit mode bound to that series. After the user closes the dialog, the registry is flushed back to the engine (saveToEngine) so engine state matches the edited points. Returns the name of the series currently bound to the dialog on close, or empty if no commit happened.

Here is the call graph for this function:

◆ projectAnchor()

QString openswmmvis::ui::TimeseriesEditorDialog::projectAnchor ( ) const
inline

◆ setProjectAnchor()

void openswmmvis::ui::TimeseriesEditorDialog::setProjectAnchor ( const QString &  dir)

Slice IO-11d — set the directory used to display external-file paths in relative form. Typically the parent dir of the active project's .inp. Empty disables relativisation (legacy behaviour). The provider stores absolute paths regardless; this only affects what the dialog shows in the read-only path field.

◆ submitCreateNew()

void openswmmvis::ui::TimeseriesEditorDialog::submitCreateNew ( )

Programmatically click the create-card's Create button (test hook).

◆ tableModel()

TimeseriesTableModel * openswmmvis::ui::TimeseriesEditorDialog::tableModel ( ) const
inlinenoexcept

The grid model. Exposed for tests.


The documentation for this class was generated from the following files: