forked from OpenWaterAnalytics/epanet-matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathENsetnodevalue.m
executable file
·47 lines (46 loc) · 1.37 KB
/
ENsetnodevalue.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function [errcode] = ENsetnodevalue(index, paramcode, value)
% Declaration:
% [errcode] = ENsetnodevalue(index, paramcode, value)
%
% Description:
% Sets the value of a parameter for a specific node.
%
% Arguments:
% index: node index
% paramcode: parameter code (see below)
% value: parameter value
%
% Returns:
% Returns an error code.
%
% Notes:
% Node indexes are consecutive integers starting from 1.
% Node parameter codes consist of the following constants:
%
% EN_ELEVATION 0 Elevation
% EN_BASEDEMAND 1 Baseline demand
% EN_PATTERN 2 Time pattern index
% EN_EMITTER 3 Emitter coefficient
% EN_INITQUAL 4 Initial quality
% EN_SOURCEQUAL 5 Source quality
% EN_SOURCEPAT 6 Source pattern
% EN_SOURCETYPE 7 Source type:(See note below)
% EN_TANKLEVEL 8 Initial water level in tank
% Source types are identified with the following constants:
%
% EN_CONCEN 0
% EN_MASS 1
% EN_SETPOINT 2
% EN_FLOWPACED 3
% See [SOURCES] for a description of these source types.
%
% Values are supplied in units which depend on the units used for flow rate in the EPANET input file (see Units of Measurement).
%
% Version 2.00.07 (January 2001)
global ENDLLNAME;
%global EN_CONSTANT;
index=int32(index);
paramcode=int32(paramcode);
value=single(value);
[errcode]=calllib(ENDLLNAME,'ENsetnodevalue',index, paramcode, value);
if errcode ENerror(errcode); end