forked from OpenWaterAnalytics/epanet-matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathENgetnetsize.m
executable file
·57 lines (50 loc) · 1.69 KB
/
ENgetnetsize.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
48
49
50
51
52
53
54
55
56
57
function [nnodes,ntanks,nlinks,npats,ncurves,ncontrols,errcode] = ENgetnetsize()
% Declaration:
% [nnodes,ntanks,nlinks,npats,ncurves,ncontrols,errcode] = ENgetnetsize()
%
% PURPOSE:
% Retreive number of network components
%
% NOTES:
% Called by ENopen()
%
% OUTPUT:
% nnodes number of network nodes
% ntanks number of network tanks/reservoirs
% nlinks number of network links
% npats number of time patterns
% ncurves number of curves
% ncontrols number of simple controls
% errcode epanet error code
global ENDLLNAME;
global EN_CONSTANT;
nnodes=int32(0);
p=libpointer('int32Ptr',nnodes);
[errcode]=calllib(ENDLLNAME,'ENgetcount',EN_CONSTANT.EN_NODECOUNT,p);
if errcode ENerror(errcode); end
nnodes=get(p,'Value');
ntanks=int32(0);
p=libpointer('int32Ptr',ntanks);
[errcode]=calllib(ENDLLNAME,'ENgetcount',EN_CONSTANT.EN_TANKCOUNT,p);
if errcode ENerror(errcode); end
ntanks=get(p,'Value');
nlinks=int32(0);
p=libpointer('int32Ptr',nlinks);
[errcode]=calllib(ENDLLNAME,'ENgetcount',EN_CONSTANT.EN_LINKCOUNT,p);
if errcode ENerror(errcode); end
nlinks=get(p,'Value');
npats=int32(0);
p=libpointer('int32Ptr',npats);
[errcode]=calllib(ENDLLNAME,'ENgetcount',EN_CONSTANT.EN_PATCOUNT,p);
if errcode ENerror(errcode); end
npats=get(p,'Value');
ncurves=int32(0);
p=libpointer('int32Ptr',ncurves);
[errcode]=calllib(ENDLLNAME,'ENgetcount',EN_CONSTANT.EN_CURVECOUNT,p);
if errcode ENerror(errcode); end
ncurves=get(p,'Value');
ncontrols=int32(0);
p=libpointer('int32Ptr',ncontrols);
[errcode]=calllib(ENDLLNAME,'ENgetcount',EN_CONSTANT.EN_CONTROLCOUNT,p);
if errcode ENerror(errcode); end
ncontrols=get(p,'Value');