#include <traceanalysisdialog.h>
|
| | TraceAnalysisDialog (SWMMVisProjectWindow *) |
| | Required first argument is live owning project with canvas/registry; create reusable node picker and bind project TraceController, installing application-wide map event filter.
|
| |
| void | setSeedNodes (const QStringList &) |
| | Copy first argument (borrowed node-ID list) into comma-space joined editor, without trimming, validation, deduplication or starting a job. IDs containing commas cannot round-trip as one seed.
|
| |
| QJsonObject | state () const |
| |
| void | restore (const QJsonObject &) |
| | Read first argument JSON into run ID, raw node text, direction/tab booleans (only integer 1 true); missing keys default empty/false.
|
| |
|
| static TraceAnalysisDialog * | showFor (SWMMVisProjectWindow *, bool upstream, bool travel, const QString &seed={}, SWMMResultsLayer *output=nullptr) |
| | For the first project argument (nullable), reuse/create its direct-child trace picker, capture run topology once, then start for seeds or show map/node picker.
|
| |
| static void | showProperties (TraceSublayer *, QWidget *parent) |
| | First argument is required live TraceSublayer with live layer/style; open immediate style editing with original JSON snapshot restored on rejection.
|
| |
| static void | showDetails (TraceSublayer *, QWidget *parent) |
| | First argument is required live TraceSublayer/layer/result; snapshot currently contributing rows into sortable read-only table and retain shared result for export/retry-save.
|
| |
| static void | recalculate (SWMMVisProjectWindow *, const QString &runId) |
| | First argument is optional project (null no-op); reuse/create picker and request full-run saved-analysis recomputation with progress.
|
| |
|
| bool | eventFilter (QObject *, QEvent *) override |
| | First argument is borrowed event target; second is required borrowed Qt event. While visible, consume left-button presses on canvas/descendants and choose nearest snapshot node strictly within 16 logical pixels.
|
| |
| void | reject () override |
| | Unset project canvas cursor and reject picker. Does not cancel controller or clear pending work; progress Cancel is separately connected to controller cancel.
|
| |
◆ TraceAnalysisDialog()
Required first argument is live owning project with canvas/registry; create reusable node picker and bind project TraceController, installing application-wide map event filter.
- Parameters
-
| [in] | p | Required owning project retained raw; must outlive dialog callbacks. |
- Note
- Dialog owns editor/completers; project owns progress dialog and controller, so destroying picker alone need not destroy progress. Controller progress/results handled only during pending session; matching run results attach unless recalculating an already open result. Project must outlive all callbacks. Direct construction requires later run/snapshot setup before starting.
◆ eventFilter()
| bool openswmmvis::trace::TraceAnalysisDialog::eventFilter |
( |
QObject * |
object, |
|
|
QEvent * |
event |
|
) |
| |
|
overrideprotected |
First argument is borrowed event target; second is required borrowed Qt event. While visible, consume left-button presses on canvas/descendants and choose nearest snapshot node strictly within 16 logical pixels.
- Parameters
-
| [in] | object | Borrowed Qt target object used to check canvas ancestry. |
| [in] | event | Required borrowed Qt event, inspected synchronously only. |
- Returns
- Base result while hidden; false for nonmouse/noncanvas/nonleft events; true for canvas left click even no node or failed required CRS transform.
- Note
- Lazily load/capture snapshot if empty; transform node coordinates to current canvas CRS when available, skipping failed points. Missing CRS can use untransformed coordinates. Nearest tie keeps earlier node. Match replaces all seeds and starts job; no live geometry mutation.
◆ recalculate()
| void openswmmvis::trace::TraceAnalysisDialog::recalculate |
( |
SWMMVisProjectWindow * |
p, |
|
|
const QString & |
runId |
|
) |
| |
|
static |
First argument is optional project (null no-op); reuse/create picker and request full-run saved-analysis recomputation with progress.
Discard the run's saved analysis and recompute its estimates from the current output, with the usual progress dialog.
- Parameters
-
| [in] | runId | Nonempty run identity looked up in project registry; empty no-op. |
| [in] | p | Optional borrowed owning project; null is a no-op. |
- Note
- Busy controller only raises existing progress. No canAnalyze preflight here: failures delegated to controller. Captures current model snapshot only when stored run snapshot absent. Existing open layers refresh rather than duplicating attached results. No synchronous result or rollback.
◆ reject()
| void openswmmvis::trace::TraceAnalysisDialog::reject |
( |
| ) |
|
|
overrideprotected |
Unset project canvas cursor and reject picker. Does not cancel controller or clear pending work; progress Cancel is separately connected to controller cancel.
◆ restore()
| void openswmmvis::trace::TraceAnalysisDialog::restore |
( |
const QJsonObject & |
j | ) |
|
Read first argument JSON into run ID, raw node text, direction/tab booleans (only integer 1 true); missing keys default empty/false.
- Parameters
-
| [in] | j | Borrowed saved state; omitted/incorrect typed fields use Qt defaults. |
- Note
- No schema/run/node validation, snapshot/completer/prompt refresh, checkbox reset or computation; caller must establish matching context before starting.
◆ setSeedNodes()
| void openswmmvis::trace::TraceAnalysisDialog::setSeedNodes |
( |
const QStringList & |
nodes | ) |
|
Copy first argument (borrowed node-ID list) into comma-space joined editor, without trimming, validation, deduplication or starting a job. IDs containing commas cannot round-trip as one seed.
- Parameters
-
| [in] | nodes | Borrowed IDs copied into editor as comma-separated text. |
◆ showDetails()
| void openswmmvis::trace::TraceAnalysisDialog::showDetails |
( |
TraceSublayer * |
part, |
|
|
QWidget * |
parent |
|
) |
| |
|
static |
First argument is required live TraceSublayer/layer/result; snapshot currently contributing rows into sortable read-only table and retain shared result for export/retry-save.
- Parameters
-
| [in] | parent | Optional QWidget owner for nonmodal WA_DeleteOnClose result window. |
| [in] | part | Required borrowed sublayer with accessible layer/result on entry. |
- Note
- Fraction remains ratio, mean flow m3/s, time seconds converted to minutes, coverage fraction to percent; nonfinite values display Unavailable. Boundary/residual volumes m3. Table does not follow later style/result changes. CSV quotes/escapes all cells and atomically commits displayed sorted rows; IO failure warns. Retry saves analysis package and sets shared saved flag only on success.
◆ showFor()
For the first project argument (nullable), reuse/create its direct-child trace picker, capture run topology once, then start for seeds or show map/node picker.
- Parameters
-
| [in] | upstream | True computes direction 1 (upstream), false direction 0. |
| [in] | travel | True attaches travel-time sublayer; false flow-balance view. |
| [in] | seed | Optional single exact node ID; empty uses currently selected model nodes. |
| [in] | output | Optional borrowed output layer; null tries active output then asks for a file. |
| [in] | p | Optional borrowed live owning project; null or absent model returns null. |
- Returns
- Borrowed project-owned reusable dialog, null only for absent project/model. Busy controller raises progress and ignores new request arguments; canceled file chooser or unavailable run can return an existing hidden dialog.
- Note
- File selection opens/adds a new results layer and makes it active; failures warn. Run must be analyzable. Project, model, canvas and registry must remain live through callbacks; no ownership transfer for explicit output. GUI thread only.
◆ showProperties()
| void openswmmvis::trace::TraceAnalysisDialog::showProperties |
( |
TraceSublayer * |
part, |
|
|
QWidget * |
parent |
|
) |
| |
|
static |
First argument is required live TraceSublayer with live layer/style; open immediate style editing with original JSON snapshot restored on rejection.
- Parameters
-
| [in] | parent | Optional Qt owner for newly allocated nonmodal WA_DeleteOnClose style window. |
| [in] | part | Required borrowed live sublayer with accessible layer/style. |
- Note
- No undo command. Link/node fields include ratio, flow, gross, time, local, coverage and node volume; flow m3/s, time minutes in label presentation. Contribution editor is 0..100 percent converted to fraction, three decimals. Size bounds 0..1e15/eight decimals, diameter/width max 80 px; label font 5..40 pt, precision 0..8, halo 0.1..6 px.
-
Invalid color/size drafts block OK; valid edits emit style changed immediately. Node marker area follows scale while editor uses diameter. Layer/sublayer destruction rejects with signals blocked, deliberately skips rollback. Other guarded callbacks tolerate destroyed style/layer. Multiple windows can hold competing snapshots; closing without rejection signal is not independently rolled back.
◆ state()
| QJsonObject openswmmvis::trace::TraceAnalysisDialog::state |
( |
| ) |
const |
- Returns
- Owning JSON with current runId, raw node editor text, direction 1 upstream/0 downstream and tab 1 travel/0 balance. Does not include snapshot, recalculation checkbox, progress or results.
The documentation for this class was generated from the following files: