forked from OpenWaterAnalytics/epanet-matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathENgetlinknodes.m
executable file
·39 lines (37 loc) · 1000 Bytes
/
ENgetlinknodes.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
function [errcode,from,to] = ENgetlinknodes(index)
% Declaration:
% [from,to,errcode] = ENusehydfile(index)
%
% Description:
% Retrieves the indexes of the end nodes of a specified link.
%
%Arguments:
% index: link index
% fromnode: index of node at start of link
% tonode: index of node at end of link
%
% Returns:
% Returns an error code.
%
%Notes:
% Node and link indexes are consecutive integers starting from 1.
%
% The From and To nodes are as defined for the link in the EPANET input file.
% The actual direction of flow in the link is not considered.
%
%See Also:
% ENgetlinkindex
%
% Version 2.00.07 (August 2008)
global ENDLLNAME;
%global EN_CONSTANT;
%global EN_SIZE;
from=int32(0);
to=int32(0);
index=int32(index);
%p1=libpointer('int32Ptr',from);
%p2=libpointer('int32Ptr',to);
[errcode,from,to]=calllib(ENDLLNAME,'ENgetlinknodes',index,from,to);
if errcode ENerror(errcode); end
%from=get(p1,'Value');
%to=get(p2,'Value');