![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Water-age source-table CRUD implementation (subplan X5). More...
#include "openswmm_api_common.hpp"#include "../../../include/openswmm/engine/openswmm_water_age.h"#include "../transport/components/WaterAgeModule/WaterAgeComponent.hpp"#include <cstdio>#include <string>Functions | |
| SWMM_ENGINE_API int | swmm_water_age_get_enabled (SWMM_Engine engine, int *enabled) |
| 1 if [OPTIONS] WATER_AGE is ON, else 0. | |
| SWMM_ENGINE_API int | swmm_water_age_get_global_source (SWMM_Engine engine, int source, double *hours) |
| GLOBAL age for one source pathway, HOURS (signed per D-NS1). | |
| SWMM_ENGINE_API int | swmm_water_age_set_global_source (SWMM_Engine engine, int source, double hours) |
| Set the GLOBAL age for one source pathway, HOURS. | |
| SWMM_ENGINE_API int | swmm_water_age_override_count (SWMM_Engine engine, int *count) |
| Number of per-node override rows. | |
| SWMM_ENGINE_API int | swmm_water_age_get_override (SWMM_Engine engine, int index, int *source, int *node_index, double *hours) |
Read override row index (0-based): its source, node index, and HOURS. Row order is stable across edits within a session. | |
| SWMM_ENGINE_API int | swmm_water_age_set_override (SWMM_Engine engine, int source, int node_index, double hours) |
| Add or update the override for (source, node_index), HOURS. | |
| SWMM_ENGINE_API int | swmm_water_age_remove_override (SWMM_Engine engine, int source, int node_index) |
| Remove the override for (source, node_index); BADINDEX if none. | |
| SWMM_ENGINE_API int | swmm_water_age_save (SWMM_Engine engine, const char *path) |
Write the current table as a [WATER_AGE_SOURCES] component file (the model.age format the waterage component parses) — the GUI editor's save path. | |
Water-age source-table CRUD implementation (subplan X5).
Values cross the boundary in HOURS (the config file's unit); the engine stores SECONDS. Negative values are legal and pass straight through — a negative source age extracts age-volume (D-NS1), clamped at consumption by the engines. There is no ucf conversion here: hours are hours in every unit system.
| SWMM_ENGINE_API int swmm_water_age_get_enabled | ( | SWMM_Engine | engine, |
| int * | enabled ) |
1 if [OPTIONS] WATER_AGE is ON, else 0.
| SWMM_ENGINE_API int swmm_water_age_get_global_source | ( | SWMM_Engine | engine, |
| int | source, | ||
| double * | hours ) |
GLOBAL age for one source pathway, HOURS (signed per D-NS1).
| SWMM_ENGINE_API int swmm_water_age_get_override | ( | SWMM_Engine | engine, |
| int | index, | ||
| int * | source, | ||
| int * | node_index, | ||
| double * | hours ) |
Read override row index (0-based): its source, node index, and HOURS. Row order is stable across edits within a session.
| SWMM_ENGINE_API int swmm_water_age_override_count | ( | SWMM_Engine | engine, |
| int * | count ) |
Number of per-node override rows.
| SWMM_ENGINE_API int swmm_water_age_remove_override | ( | SWMM_Engine | engine, |
| int | source, | ||
| int | node_index ) |
Remove the override for (source, node_index); BADINDEX if none.
| SWMM_ENGINE_API int swmm_water_age_save | ( | SWMM_Engine | engine, |
| const char * | path ) |
Write the current table as a [WATER_AGE_SOURCES] component file (the model.age format the waterage component parses) — the GUI editor's save path.
| SWMM_ENGINE_API int swmm_water_age_set_global_source | ( | SWMM_Engine | engine, |
| int | source, | ||
| double | hours ) |
Set the GLOBAL age for one source pathway, HOURS.
Negative hours are legal (age-volume extraction, D-NS1). Marks the config as present so the engine consumes it.
| SWMM_ENGINE_API int swmm_water_age_set_override | ( | SWMM_Engine | engine, |
| int | source, | ||
| int | node_index, | ||
| double | hours ) |
Add or update the override for (source, node_index), HOURS.
Only SWMM_AGE_SRC_DWF and SWMM_AGE_SRC_EXTERNAL_INFLOW take NODE scope (the parser's A1a rule) — others return SWMM_ERR_BADPARAM. Negative hours are legal (D-NS1).