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::trace::AnalysisStore Class Reference

#include <traceanalysisstore.h>

Collaboration diagram for openswmmvis::trace::AnalysisStore:

Static Public Member Functions

static bool prepare (const QString &path, const Dataset &data, QString *error, std::atomic_bool *cancel=nullptr)
 Create a schema-two GeoPackage of immutable hydraulic averages and run provenance.
 
static bool save (const QString &path, const Result &r, QString *error, std::atomic_bool *cancel=nullptr)
 Persist or replace one estimate and its geometry/summary/diagnostic tables.
 
static std::shared_ptr< Dataset > readDataset (const QString &path, QString *error)
 Restore a package topology and complete index-aligned SI averages into owning memory.
 
static bool isPartial (const QString &path)
 
static QVector< QJsonObject > analyses (const QString &path, QString *error)
 Enumerate saved estimate recipes, styles, and summaries without reading every spatial result.
 
static std::shared_ptr< Result > read (const QString &path, const QString &id, QString *error)
 Restore a saved estimate, first loading its complete dataset averages.
 
static std::shared_ptr< Result > read (const QString &path, const QString &id, std::shared_ptr< const Dataset > data, QString *error)
 Restore saved estimate fields using already loaded averages.
 
static bool saveStyle (const QString &path, const QString &id, const QJsonObject &style, QString *error)
 Replace a saved estimate default-style JSON value.
 

Member Function Documentation

◆ analyses()

QVector< QJsonObject > openswmmvis::trace::AnalysisStore::analyses ( const QString &  path,
QString *  error 
)
static

Enumerate saved estimate recipes, styles, and summaries without reading every spatial result.

Parameters
[in]pathPackage opened read-only and closed before return.
[out]errorOptional failure diagnostic, unchanged on success.
Returns
Owning recipe objects with IDs/style/summary; can contain rows read before a later caught failure.

◆ isPartial()

bool openswmmvis::trace::AnalysisStore::isPartial ( const QString &  path)
static

True when the package was built from a running or cancelled output. Reads only the run metadata row.

Parameters
[in]pathPackage read independently on the caller thread.
Returns
Metadata partial flag, or false for any open/read/parse failure; false does not establish package validity.

◆ prepare()

bool openswmmvis::trace::AnalysisStore::prepare ( const QString &  path,
const Dataset &  data,
QString *  error,
std::atomic_bool *  cancel = nullptr 
)
static

Create a schema-two GeoPackage of immutable hydraulic averages and run provenance.

Parameters
[in]pathPackage destination; existing files are accepted only when run ID, content fingerprint, and model fingerprint match.
[in]dataValid snapshot and aligned SI native node/link averages.
[out]errorOptional failure diagnostic; not cleared on entry or success. An existing-package identity mismatch can return false without a new diagnostic.
[in]cancelOptional atomic cancellation flag checked during row writes and before commit.
Returns
True for a compatible existing package or after staging/transaction commit and rename; false removes newly staged files on caught failure.

Owns/closes GDAL handles on the caller thread. Creates parent directories as needed; does not replace an incompatible existing package.

Here is the call graph for this function:

◆ read() [1/2]

std::shared_ptr< Result > openswmmvis::trace::AnalysisStore::read ( const QString &  path,
const QString &  id,
QString *  error 
)
static

Restore a saved estimate, first loading its complete dataset averages.

Parameters
[in]pathPackage path.
[in]idSaved analysis identifier.
[out]errorOptional failure diagnostic, unchanged on success.
Returns
Owning shared result/dataset or null on read/validation failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read() [2/2]

std::shared_ptr< Result > openswmmvis::trace::AnalysisStore::read ( const QString &  path,
const QString &  id,
std::shared_ptr< const Dataset >  data,
QString *  error 
)
static

Restore saved estimate fields using already loaded averages.

Parameters
[in]pathPackage opened independently read-only.
[in]idAnalysis ID whose recipe and node/link tables are read.
[in]dataNon-null matching immutable dataset; caller ensures it belongs to this package/run.
[out]errorOptional failure diagnostic, unchanged on success.
Returns
Owning shared result referencing data, or null for missing/invalid recipe or incomplete/mismatched trace rows.
Here is the call graph for this function:

◆ readDataset()

std::shared_ptr< Dataset > openswmmvis::trace::AnalysisStore::readDataset ( const QString &  path,
QString *  error 
)
static

Restore a package topology and complete index-aligned SI averages into owning memory.

Parameters
[in]pathRead-only GeoPackage path.
[out]errorOptional caught-failure diagnostic, unchanged on success.
Returns
Shared owning dataset, or null for unavailable/schema-invalid/incomplete or mismatched row data. Geometry comes from saved snapshot JSON, not feature geometry.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

bool openswmmvis::trace::AnalysisStore::save ( const QString &  path,
const Result &  r,
QString *  error,
std::atomic_bool *  cancel = nullptr 
)
static

Persist or replace one estimate and its geometry/summary/diagnostic tables.

Parameters
[in]pathExisting writable package with matching run ID and fingerprint.
[in]rResult with non-null aligned dataset, valid in-range seed, and UUID-like lowercase hex analysis ID.
[out]errorOptional caught-failure diagnostic, unchanged on success.
[in]cancelOptional cancellation flag checked during row writes and before commit.
Returns
True after transaction commit; false attempts rollback on failure/cancellation.

Existing rows/tables for the analysis ID are replaced; failure preserves the in-memory result for caller retry. GDAL handles never leave the calling thread.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveStyle()

bool openswmmvis::trace::AnalysisStore::saveStyle ( const QString &  path,
const QString &  id,
const QJsonObject &  style,
QString *  error 
)
static

Replace a saved estimate default-style JSON value.

Parameters
[in]pathExisting package opened for update on the caller thread.
[in]idExisting analysis ID matched exactly.
[in]styleStyle metadata copied without semantic validation.
[out]errorOptional failure diagnostic, unchanged on success.
Returns
True after GDAL SetFeature() succeeds; false for absent ID or update/open failure. No explicit transaction or close-flush error check is performed.

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