Merge branch 'coordinates-getter' into dev-2.1
Conflicts resolved in : build/Linux/Makefile build/Linux/Makefile_Rev build/Xcode/epanet.xcodeproj/project.pbxproj include/epanet2.h
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -2,9 +2,14 @@
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.map
|
||||
*.exp
|
||||
*.lib
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
# Compiled Dynamic libraries and executables
|
||||
*.so
|
||||
*.dll
|
||||
*.exe
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
@@ -101,6 +106,7 @@ ipch/
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.idb
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
18
build/CMake/CMakeLists.txt
Normal file
18
build/CMake/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
## cmake .
|
||||
## make
|
||||
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
project (EPANET)
|
||||
|
||||
# the library
|
||||
include_directories(../../include)
|
||||
add_library(epanet STATIC ../../src/epanet.c ../../src/hydraul.c ../../src/hash.c ../../src/inpfile.c ../../src/input1.c ../../src/input2.c ../../src/input3.c ../../src/mempool.c ../../src/output.c ../../src/quality.c ../../src/report.c ../../src/rules.c ../../src/smatrix.c)
|
||||
|
||||
# the standalone executable
|
||||
include_directories(../../src)
|
||||
add_executable(runepanet ../../run/main.c)
|
||||
target_link_libraries (runepanet LINK_PUBLIC epanet m)
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LemonTigerJ", "LemonTigerJ.vcxproj", "{4B66D9F0-407B-4995-B625-1CA1B72662C6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4B66D9F0-407B-4995-B625-1CA1B72662C6}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4B66D9F0-407B-4995-B625-1CA1B72662C6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4B66D9F0-407B-4995-B625-1CA1B72662C6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4B66D9F0-407B-4995-B625-1CA1B72662C6}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,105 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\enumstxt.h" />
|
||||
<ClInclude Include="src\funcs.h" />
|
||||
<ClInclude Include="src\hash.h" />
|
||||
<ClInclude Include="src\lemontiger.h" />
|
||||
<ClInclude Include="src\mempool.h" />
|
||||
<ClInclude Include="src\text.h" />
|
||||
<ClInclude Include="src\toolkit.h" />
|
||||
<ClInclude Include="src\types.h" />
|
||||
<ClInclude Include="src\vars.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\epanet.c" />
|
||||
<ClCompile Include="src\hash.c" />
|
||||
<ClCompile Include="src\hydraul.c" />
|
||||
<ClCompile Include="src\inpfile.c" />
|
||||
<ClCompile Include="src\input1.c" />
|
||||
<ClCompile Include="src\input2.c" />
|
||||
<ClCompile Include="src\input3.c" />
|
||||
<ClCompile Include="src\lemontiger.c" />
|
||||
<ClCompile Include="src\mempool.c" />
|
||||
<ClCompile Include="src\output.c" />
|
||||
<ClCompile Include="src\quality.c" />
|
||||
<ClCompile Include="src\report.c" />
|
||||
<ClCompile Include="src\rules.c" />
|
||||
<ClCompile Include="src\smatrix.c" />
|
||||
<ClCompile Include="src\testLT.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4B66D9F0-407B-4995-B625-1CA1B72662C6}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.\include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -59,6 +59,12 @@ EXPORTS
|
||||
ENgetnumdemands = _ENgetnumdemands@8
|
||||
ENgetbasedemand = _ENgetbasedemand@12
|
||||
ENgetdemandpattern = _ENgetdemandpattern@12
|
||||
ENgetcurve = _ENgetcurve@16
|
||||
ENgetcurve = _ENgetcurve@20
|
||||
ENgetstatistic = _ENgetstatistic@8
|
||||
ENgetcoord = _ENgetcoord@12
|
||||
ENsetcoord = _ENsetcoord@12
|
||||
ENgetqualinfo = _ENgetqualinfo@16
|
||||
ENsetbasedemand = _ENsetbasedemand@12
|
||||
ENgetaveragepatternvalue = _ENgetaveragepatternvalue@8
|
||||
ENgetheadcurve = _ENgetheadcurve@8
|
||||
ENgetpumptype = _ENgetpumptype@8
|
||||
28
build/WinSDK/makeWINx64.bat
Normal file
28
build/WinSDK/makeWINx64.bat
Normal file
@@ -0,0 +1,28 @@
|
||||
rem : set path to Windows SDK
|
||||
Set Reg.Key=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows
|
||||
Set Reg.Val=CurrentInstallFolder
|
||||
|
||||
For /F "Tokens=2*" %%A In ('Reg Query "%Reg.Key%" /v "%Reg.Val%" ^| Find /I "%Reg.Val%"' ) Do Call Set SDK_PATH=%%B
|
||||
echo %SDK_PATH%
|
||||
|
||||
|
||||
CALL "%SDK_PATH%bin\"SetEnv.cmd /x64 /release
|
||||
|
||||
rem : set path for source EPANET files
|
||||
cd ..\..\src
|
||||
set SRC_PATH=%CD%
|
||||
|
||||
del %SRC_PATH%\*.dll
|
||||
del %SRC_PATH%\*.exe
|
||||
|
||||
rem : do the magic ...
|
||||
rem : create EPANET2.DLL
|
||||
cl -o epanet2.dll epanet.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /link /DLL
|
||||
rem : create EPANET2.EXE
|
||||
cl -o epanet2.exe epanet.c ..\run\main.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /I ..\src /link
|
||||
|
||||
rem : a bit of housekeeping and cleaning
|
||||
del %SRC_PATH%\*.obj
|
||||
del %SRC_PATH%\*.exp
|
||||
del %SRC_PATH%\*.lib
|
||||
del %SRC_PATH%\*.map
|
||||
29
build/WinSDK/makeWINx86.bat
Normal file
29
build/WinSDK/makeWINx86.bat
Normal file
@@ -0,0 +1,29 @@
|
||||
rem : set path to Windows SDK
|
||||
Set Reg.Key=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows
|
||||
Set Reg.Val=CurrentInstallFolder
|
||||
|
||||
For /F "Tokens=2*" %%A In ('Reg Query "%Reg.Key%" /v "%Reg.Val%" ^| Find /I "%Reg.Val%"' ) Do Call Set SDK_PATH=%%B
|
||||
echo %SDK_PATH%
|
||||
|
||||
|
||||
CALL "%SDK_PATH%bin\"SetEnv.cmd /x86 /release
|
||||
|
||||
rem : set path for source EPANET files
|
||||
SET SRC_PATH="D:\Projects\EPANET\Open Source\Code\owa\EPANET\src"
|
||||
cd ..\..\src
|
||||
set SRC_PATH=%CD%
|
||||
|
||||
del %SRC_PATH%\*.dll
|
||||
del %SRC_PATH%\*.exe
|
||||
|
||||
rem : do the magic ...
|
||||
rem : create EPANET2.DLL
|
||||
cl -o epanet2.dll epanet.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /link /DLL /def:..\build\winsdk\epanet2.def /MAP
|
||||
rem : create EPANET2.EXE
|
||||
cl -o epanet2.exe epanet.c ..\run\main.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /I ..\src /link
|
||||
|
||||
rem : a bit of housekeeping and cleaning
|
||||
del %SRC_PATH%\*.obj
|
||||
del %SRC_PATH%\*.exp
|
||||
del %SRC_PATH%\*.lib
|
||||
del %SRC_PATH%\*.map
|
||||
22
build/WinSDK/win_make.bat
Normal file
22
build/WinSDK/win_make.bat
Normal file
@@ -0,0 +1,22 @@
|
||||
rem : set path to Windows SDK
|
||||
SET SDK_PATH="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\"
|
||||
|
||||
rem : set path for source EPANET files
|
||||
SET SRC_PATH="D:\Projects\EPANET\Open Source\Code\owa\EPANET\src"
|
||||
|
||||
CALL %SDK_PATH%SetEnv.cmd /x86 /release
|
||||
CHDIR /D %SRC_PATH%
|
||||
del %SRC_PATH%\*.dll
|
||||
del %SRC_PATH%\*.exe
|
||||
|
||||
rem : do the magic ...
|
||||
rem : creat EPANET2.DLL
|
||||
cl -o epanet2.dll epanet.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /link /DLL /def:..\build\winsdk\epanet2.def /MAP
|
||||
rem : creat EPANET2.EXE
|
||||
cl -o epanet2.exe epanet.c ..\run\main.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /I ..\src /link
|
||||
|
||||
rem : a bit of housekeeping and cleaning
|
||||
del %SRC_PATH%\*.obj
|
||||
del %SRC_PATH%\*.exp
|
||||
del %SRC_PATH%\*.lib
|
||||
del %SRC_PATH%\*.map
|
||||
520
build/Xcode/epanet.xcodeproj/project.pbxproj
Executable file
520
build/Xcode/epanet.xcodeproj/project.pbxproj
Executable file
@@ -0,0 +1,520 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
22322F851068369500641384 /* enumstxt.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322F701068369500641384 /* enumstxt.h */; };
|
||||
22322F861068369500641384 /* epanet.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F711068369500641384 /* epanet.c */; };
|
||||
22322F871068369500641384 /* funcs.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322F721068369500641384 /* funcs.h */; };
|
||||
22322F881068369500641384 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F731068369500641384 /* hash.c */; };
|
||||
22322F891068369500641384 /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322F741068369500641384 /* hash.h */; };
|
||||
22322F8A1068369500641384 /* hydraul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F751068369500641384 /* hydraul.c */; };
|
||||
22322F8B1068369500641384 /* inpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F761068369500641384 /* inpfile.c */; };
|
||||
22322F8C1068369500641384 /* input1.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F771068369500641384 /* input1.c */; };
|
||||
22322F8D1068369500641384 /* input2.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F781068369500641384 /* input2.c */; };
|
||||
22322F8E1068369500641384 /* input3.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F791068369500641384 /* input3.c */; };
|
||||
22322F8F1068369500641384 /* mempool.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7A1068369500641384 /* mempool.c */; };
|
||||
22322F901068369500641384 /* mempool.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322F7B1068369500641384 /* mempool.h */; };
|
||||
22322F911068369500641384 /* output.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7C1068369500641384 /* output.c */; };
|
||||
22322F921068369500641384 /* quality.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7D1068369500641384 /* quality.c */; };
|
||||
22322F931068369500641384 /* report.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7E1068369500641384 /* report.c */; };
|
||||
22322F941068369500641384 /* rules.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7F1068369500641384 /* rules.c */; };
|
||||
22322F951068369500641384 /* smatrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F801068369500641384 /* smatrix.c */; };
|
||||
22322F961068369500641384 /* text.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322F811068369500641384 /* text.h */; };
|
||||
22322F981068369500641384 /* types.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322F831068369500641384 /* types.h */; };
|
||||
22322F991068369500641384 /* vars.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322F841068369500641384 /* vars.h */; };
|
||||
22322FAA106836BC00641384 /* epanet2.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322FA9106836B000641384 /* epanet2.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
2255753F17551234009946B1 /* epanet.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F711068369500641384 /* epanet.c */; };
|
||||
2255754017551234009946B1 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F731068369500641384 /* hash.c */; };
|
||||
2255754117551234009946B1 /* hydraul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F751068369500641384 /* hydraul.c */; };
|
||||
2255754217551234009946B1 /* inpfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F761068369500641384 /* inpfile.c */; };
|
||||
2255754317551234009946B1 /* input1.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F771068369500641384 /* input1.c */; };
|
||||
2255754417551234009946B1 /* input2.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F781068369500641384 /* input2.c */; };
|
||||
2255754517551234009946B1 /* input3.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F791068369500641384 /* input3.c */; };
|
||||
2255754617551234009946B1 /* mempool.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7A1068369500641384 /* mempool.c */; };
|
||||
2255754717551234009946B1 /* output.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7C1068369500641384 /* output.c */; };
|
||||
2255754817551234009946B1 /* quality.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7D1068369500641384 /* quality.c */; };
|
||||
2255754917551234009946B1 /* report.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7E1068369500641384 /* report.c */; };
|
||||
2255754A17551234009946B1 /* rules.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7F1068369500641384 /* rules.c */; };
|
||||
2255754B17551234009946B1 /* smatrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F801068369500641384 /* smatrix.c */; };
|
||||
226537E0179EDEEB00258C60 /* epanet2.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322FA9106836B000641384 /* epanet2.h */; };
|
||||
22CD9A5E1B27898E00B65E83 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 22CD9A5D1B27898E00B65E83 /* main.c */; };
|
||||
22CD9A611B278BB900B65E83 /* libepanet-static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2255753B17551217009946B1 /* libepanet-static.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
22CD9A5F1B278B0400B65E83 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 2255753A17551217009946B1;
|
||||
remoteInfo = "epanet-static";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
22322F66106833BB00641384 /* runepanet */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = runepanet; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
22322F701068369500641384 /* enumstxt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = enumstxt.h; path = ../../src/enumstxt.h; sourceTree = SOURCE_ROOT; };
|
||||
22322F711068369500641384 /* epanet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = epanet.c; path = ../../src/epanet.c; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.c; };
|
||||
22322F721068369500641384 /* funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = funcs.h; path = ../../src/funcs.h; sourceTree = SOURCE_ROOT; };
|
||||
22322F731068369500641384 /* hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hash.c; path = ../../src/hash.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F741068369500641384 /* hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash.h; path = ../../src/hash.h; sourceTree = SOURCE_ROOT; };
|
||||
22322F751068369500641384 /* hydraul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hydraul.c; path = ../../src/hydraul.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F761068369500641384 /* inpfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = inpfile.c; path = ../../src/inpfile.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F771068369500641384 /* input1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = input1.c; path = ../../src/input1.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F781068369500641384 /* input2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = input2.c; path = ../../src/input2.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F791068369500641384 /* input3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = input3.c; path = ../../src/input3.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F7A1068369500641384 /* mempool.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mempool.c; path = ../../src/mempool.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F7B1068369500641384 /* mempool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mempool.h; path = ../../src/mempool.h; sourceTree = SOURCE_ROOT; };
|
||||
22322F7C1068369500641384 /* output.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = output.c; path = ../../src/output.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F7D1068369500641384 /* quality.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = quality.c; path = ../../src/quality.c; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.c; };
|
||||
22322F7E1068369500641384 /* report.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = report.c; path = ../../src/report.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F7F1068369500641384 /* rules.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rules.c; path = ../../src/rules.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F801068369500641384 /* smatrix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = smatrix.c; path = ../../src/smatrix.c; sourceTree = SOURCE_ROOT; };
|
||||
22322F811068369500641384 /* text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = text.h; path = ../../src/text.h; sourceTree = SOURCE_ROOT; };
|
||||
22322F831068369500641384 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = types.h; path = ../../src/types.h; sourceTree = SOURCE_ROOT; };
|
||||
22322F841068369500641384 /* vars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vars.h; path = ../../src/vars.h; sourceTree = SOURCE_ROOT; };
|
||||
22322FA9106836B000641384 /* epanet2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 2; name = epanet2.h; path = ../../include/epanet2.h; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
2255753B17551217009946B1 /* libepanet-static.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libepanet-static.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
22CD9A5D1B27898E00B65E83 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../../run/main.c; sourceTree = "<group>"; };
|
||||
D2AAC0630554660B00DB518D /* libepanet.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libepanet.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
22322F64106833BB00641384 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
22CD9A611B278BB900B65E83 /* libepanet-static.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2255753817551217009946B1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D289988505E68E00004EDB86 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
08FB7794FE84155DC02AAC07 /* epanet */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
22CD9A5C1B27896200B65E83 /* run epanet */,
|
||||
22322FA8106836A000641384 /* Include */,
|
||||
08FB7795FE84155DC02AAC07 /* Source */,
|
||||
1AB674ADFE9D54B511CA2CBB /* Products */,
|
||||
);
|
||||
name = epanet;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
22322F711068369500641384 /* epanet.c */,
|
||||
22322F751068369500641384 /* hydraul.c */,
|
||||
22322F701068369500641384 /* enumstxt.h */,
|
||||
22322F721068369500641384 /* funcs.h */,
|
||||
22322F731068369500641384 /* hash.c */,
|
||||
22322F741068369500641384 /* hash.h */,
|
||||
22322F761068369500641384 /* inpfile.c */,
|
||||
22322F771068369500641384 /* input1.c */,
|
||||
22322F781068369500641384 /* input2.c */,
|
||||
22322F791068369500641384 /* input3.c */,
|
||||
22322F7A1068369500641384 /* mempool.c */,
|
||||
22322F7B1068369500641384 /* mempool.h */,
|
||||
22322F7C1068369500641384 /* output.c */,
|
||||
22322F7D1068369500641384 /* quality.c */,
|
||||
22322F7E1068369500641384 /* report.c */,
|
||||
22322F7F1068369500641384 /* rules.c */,
|
||||
22322F801068369500641384 /* smatrix.c */,
|
||||
22322F811068369500641384 /* text.h */,
|
||||
22322F831068369500641384 /* types.h */,
|
||||
22322F841068369500641384 /* vars.h */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1AB674ADFE9D54B511CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2AAC0630554660B00DB518D /* libepanet.dylib */,
|
||||
22322F66106833BB00641384 /* runepanet */,
|
||||
2255753B17551217009946B1 /* libepanet-static.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
22322FA8106836A000641384 /* Include */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
22322FA9106836B000641384 /* epanet2.h */,
|
||||
);
|
||||
name = Include;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
22CD9A5C1B27896200B65E83 /* run epanet */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
22CD9A5D1B27898E00B65E83 /* main.c */,
|
||||
);
|
||||
name = "run epanet";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
2255753917551217009946B1 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
226537E0179EDEEB00258C60 /* epanet2.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D2AAC0600554660B00DB518D /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
22322FAA106836BC00641384 /* epanet2.h in Headers */,
|
||||
22322F851068369500641384 /* enumstxt.h in Headers */,
|
||||
22322F871068369500641384 /* funcs.h in Headers */,
|
||||
22322F891068369500641384 /* hash.h in Headers */,
|
||||
22322F901068369500641384 /* mempool.h in Headers */,
|
||||
22322F961068369500641384 /* text.h in Headers */,
|
||||
22322F981068369500641384 /* types.h in Headers */,
|
||||
22322F991068369500641384 /* vars.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
22322F65106833BB00641384 /* runepanet */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 22322F6A106833E600641384 /* Build configuration list for PBXNativeTarget "runepanet" */;
|
||||
buildPhases = (
|
||||
22322F63106833BB00641384 /* Sources */,
|
||||
22322F64106833BB00641384 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
22CD9A601B278B0400B65E83 /* PBXTargetDependency */,
|
||||
);
|
||||
name = runepanet;
|
||||
productName = runepanet;
|
||||
productReference = 22322F66106833BB00641384 /* runepanet */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
2255753A17551217009946B1 /* epanet-static */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2255753E17551217009946B1 /* Build configuration list for PBXNativeTarget "epanet-static" */;
|
||||
buildPhases = (
|
||||
2255753717551217009946B1 /* Sources */,
|
||||
2255753817551217009946B1 /* Frameworks */,
|
||||
2255753917551217009946B1 /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "epanet-static";
|
||||
productName = "epanet-static";
|
||||
productReference = 2255753B17551217009946B1 /* libepanet-static.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
D2AAC0620554660B00DB518D /* epanet */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB914A08733D8E0010E9CD /* Build configuration list for PBXNativeTarget "epanet" */;
|
||||
buildPhases = (
|
||||
D2AAC0600554660B00DB518D /* Headers */,
|
||||
D2AAC0610554660B00DB518D /* Sources */,
|
||||
D289988505E68E00004EDB86 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = epanet;
|
||||
productName = epanet;
|
||||
productReference = D2AAC0630554660B00DB518D /* libepanet.dylib */;
|
||||
productType = "com.apple.product-type.library.dynamic";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0630;
|
||||
};
|
||||
buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "epanet" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
English,
|
||||
Japanese,
|
||||
French,
|
||||
German,
|
||||
);
|
||||
mainGroup = 08FB7794FE84155DC02AAC07 /* epanet */;
|
||||
projectDirPath = "";
|
||||
projectRoot = ../../..;
|
||||
targets = (
|
||||
D2AAC0620554660B00DB518D /* epanet */,
|
||||
22322F65106833BB00641384 /* runepanet */,
|
||||
2255753A17551217009946B1 /* epanet-static */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
22322F63106833BB00641384 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
22CD9A5E1B27898E00B65E83 /* main.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2255753717551217009946B1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2255753F17551234009946B1 /* epanet.c in Sources */,
|
||||
2255754017551234009946B1 /* hash.c in Sources */,
|
||||
2255754117551234009946B1 /* hydraul.c in Sources */,
|
||||
2255754217551234009946B1 /* inpfile.c in Sources */,
|
||||
2255754317551234009946B1 /* input1.c in Sources */,
|
||||
2255754417551234009946B1 /* input2.c in Sources */,
|
||||
2255754517551234009946B1 /* input3.c in Sources */,
|
||||
2255754617551234009946B1 /* mempool.c in Sources */,
|
||||
2255754717551234009946B1 /* output.c in Sources */,
|
||||
2255754817551234009946B1 /* quality.c in Sources */,
|
||||
2255754917551234009946B1 /* report.c in Sources */,
|
||||
2255754A17551234009946B1 /* rules.c in Sources */,
|
||||
2255754B17551234009946B1 /* smatrix.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D2AAC0610554660B00DB518D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
22322F861068369500641384 /* epanet.c in Sources */,
|
||||
22322F881068369500641384 /* hash.c in Sources */,
|
||||
22322F8A1068369500641384 /* hydraul.c in Sources */,
|
||||
22322F8B1068369500641384 /* inpfile.c in Sources */,
|
||||
22322F8C1068369500641384 /* input1.c in Sources */,
|
||||
22322F8D1068369500641384 /* input2.c in Sources */,
|
||||
22322F8E1068369500641384 /* input3.c in Sources */,
|
||||
22322F8F1068369500641384 /* mempool.c in Sources */,
|
||||
22322F911068369500641384 /* output.c in Sources */,
|
||||
22322F921068369500641384 /* quality.c in Sources */,
|
||||
22322F931068369500641384 /* report.c in Sources */,
|
||||
22322F941068369500641384 /* rules.c in Sources */,
|
||||
22322F951068369500641384 /* smatrix.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
22CD9A601B278B0400B65E83 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 2255753A17551217009946B1 /* epanet-static */;
|
||||
targetProxy = 22CD9A5F1B278B0400B65E83 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1DEB914B08733D8E0010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "EN_API_FLOAT_TYPE=double";
|
||||
PRODUCT_NAME = epanet;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB914C08733D8E0010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "EN_API_FLOAT_TYPE=double";
|
||||
PRODUCT_NAME = epanet;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1DEB914F08733D8E0010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = c89;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB915008733D8E0010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = c89;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
SDKROOT = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
22322F68106833BC00641384 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "";
|
||||
INFOPLIST_PREPROCESSOR_DEFINITIONS = "";
|
||||
PRODUCT_NAME = runepanet;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
22322F69106833BC00641384 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "";
|
||||
INFOPLIST_PREPROCESSOR_DEFINITIONS = "";
|
||||
PRODUCT_NAME = runepanet;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2255753C17551217009946B1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "EN_API_FLOAT_TYPE=double";
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2255753D17551217009946B1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "EN_API_FLOAT_TYPE=double";
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1DEB914A08733D8E0010E9CD /* Build configuration list for PBXNativeTarget "epanet" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB914B08733D8E0010E9CD /* Debug */,
|
||||
1DEB914C08733D8E0010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "epanet" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB914F08733D8E0010E9CD /* Debug */,
|
||||
1DEB915008733D8E0010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
22322F6A106833E600641384 /* Build configuration list for PBXNativeTarget "runepanet" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
22322F68106833BC00641384 /* Debug */,
|
||||
22322F69106833BC00641384 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2255753E17551217009946B1 /* Build configuration list for PBXNativeTarget "epanet-static" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2255753C17551217009946B1 /* Debug */,
|
||||
2255753D17551217009946B1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
|
||||
}
|
||||
@@ -33,8 +33,8 @@ Global Const EN_MINLEVEL = 20
|
||||
Global Const EN_MAXLEVEL = 21
|
||||
Global Const EN_MIXFRACTION = 22
|
||||
Global Const EN_TANK_KBULK = 23
|
||||
|
||||
Global Const EN_TANKVOLUME = 24 'ES
|
||||
Global Const EN_TANKVOLUME = 24
|
||||
Global Const EN_MAXVOLUME = 25
|
||||
|
||||
Global Const EN_DIAMETER = 0 ' Link parameters
|
||||
Global Const EN_LENGTH = 1
|
||||
@@ -51,6 +51,7 @@ Global Const EN_STATUS = 11
|
||||
Global Const EN_SETTING = 12
|
||||
Global Const EN_ENERGY = 13
|
||||
Global Const EN_LINKQUAL = 14 'ES
|
||||
Global Const EN_LINKPATTERN = 15
|
||||
|
||||
Global Const EN_DURATION = 0 ' Time parameters
|
||||
Global Const EN_HYDSTEP = 1
|
||||
@@ -62,7 +63,14 @@ Global Const EN_REPORTSTART = 6
|
||||
Global Const EN_RULESTEP = 7
|
||||
Global Const EN_STATISTIC = 8
|
||||
Global Const EN_PERIODS = 9
|
||||
Global Const EN_STARTTIME = 10 'ES
|
||||
Global Const EN_STARTTIME = 10
|
||||
Global Const EN_HTIME = 11
|
||||
Global Const EN_QTIME = 12
|
||||
Global Const EN_HALTFLAG = 13
|
||||
Global Const EN_NEXTEVENT = 14
|
||||
|
||||
Global Const EN_ITERATIONS = 0
|
||||
Global Const EN_RELATIVEERROR = 1
|
||||
|
||||
Global Const EN_NODECOUNT = 0 'Component counts
|
||||
Global Const EN_TANKCOUNT = 1
|
||||
@@ -132,10 +140,6 @@ Global Const EN_SAVE = 1
|
||||
|
||||
Global Const EN_INITFLOW = 10 ' Re-initialize flow flag
|
||||
|
||||
Global Const EN_CONST_HP = 0 ' constant horsepower
|
||||
Global Const EN_POWER_FUNC = 1 ' power function
|
||||
Global Const EN_CUSTOM = 2 ' user-defined custom curve
|
||||
|
||||
'These are the external functions that comprise the DLL
|
||||
|
||||
Declare Function ENepanet Lib "epanet2.dll" (ByVal F1 As String, ByVal F2 As String, ByVal F3 As String, ByVal F4 As Any) As Long
|
||||
@@ -175,17 +179,21 @@ Global Const EN_CUSTOM = 2 ' user-defined custom curve
|
||||
Declare Function ENgetpatternid Lib "epanet2.dll" (ByVal Index As Long, ByVal ID As String) As Long
|
||||
Declare Function ENgetpatternlen Lib "epanet2.dll" (ByVal Index As Long, L As Long) As Long
|
||||
Declare Function ENgetpatternvalue Lib "epanet2.dll" (ByVal Index As Long, ByVal Period As Long, Value As Single) As Long
|
||||
Declare Function ENgetaveragepatternvalue Lib "epanet2.dll" (ByVal Index As Long, Value As Single) As Long
|
||||
Declare Function ENgetqualtype Lib "epanet2.dll" (QualCode As Long, TraceNode As Long) As Long
|
||||
Declare Function ENgeterror Lib "epanet2.dll" (ByVal ErrCode As Long, ByVal ErrMsg As String, ByVal N As Long)
|
||||
Declare Function ENgeterror Lib "epanet2.dll" (ByVal ErrCode As Long, ByVal ErrMsg As String, ByVal N As Long) As Long
|
||||
Declare Function ENgetstatistic Lib "epanet2.dll" (ByVal Code As Long, Value As Single) As Long
|
||||
|
||||
Declare Function ENgetnodeindex Lib "epanet2.dll" (ByVal ID As String, Index As Long) As Long
|
||||
Declare Function ENgetnodeid Lib "epanet2.dll" (ByVal Index As Long, ByVal ID As String) As Long
|
||||
Declare Function ENgetnodetype Lib "epanet2.dll" (ByVal Index As Long, Code As Long) As Long
|
||||
Declare Function ENgetnodevalue Lib "epanet2.dll" (ByVal Index As Long, ByVal Code As Long, Value As Single) As Long
|
||||
Declare Function ENgetcoord Lib "epanet2.dll" (ByVal Index As Long, X As Single, Y As Single) As Long
|
||||
Declare Function ENsetcoord Lib "epanet2.dll" (ByVal Index As Long, ByVal X As Single, ByVal Y As Single) As Long
|
||||
|
||||
Declare Function ENgetnumdemands Lib "epanet2.dll" (ByVal Index As Long, numDemands As Long) As Long 'ES
|
||||
Declare Function ENgetbasedemand Lib "epanet2.dll" (ByVal Index As Long, ByVal DemandIndex As Long, Value As Single) As Long 'ES
|
||||
Declare Function ENgetdemandpattern Lib "epanet2.dll" (ByVal Index As Long, ByVal DemandIndex As Long, PatIndex As Long) As Long 'ES
|
||||
Declare Function ENgetnumdemands Lib "epanet2.dll" (ByVal Index As Long, numDemands As Long) As Long
|
||||
Declare Function ENgetbasedemand Lib "epanet2.dll" (ByVal Index As Long, ByVal DemandIndex As Long, Value As Single) As Long
|
||||
Declare Function ENgetdemandpattern Lib "epanet2.dll" (ByVal Index As Long, ByVal DemandIndex As Long, PatIndex As Long) As Long
|
||||
|
||||
Declare Function ENgetlinkindex Lib "epanet2.dll" (ByVal ID As String, Index As Long) As Long
|
||||
Declare Function ENgetlinkid Lib "epanet2.dll" (ByVal Index As Long, ByVal ID As String) As Long
|
||||
@@ -193,9 +201,9 @@ Global Const EN_CUSTOM = 2 ' user-defined custom curve
|
||||
Declare Function ENgetlinknodes Lib "epanet2.dll" (ByVal Index As Long, Node1 As Long, Node2 As Long) As Long
|
||||
Declare Function ENgetlinkvalue Lib "epanet2.dll" (ByVal Index As Long, ByVal Code As Long, Value As Single) As Long
|
||||
|
||||
Declare Function ENgetcurve Lib "epanet2.dll" (ByVal CurveIndex As Long, nValues As Long, xValues As Any, yValues As Any) As Long 'ES
|
||||
Declare Function ENgetheadcurve Lib "epanet2.dll" (ByVal Index As Long, ID As String) As Long 'ES
|
||||
Declare Function ENgetpumptype Lib "epanet2.dll" (ByVal Index As Long, PumpType As Long) As Long 'ES
|
||||
Declare Function ENgetcurve Lib "epanet2.dll" (ByVal CurveIndex As Long, ByVal CurveID As String, nValues As Long, xValues As Any, yValues As Any) As Long
|
||||
Declare Function ENgetheadcurve Lib "epanet2.dll" (ByVal Index As Long, ByVal ID As String) As Long
|
||||
Declare Function ENgetpumptype Lib "epanet2.dll" (ByVal Index As Long, PumpType As Long) As Long
|
||||
|
||||
Declare Function ENgetversion Lib "epanet2.dll" (Value As Long) As Long
|
||||
|
||||
@@ -209,4 +217,5 @@ Global Const EN_CUSTOM = 2 ' user-defined custom curve
|
||||
Declare Function ENsetoption Lib "epanet2.dll" (ByVal Code As Long, ByVal Value As Single) As Long
|
||||
Declare Function ENsetstatusreport Lib "epanet2.dll" (ByVal Code As Long) As Long
|
||||
Declare Function ENsetqualtype Lib "epanet2.dll" (ByVal QualCode As Long, ByVal ChemName As String, ByVal ChemUnits As String, ByVal TraceNode As String) As Long
|
||||
|
||||
Declare Function ENgetqualinfo Lib "epanet2.dll" (QualCode As Long, ChemName As String, ChemUnits As String, TraceNode As Long) As Long
|
||||
Declare Function ENsetbasedemand Lib "epanet2.dll" (ByVal NodeIndex As Long, ByVal DemandIndex As Long, ByVal BaseDemand As Single) As Long
|
||||
|
||||
@@ -19,26 +19,39 @@
|
||||
#define EPANET2_H
|
||||
|
||||
#ifndef EN_API_FLOAT_TYPE
|
||||
#define EN_API_FLOAT_TYPE float
|
||||
#define EN_API_FLOAT_TYPE float
|
||||
#endif
|
||||
|
||||
// --- define WINDOWS
|
||||
#undef WINDOWS
|
||||
#ifdef _WIN32
|
||||
#define WINDOWS
|
||||
#endif
|
||||
#ifdef __WIN32__
|
||||
#define WINDOWS
|
||||
#endif
|
||||
|
||||
// --- define DLLEXPORT
|
||||
#ifndef DLLEXPORT
|
||||
#ifdef DLL
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#endif
|
||||
#elif defined(CYGWIN)
|
||||
#define DLLEXPORT __stdcall
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#endif
|
||||
#ifdef WINDOWS
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#define DLLEXPORT __declspec(dllexport) __stdcall
|
||||
#endif // __cplusplus
|
||||
#elif defined(CYGWIN)
|
||||
#define DLLEXPORT __stdcall
|
||||
#elif defined(__APPLE__)
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// --- Define the EPANET toolkit constants
|
||||
|
||||
#define EN_ELEVATION 0 /* Node parameters */
|
||||
@@ -83,7 +96,7 @@
|
||||
#define EN_STATUS 11
|
||||
#define EN_SETTING 12
|
||||
#define EN_ENERGY 13
|
||||
#define EN_LINKQUAL 14 /* TNT */
|
||||
#define EN_LINKQUAL 14
|
||||
#define EN_LINKPATTERN 15
|
||||
|
||||
#define EN_DURATION 0 /* Time parameters */
|
||||
@@ -226,6 +239,7 @@ extern "C" {
|
||||
int DLLEXPORT ENgetnodetype(int index, int *code);
|
||||
int DLLEXPORT ENgetnodevalue(int index, int code, EN_API_FLOAT_TYPE *value);
|
||||
int DLLEXPORT ENgetcoord(int index, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_TYPE *y);
|
||||
int DLLEXPORT ENsetcoord(int index, EN_API_FLOAT_TYPE x, EN_API_FLOAT_TYPE y);
|
||||
|
||||
int DLLEXPORT ENgetnumdemands(int nodeIndex, int *numDemands);
|
||||
int DLLEXPORT ENgetbasedemand(int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE *baseDemand);
|
||||
@@ -238,7 +252,8 @@ extern "C" {
|
||||
int DLLEXPORT ENgetlinkvalue(int index, int code, EN_API_FLOAT_TYPE *value);
|
||||
|
||||
int DLLEXPORT ENgetcurve(int curveIndex, char* id, int *nValues, EN_API_FLOAT_TYPE **xValues, EN_API_FLOAT_TYPE **yValues);
|
||||
|
||||
int DLLEXPORT ENgetheadcurve(int, char *);
|
||||
int DLLEXPORT ENgetpumptype(int, int *);
|
||||
|
||||
int DLLEXPORT ENgetversion(int *version);
|
||||
|
||||
@@ -259,4 +274,8 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
<<<<<<< HEAD
|
||||
#endif //TOOLKIT_H
|
||||
=======
|
||||
#endif //EPANET2_H
|
||||
>>>>>>> coordinates-getter
|
||||
|
||||
220
include/epanet2.vb
Normal file
220
include/epanet2.vb
Normal file
@@ -0,0 +1,220 @@
|
||||
|
||||
'EPANET2.VB
|
||||
'
|
||||
'Declarations of functions in the EPANET PROGRAMMERs TOOLKIT
|
||||
'(EPANET2.DLL) for use with VB.Net.
|
||||
|
||||
'Last updated on 7/19/15 - LR
|
||||
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Text
|
||||
|
||||
Module Epanet2
|
||||
|
||||
' These are codes used by the DLL functions
|
||||
Public Const EN_ELEVATION = 0 ' Node parameters
|
||||
Public Const EN_BASEDEMAND = 1
|
||||
Public Const EN_PATTERN = 2
|
||||
Public Const EN_EMITTER = 3
|
||||
Public Const EN_INITQUAL = 4
|
||||
Public Const EN_SOURCEQUAL = 5
|
||||
Public Const EN_SOURCEPAT = 6
|
||||
Public Const EN_SOURCETYPE = 7
|
||||
Public Const EN_TANKLEVEL = 8
|
||||
Public Const EN_DEMAND = 9
|
||||
Public Const EN_HEAD = 10
|
||||
Public Const EN_PRESSURE = 11
|
||||
Public Const EN_QUALITY = 12
|
||||
Public Const EN_SOURCEMASS = 13
|
||||
Public Const EN_INITVOLUME = 14
|
||||
Public Const EN_MIXMODEL = 15
|
||||
Public Const EN_MIXZONEVOL = 16
|
||||
|
||||
Public Const EN_TANKDIAM = 17
|
||||
Public Const EN_MINVOLUME = 18
|
||||
Public Const EN_VOLCURVE = 19
|
||||
Public Const EN_MINLEVEL = 20
|
||||
Public Const EN_MAXLEVEL = 21
|
||||
Public Const EN_MIXFRACTION = 22
|
||||
Public Const EN_TANK_KBULK = 23
|
||||
|
||||
Public Const EN_TANKVOLUME = 24 'ES
|
||||
|
||||
Public Const EN_DIAMETER = 0 ' Link parameters
|
||||
Public Const EN_LENGTH = 1
|
||||
Public Const EN_ROUGHNESS = 2
|
||||
Public Const EN_MINORLOSS = 3
|
||||
Public Const EN_INITSTATUS = 4
|
||||
Public Const EN_INITSETTING = 5
|
||||
Public Const EN_KBULK = 6
|
||||
Public Const EN_KWALL = 7
|
||||
Public Const EN_FLOW = 8
|
||||
Public Const EN_VELOCITY = 9
|
||||
Public Const EN_HEADLOSS = 10
|
||||
Public Const EN_STATUS = 11
|
||||
Public Const EN_SETTING = 12
|
||||
Public Const EN_ENERGY = 13
|
||||
Public Const EN_LINKQUAL = 14 'ES
|
||||
Public Const EN_LINKPATTERN 15
|
||||
|
||||
Public Const EN_DURATION = 0 ' Time parameters
|
||||
Public Const EN_HYDSTEP = 1
|
||||
Public Const EN_QUALSTEP = 2
|
||||
Public Const EN_PATTERNSTEP = 3
|
||||
Public Const EN_PATTERNSTART = 4
|
||||
Public Const EN_REPORTSTEP = 5
|
||||
Public Const EN_REPORTSTART = 6
|
||||
Public Const EN_RULESTEP = 7
|
||||
Public Const EN_STATISTIC = 8
|
||||
Public Const EN_PERIODS = 9
|
||||
Public Const EN_STARTTIME = 10 'ES
|
||||
|
||||
Public Const EN_NODECOUNT = 0 'Component counts
|
||||
Public Const EN_TANKCOUNT = 1
|
||||
Public Const EN_LINKCOUNT = 2
|
||||
Public Const EN_PATCOUNT = 3
|
||||
Public Const EN_CURVECOUNT = 4
|
||||
Public Const EN_CONTROLCOUNT = 5
|
||||
|
||||
Public Const EN_JUNCTION = 0 ' Node types
|
||||
Public Const EN_RESERVOIR = 1
|
||||
Public Const EN_TANK = 2
|
||||
|
||||
Public Const EN_CVPIPE = 0 ' Link types
|
||||
Public Const EN_PIPE = 1
|
||||
Public Const EN_PUMP = 2
|
||||
Public Const EN_PRV = 3
|
||||
Public Const EN_PSV = 4
|
||||
Public Const EN_PBV = 5
|
||||
Public Const EN_FCV = 6
|
||||
Public Const EN_TCV = 7
|
||||
Public Const EN_GPV = 8
|
||||
|
||||
Public Const EN_NONE = 0 ' Quality analysis types
|
||||
Public Const EN_CHEM = 1
|
||||
Public Const EN_AGE = 2
|
||||
Public Const EN_TRACE = 3
|
||||
|
||||
Public Const EN_CONCEN = 0 ' Source quality types
|
||||
Public Const EN_MASS = 1
|
||||
Public Const EN_SETPOINT = 2
|
||||
Public Const EN_FLOWPACED = 3
|
||||
|
||||
Public Const EN_CFS = 0 ' Flow units types
|
||||
Public Const EN_GPM = 1
|
||||
Public Const EN_MGD = 2
|
||||
Public Const EN_IMGD = 3
|
||||
Public Const EN_AFD = 4
|
||||
Public Const EN_LPS = 5
|
||||
Public Const EN_LPM = 6
|
||||
Public Const EN_MLD = 7
|
||||
Public Const EN_CMH = 8
|
||||
Public Const EN_CMD = 9
|
||||
|
||||
Public Const EN_TRIALS = 0 ' Misc. options
|
||||
Public Const EN_ACCURACY = 1
|
||||
Public Const EN_TOLERANCE = 2
|
||||
Public Const EN_EMITEXPON = 3
|
||||
Public Const EN_DEMANDMULT = 4
|
||||
|
||||
Public Const EN_LOWLEVEL = 0 ' Control types
|
||||
Public Const EN_HILEVEL = 1
|
||||
Public Const EN_TIMER = 2
|
||||
Public Const EN_TIMEOFDAY = 3
|
||||
|
||||
Public Const EN_AVERAGE = 1 'Time statistic types
|
||||
Public Const EN_MINIMUM = 2
|
||||
Public Const EN_MAXIMUM = 3
|
||||
Public Const EN_RANGE = 4
|
||||
|
||||
Public Const EN_MIX1 = 0 'Tank mixing models
|
||||
Public Const EN_MIX2 = 1
|
||||
Public Const EN_FIFO = 2
|
||||
Public Const EN_LIFO = 3
|
||||
|
||||
Public Const EN_NOSAVE = 0 ' Save-results-to-file flag
|
||||
Public Const EN_SAVE = 1
|
||||
Public Const EN_INITFLOW = 10 ' Re-initialize flow flag
|
||||
|
||||
Public Const EN_CONST_HP = 0 ' constant horsepower
|
||||
Public Const EN_POWER_FUNC = 1 ' power function
|
||||
Public Const EN_CUSTOM = 2 ' user-defined custom curve
|
||||
|
||||
'These are the external functions that comprise the DLL
|
||||
|
||||
Declare Function ENepanet Lib "epanet2.dll" (ByVal F1 As String, ByVal F2 As String, ByVal F3 As String, ByVal F4 As String) As Int32
|
||||
Declare Function ENopen Lib "epanet2.dll" (ByVal F1 As String, ByVal F2 As String, ByVal F3 As String) As Int32
|
||||
Declare Function ENsaveinpfile Lib "epanet2.dll" (ByVal F As String) As Int32
|
||||
Declare Function ENclose Lib "epanet2.dll" () As Int32
|
||||
|
||||
Declare Function ENsolveH Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENsaveH Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENopenH Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENinitH Lib "epanet2.dll" (ByVal SaveFlag As Int32) As Int32
|
||||
Declare Function ENrunH Lib "epanet2.dll" (ByRef T As Int32) As Int32
|
||||
Declare Function ENnextH Lib "epanet2.dll" (ByRef Tstep As Int32) As Int32
|
||||
Declare Function ENcloseH Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENsavehydfile Lib "epanet2.dll" (ByVal F As String) As Int32
|
||||
Declare Function ENusehydfile Lib "epanet2.dll" (ByVal F As String) As Int32
|
||||
|
||||
Declare Function ENsolveQ Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENopenQ Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENinitQ Lib "epanet2.dll" (ByVal SaveFlag As Int32) As Int32
|
||||
Declare Function ENrunQ Lib "epanet2.dll" (ByRef T As Int32) As Int32
|
||||
Declare Function ENnextQ Lib "epanet2.dll" (ByRef Tstep As Int32) As Int32
|
||||
Declare Function ENstepQ Lib "epanet2.dll" (ByRef Tleft As Int32) As Int32
|
||||
Declare Function ENcloseQ Lib "epanet2.dll" () As Int32
|
||||
|
||||
Declare Function ENwriteline Lib "epanet2.dll" (ByVal S As String) As Int32
|
||||
Declare Function ENreport Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENresetreport Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENsetreport Lib "epanet2.dll" (ByVal S As String) As Int32
|
||||
|
||||
Declare Function ENgetcontrol Lib "epanet2.dll" (ByVal Cindex As Int32, ByRef CtlType As Int32, ByRef Lindex As Int32, ByRef Setting As Single, ByRef Nindex As Int32, ByRef Level As Single) As Int32
|
||||
Declare Function ENgetcount Lib "epanet2.dll" (ByVal Code As Int32, ByRef Value As Int32) As Int32
|
||||
Declare Function ENgetoption Lib "epanet2.dll" (ByVal Code As Int32, ByRef Value As Single) As Int32
|
||||
Declare Function ENgettimeparam Lib "epanet2.dll" (ByVal Code As Int32, ByRef Value As Int32) As Int32
|
||||
Declare Function ENgetflowunits Lib "epanet2.dll" (ByRef Code As Int32) As Int32
|
||||
Declare Function ENgetpatternindex Lib "epanet2.dll" (ByVal ID As String, ByRef Index As Int32) As Int32
|
||||
Declare Function ENgetpatternid Lib "epanet2.dll" (ByVal Index As Int32, ByVal ID As StringBuilder) As Int32
|
||||
Declare Function ENgetpatternlen Lib "epanet2.dll" (ByVal Index As Int32, ByRef L As Int32) As Int32
|
||||
Declare Function ENgetpatternvalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Period As Int32, ByRef Value As Single) As Int32
|
||||
Declare Function ENgetqualtype Lib "epanet2.dll" (ByRef QualCode As Int32, ByRef TraceNode As Int32) As Int32
|
||||
Declare Function ENgeterror Lib "epanet2.dll" (ByVal ErrCode As Int32, ByVal ErrMsg As StringBuilder, ByVal N As Int32)
|
||||
|
||||
Declare Function ENgetnodeindex Lib "epanet2.dll" (ByVal ID As String, ByRef Index As Int32) As Int32
|
||||
Declare Function ENgetnodeid Lib "epanet2.dll" (ByVal Index As Int32, ByVal ID As StringBuilder) As Int32
|
||||
Declare Function ENgetnodetype Lib "epanet2.dll" (ByVal Index As Int32, ByRef Code As Int32) As Int32
|
||||
Declare Function ENgetnodevalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Code As Int32, ByRef Value As Single) As Int32
|
||||
Declare Function ENgetcoord Lib "epanet2.dll" (ByVal Index As Int32, ByRef X As Single, ByRef Y As Single) As Int32
|
||||
Declare Function ENsetcoord Lib "epanet2.dll" (ByVal Index As Int32, ByVal X As Single, ByVal Y As Single) As Int32
|
||||
|
||||
Declare Function ENgetnumdemands Lib "epanet2.dll" (ByVal Index As Int32, ByRef numDemands As Int32) As Int32 'ES
|
||||
Declare Function ENgetbasedemand Lib "epanet2.dll" (ByVal Index As Int32, ByVal DemandIndex As Int32, ByRef Value As Single) As Int32 'ES
|
||||
Declare Function ENgetdemandpattern Lib "epanet2.dll" (ByVal Index As Int32, ByVal DemandIndex As Int32, ByRef PatIndex As Int32) As Int32 'ES
|
||||
|
||||
Declare Function ENgetlinkindex Lib "epanet2.dll" (ByVal ID As String, ByRef Index As Int32) As Int32
|
||||
Declare Function ENgetlinkid Lib "epanet2.dll" (ByVal Index As Int32, ByVal ID As StringBuilder) As Int32
|
||||
Declare Function ENgetlinktype Lib "epanet2.dll" (ByVal Index As Int32, ByRef Code As Int32) As Int32
|
||||
Declare Function ENgetlinknodes Lib "epanet2.dll" (ByVal Index As Int32, ByRef Node1 As Int32, ByRef Node2 As Int32) As Int32
|
||||
Declare Function ENgetlinkvalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Code As Int32, ByRef Value As Single) As Int32
|
||||
|
||||
Declare Function ENgetcurve Lib "epanet2.dll" (ByVal CurveIndex As Int32, ByRef nValues As Int32, ByRef xValues As Single, ByRef yValues As Single) As Int32 'ES
|
||||
Declare Function ENgetheadcurve Lib "epanet2.dll" (ByVal Index As Int32, ByVal ID As StringBuilder) As Int32 'ES
|
||||
Declare Function ENgetpumptype Lib "epanet2.dll" (ByVal Index As Int32, ByRef PumpType As Int32) As Int32 'ES
|
||||
|
||||
Declare Function ENgetversion Lib "epanet2.dll" (ByRef Value As Int32) As Int32
|
||||
|
||||
Declare Function ENsetcontrol Lib "epanet2.dll" (ByVal Cindex As Int32, ByVal CtlType As Int32, ByVal Lindex As Int32, ByVal Setting As Single, ByVal Nindex As Int32, ByVal Level As Single) As Int32
|
||||
Declare Function ENsetnodevalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Code As Int32, ByVal Value As Single) As Int32
|
||||
Declare Function ENsetlinkvalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Code As Int32, ByVal Value As Single) As Int32
|
||||
Declare Function ENsetpattern Lib "epanet2.dll" (ByVal Index as Int32, ByRef F as Single, ByVal N as Int32) as Int32
|
||||
Declare Function ENsetpatternvalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Period As Int32, ByVal Value As Single) As Int32
|
||||
Declare Function ENsettimeparam Lib "epanet2.dll" (ByVal Code As Int32, ByVal Value As Int32) As Int32
|
||||
Declare Function ENsetoption Lib "epanet2.dll" (ByVal Code As Int32, ByVal Value As Single) As Int32
|
||||
Declare Function ENsetstatusreport Lib "epanet2.dll" (ByVal Code As Int32) As Int32
|
||||
Declare Function ENsetqualtype Lib "epanet2.dll" (ByVal QualCode As Int32, ByVal ChemName As String, ByVal ChemUnits As String, ByVal TraceNode As String) As Int32
|
||||
|
||||
Declare Function ENaddpattern Lib "epanet2.dll" (ByVal ID As String) As Int32
|
||||
|
||||
End Module
|
||||
75
run/main.c
Normal file
75
run/main.c
Normal file
@@ -0,0 +1,75 @@
|
||||
#include <stdio.h>
|
||||
#include "epanet2.h"
|
||||
#include "text.h"
|
||||
|
||||
void writeConsole(char *s);
|
||||
|
||||
extern char Warnflag;
|
||||
|
||||
/*
|
||||
----------------------------------------------------------------
|
||||
Entry point used to compile a stand-alone executable.
|
||||
----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
/*--------------------------------------------------------------
|
||||
** Input: argc = number of command line arguments
|
||||
** *argv[] = array of command line arguments
|
||||
** Output: none
|
||||
** Purpose: main program segment
|
||||
**
|
||||
** Command line for stand-alone operation is:
|
||||
** progname f1 f2 f3
|
||||
** where progname = name of executable this code was compiled to,
|
||||
** f1 = name of input file, f2 = name of report file, and
|
||||
** f3 = name of binary output file (optional).
|
||||
**--------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
char *f1,*f2,*f3;
|
||||
char blank[] = "";
|
||||
int errcode;
|
||||
|
||||
/* Check for proper number of command line arguments */
|
||||
if (argc < 3) {
|
||||
writeConsole(FMT03);
|
||||
}
|
||||
else {
|
||||
/* Call the main control function */
|
||||
f1 = argv[1];
|
||||
f2 = argv[2];
|
||||
if (argc > 3) {
|
||||
f3 = argv[3];
|
||||
}
|
||||
else {
|
||||
f3 = blank;
|
||||
}
|
||||
writeConsole(FMT01);
|
||||
errcode = ENepanet(f1,f2,f3,NULL);
|
||||
if (errcode > 0) {
|
||||
writeConsole(FMT11);
|
||||
}
|
||||
else if (Warnflag > 0) {
|
||||
writeConsole(FMT10);
|
||||
}
|
||||
else {
|
||||
writeConsole(FMT09);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
} /* End of main */
|
||||
|
||||
|
||||
void writeConsole(char *s)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: text string
|
||||
** Output: none
|
||||
** Purpose: writes string of characters to console
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
fprintf(stdout,"%s",s);
|
||||
fflush(stdout);
|
||||
}
|
||||
260
src/epanet.c
260
src/epanet.c
@@ -12,8 +12,8 @@ DATE: 5/30/00
|
||||
6/24/02
|
||||
8/15/07 (2.00.11)
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
AUTHORS: L. Rossman - US EPA - NRMRL
|
||||
OpenWaterAnalytics members: see git stats for contributors
|
||||
|
||||
EPANET performs extended period hydraulic and water quality analysis of
|
||||
looped, pressurized piping networks. The program consists of the
|
||||
@@ -37,7 +37,7 @@ The program can be compiled as either a stand-alone console application
|
||||
or as a dynamic link library (DLL) of function calls depending on whether
|
||||
the macro identifier 'DLL' is defined or not.
|
||||
|
||||
See TOOLKIT.H for function prototypes of exported DLL functions
|
||||
See EPANET2.H for function prototypes of exported DLL functions
|
||||
See FUNCS.H for prototypes of all other functions
|
||||
See TYPES.H for declaration of global constants and data structures
|
||||
See VARS.H for declaration of global variables
|
||||
@@ -144,64 +144,6 @@ void (* viewprog) (char *); /* Pointer to progress viewing function */
|
||||
----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*** This code is no longer required ***** //(2.00.11 - LR)
|
||||
#ifdef DLL
|
||||
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* reserved)
|
||||
{
|
||||
viewprog = NULL;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
*****************************************/
|
||||
|
||||
|
||||
/*
|
||||
----------------------------------------------------------------
|
||||
Entry point used to compile a stand-alone executable.
|
||||
----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef CLE //(2.00.11 - LR)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
/*--------------------------------------------------------------
|
||||
** Input: argc = number of command line arguments
|
||||
** *argv[] = array of command line arguments
|
||||
** Output: none
|
||||
** Purpose: main program segment
|
||||
**
|
||||
** Command line for stand-alone operation is:
|
||||
** progname f1 f2 f3
|
||||
** where progname = name of executable this code was compiled to,
|
||||
** f1 = name of input file, f2 = name of report file, and
|
||||
** f3 = name of binary output file (optional).
|
||||
**--------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
char *f1,*f2,*f3;
|
||||
char blank[] = "";
|
||||
int errcode;
|
||||
|
||||
/* Check for proper number of command line arguments */
|
||||
if (argc < 3) writecon(FMT03);
|
||||
else
|
||||
{
|
||||
|
||||
/* Call the main control function */
|
||||
f1 = argv[1];
|
||||
f2 = argv[2];
|
||||
if (argc > 3) f3 = argv[3];
|
||||
else f3 = blank;
|
||||
writecon(FMT01);
|
||||
errcode = ENepanet(f1,f2,f3,NULL);
|
||||
if (errcode > 0) writecon(FMT11);
|
||||
else if (Warnflag > 0) writecon(FMT10);
|
||||
else writecon(FMT09);
|
||||
}
|
||||
return(0);
|
||||
} /* End of main */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
----------------------------------------------------------------
|
||||
@@ -268,19 +210,10 @@ int DLLEXPORT ENopen(char *f1, char *f2, char *f3)
|
||||
SaveHflag = FALSE;
|
||||
SaveQflag = FALSE;
|
||||
Warnflag = FALSE;
|
||||
|
||||
Coordflag = TRUE;
|
||||
|
||||
/*** Updated 9/7/00 ***/
|
||||
Messageflag = TRUE;
|
||||
|
||||
/* If binary output file being used, then */
|
||||
/* do not write full results to Report file */
|
||||
/* (use it only for status reports). */
|
||||
Rptflag = 0;
|
||||
if (strlen(f3) == 0) Rptflag = 1;
|
||||
|
||||
/*** Updated 9/7/00 ***/
|
||||
/*** Previous code segment ignored. ***/
|
||||
/*** Rptflag now always set to 1. ***/
|
||||
Rptflag = 1;
|
||||
|
||||
/* Initialize global pointers to NULL. */
|
||||
@@ -307,7 +240,6 @@ int DLLEXPORT ENopen(char *f1, char *f2, char *f3)
|
||||
/* Free temporary linked lists used for Patterns & Curves */
|
||||
freeTmplist(Patlist);
|
||||
freeTmplist(Curvelist);
|
||||
freeTmplist(Coordlist);
|
||||
|
||||
/* If using previously saved hydraulics then open its file */
|
||||
if (Hydflag == USE) ERRCODE(openhydfile());
|
||||
@@ -964,12 +896,11 @@ int DLLEXPORT ENgetversion(int *v)
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENgetcontrol(int cindex, int *ctype, int *lindex,
|
||||
EN_API_FLOAT_TYPE *setting, int *nindex, EN_API_FLOAT_TYPE *level)
|
||||
int DLLEXPORT ENgetcontrol(int cindex, int *ctype, int *lindex, EN_API_FLOAT_TYPE *setting, int *nindex, EN_API_FLOAT_TYPE *level)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: cindex = control index (position of control statement
|
||||
** in the input file, starting from 1)
|
||||
** Output: *ctype = control type code (see TOOLKIT.H)
|
||||
** Output: *ctype = control type code (see EPANET2.H)
|
||||
** *lindex = index of controlled link
|
||||
** *setting = control setting on link
|
||||
** *nindex = index of controlling node (0 for TIMER
|
||||
@@ -1020,7 +951,7 @@ int DLLEXPORT ENgetcontrol(int cindex, int *ctype, int *lindex,
|
||||
|
||||
int DLLEXPORT ENgetcount(int code, int *count)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: code = component code (see TOOLKIT.H)
|
||||
** Input: code = component code (see EPANET2.H)
|
||||
** Output: *count = number of components in network
|
||||
** Returns: error code
|
||||
** Purpose: retrieves the number of components of a
|
||||
@@ -1046,7 +977,7 @@ int DLLEXPORT ENgetcount(int code, int *count)
|
||||
|
||||
int DLLEXPORT ENgetoption(int code, EN_API_FLOAT_TYPE *value)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: code = option code (see TOOLKIT.H)
|
||||
** Input: code = option code (see EPANET2.H)
|
||||
** Output: *value = option value
|
||||
** Returns: error code
|
||||
** Purpose: gets value for an analysis option
|
||||
@@ -1077,7 +1008,7 @@ int DLLEXPORT ENgetoption(int code, EN_API_FLOAT_TYPE *value)
|
||||
|
||||
int DLLEXPORT ENgettimeparam(int code, long *value)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: code = time parameter code (see TOOLKIT.H)
|
||||
** Input: code = time parameter code (see EPANET2.H)
|
||||
** Output: *value = value of time parameter
|
||||
** Returns: error code
|
||||
** Purpose: retrieves value of specific time parameter
|
||||
@@ -1114,7 +1045,7 @@ int DLLEXPORT ENgetflowunits(int *code)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: none
|
||||
** Output: *code = code of flow units in use
|
||||
** (see TOOLKIT.H or TYPES.H)
|
||||
** (see EPANET2.H or TYPES.H)
|
||||
** Returns: error code
|
||||
** Purpose: retrieves flow units code
|
||||
**----------------------------------------------------------------
|
||||
@@ -1206,10 +1137,10 @@ int DLLEXPORT ENgetpatternvalue(int index, int period, EN_API_FLOAT_TYPE *value)
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENgetqualtype(int *qualcode, int *tracenode)
|
||||
int DLLEXPORT ENgetqualtype(int *qualcode, int *tracenode)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: none
|
||||
** Output: *qualcode = WQ analysis code number (see TOOLKIT.H)
|
||||
** Output: *qualcode = WQ analysis code number (see EPANET2.H)
|
||||
** *tracenode = index of node being traced (if
|
||||
** qualocode = WQ tracing)
|
||||
** Returns: error code
|
||||
@@ -1330,7 +1261,7 @@ int DLLEXPORT ENgetnodeid(int index, char *id)
|
||||
int DLLEXPORT ENgetnodetype(int index, int *code)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: index = node index
|
||||
** Output: *code = node type code number (see TOOLKIT.H)
|
||||
** Output: *code = node type code number (see EPANET2.H)
|
||||
** Returns: error code
|
||||
** Purpose: retrieves node type of specific node
|
||||
**----------------------------------------------------------------
|
||||
@@ -1353,21 +1284,51 @@ int DLLEXPORT ENgetcoord(int index, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_TYPE *y)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: index = node index
|
||||
** Output: *x = value of node's coordinate
|
||||
** *x = value of node's coordinate
|
||||
** *y = value of node's coordinate
|
||||
** Returns: error code
|
||||
** Purpose: retrieves coordinate x, y for a node
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
*x = Coord[index].X[0];
|
||||
*y = Coord[index].Y[0];
|
||||
return 0;
|
||||
if (!Openflag) return(102);
|
||||
if (index < 1 || index > Nnodes) return(203);
|
||||
if (!Coordflag) return(255);
|
||||
|
||||
// check if node have coords
|
||||
if (Coord[index].HaveCoords == FALSE) return(254);
|
||||
|
||||
*x = Coord[index].X;
|
||||
*y = Coord[index].Y;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENsetcoord(int index, EN_API_FLOAT_TYPE x, EN_API_FLOAT_TYPE y)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: index = node index
|
||||
** *x = value of node's coordinate
|
||||
** *y = value of node's coordinate
|
||||
** Output: None
|
||||
** Returns: error code
|
||||
** Purpose: sets coordinate x, y for a node
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
if (!Openflag) return(102);
|
||||
if (index < 1 || index > Nnodes) return(203);
|
||||
if (!Coordflag) return(255);
|
||||
|
||||
Coord[index].X = x;
|
||||
Coord[index].Y = y;
|
||||
Coord[index].HaveCoords = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENgetnodevalue(int index, int code, EN_API_FLOAT_TYPE *value)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: index = node index
|
||||
** code = node parameter code (see TOOLKIT.H)
|
||||
** code = node parameter code (see EPANET2.H)
|
||||
** Output: *value = value of node's parameter
|
||||
** Returns: error code
|
||||
** Purpose: retrieves parameter value for a node
|
||||
@@ -1588,7 +1549,7 @@ int DLLEXPORT ENgetlinkid(int index, char *id)
|
||||
int DLLEXPORT ENgetlinktype(int index, int *code)
|
||||
/*------------------------------------------------------------------
|
||||
** Input: index = link index
|
||||
** Output: *code = link type code number (see TOOLKIT.H)
|
||||
** Output: *code = link type code number (see EPANET2.H)
|
||||
** Returns: error code
|
||||
** Purpose: retrieves link type of specific link
|
||||
**------------------------------------------------------------------
|
||||
@@ -1625,7 +1586,7 @@ int DLLEXPORT ENgetlinknodes(int index, int *node1, int *node2)
|
||||
int DLLEXPORT ENgetlinkvalue(int index, int code, EN_API_FLOAT_TYPE *value)
|
||||
/*------------------------------------------------------------------
|
||||
** Input: index = link index
|
||||
** code = link parameter code (see TOOLKIT.H)
|
||||
** code = link parameter code (see EPANET2.H)
|
||||
** Output: *value = value of link's parameter
|
||||
** Returns: error code
|
||||
** Purpose: retrieves parameter value for a link
|
||||
@@ -1778,21 +1739,29 @@ int DLLEXPORT ENgetcurve(int curveIndex, char* id, int *nValues, EN_API_FLOAT_T
|
||||
/*----------------------------------------------------------------
|
||||
** Input: curveIndex = curve index
|
||||
** Output: *nValues = number of points on curve
|
||||
** id = curve ID
|
||||
** *xValues = values for x
|
||||
** *yValues = values for y
|
||||
** Returns: error code
|
||||
** Purpose: retrieves end nodes of a specific link
|
||||
** Purpose: retrieves curve id, number of values and (x,y) values
|
||||
**
|
||||
** NOTE: 'id' must be able to hold MAXID characters
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
int err = 0;
|
||||
int iPoint, nPoints;
|
||||
Scurve curve;
|
||||
EN_API_FLOAT_TYPE *pointX, *pointY;
|
||||
|
||||
Scurve curve = Curve[curveIndex];
|
||||
int nPoints = curve.Npts;
|
||||
/* Check that input file opened */
|
||||
if (!Openflag) return(102);
|
||||
|
||||
curve = Curve[curveIndex];
|
||||
nPoints = curve.Npts;
|
||||
|
||||
pointX = calloc(nPoints, sizeof(EN_API_FLOAT_TYPE));
|
||||
pointY = calloc(nPoints, sizeof(EN_API_FLOAT_TYPE));
|
||||
|
||||
EN_API_FLOAT_TYPE *pointX = calloc(nPoints, sizeof(EN_API_FLOAT_TYPE));
|
||||
EN_API_FLOAT_TYPE *pointY = calloc(nPoints, sizeof(EN_API_FLOAT_TYPE));
|
||||
int iPoint;
|
||||
for (iPoint = 0; iPoint < nPoints; iPoint++) {
|
||||
double x = curve.X[iPoint] * Ucf[LENGTH];
|
||||
double y = curve.Y[iPoint] * Ucf[VOLUME];
|
||||
@@ -1800,12 +1769,13 @@ int DLLEXPORT ENgetcurve(int curveIndex, char* id, int *nValues, EN_API_FLOAT_T
|
||||
pointY[iPoint] = (EN_API_FLOAT_TYPE)y;
|
||||
}
|
||||
|
||||
strncpy(id,"", MAXID);
|
||||
strncpy(id, curve.ID, MAXID);
|
||||
*nValues = nPoints;
|
||||
*xValues = pointX;
|
||||
*yValues = pointY;
|
||||
|
||||
return err;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1821,7 +1791,7 @@ int DLLEXPORT ENsetcontrol(int cindex, int ctype, int lindex,
|
||||
/*----------------------------------------------------------------
|
||||
** Input: cindex = control index (position of control statement
|
||||
** in the input file, starting from 1)
|
||||
** ctype = control type code (see TOOLKIT.H)
|
||||
** ctype = control type code (see EPANET2.H)
|
||||
** lindex = index of controlled link
|
||||
** setting = control setting applied to link
|
||||
** nindex = index of controlling node (0 for TIMER
|
||||
@@ -1908,7 +1878,7 @@ int DLLEXPORT ENsetcontrol(int cindex, int ctype, int lindex,
|
||||
int DLLEXPORT ENsetnodevalue(int index, int code, EN_API_FLOAT_TYPE v)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: index = node index
|
||||
** code = node parameter code (see TOOLKIT.H)
|
||||
** code = node parameter code (see EPANET2.H)
|
||||
** value = parameter value
|
||||
** Output: none
|
||||
** Returns: error code
|
||||
@@ -2121,7 +2091,7 @@ int DLLEXPORT ENsetnodevalue(int index, int code, EN_API_FLOAT_TYPE v)
|
||||
int DLLEXPORT ENsetlinkvalue(int index, int code, EN_API_FLOAT_TYPE v)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: index = link index
|
||||
** code = link parameter code (see TOOLKIT.H)
|
||||
** code = link parameter code (see EPANET2.H)
|
||||
** v = parameter value
|
||||
** Output: none
|
||||
** Returns: error code
|
||||
@@ -2355,7 +2325,7 @@ int DLLEXPORT ENsetpatternvalue(int index, int period, EN_API_FLOAT_TYPE value
|
||||
|
||||
int DLLEXPORT ENsettimeparam(int code, long value)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: code = time parameter code (see TOOLKIT.H)
|
||||
** Input: code = time parameter code (see EPANET2.H)
|
||||
** value = time parameter value
|
||||
** Output: none
|
||||
** Returns: error code
|
||||
@@ -2447,7 +2417,7 @@ int DLLEXPORT ENsettimeparam(int code, long value)
|
||||
|
||||
int DLLEXPORT ENsetoption(int code, EN_API_FLOAT_TYPE v)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: code = option code (see TOOLKIT.H)
|
||||
** Input: code = option code (see EPANET2.H)
|
||||
** v = option value
|
||||
** Output: none
|
||||
** Returns: error code
|
||||
@@ -2508,7 +2478,7 @@ int DLLEXPORT ENsetstatusreport(int code)
|
||||
int DLLEXPORT ENsetqualtype(int qualcode, char *chemname,
|
||||
char *chemunits, char *tracenode)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: qualcode = WQ parameter code (see TOOLKIT.H)
|
||||
** Input: qualcode = WQ parameter code (see EPANET2.H)
|
||||
** chemname = name of WQ constituent
|
||||
** chemunits = concentration units of WQ constituent
|
||||
** tracenode = ID of node being traced
|
||||
@@ -2830,12 +2800,11 @@ void initpointers()
|
||||
Pattern = NULL;
|
||||
Curve = NULL;
|
||||
Control = NULL;
|
||||
Coord = NULL;
|
||||
Coord = NULL;
|
||||
|
||||
X = NULL;
|
||||
Patlist = NULL;
|
||||
Curvelist = NULL;
|
||||
Coordlist = NULL;
|
||||
Adjlist = NULL;
|
||||
Aii = NULL;
|
||||
Aij = NULL;
|
||||
@@ -2915,14 +2884,17 @@ int allocdata()
|
||||
Control = (Scontrol *) calloc(MaxControls+1,sizeof(Scontrol));
|
||||
Pattern = (Spattern *) calloc(MaxPats+1, sizeof(Spattern));
|
||||
Curve = (Scurve *) calloc(MaxCurves+1, sizeof(Scurve));
|
||||
Coord = (Scoord *) calloc(MaxNodes+1, sizeof(Scoord));
|
||||
if (Coordflag == TRUE)
|
||||
{
|
||||
Coord = (Scoord *) calloc(MaxNodes+1, sizeof(Scoord));
|
||||
}
|
||||
ERRCODE(MEMCHECK(Tank));
|
||||
ERRCODE(MEMCHECK(Pump));
|
||||
ERRCODE(MEMCHECK(Valve));
|
||||
ERRCODE(MEMCHECK(Control));
|
||||
ERRCODE(MEMCHECK(Pattern));
|
||||
ERRCODE(MEMCHECK(Curve));
|
||||
ERRCODE(MEMCHECK(Coord));
|
||||
if (Coordflag == TRUE) ERRCODE(MEMCHECK(Coord));
|
||||
}
|
||||
|
||||
/* Initialize pointers used in patterns, curves, and demand category lists */
|
||||
@@ -2945,12 +2917,13 @@ int allocdata()
|
||||
{
|
||||
// node demand
|
||||
Node[n].D = NULL;
|
||||
/* Allocate memory for coord data */
|
||||
Coord[n].X = (double *) calloc(1, sizeof(double));
|
||||
Coord[n].Y = (double *) calloc(1, sizeof(double));
|
||||
if (Coord[n].X == NULL || Coord[n].Y == NULL) return(101);
|
||||
Coord[n].X[0] = 0;
|
||||
Coord[n].Y[0] = 0;
|
||||
/* ini coord data */
|
||||
if (Coordflag == TRUE)
|
||||
{
|
||||
Coord[n].X = 0;
|
||||
Coord[n].Y = 0;
|
||||
Coord[n].HaveCoords = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3248,7 +3221,10 @@ char *geterrmsg(int errcode)
|
||||
case 241: sprintf(Msg,ERR241,t_FUNCCALL,""); break;
|
||||
case 250: sprintf(Msg,ERR250); break;
|
||||
case 251: sprintf(Msg,ERR251); break;
|
||||
|
||||
case 253: sprintf(Msg,ERR253); break;
|
||||
case 254: sprintf(Msg,ERR254); break;
|
||||
case 255: sprintf(Msg,ERR255); break;
|
||||
|
||||
/* File Errors */
|
||||
case 301: strcpy(Msg,ERR301); break;
|
||||
case 302: strcpy(Msg,ERR302); break;
|
||||
@@ -3295,10 +3271,10 @@ void writecon(char *s)
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
#ifdef CLE //(2.00.11 - LR)
|
||||
//(2.00.11 - LR)
|
||||
fprintf(stdout,s);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3320,7 +3296,16 @@ void writewin(char *s)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENgetnumdemands(int nodeIndex, int *numDemands)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: nodeIndex = index of node
|
||||
** Output: *numDemands = number of demand categories
|
||||
** Returns: error code
|
||||
** Purpose: retrieves the number of a demand categories for a node
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
Pdemand d;
|
||||
int n=0;
|
||||
@@ -3331,7 +3316,17 @@ int DLLEXPORT ENgetnumdemands(int nodeIndex, int *numDemands)
|
||||
*numDemands=n;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENgetbasedemand(int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE *baseDemand)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: nodeIndex = index of node
|
||||
** demandIdx = index of demand category
|
||||
** Output: *baseDemand = base demand for selected category
|
||||
** Returns: error code
|
||||
** Purpose: retrieves the node's base demand for a category
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
Pdemand d;
|
||||
int n=1;
|
||||
@@ -3349,7 +3344,16 @@ int DLLEXPORT ENgetbasedemand(int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE *
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENsetbasedemand(int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE baseDemand)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: nodeIndex = index of node
|
||||
** demandIdx = index of demand category
|
||||
** baseDemand = base demand for selected category
|
||||
** Returns: error code
|
||||
** Purpose: sets the node's base demand for a category
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
Pdemand d;
|
||||
int n=1;
|
||||
@@ -3364,7 +3368,17 @@ int DLLEXPORT ENsetbasedemand(int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE b
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENgetdemandpattern(int nodeIndex, int demandIdx, int *pattIdx)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: nodeIndex = index of node
|
||||
** demandIdx = index of demand category
|
||||
** Output: *pattIdx = demand pattern index
|
||||
** Returns: error code
|
||||
** Purpose: retrieves the index of a demand pattern for a specific
|
||||
** demand category of a node
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
Pdemand d;
|
||||
int n=1;
|
||||
@@ -3377,21 +3391,21 @@ int DLLEXPORT ENgetdemandpattern(int nodeIndex, int demandIdx, int *pattIdx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int DLLEXPORT ENgetaveragepatternvalue(int index, EN_API_FLOAT_TYPE *value)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: index = index of time pattern
|
||||
** period = pattern time period
|
||||
** Output: *value = pattern multiplier
|
||||
** Output: *value = pattern average value
|
||||
** Returns: error code
|
||||
** Purpose: retrieves multiplier for a specific time period
|
||||
** and pattern
|
||||
** Purpose: retrieves the average value of a pattern
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{ *value = 0.0;
|
||||
{
|
||||
int i;
|
||||
*value = 0.0;
|
||||
if (!Openflag) return(102);
|
||||
if (index < 1 || index > Npats) return(205);
|
||||
//if (period < 1 || period > Pattern[index].Length) return(251);
|
||||
int i;
|
||||
for (i=0; i<Pattern[index].Length; i++) {
|
||||
*value+=Pattern[index].F[i];
|
||||
}
|
||||
|
||||
@@ -65,13 +65,11 @@ int addnodeID(int, char *); /* Adds node ID to data base */
|
||||
int addlinkID(int, char *); /* Adds link ID to data base */
|
||||
int addpattern(char *); /* Adds pattern to data base */
|
||||
int addcurve(char *); /* Adds curve to data base */
|
||||
int addcoord(char *); /* Adds coord to data base */
|
||||
STmplist *findID(char *, STmplist *); /* Locates ID on linked list */
|
||||
int unlinked(void); /* Checks for unlinked nodes */
|
||||
int getpumpparams(void); /* Computes pump curve coeffs.*/
|
||||
int getpatterns(void); /* Gets pattern data from list*/
|
||||
int getcurves(void); /* Gets curve data from list */
|
||||
int getcoords(void); /* Gets coordinate data from list */
|
||||
int findmatch(char *,char *[]); /* Finds keyword in line */
|
||||
int match(char *, char *); /* Checks for word match */
|
||||
int gettokens(char *); /* Tokenizes input line */
|
||||
@@ -88,7 +86,7 @@ int pumpdata(void); /* Processes pump data */
|
||||
int valvedata(void); /* Processes valve data */
|
||||
int patterndata(void); /* Processes pattern data */
|
||||
int curvedata(void); /* Processes curve data */
|
||||
int coordata(void); /* Processes coordinate data */
|
||||
int coordata(void); /* Processes coordinate data */
|
||||
int demanddata(void); /* Processes demand data */
|
||||
int controldata(void); /* Processes simple controls */
|
||||
int energydata(void); /* Processes energy data */
|
||||
@@ -287,4 +285,4 @@ int saveepilog(void); /* Saves output file epilog */
|
||||
/* ------------ INPFILE.C --------------*/
|
||||
int saveinpfile(char *); /* Saves network to text file */
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -30,11 +30,12 @@ unsigned int _enHash(char *str);
|
||||
unsigned int _enHash(char *str)
|
||||
{
|
||||
unsigned int hash = 5381;
|
||||
unsigned int retHash;
|
||||
int c;
|
||||
while ((c = *str++)) {
|
||||
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
|
||||
}
|
||||
unsigned int retHash = hash % ENHASHTABLEMAXSIZE;
|
||||
retHash = hash % ENHASHTABLEMAXSIZE;
|
||||
return retHash;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,11 @@ void saveauxdata(FILE *f) /
|
||||
switch(sect)
|
||||
{
|
||||
case _RULES:
|
||||
case _COORDS:
|
||||
case _COORDS: if (Coordflag == FALSE)
|
||||
{
|
||||
fprintf(f, "%s", line);
|
||||
}
|
||||
break;
|
||||
case _VERTICES:
|
||||
case _LABELS:
|
||||
case _BACKDROP:
|
||||
@@ -92,7 +96,11 @@ void saveauxdata(FILE *f) /
|
||||
switch(sect)
|
||||
{
|
||||
case _RULES:
|
||||
case _COORDS:
|
||||
case _COORDS: if (Coordflag == FALSE)
|
||||
{
|
||||
fprintf(f, "%s", line);
|
||||
}
|
||||
break;
|
||||
case _VERTICES:
|
||||
case _LABELS:
|
||||
case _BACKDROP:
|
||||
@@ -558,6 +566,9 @@ int saveinpfile(char *fname)
|
||||
fprintf(f, "\n STATUS %s", RptFlagTxt[Statflag]);
|
||||
fprintf(f, "\n SUMMARY %s", RptFlagTxt[Summaryflag]);
|
||||
fprintf(f, "\n ENERGY %s", RptFlagTxt[Energyflag]);
|
||||
fprintf(f, "\n MESSAGES %s", RptFlagTxt[Messageflag]);
|
||||
if (strlen(Rpt2Fname) > 0)
|
||||
fprintf(f, "\n FILE %s", Rpt2Fname);
|
||||
switch (Nodeflag)
|
||||
{
|
||||
case 0:
|
||||
@@ -610,7 +621,22 @@ int saveinpfile(char *fname)
|
||||
}
|
||||
else fprintf(f, "\n %-20sNO", Field[i].Name);
|
||||
}
|
||||
fprintf(f, "\n");
|
||||
fprintf(f, "\n\n");
|
||||
|
||||
/* Write [COORDINATES] section */
|
||||
|
||||
if (Coordflag == TRUE)
|
||||
{
|
||||
fprintf(f, "\n\n[COORDINATES]");
|
||||
for (i=1; i<=Nnodes; i++)
|
||||
{
|
||||
if (Coord[i].HaveCoords == TRUE)
|
||||
{
|
||||
fprintf(f,"\n %-31s %14.6f %14.6f",Node[i].ID,Coord[i].X,Coord[i].Y);
|
||||
}
|
||||
}
|
||||
fprintf(f, "\n\n");
|
||||
}
|
||||
|
||||
/* Save auxilary data to new input file */
|
||||
|
||||
|
||||
108
src/input2.c
108
src/input2.c
@@ -48,7 +48,6 @@ char *Tok[MAXTOKS]; /* Array of token strings */
|
||||
/* Used in INPUT3.C: */
|
||||
STmplist *PrevPat; /* Pointer to pattern list element */
|
||||
STmplist *PrevCurve; /* Pointer to curve list element */
|
||||
STmplist *PrevCoord; /* Pointer to coordinate list element */
|
||||
|
||||
/* Defined in enumstxt.h in EPANET.C */
|
||||
extern char *SectTxt[]; /* Input section keywords */
|
||||
@@ -79,7 +78,6 @@ int netsize()
|
||||
MaxRules = 0;
|
||||
MaxCurves = 0;
|
||||
sect = -1;
|
||||
MaxCoords = 0;
|
||||
|
||||
/* Add a default pattern 0 */
|
||||
MaxPats = -1;
|
||||
@@ -121,8 +119,6 @@ int netsize()
|
||||
break;
|
||||
case _CURVES: errcode = addcurve(tok);
|
||||
break;
|
||||
// case _COORDS: errcode = addcoord(tok); //06.02.2010-woohn
|
||||
// break;
|
||||
}
|
||||
if (errcode) break;
|
||||
}
|
||||
@@ -176,7 +172,6 @@ int readdata()
|
||||
Npats = MaxPats;
|
||||
PrevPat = NULL;
|
||||
PrevCurve = NULL;
|
||||
PrevCoord = NULL;
|
||||
|
||||
sect = -1;
|
||||
errsum = 0;
|
||||
@@ -245,7 +240,6 @@ int readdata()
|
||||
/* Get pattern & curve data from temp. lists */
|
||||
if (!errcode) errcode = getpatterns();
|
||||
if (!errcode) errcode = getcurves();
|
||||
//if (!errcode) errcode = getcoords();
|
||||
if (!errcode) errcode = getpumpparams();
|
||||
|
||||
/* Free input buffer */
|
||||
@@ -300,7 +294,11 @@ int newline(int sect, char *line)
|
||||
case _OPTIONS: return(optiondata());
|
||||
|
||||
/* Data in these sections are not used for any computations */
|
||||
case _COORDS: return (0); //return(coordata());
|
||||
case _COORDS: if (Coordflag == TRUE)
|
||||
{
|
||||
return(coordata());
|
||||
}
|
||||
else return(0);
|
||||
case _LABELS: return(0);
|
||||
case _TAGS: return(0);
|
||||
case _VERTICES: return(0);
|
||||
@@ -520,43 +518,6 @@ int addcurve(char *id)
|
||||
return(0);
|
||||
}
|
||||
|
||||
int addcoord(char *id)
|
||||
/*
|
||||
**-------------------------------------------------------------
|
||||
** Input: id = curve ID label
|
||||
** Output: returns error code
|
||||
** Purpose: adds a new curve to the database
|
||||
**--------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
STmplist *c;
|
||||
|
||||
/* Check if ID is same as last one processed */
|
||||
if (Coordlist != NULL && strcmp(id,Coordlist->ID) == 0) return(0);
|
||||
|
||||
/* Check that coordinate was not already created */
|
||||
if (findID(id,Coordlist) == NULL)
|
||||
{
|
||||
|
||||
/* Update coordinate count & create new list element */
|
||||
(MaxCoords)++;
|
||||
c = (STmplist *) malloc(sizeof(STmplist));
|
||||
if (c == NULL) {
|
||||
return(101);
|
||||
}
|
||||
else {
|
||||
/* Initialize list element properties */
|
||||
// c->i = MaxCoords; // bug! if coordinates are not in the same order as junctions, then this is a BAD assumption
|
||||
// do this later: c->i = findnode(id);
|
||||
strncpy(c->ID,id,MAXID);
|
||||
c->x = NULL;
|
||||
c->y = NULL;
|
||||
c->next = Coordlist;
|
||||
Coordlist = c;
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
STmplist *findID(char *id, STmplist *list)
|
||||
/*
|
||||
@@ -749,65 +710,6 @@ int getcurves(void)
|
||||
return(0);
|
||||
}
|
||||
|
||||
int getcoords(void)
|
||||
/*
|
||||
**-----------------------------------------------------------
|
||||
** Input: none
|
||||
** Output: returns error code
|
||||
** Purpose: retrieves curve data from temporary linked list
|
||||
**-----------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
int i,j,n;
|
||||
double x;
|
||||
SFloatlist *xFloatList, *yFloatList;
|
||||
STmplist *coordinateList;
|
||||
|
||||
/* Start at head of coordinate list */
|
||||
coordinateList = Coordlist;
|
||||
|
||||
/* Traverse list of coordinates */
|
||||
while (coordinateList != NULL)
|
||||
{
|
||||
// BAD! ---> i = coordinateList->i;
|
||||
i = findnode(coordinateList->ID);
|
||||
if (i >= 1 && i <= MaxNodes)
|
||||
{
|
||||
/* Save coordinate ID */
|
||||
strcpy(Coord[i].ID, coordinateList->ID);
|
||||
|
||||
n = 1; //Coord[i].Npts
|
||||
|
||||
/* Traverse list of x,y data */
|
||||
x = BIG;
|
||||
xFloatList = coordinateList->x;
|
||||
yFloatList = coordinateList->y;
|
||||
j = n - 1;
|
||||
while (xFloatList != NULL && yFloatList != NULL && j >= 0)
|
||||
{
|
||||
|
||||
/* Check that x data is in ascending order */
|
||||
if (xFloatList->value >= x)
|
||||
{
|
||||
sprintf(Msg,ERR230,coordinateList->ID);
|
||||
writeline(Msg);
|
||||
return(200);
|
||||
}
|
||||
x = xFloatList->value;
|
||||
|
||||
/* Save x,y data in Curve structure */
|
||||
Coord[i].X[j] = xFloatList->value;
|
||||
xFloatList = xFloatList->next;
|
||||
Coord[i].Y[j] = yFloatList->value;
|
||||
yFloatList = yFloatList->next;
|
||||
j--;
|
||||
}
|
||||
}
|
||||
coordinateList = coordinateList->next;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int findmatch(char *line, char *keyword[])
|
||||
/*
|
||||
|
||||
52
src/input3.c
52
src/input3.c
@@ -42,8 +42,6 @@ extern char *Fldname[];
|
||||
extern char *Tok[MAXTOKS];
|
||||
extern STmplist *PrevPat;
|
||||
extern STmplist *PrevCurve;
|
||||
|
||||
extern STmplist *PrevCoord;
|
||||
extern int Ntokens;
|
||||
|
||||
|
||||
@@ -591,46 +589,24 @@ int coordata()
|
||||
**--------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
double x,y;
|
||||
SFloatlist *fx, *fy;
|
||||
STmplist *c;
|
||||
double x, y;
|
||||
int j;
|
||||
|
||||
/* Check for valid curve ID */
|
||||
/* Check for valid node ID */
|
||||
if (Ntokens < 3) return(201);
|
||||
|
||||
if (
|
||||
PrevCoord != NULL &&
|
||||
strcmp(Tok[0],PrevCoord->ID) == 0
|
||||
) c = PrevCoord;
|
||||
else c = findID(Tok[0],Coordlist);
|
||||
|
||||
// c = findID(Tok[0],Coordlist);
|
||||
if (c == NULL) return(205);
|
||||
|
||||
/* Check for valid data */
|
||||
/* Check for valid data */
|
||||
if ((j = findnode(Tok[0])) == 0) return(203);
|
||||
if (!getfloat(Tok[1],&x)) return(202);
|
||||
if (!getfloat(Tok[2],&y)) return(202);
|
||||
|
||||
/* Add new data point to curve's linked list */
|
||||
fx = (SFloatlist *) malloc(sizeof(SFloatlist));
|
||||
fy = (SFloatlist *) malloc(sizeof(SFloatlist));
|
||||
if (fx == NULL || fy == NULL) return(101);
|
||||
fx->value = x;
|
||||
fx->next = c->x;
|
||||
c->x = fx;
|
||||
fy->value = y;
|
||||
fy->next = c->y;
|
||||
c->y = fy;
|
||||
//Curve[c->i].Npts++;
|
||||
|
||||
/* Save the pointer to this curve */
|
||||
PrevCoord = c;
|
||||
return(0);
|
||||
|
||||
/* Save coordn data */
|
||||
//Coord[Njuncs].X = x;
|
||||
//Coord[Njuncs].Y = y;
|
||||
|
||||
|
||||
/* Save coord data */
|
||||
strncpy(Coord[j].ID, Node[j].ID, MAXID);
|
||||
Coord[j].X = x;
|
||||
Coord[j].Y = y;
|
||||
Coord[j].HaveCoords = TRUE;
|
||||
|
||||
return(0);
|
||||
} /* end of coordata */
|
||||
|
||||
int demanddata()
|
||||
@@ -1370,7 +1346,7 @@ int reportdata()
|
||||
/* Check if input is a reporting criterion. */
|
||||
|
||||
/*** Special case needed to distinguish "HEAD" from "HEADLOSS" ***/ //(2.00.11 - LR)
|
||||
if (strcomp(Tok[0], w_HEADLOSS)) i = HEADLOSS; //(2.00.11 - LR)
|
||||
if (strcomp(Tok[0], t_HEADLOSS)) i = HEADLOSS;
|
||||
else i = findmatch(Tok[0],Fldname); //(2.00.11 - LR)
|
||||
if (i >= 0) //(2.00.11 - LR)
|
||||
/*****************************************************************/ //(2.00.11 - LR)
|
||||
|
||||
@@ -222,7 +222,8 @@ int runqual(long *t)
|
||||
long hydtime; /* Hydraulic solution time */
|
||||
long hydstep; /* Hydraulic time step */
|
||||
int errcode = 0;
|
||||
|
||||
int i;
|
||||
|
||||
/* Update reported simulation time */
|
||||
*t = Qtime;
|
||||
|
||||
@@ -236,11 +237,11 @@ int runqual(long *t)
|
||||
}
|
||||
else {
|
||||
// stepwise calculation - hydraulic results are already in memory
|
||||
for (int i=1; i<= Ntanks; ++i) {
|
||||
for (i=1; i<= Ntanks; ++i) {
|
||||
QTankVolumes[i-1] = Tank[i].V;
|
||||
}
|
||||
|
||||
for (int i=1; i<= Nlinks; ++i)
|
||||
for (i=1; i<= Nlinks; ++i)
|
||||
{
|
||||
if (LinkStatus[i] <= CLOSED) {
|
||||
QLinkFlow[i-1] = Q[i];
|
||||
@@ -251,11 +252,11 @@ int runqual(long *t)
|
||||
}
|
||||
else {
|
||||
// stepwise calculation
|
||||
for (int i=1; i<= Ntanks; ++i) {
|
||||
for (i=1; i<= Ntanks; ++i) {
|
||||
QTankVolumes[i-1] = Tank[i].V;
|
||||
}
|
||||
|
||||
for (int i=1; i<= Nlinks; ++i)
|
||||
for (i=1; i<= Nlinks; ++i)
|
||||
{
|
||||
if (LinkStatus[i] <= CLOSED) {
|
||||
QLinkFlow[i-1] = Q[i];
|
||||
@@ -281,7 +282,9 @@ int nextqual(long *tstep)
|
||||
{
|
||||
long hydstep; /* Hydraulic solution time step */
|
||||
int errcode = 0;
|
||||
|
||||
double *tankVolumes;
|
||||
int i;
|
||||
|
||||
/* Determine time step */
|
||||
*tstep = 0;
|
||||
|
||||
@@ -290,19 +293,17 @@ int nextqual(long *tstep)
|
||||
if (Htime <= Dur) hydstep = Htime - Qtime;
|
||||
else hydstep = 0;
|
||||
|
||||
double *tankVolumes;
|
||||
|
||||
// if we're operating in stepwise mode, capture the tank levels so we can restore them later.
|
||||
if (OpenHflag) {
|
||||
tankVolumes = calloc(Ntanks, sizeof(double));
|
||||
for (int i=1; i<=Ntanks; ++i) {
|
||||
for (i=1; i<=Ntanks; ++i) {
|
||||
if (Tank[i].A != 0) { // skip reservoirs
|
||||
tankVolumes[i-1] = Tank[i].V;
|
||||
}
|
||||
}
|
||||
|
||||
// restore the previous step's tank volumes
|
||||
for (int i=1; i<=Ntanks; i++) {
|
||||
for (i=1; i<=Ntanks; i++) {
|
||||
if (Tank[i].A != 0) { // skip reservoirs again
|
||||
int n = Tank[i].Node;
|
||||
Tank[i].V = QTankVolumes[i-1];
|
||||
@@ -311,7 +312,7 @@ int nextqual(long *tstep)
|
||||
}
|
||||
|
||||
// restore the previous step's pipe link flows
|
||||
for (int i=1; i<=Nlinks; i++) {
|
||||
for (i=1; i<=Nlinks; i++) {
|
||||
if (LinkStatus[i] <= CLOSED) {
|
||||
Q[i] = 0.0;
|
||||
}
|
||||
@@ -332,7 +333,7 @@ int nextqual(long *tstep)
|
||||
|
||||
// restore tank levels to post-runH state, if needed.
|
||||
if (OpenHflag) {
|
||||
for (int i=1; i<=Ntanks; i++) {
|
||||
for (i=1; i<=Ntanks; i++) {
|
||||
if (Tank[i].A != 0) { // skip reservoirs again
|
||||
int n = Tank[i].Node;
|
||||
Tank[i].V = tankVolumes[i-1];
|
||||
@@ -340,7 +341,7 @@ int nextqual(long *tstep)
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=1; i<=Nlinks; ++i) {
|
||||
for (i=1; i<=Nlinks; ++i) {
|
||||
if (LinkStatus[i] <= CLOSED) {
|
||||
Q[i] = QLinkFlow[i-1];
|
||||
}
|
||||
|
||||
@@ -1,332 +0,0 @@
|
||||
#include <map>
|
||||
#include <iomanip>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "testLemonTiger.h"
|
||||
#include "toolkit.h"
|
||||
|
||||
#define COLW 15
|
||||
#define OUTPRECISION 6
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef struct {
|
||||
double head;
|
||||
double demand;
|
||||
double quality;
|
||||
} nodeState_t;
|
||||
|
||||
typedef struct {
|
||||
double flow;
|
||||
} linkState_t;
|
||||
|
||||
typedef map<int, nodeState_t> networkNodeState_t; // nodeIndex, state
|
||||
typedef map<int, linkState_t> networkLinkState_t; // linkIndex, state
|
||||
|
||||
typedef struct {
|
||||
networkNodeState_t nodeState;
|
||||
networkLinkState_t linkState;
|
||||
} networkState_t;
|
||||
typedef map<long, networkState_t> result_t; // time, networkState
|
||||
// access results by, for instance, resultsContainer[time][nodeIndex].head
|
||||
|
||||
|
||||
|
||||
void checkErr(int err, std::string function);
|
||||
void saveHydResults(networkState_t* networkState);
|
||||
void saveQualResults(networkState_t* networkState);
|
||||
void printResults(result_t* state1, result_t* state2, std::ostream& out);
|
||||
void compare(result_t* results1, result_t* results2, std::ostream &out);
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
|
||||
// create storage structures for results.
|
||||
result_t epanetResults, lemonTigerResults;
|
||||
|
||||
cout << "Lemon Tiger TEST" << endl
|
||||
<< "________________" << endl;
|
||||
|
||||
|
||||
long simulationTime = 0;
|
||||
long nextEventH = 0, nextEventQ = 0;
|
||||
long simTimeRemaining = 0;
|
||||
|
||||
try {
|
||||
|
||||
/* Batch solver (old epanet) */
|
||||
cout << "*****Original EPANET results******" << endl;
|
||||
checkErr( ENopen(argv[1], argv[2], (char*)""), "ENopen" );
|
||||
|
||||
checkErr( ENopenH(), "ENopenH" );
|
||||
checkErr( ENinitH(EN_SAVE), "ENinitH" );
|
||||
|
||||
cout << "Running hydraulics..." << endl;
|
||||
do {
|
||||
|
||||
/* Solve for hydraulics & advance to next time period */
|
||||
checkErr( ENrunH(&simulationTime), "ENrunH" );
|
||||
checkErr( ENnextH(&nextEventH), "ENnextH" );
|
||||
|
||||
// gather hydraulic results
|
||||
saveHydResults(&epanetResults[simulationTime]);
|
||||
|
||||
|
||||
|
||||
} while (nextEventH > 0);
|
||||
// hydraulics are done
|
||||
checkErr( ENcloseH(), "ENcloseH" );
|
||||
cout << "\t\t\tdone." << endl;
|
||||
cout << "Running WQ..." << endl;
|
||||
|
||||
checkErr( ENopenQ(), "ENopenQ" );
|
||||
checkErr( ENinitQ(EN_NOSAVE), "ENinitQ" );
|
||||
|
||||
do {
|
||||
|
||||
checkErr( ENrunQ(&simulationTime), "ENrunQ" );
|
||||
checkErr( ENnextQ(&nextEventH), "ENstepQ" );
|
||||
|
||||
// gather quality results
|
||||
saveQualResults(&epanetResults[simulationTime]);
|
||||
|
||||
} while (nextEventH > 0);
|
||||
// water quality is done
|
||||
checkErr( ENcloseQ(), "ENcloseQ" );
|
||||
cout << "\t\t\tdone." << endl;
|
||||
|
||||
// everything is done
|
||||
checkErr( ENclose(), "ENclose" );
|
||||
|
||||
|
||||
nextEventH = 0;
|
||||
simTimeRemaining = 0;
|
||||
simulationTime = 0;
|
||||
|
||||
/* stepwise solver (LemonTiger) */
|
||||
cout << "*****LemonTiger results******" << endl;
|
||||
|
||||
checkErr( ENopen(argv[1], argv[2], (char*)""), "ENopen" );
|
||||
|
||||
checkErr( ENopenH(), "ENopenH" );
|
||||
checkErr( ENinitH(EN_NOSAVE), "ENinitH" );
|
||||
checkErr( ENopenQ(), "ENopenQ" );
|
||||
checkErr( ENinitQ(EN_NOSAVE), "ENinitQ" );
|
||||
|
||||
cout << "Running stepwise hydraulics and water quality..." << endl;
|
||||
do {
|
||||
/* Solve for hydraulics & advance to next time period */
|
||||
checkErr( ENrunH(&simulationTime), "ENrunH" );
|
||||
checkErr( ENrunQ(&simulationTime), "ENrunQ" );
|
||||
|
||||
checkErr( ENnextH(&nextEventH), "ENnextH" );
|
||||
checkErr( ENnextQ(&nextEventQ), "ENstepQ" );
|
||||
|
||||
|
||||
saveHydResults(&lemonTigerResults[simulationTime]);
|
||||
saveQualResults(&lemonTigerResults[simulationTime]);
|
||||
|
||||
|
||||
} while (nextEventH > 0);
|
||||
cout << "\t\t\tdone." << endl;
|
||||
|
||||
// all done
|
||||
checkErr( ENcloseH(), "ENcloseH" );
|
||||
checkErr( ENcloseQ(), "ENcloseQ" );
|
||||
checkErr( ENclose(), "ENclose" );
|
||||
|
||||
|
||||
// summarize the results
|
||||
printResults(&epanetResults, &lemonTigerResults, cout);
|
||||
compare(&epanetResults, &lemonTigerResults, cout);
|
||||
|
||||
} catch (int err) {
|
||||
cerr << "exiting with error " << err << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void saveHydResults(networkState_t* networkState) {
|
||||
int nNodes, nLinks;
|
||||
float head, demand, flow;
|
||||
ENgetcount(EN_NODECOUNT, &nNodes);
|
||||
ENgetcount(EN_LINKCOUNT, &nLinks);
|
||||
for (int iNode = 1; iNode <= nNodes; ++iNode) {
|
||||
ENgetnodevalue(iNode, EN_HEAD, &head);
|
||||
ENgetnodevalue(iNode, EN_DEMAND, &demand);
|
||||
(*networkState).nodeState[iNode].head = head;
|
||||
(*networkState).nodeState[iNode].demand = demand;
|
||||
}
|
||||
for (int iLink = 1; iLink <= nLinks; ++iLink) {
|
||||
ENgetlinkvalue(iLink, EN_FLOW, &flow);
|
||||
(*networkState).linkState[iLink].flow = flow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void saveQualResults(networkState_t* networkState) {
|
||||
int nNodes;
|
||||
float quality;
|
||||
ENgetcount(EN_NODECOUNT, &nNodes);
|
||||
|
||||
for (int iNode = 1; iNode <= nNodes; iNode++) {
|
||||
ENgetnodevalue(iNode, EN_QUALITY, &quality);
|
||||
(*networkState).nodeState[iNode].quality = quality;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void printResults(result_t* results1, result_t* results2, std::ostream &out) {
|
||||
|
||||
result_t::const_iterator resultIterator;
|
||||
|
||||
for (resultIterator = (*results1).begin(); resultIterator != (*results1).end(); ++resultIterator) {
|
||||
// get the current frame
|
||||
const long time = resultIterator->first;
|
||||
const networkNodeState_t networkNodeState1= resultIterator->second.nodeState;
|
||||
//nodeState1 = resultIterator->second.nodeState;
|
||||
const networkLinkState_t networkLinkState1 = resultIterator->second.linkState;
|
||||
//linkState1 = resultIterator->second.linkState;
|
||||
|
||||
// see if this time is indexed in the second state container
|
||||
if ((*results2).find(time) == (*results2).end()) {
|
||||
// nope.
|
||||
out << "time " << time << " not found in second result set" << endl;
|
||||
}
|
||||
else {
|
||||
// get the second result set's state
|
||||
const networkNodeState_t networkNodeState2 = (*results2)[time].nodeState;
|
||||
const networkLinkState_t networkLinkState2 = (*results2)[time].linkState;
|
||||
// print the current simulation time
|
||||
out << left;
|
||||
out << setfill('*') << setw(100) << "*" << endl;
|
||||
out << setfill(' ');
|
||||
out << setw(4) << "T = " << setw(6) << time;
|
||||
out << "|" << setw(3*COLW) << "EPANET";
|
||||
out << "|" << setw(3*COLW) << "LemonTiger" << endl;
|
||||
out << setw(10) << "Index" << "|";
|
||||
out << setw(COLW) << "Demand" << setw(COLW) << "Head" << setw(COLW) << "Quality" << "|";
|
||||
out << setw(COLW) << "Demand" << setw(COLW) << "Head" << setw(COLW) << "Quality" << endl;
|
||||
out << setprecision(OUTPRECISION);
|
||||
|
||||
// loop through the nodes in the networkState objs, and print out the results for this time period
|
||||
networkNodeState_t::const_iterator networkNodeIterator;
|
||||
for (networkNodeIterator = networkNodeState1.begin(); networkNodeIterator != networkNodeState1.end(); ++networkNodeIterator) {
|
||||
int nodeIndex = networkNodeIterator->first;
|
||||
// trusting that all nodes are present...
|
||||
const nodeState_t nodeState1 = networkNodeIterator->second;
|
||||
const nodeState_t nodeState2 = networkNodeState2.at(nodeIndex);
|
||||
|
||||
if (nodeState1.quality != nodeState2.quality ) {
|
||||
// epanet
|
||||
out << setw(10) << nodeIndex << "|";
|
||||
out << setw(COLW) << nodeState1.demand;
|
||||
out << setw(COLW) << nodeState1.head;
|
||||
out << setw(COLW) << nodeState1.quality;
|
||||
|
||||
// lemontiger
|
||||
out << "|";
|
||||
out << setw(COLW) << nodeState2.demand;
|
||||
out << setw(COLW) << nodeState2.head;
|
||||
out << setw(COLW) << nodeState2.quality;
|
||||
out << endl;
|
||||
}
|
||||
}
|
||||
|
||||
networkLinkState_t::const_iterator networkLinkIterator;
|
||||
for (networkLinkIterator = networkLinkState1.begin(); networkLinkIterator != networkLinkState1.end(); ++networkLinkIterator) {
|
||||
int linkIndex = networkLinkIterator->first;
|
||||
// trusting that all nodes are present...
|
||||
const linkState_t linkState1 = networkLinkIterator->second;
|
||||
const linkState_t linkState2 = networkLinkState2.at(linkIndex);
|
||||
|
||||
if ( linkState1.flow != linkState2.flow ) {
|
||||
// epanet
|
||||
out << setw(10) << linkIndex << "|";
|
||||
out << setw(COLW) << linkState1.flow;
|
||||
|
||||
// lemontiger
|
||||
out << "|";
|
||||
out << setw(COLW) << linkState2.flow;
|
||||
out << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void compare(result_t* results1, result_t* results2, std::ostream &out) {
|
||||
|
||||
double sumHeadDiff=0, sumDemandDiff=0, sumQualDiff=0, sumFlowDiff=0;
|
||||
|
||||
result_t::const_iterator resultIterator;
|
||||
|
||||
for (resultIterator = (*results1).begin(); resultIterator != (*results1).end(); ++resultIterator) {
|
||||
// get the current frame
|
||||
const long time = resultIterator->first;
|
||||
const networkNodeState_t nodeState1 = resultIterator->second.nodeState;
|
||||
const networkLinkState_t linkState1 = resultIterator->second.linkState;
|
||||
|
||||
// see if this time is indexed in the second state container
|
||||
if ((*results2).find(time) == (*results2).end()) {
|
||||
// nope.
|
||||
out << "time " << time << " not found in second result set" << endl;
|
||||
}
|
||||
else {
|
||||
// get the second result set's state
|
||||
const networkNodeState_t networkNodeState2 = (*results2)[time].nodeState;
|
||||
const networkLinkState_t networkLinkState2 = (*results2)[time].linkState;
|
||||
double qualD=0;
|
||||
|
||||
networkNodeState_t::const_iterator networkNodeIterator;
|
||||
for (networkNodeIterator = nodeState1.begin(); networkNodeIterator != nodeState1.end(); ++networkNodeIterator) {
|
||||
int nodeIndex = networkNodeIterator->first;
|
||||
// trusting that all nodes are present...
|
||||
const nodeState_t nodeState1 = networkNodeIterator->second;
|
||||
const nodeState_t nodeState2 = networkNodeState2.at(nodeIndex);
|
||||
|
||||
sumHeadDiff += fabs(nodeState1.head - nodeState2.head);
|
||||
sumDemandDiff += fabs(nodeState1.demand - nodeState2.demand);
|
||||
|
||||
qualD += fabs(nodeState1.quality - nodeState2.quality);
|
||||
}
|
||||
//out << "T: " << time << " dq: " << setprecision(20) << qualD << endl;
|
||||
sumQualDiff += qualD;
|
||||
|
||||
networkLinkState_t::const_iterator networkLinkIterator;
|
||||
for (networkLinkIterator = linkState1.begin(); networkLinkIterator != linkState1.end(); ++networkLinkIterator) {
|
||||
int linkIndex = networkLinkIterator->first;
|
||||
// trusting that all nodes are present...
|
||||
const linkState_t linkState1 = networkLinkIterator->second;
|
||||
const linkState_t linkState2 = networkLinkState2.at(linkIndex);
|
||||
|
||||
sumFlowDiff += fabs(linkState1.flow - linkState2.flow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int c1 = 18;
|
||||
int p = 20;
|
||||
out << setw(c1) << "Head Diff:" << setprecision(p) << sumHeadDiff << endl;
|
||||
out << setw(c1) << "Demand Diff:" << setprecision(p) << sumDemandDiff << endl;
|
||||
out << setw(c1) << "Quality Diff:" << setprecision(p) << sumQualDiff << endl;
|
||||
out << setw(c1) << "Flow Diff:" << setprecision(p) << sumFlowDiff << endl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void checkErr(int err, std::string function) {
|
||||
if (err > 0) {
|
||||
cerr << "Error in " << function << ": " << err << endl;
|
||||
char errmsg[1024];
|
||||
ENgeterror(err, errmsg, 1024);
|
||||
cerr << errmsg << endl;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// testLemonTiger.h
|
||||
// epanet
|
||||
//
|
||||
// Created by Sam Hatchett on 2/1/13.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef __epanet__testLemonTiger__
|
||||
#define __epanet__testLemonTiger__
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#endif /* defined(__epanet__testLemonTiger__) */
|
||||
@@ -493,6 +493,10 @@ AUTHOR: L. Rossman
|
||||
#define ERR250 "Input Error 250: function call contains invalid format."
|
||||
#define ERR251 "Input Error 251: function call contains invalid parameter code."
|
||||
|
||||
#define ERR253 "Input Error 253: Function call error - No such demand category index."
|
||||
#define ERR254 "Input Error 254: Function call error - Node have no coordinates."
|
||||
#define ERR255 "Input Error 255: Function call error - Coordinates were not loaded."
|
||||
|
||||
#define ERR301 "File Error 301: identical file names."
|
||||
#define ERR302 "File Error 302: cannot open input file."
|
||||
#define ERR303 "File Error 303: cannot open report file."
|
||||
|
||||
255
src/toolkit.h
255
src/toolkit.h
@@ -1,255 +0,0 @@
|
||||
/*
|
||||
*******************************************************************
|
||||
|
||||
TOOLKIT.H - Prototypes for EPANET Functions Exported to DLL Toolkit
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
10/25/00
|
||||
3/1/01
|
||||
8/15/07 (2.00.11)
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
*******************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifndef DLLEXPORT
|
||||
#ifdef DLL
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#define DLLEXPORT __declspec(dllexport) __stdcall
|
||||
#endif
|
||||
#elif defined(CYGWIN)
|
||||
#define DLLEXPORT __stdcall
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// --- Define the EPANET toolkit constants
|
||||
|
||||
#define EN_ELEVATION 0 /* Node parameters */
|
||||
#define EN_BASEDEMAND 1
|
||||
#define EN_PATTERN 2
|
||||
#define EN_EMITTER 3
|
||||
#define EN_INITQUAL 4
|
||||
#define EN_SOURCEQUAL 5
|
||||
#define EN_SOURCEPAT 6
|
||||
#define EN_SOURCETYPE 7
|
||||
#define EN_TANKLEVEL 8
|
||||
#define EN_DEMAND 9
|
||||
#define EN_HEAD 10
|
||||
#define EN_PRESSURE 11
|
||||
#define EN_QUALITY 12
|
||||
#define EN_SOURCEMASS 13
|
||||
#define EN_INITVOLUME 14
|
||||
#define EN_MIXMODEL 15
|
||||
#define EN_MIXZONEVOL 16
|
||||
|
||||
#define EN_TANKDIAM 17
|
||||
#define EN_MINVOLUME 18
|
||||
#define EN_VOLCURVE 19
|
||||
#define EN_MINLEVEL 20
|
||||
#define EN_MAXLEVEL 21
|
||||
#define EN_MIXFRACTION 22
|
||||
#define EN_TANK_KBULK 23
|
||||
#define EN_TANKVOLUME 24
|
||||
#define EN_MAXVOLUME 25
|
||||
|
||||
#define EN_DIAMETER 0 /* Link parameters */
|
||||
#define EN_LENGTH 1
|
||||
#define EN_ROUGHNESS 2
|
||||
#define EN_MINORLOSS 3
|
||||
#define EN_INITSTATUS 4
|
||||
#define EN_INITSETTING 5
|
||||
#define EN_KBULK 6
|
||||
#define EN_KWALL 7
|
||||
#define EN_FLOW 8
|
||||
#define EN_VELOCITY 9
|
||||
#define EN_HEADLOSS 10
|
||||
#define EN_STATUS 11
|
||||
#define EN_SETTING 12
|
||||
#define EN_ENERGY 13
|
||||
#define EN_LINKQUAL 14 /* TNT */
|
||||
#define EN_LINKPATTERN 15
|
||||
|
||||
#define EN_DURATION 0 /* Time parameters */
|
||||
#define EN_HYDSTEP 1
|
||||
#define EN_QUALSTEP 2
|
||||
#define EN_PATTERNSTEP 3
|
||||
#define EN_PATTERNSTART 4
|
||||
#define EN_REPORTSTEP 5
|
||||
#define EN_REPORTSTART 6
|
||||
#define EN_RULESTEP 7
|
||||
#define EN_STATISTIC 8
|
||||
#define EN_PERIODS 9
|
||||
#define EN_STARTTIME 10 /* Added TNT 10/2/2009 */
|
||||
#define EN_HTIME 11
|
||||
#define EN_HALTFLAG 12
|
||||
#define EN_NEXTEVENT 13
|
||||
|
||||
#define EN_ITERATIONS 0
|
||||
#define EN_RELATIVEERROR 1
|
||||
|
||||
#define EN_NODECOUNT 0 /* Component counts */
|
||||
#define EN_TANKCOUNT 1
|
||||
#define EN_LINKCOUNT 2
|
||||
#define EN_PATCOUNT 3
|
||||
#define EN_CURVECOUNT 4
|
||||
#define EN_CONTROLCOUNT 5
|
||||
|
||||
#define EN_JUNCTION 0 /* Node types */
|
||||
#define EN_RESERVOIR 1
|
||||
#define EN_TANK 2
|
||||
|
||||
#define EN_CVPIPE 0 /* Link types. */
|
||||
#define EN_PIPE 1 /* See LinkType in TYPES.H */
|
||||
#define EN_PUMP 2
|
||||
#define EN_PRV 3
|
||||
#define EN_PSV 4
|
||||
#define EN_PBV 5
|
||||
#define EN_FCV 6
|
||||
#define EN_TCV 7
|
||||
#define EN_GPV 8
|
||||
|
||||
#define EN_NONE 0 /* Quality analysis types. */
|
||||
#define EN_CHEM 1 /* See QualType in TYPES.H */
|
||||
#define EN_AGE 2
|
||||
#define EN_TRACE 3
|
||||
|
||||
#define EN_CONCEN 0 /* Source quality types. */
|
||||
#define EN_MASS 1 /* See SourceType in TYPES.H. */
|
||||
#define EN_SETPOINT 2
|
||||
#define EN_FLOWPACED 3
|
||||
|
||||
#define EN_CFS 0 /* Flow units types. */
|
||||
#define EN_GPM 1 /* See FlowUnitsType */
|
||||
#define EN_MGD 2 /* in TYPES.H. */
|
||||
#define EN_IMGD 3
|
||||
#define EN_AFD 4
|
||||
#define EN_LPS 5
|
||||
#define EN_LPM 6
|
||||
#define EN_MLD 7
|
||||
#define EN_CMH 8
|
||||
#define EN_CMD 9
|
||||
|
||||
#define EN_TRIALS 0 /* Misc. options */
|
||||
#define EN_ACCURACY 1
|
||||
#define EN_TOLERANCE 2
|
||||
#define EN_EMITEXPON 3
|
||||
#define EN_DEMANDMULT 4
|
||||
|
||||
#define EN_LOWLEVEL 0 /* Control types. */
|
||||
#define EN_HILEVEL 1 /* See ControlType */
|
||||
#define EN_TIMER 2 /* in TYPES.H. */
|
||||
#define EN_TIMEOFDAY 3
|
||||
|
||||
#define EN_AVERAGE 1 /* Time statistic types. */
|
||||
#define EN_MINIMUM 2 /* See TstatType in TYPES.H */
|
||||
#define EN_MAXIMUM 3
|
||||
#define EN_RANGE 4
|
||||
|
||||
#define EN_MIX1 0 /* Tank mixing models */
|
||||
#define EN_MIX2 1
|
||||
#define EN_FIFO 2
|
||||
#define EN_LIFO 3
|
||||
|
||||
#define EN_NOSAVE 0 /* Save-results-to-file flag */
|
||||
#define EN_SAVE 1
|
||||
|
||||
#define EN_INITFLOW 10 /* Re-initialize flows flag */
|
||||
|
||||
#define EN_CONST_HP 0 /* constant horsepower */
|
||||
#define EN_POWER_FUNC 1 /* power function */
|
||||
#define EN_CUSTOM 2 /* user-defined custom curve */
|
||||
|
||||
// --- Declare the EPANET toolkit functions
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
int DLLEXPORT ENepanet(char *, char *, char *, void (*) (char *));
|
||||
|
||||
int DLLEXPORT ENopen(char *, char *, char *);
|
||||
int DLLEXPORT ENsaveinpfile(char *);
|
||||
int DLLEXPORT ENclose(void);
|
||||
|
||||
int DLLEXPORT ENsolveH(void);
|
||||
int DLLEXPORT ENsaveH(void);
|
||||
int DLLEXPORT ENopenH(void);
|
||||
int DLLEXPORT ENinitH(int);
|
||||
int DLLEXPORT ENrunH(long *);
|
||||
int DLLEXPORT ENnextH(long *);
|
||||
int DLLEXPORT ENcloseH(void);
|
||||
int DLLEXPORT ENsavehydfile(char *);
|
||||
int DLLEXPORT ENusehydfile(char *);
|
||||
|
||||
int DLLEXPORT ENsolveQ(void);
|
||||
int DLLEXPORT ENopenQ(void);
|
||||
int DLLEXPORT ENinitQ(int);
|
||||
int DLLEXPORT ENrunQ(long *);
|
||||
int DLLEXPORT ENnextQ(long *);
|
||||
int DLLEXPORT ENstepQ(long *);
|
||||
int DLLEXPORT ENcloseQ(void);
|
||||
|
||||
int DLLEXPORT ENwriteline(char *);
|
||||
int DLLEXPORT ENreport(void);
|
||||
int DLLEXPORT ENresetreport(void);
|
||||
int DLLEXPORT ENsetreport(char *);
|
||||
|
||||
int DLLEXPORT ENgetcontrol(int, int *, int *, float *,
|
||||
int *, float *);
|
||||
int DLLEXPORT ENgetcount(int, int *);
|
||||
int DLLEXPORT ENgetoption(int, float *);
|
||||
int DLLEXPORT ENgettimeparam(int, long *);
|
||||
int DLLEXPORT ENgetflowunits(int *);
|
||||
int DLLEXPORT ENgetpatternindex(char *, int *);
|
||||
int DLLEXPORT ENgetpatternid(int, char *);
|
||||
int DLLEXPORT ENgetpatternlen(int, int *);
|
||||
int DLLEXPORT ENgetpatternvalue(int, int, float *);
|
||||
int DLLEXPORT ENgetqualtype(int *, int *);
|
||||
int DLLEXPORT ENgeterror(int, char *, int);
|
||||
int DLLEXPORT ENgetstatistic(int code, int* value);
|
||||
|
||||
int DLLEXPORT ENgetnodeindex(char *, int *);
|
||||
int DLLEXPORT ENgetnodeid(int, char *);
|
||||
int DLLEXPORT ENgetnodetype(int, int *);
|
||||
int DLLEXPORT ENgetnodevalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetnumdemands(int, int *);
|
||||
int DLLEXPORT ENgetbasedemand(int, int, float *);
|
||||
int DLLEXPORT ENgetdemandpattern(int, int, int *);
|
||||
|
||||
int DLLEXPORT ENgetlinkindex(char *, int *);
|
||||
int DLLEXPORT ENgetlinkid(int, char *);
|
||||
int DLLEXPORT ENgetlinktype(int, int *);
|
||||
int DLLEXPORT ENgetlinknodes(int, int *, int *);
|
||||
int DLLEXPORT ENgetlinkvalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetcurve(int curveIndex, int *nValues, float **xValues, float **yValues);
|
||||
int DLLEXPORT ENgetheadcurve(int, char *);
|
||||
int DLLEXPORT ENgetpumptype(int, int *);
|
||||
|
||||
int DLLEXPORT ENgetversion(int *);
|
||||
|
||||
int DLLEXPORT ENsetcontrol(int, int, int, float, int, float);
|
||||
int DLLEXPORT ENsetnodevalue(int, int, float);
|
||||
int DLLEXPORT ENsetlinkvalue(int, int, float);
|
||||
int DLLEXPORT ENaddpattern(char *);
|
||||
int DLLEXPORT ENsetpattern(int, float *, int);
|
||||
int DLLEXPORT ENsetpatternvalue(int, int, float);
|
||||
int DLLEXPORT ENsettimeparam(int, long);
|
||||
int DLLEXPORT ENsetoption(int, float);
|
||||
int DLLEXPORT ENsetstatusreport(int);
|
||||
int DLLEXPORT ENsetqualtype(int, char *, char *, char *);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@ AUTHOR: L. Rossman
|
||||
Definition of 4-byte integers & reals
|
||||
-------------------------------------------
|
||||
*/
|
||||
typedef double REAL4; //(2.00.11 - LR)
|
||||
typedef float REAL4; //(2.00.11 - LR)
|
||||
typedef int INT4; //(2.00.12 - LR)
|
||||
|
||||
/*
|
||||
@@ -169,9 +169,10 @@ typedef struct /* CURVE OBJECT */
|
||||
|
||||
typedef struct /* Coord OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Coord ID */
|
||||
double *X; /* X-values */
|
||||
double *Y; /* Y-values */
|
||||
char ID[MAXID+1]; /* Coord ID */
|
||||
double X; /* X-value */
|
||||
double Y; /* Y-value */
|
||||
char HaveCoords; /* Coordinates flag */
|
||||
} Scoord;
|
||||
|
||||
struct Sdemand /* DEMAND CATEGORY OBJECT */
|
||||
|
||||
32
src/vars.h
32
src/vars.h
@@ -17,15 +17,15 @@ AUTHOR: L. Rossman
|
||||
#include <stdio.h>
|
||||
#include "hash.h"
|
||||
|
||||
FILE *InFile, /* Input file pointer */
|
||||
EXTERN FILE *InFile, /* Input file pointer */
|
||||
*OutFile, /* Output file pointer */
|
||||
*RptFile, /* Report file pointer */
|
||||
*HydFile, /* Hydraulics file pointer */
|
||||
*TmpOutFile; /* Temporary file handle */
|
||||
long HydOffset, /* Hydraulics file byte offset */
|
||||
EXTERN long HydOffset, /* Hydraulics file byte offset */
|
||||
OutOffset1, /* 1st output file byte offset */
|
||||
OutOffset2; /* 2nd output file byte offset */
|
||||
char Msg[MAXMSG+1], /* Text of output message */
|
||||
EXTERN char Msg[MAXMSG+1], /* Text of output message */
|
||||
InpFname[MAXFNAME+1], /* Input file name */
|
||||
Rpt1Fname[MAXFNAME+1], /* Primary report file name */
|
||||
Rpt2Fname[MAXFNAME+1], /* Secondary report file name */
|
||||
@@ -64,8 +64,9 @@ AUTHOR: L. Rossman
|
||||
SaveHflag, /* Hydraul. results saved flag */
|
||||
OpenQflag, /* Quality system opened flag */
|
||||
SaveQflag, /* Quality results saved flag */
|
||||
Saveflag; /* General purpose save flag */
|
||||
int MaxNodes, /* Node count from input file */
|
||||
Saveflag, /* General purpose save flag */
|
||||
Coordflag; /* Load coordinates flag */
|
||||
EXTERN int MaxNodes, /* Node count from input file */
|
||||
MaxLinks, /* Link count from input file */
|
||||
MaxJuncs, /* Junction count */
|
||||
MaxPipes, /* Pipe count */
|
||||
@@ -76,7 +77,6 @@ AUTHOR: L. Rossman
|
||||
MaxRules, /* Rule count */
|
||||
MaxPats, /* Pattern count */
|
||||
MaxCurves, /* Curve count */
|
||||
MaxCoords, /* Coords count */
|
||||
Nnodes, /* Number of network nodes */
|
||||
Ntanks, /* Number of tanks */
|
||||
Njuncs, /* Number of junction nodes */
|
||||
@@ -88,7 +88,6 @@ AUTHOR: L. Rossman
|
||||
Nrules, /* Number of control rules */
|
||||
Npats, /* Number of time patterns */
|
||||
Ncurves, /* Number of data curves */
|
||||
Ncoords, /* Number of Coords */
|
||||
Nperiods, /* Number of reporting periods */
|
||||
Ncoeffs, /* Number of non-0 matrix coeffs*/
|
||||
DefPat, /* Default demand pattern */
|
||||
@@ -99,7 +98,7 @@ AUTHOR: L. Rossman
|
||||
PageSize, /* Lines/page in output report */
|
||||
CheckFreq, /* Hydraulics solver parameter */
|
||||
MaxCheck; /* Hydraulics solver parameter */
|
||||
double Ucf[MAXVAR], /* Unit conversion factors */
|
||||
EXTERN double Ucf[MAXVAR], /* Unit conversion factors */
|
||||
Ctol, /* Water quality tolerance */
|
||||
Htol, /* Hydraulic head tolerance */
|
||||
Qtol, /* Flow rate tolerance */
|
||||
@@ -128,7 +127,7 @@ AUTHOR: L. Rossman
|
||||
Wwall, /* Avg. wall reaction rate */
|
||||
Wtank, /* Avg. tank reaction rate */
|
||||
Wsource; /* Avg. mass inflow */
|
||||
long Tstart, /* Starting time of day (sec) */
|
||||
EXTERN long Tstart, /* Starting time of day (sec) */
|
||||
Hstep, /* Nominal hyd. time step (sec) */
|
||||
Qstep, /* Quality time step (sec) */
|
||||
Pstep, /* Time pattern time step (sec) */
|
||||
@@ -141,12 +140,12 @@ AUTHOR: L. Rossman
|
||||
Hydstep, /* Actual hydraulic time step */
|
||||
Rulestep, /* Rule evaluation time step */
|
||||
Dur; /* Duration of simulation (sec) */
|
||||
SField Field[MAXVAR]; /* Output reporting fields */
|
||||
EXTERN SField Field[MAXVAR]; /* Output reporting fields */
|
||||
|
||||
/* Array pointers not allocated and freed in same routine */
|
||||
char *LinkStatus, /* Link status */
|
||||
EXTERN char *LinkStatus, /* Link status */
|
||||
*OldStat; /* Previous link/tank status */
|
||||
double *NodeDemand, /* Node actual demand */
|
||||
EXTERN double *NodeDemand, /* Node actual demand */
|
||||
*NodeQual, /* Node actual quality */
|
||||
*E, /* Emitter flows */
|
||||
*LinkSetting, /* Link settings */
|
||||
@@ -159,7 +158,6 @@ EXTERN double *QTankVolumes;
|
||||
EXTERN double *QLinkFlow;
|
||||
EXTERN STmplist *Patlist; /* Temporary time pattern list */
|
||||
EXTERN STmplist *Curvelist; /* Temporary list of curves */
|
||||
EXTERN STmplist *Coordlist; /* Temporary list of coordinates*/
|
||||
EXTERN Spattern *Pattern; /* Time patterns */
|
||||
EXTERN Scurve *Curve; /* Curve data */
|
||||
EXTERN Scoord *Coord; /* Coordinate data */
|
||||
@@ -194,19 +192,19 @@ EXTERN int _iterations; /* Info about hydraulic solution */
|
||||
** The following arrays are used to efficiently manage this sparsity:
|
||||
*/
|
||||
|
||||
double *Aii, /* Diagonal coeffs. of A */
|
||||
EXTERN double *Aii, /* Diagonal coeffs. of A */
|
||||
*Aij, /* Non-zero, off-diagonal coeffs. of A */
|
||||
*F; /* Right hand side coeffs. */
|
||||
double *P, /* Inverse headloss derivatives */
|
||||
EXTERN double *P, /* Inverse headloss derivatives */
|
||||
*Y; /* Flow correction factors */
|
||||
int *Order, /* Node-to-row of A */
|
||||
EXTERN int *Order, /* Node-to-row of A */
|
||||
*Row, /* Row-to-node of A */
|
||||
*Ndx; /* Index of link's coeff. in Aij */
|
||||
/*
|
||||
** The following arrays store the positions of the non-zero coeffs.
|
||||
** of the lower triangular portion of A whose values are stored in Aij:
|
||||
*/
|
||||
int *XLNZ, /* Start position of each column in NZSUB */
|
||||
EXTERN int *XLNZ, /* Start position of each column in NZSUB */
|
||||
*NZSUB, /* Row index of each coeff. in each column */
|
||||
*LNZ; /* Position of each coeff. in Aij array */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user