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 state only)
70 * ========================================================================= */
71
78SWMM_ENGINE_API int swmm_gage_add(SWMM_Engine engine, const char* id);
79
80/* =========================================================================
81 * Property setters (BUILDING or OPENED)
82 * ========================================================================= */
83
91SWMM_ENGINE_API int swmm_gage_set_rain_type(SWMM_Engine engine, int idx, int type);
92
100SWMM_ENGINE_API int swmm_gage_set_rain_interval(SWMM_Engine engine, int idx, double seconds);
101
109SWMM_ENGINE_API int swmm_gage_set_data_source(SWMM_Engine engine, int idx, int source);
110
118SWMM_ENGINE_API int swmm_gage_set_timeseries(SWMM_Engine engine, int idx, const char* ts_id);
119
128SWMM_ENGINE_API int swmm_gage_set_filename(SWMM_Engine engine, int idx, const char* path,
129 const char* station_id);
130
131/* =========================================================================
132 * Property getters
133 * ========================================================================= */
134
142SWMM_ENGINE_API int swmm_gage_get_rain_type(SWMM_Engine engine, int idx, int* type);
143
151SWMM_ENGINE_API int swmm_gage_get_data_source(SWMM_Engine engine, int idx, int* source);
152
153/* =========================================================================
154 * State
155 * ========================================================================= */
156
158SWMM_ENGINE_API int swmm_gage_get_rainfall(SWMM_Engine engine, int idx, double* rainfall);
159
166SWMM_ENGINE_API int swmm_gage_set_rainfall(SWMM_Engine engine, int idx, double rainfall);
167
168/* =========================================================================
169 * Bulk access
170 * ========================================================================= */
171
179SWMM_ENGINE_API int swmm_gage_get_rainfall_bulk(SWMM_Engine engine, double* buf, int count);
180
181#ifdef __cplusplus
182} /* extern "C" */
183#endif
184
185#endif /* OPENSWMM_GAGES_H */
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:35
OpenSWMM Engine — primary transparent C API (master header).
#define SWMM_ENGINE_API
Definition openswmm_engine.h:87
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:106
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:144
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:93
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:75
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:65
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:124
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:84
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:152
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:165
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:132