OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm_gages.h
Go to the documentation of this file.
1
15#ifndef OPENSWMM_GAGES_H
16#define OPENSWMM_GAGES_H
17
18#include "openswmm_engine.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
31
40
41/* =========================================================================
42 * Identity
43 * ========================================================================= */
44
51
58SWMM_ENGINE_API int swmm_gage_index(SWMM_Engine engine, const char* id);
59
66SWMM_ENGINE_API const char* swmm_gage_id(SWMM_Engine engine, int idx);
67
68/* =========================================================================
69 * Creation (BUILDING or OPENED — "editable" states)
70 * ========================================================================= */
71
79SWMM_ENGINE_API int swmm_gage_add(SWMM_Engine engine, const char* id);
80
81/* =========================================================================
82 * Property setters (BUILDING or OPENED)
83 * ========================================================================= */
84
92SWMM_ENGINE_API int swmm_gage_set_rain_type(SWMM_Engine engine, int idx, int type);
93
101SWMM_ENGINE_API int swmm_gage_set_rain_interval(SWMM_Engine engine, int idx, double seconds);
102
110SWMM_ENGINE_API int swmm_gage_set_data_source(SWMM_Engine engine, int idx, int source);
111
119SWMM_ENGINE_API int swmm_gage_set_timeseries(SWMM_Engine engine, int idx, const char* ts_id);
120
129SWMM_ENGINE_API int swmm_gage_set_filename(SWMM_Engine engine, int idx, const char* path,
130 const char* station_id);
131
132/* =========================================================================
133 * Property getters
134 * ========================================================================= */
135
143SWMM_ENGINE_API int swmm_gage_get_rain_type(SWMM_Engine engine, int idx, int* type);
144
152SWMM_ENGINE_API int swmm_gage_get_data_source(SWMM_Engine engine, int idx, int* source);
153
154/* =========================================================================
155 * State
156 * ========================================================================= */
157
159SWMM_ENGINE_API int swmm_gage_get_rainfall(SWMM_Engine engine, int idx, double* rainfall);
160
167SWMM_ENGINE_API int swmm_gage_set_rainfall(SWMM_Engine engine, int idx, double rainfall);
168
169/* =========================================================================
170 * Bulk access
171 * ========================================================================= */
172
180SWMM_ENGINE_API int swmm_gage_get_rainfall_bulk(SWMM_Engine engine, double* buf, int count);
181
185SWMM_ENGINE_API int swmm_gage_rename(SWMM_Engine engine, int idx, const char* newId);
186
187#ifdef __cplusplus
188} /* extern "C" */
189#endif
190
191#endif /* OPENSWMM_GAGES_H */
#define SWMM_ENGINE_API
Definition openswmm_2d.h:37
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:35
OpenSWMM Engine — primary transparent C API (master header).
SWMM_GageRainType
Rain gage rainfall data format.
Definition openswmm_gages.h:35
@ SWMM_RAIN_VOLUME
Definition openswmm_gages.h:37
@ SWMM_RAIN_CUMULATIVE
Definition openswmm_gages.h:38
@ SWMM_RAIN_INTENSITY
Definition openswmm_gages.h:36
SWMM_ENGINE_API int swmm_gage_add(SWMM_Engine engine, const char *id)
Add a new rain gage to the model.
Definition openswmm_gages_impl.cpp:43
SWMM_GageDataSource
Rain gage data source type.
Definition openswmm_gages.h:27
@ SWMM_GAGE_TIMESERIES
Definition openswmm_gages.h:28
@ SWMM_GAGE_FILE
Definition openswmm_gages.h:29
SWMM_ENGINE_API int swmm_gage_set_filename(SWMM_Engine engine, int idx, const char *path, const char *station_id)
Assign an external rainfall file as the data source for a gage.
Definition openswmm_gages_impl.cpp:108
SWMM_ENGINE_API int swmm_gage_count(SWMM_Engine engine)
Get the total number of rain gages in the model.
Definition openswmm_gages_impl.cpp:22
SWMM_ENGINE_API int swmm_gage_get_rainfall(SWMM_Engine engine, int idx, double *rainfall)
Get current rainfall rate at a gage (project rate units).
Definition openswmm_gages_impl.cpp:146
SWMM_ENGINE_API int swmm_gage_set_timeseries(SWMM_Engine engine, int idx, const char *ts_id)
Assign a time series as the data source for a gage.
Definition openswmm_gages_impl.cpp:95
SWMM_ENGINE_API int swmm_gage_set_rain_interval(SWMM_Engine engine, int idx, double seconds)
Set the rainfall recording interval for a gage.
Definition openswmm_gages_impl.cpp:77
SWMM_ENGINE_API int swmm_gage_set_rain_type(SWMM_Engine engine, int idx, int type)
Set the rainfall data format for a gage.
Definition openswmm_gages_impl.cpp:67
SWMM_ENGINE_API int swmm_gage_get_rain_type(SWMM_Engine engine, int idx, int *type)
Get the rainfall data format for a gage.
Definition openswmm_gages_impl.cpp:126
SWMM_ENGINE_API int swmm_gage_index(SWMM_Engine engine, const char *id)
Look up a rain gage's zero-based index by its string identifier.
Definition openswmm_gages_impl.cpp:27
SWMM_ENGINE_API int swmm_gage_set_data_source(SWMM_Engine engine, int idx, int source)
Set the data source type for a gage.
Definition openswmm_gages_impl.cpp:86
SWMM_ENGINE_API const char * swmm_gage_id(SWMM_Engine engine, int idx)
Get the string identifier of a rain gage by index.
Definition openswmm_gages_impl.cpp:32
SWMM_ENGINE_API int swmm_gage_set_rainfall(SWMM_Engine engine, int idx, double rainfall)
Override rainfall at a gage for the current timestep.
Definition openswmm_gages_impl.cpp:154
SWMM_ENGINE_API int swmm_gage_get_rainfall_bulk(SWMM_Engine engine, double *buf, int count)
Get current rainfall rates for all gages in a single call.
Definition openswmm_gages_impl.cpp:167
SWMM_ENGINE_API int swmm_gage_rename(SWMM_Engine engine, int idx, const char *newId)
Rename the rain gage at idx to newId. Returns SWMM_ERR_BADPARAM if newId is null, empty,...
Definition openswmm_gages_impl.cpp:176
SWMM_ENGINE_API int swmm_gage_get_data_source(SWMM_Engine engine, int idx, int *source)
Get the data source type for a gage.
Definition openswmm_gages_impl.cpp:134