Weighted, monotonic progress aggregator for one project open.
More...
#include <loadprogress.h>
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.
◆ OpenProgressModel()
| OpenProgressModel::OpenProgressModel |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ 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.
◆ 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.
◆ 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.
◆ 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: