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
OpenProgressModel Class Reference

Weighted, monotonic progress aggregator for one project open. More...

#include <loadprogress.h>

Inheritance diagram for OpenProgressModel:
Collaboration diagram for OpenProgressModel:

Signals

void progressChanged (int pct, const QString &label)
 
void finished ()
 

Public Member Functions

 OpenProgressModel (QObject *parent=nullptr)
 
void setStage (OpenStage stage, int localPct, const QString &label=QString())
 Report partial progress within stage.
 
void finishStage (OpenStage stage)
 Mark stage fully done (idempotent).
 
void finishAll ()
 
int percent () const
 
QString label () const
 
bool isComplete () const
 

Static Public Member Functions

static int stageWeight (OpenStage stage)
 
static QString stageLabel (OpenStage stage)
 

Detailed Description

Weighted, monotonic progress aggregator for one project open.

One instance per open. SWMVis owns them in a map keyed by open id so a multi-model .oswp can report the minimum across concurrent opens, matching what the simulation path already does for concurrent runs.

Constructor & Destructor Documentation

◆ OpenProgressModel()

OpenProgressModel::OpenProgressModel ( QObject *  parent = nullptr)
explicit

Member Function Documentation

◆ finishAll()

void OpenProgressModel::finishAll ( )

Finish every outstanding stage. Used on error/abandon so a failed open still tears its indicator down.

◆ finished

void OpenProgressModel::finished ( )
signal

Every stage has completed — the view may hide its indicator. Emitted exactly once.

◆ finishStage()

void OpenProgressModel::finishStage ( OpenStage  stage)

Mark stage fully done (idempotent).

Call this for stages that turn out not to apply — a model with no 2D mesh finishes MeshParse/MeshSceneA/MeshSceneB immediately — otherwise the open never reaches 100 and the bar never hides.

◆ isComplete()

bool OpenProgressModel::isComplete ( ) const

True once every stage has completed.

◆ label()

QString OpenProgressModel::label ( ) const
inline

Current stage label, or empty before the first labelled tick.

Here is the caller graph for this function:

◆ percent()

int OpenProgressModel::percent ( ) const
inline

Aggregate 0-100. Never decreases across calls.

◆ progressChanged

void OpenProgressModel::progressChanged ( int  pct,
const QString &  label 
)
signal

Aggregate percent and/or label changed.

◆ setStage()

void OpenProgressModel::setStage ( OpenStage  stage,
int  localPct,
const QString &  label = QString() 
)

Report partial progress within stage.

localPct is clamped to [0,100]. A non-empty label becomes the current status text. Emits progressChanged when the aggregate percent or the label actually changed — callers may tick freely.

Here is the call graph for this function:

◆ stageLabel()

QString OpenProgressModel::stageLabel ( OpenStage  stage)
static

Canonical user-facing label for stage, e.g. "Parsing 2D mesh…". Lets a worker report a stage without also shipping its own text.

Here is the caller graph for this function:

◆ stageWeight()

int OpenProgressModel::stageWeight ( OpenStage  stage)
static

Percent of the total attributed to stage. Sums to 100 across all stages. Public so the unit test can assert the invariant rather than duplicating the table.


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