Top-level project container managing sessions, the SWMM model layer, and persistence paths for one SWMMVis project.
More...
#include <openswmmvisworkspace.h>
Top-level project container managing sessions, the SWMM model layer, and persistence paths for one SWMMVis project.
The workspace is the owner of:
- The project file path (
.oswp or a path to an .inp).
- The (optional) separate SWMM input file path when an
.oswp sidecar is used.
- The list of open sessions (one per MDI sub-window).
- The single SWMMModelLayer that is bound to the project.
Use newInstance() to create a workspace; the constructor alone does not open any files.
◆ OpenSWMMVisWorkspace() [1/2]
| OpenSWMMVisWorkspace::OpenSWMMVisWorkspace |
( |
QObject * |
parent = nullptr | ) |
|
◆ OpenSWMMVisWorkspace() [2/2]
| OpenSWMMVisWorkspace::OpenSWMMVisWorkspace |
( |
const QString & |
projectFilepath = "", |
|
|
QObject * |
parent = nullptr |
|
) |
| |
OpenSWMMVisWorkspace constructor with project file path and parent object as parameters.
- Parameters
-
| projectFilepath | QString project file path |
| parent | QObject parent object |
- Returns
- OpenSWMMVisWorkspace object with project file path and parent as parent object
◆ ~OpenSWMMVisWorkspace()
| OpenSWMMVisWorkspace::~OpenSWMMVisWorkspace |
( |
| ) |
|
|
virtual |
◆ hasChanges()
| bool OpenSWMMVisWorkspace::hasChanges |
( |
| ) |
const |
Returns true when the workspace has unsaved changes.
The flag is set whenever the model layer is mutated and cleared after a successful save.
◆ layerChanged
| void OpenSWMMVisWorkspace::layerChanged |
( |
| ) |
|
|
signal |
◆ layers()
layers getter method
- Returns
- QVector<OpenSWMMVisLayer*> vector of OpenSWMMVisLayer pointers
- See also
- layer
-
addLayer
-
removeLayer
-
layer
◆ newInstance()
| OpenSWMMVisWorkspace * OpenSWMMVisWorkspace::newInstance |
( |
const QString & |
projectFilepath = "", |
|
|
QObject * |
parent = nullptr |
|
) |
| |
|
static |
Factory: create and optionally initialise a workspace from a project file path.
If projectFilepath is non-empty the two-phase initialisation is run immediately so the returned workspace is ready for use.
- Parameters
-
| projectFilepath | Path to an .oswp or .inp file, or empty for a new untitled project. |
| parent | Qt parent object. |
- Returns
- Newly allocated workspace; ownership passes to the caller.
◆ openSWMMModel()
| bool OpenSWMMVisWorkspace::openSWMMModel |
( |
const QString & |
filepath, |
|
|
QList< QString > & |
warnings, |
|
|
QList< QString > & |
errors |
|
) |
| |
Opens a SWMM input file and loads the model into this workspace.
- Parameters
-
| filepath | Absolute path to the .inp file. |
| warnings | Populated with non-fatal parser warnings. |
| errors | Populated with error messages on failure. |
- Returns
- true on success; false if the file could not be opened or parsed.
◆ projectFilePathChanged
| void OpenSWMMVisWorkspace::projectFilePathChanged |
( |
| ) |
|
|
signal |
◆ projectPath()
| QString OpenSWMMVisWorkspace::projectPath |
( |
| ) |
const |
projectPath getter method
- Returns
- QString project file path
◆ projectTileChanged
| void OpenSWMMVisWorkspace::projectTileChanged |
( |
| ) |
|
|
signal |
◆ saveProject()
| bool OpenSWMMVisWorkspace::saveProject |
( |
const QString & |
filepath, |
|
|
QList< QString > & |
warnings, |
|
|
QList< QString > & |
errors |
|
) |
| |
Saves the workspace project to the given file path.
- Parameters
-
| filepath | Destination path (.oswp or .inp). |
| warnings | Populated with non-fatal save warnings. |
| errors | Populated with error messages on failure. |
- Returns
- true on success; false otherwise.
- Note
- Currently unimplemented at the workspace level; per-window save is handled by SWMMVisProjectWindow::saveAs(). Calls log a warning and append an error explaining the limitation.
◆ saveSWMMProject()
| bool OpenSWMMVisWorkspace::saveSWMMProject |
( |
const QString & |
filepath, |
|
|
QList< QString > & |
warnings, |
|
|
QList< QString > & |
errors |
|
) |
| |
Saves the SWMM model file companion (.inp) to the given path.
- Parameters
-
| filepath | Destination .inp path. |
| warnings | Populated with non-fatal save warnings. |
| errors | Populated with error messages on failure. |
- Returns
- true on success; false otherwise.
- Note
- Currently unimplemented; see saveProject() for the same routing contract.
◆ setSWMMModelLayer()
| bool OpenSWMMVisWorkspace::setSWMMModelLayer |
( |
SWMMModelLayer * |
modelLayer, |
|
|
QList< QString > & |
warnings, |
|
|
QList< QString > & |
errors |
|
) |
| |
Binds a SWMM model layer to the project.
Exactly one model layer can be bound to each project.
◆ swmmModelLayer()
Returns the SWMM model layer bound to this project.
◆ swmmProjectPath()
| QString OpenSWMMVisWorkspace::swmmProjectPath |
( |
| ) |
const |
Get the path to the SWMM project file.
- See also
- projectName
◆ title()
| QString OpenSWMMVisWorkspace::title |
( |
| ) |
const |
projectName getter method
- Returns
- QString project name
- See also
- setProjectName
◆ ProjectFilePath
| QString OpenSWMMVisWorkspace::ProjectFilePath |
|
read |
◆ Title
| QString OpenSWMMVisWorkspace::Title |
|
read |
The documentation for this class was generated from the following files: