Commit b63cb844 authored by 刘乐's avatar 刘乐

1 ddd

parent 734492ef
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{6a4f723d-c24b-4b16-a230-9c39a379f082}</ProjectGuid>
<RootNamespace>funcDemo</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</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>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<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|x64'">
<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>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\hModelProgram\Program\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(OUTDIR)..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>pandaAnalysis.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OUTDIR)..\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
#include <iostream>
#include <libpq-fe.h>
#include "CivHydrCalc.h"
#include "CivHydrFuncInterface.h"
int main(int argc, char* argv[])
{
const char* uri = "host=192.168.12.7 port=5432 dbname=2222 user=postgres password=admin";
char* findUri = const_cast<char*>(uri);
CivHydrCalc* calc = new CivHydrCalc(findUri, std::string("ˮģ"));
char fileName[20];
char rptR[20];
char outBinFile[20];
......@@ -16,9 +15,9 @@ int main(int argc, char* argv[])
strcpy_s(rptR, "test.rpt");
strcpy_s(outBinFile, "test.bin");
// calc->exportInp(fileName);
calc->hydrSimulation(fileName, rptR, outBinFile);
delete calc;
return 0;
bool msg = hydrSimulation(findUri, std::string("ˮģ"), fileName, rptR, outBinFile);
std::cout << msg << std::endl;
getchar();
return 0;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Page 1 Fri Jun 12 11:05:01 2020
******************************************************************
* E P A N E T *
* Hydraulic and Water Quality *
* Analysis for Pipe Networks *
* Version 2.1 *
******************************************************************
Scenario: Base
Date:
Input Data File ................... test.inp
Number of Junctions................ 730
Number of Reservoirs............... 1
Number of Tanks ................... 0
Number of Pipes ................... 753
Number of Pumps ................... 2
Number of Valves .................. 1
Headloss Formula .................. Hazen-Williams
Hydraulic Timestep ................ 1.00 hrs
Hydraulic Accuracy ................ 0.001000
Status Check Frequency ............ 2
Maximum Trials Checked ............ 10
Damping Limit Threshold ........... 0.000000
Maximum Trials .................... 40
Quality Analysis .................. Age
Water Quality Time Step ........... 6.00 min
Water Quality Tolerance ........... 0.01 hrs
Specific Gravity .................. 1.00
Relative Kinematic Viscosity ...... 0.10
Relative Chemical Diffusivity ..... 1.00
Demand Multiplier ................. 1.00
Total Duration .................... 24.00 hrs
Reporting Criteria:
No Nodes
No Links
Analysis begun Fri Jun 12 11:05:01 2020
 正在生成代码
Previous IPDB not found, fall back to full compilation.
All 68 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
funcDemo.vcxproj -> E:\work\workspace\hydraulicModelCode\hydraulicModel\funcDemo\..\..\hModelProgram\Program\funcDemo.exe
B^E:\WORK\WORKSPACE\HYDRAULICMODELCODE\HYDRAULICMODEL\FUNCDEMO\MAIN.CPP
B^E:\WORK\WORKSPACE\HYDRAULICMODELCODE\HYDRAULICMODEL\FUNCDEMO\MAIN.CPP
B^E:\WORK\WORKSPACE\HYDRAULICMODELCODE\HYDRAULICMODEL\FUNCDEMO\MAIN.CPP
PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.26.28801:TargetPlatformVersion=10.0.18362.0:
Release|x64|E:\work\workspace\hydraulicModelCode\hydraulicModel\|
B^E:\work\workspace\hydraulicModelCode\hydraulicModel\funcDemo\funcDemo.vcxproj
B^E:\WORK\WORKSPACE\HYDRAULICMODELCODE\HYDRAULICMODEL\FUNCDEMO\X64\RELEASE\MAIN.OBJ
B^E:\WORK\WORKSPACE\HYDRAULICMODELCODE\HYDRAULICMODEL\FUNCDEMO\X64\RELEASE\MAIN.OBJ
B^E:\WORK\WORKSPACE\HYDRAULICMODELCODE\HYDRAULICMODEL\FUNCDEMO\X64\RELEASE\MAIN.OBJ
......@@ -13,6 +13,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pandaHydrCalcMiddle", "pand
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pandaHydrDemo", "pandaHydrDemo\pandaHydrDemo.csproj", "{5BDF427E-7ACB-4CE9-95B2-CCD9EA5879CD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "funcDemo", "funcDemo\funcDemo.vcxproj", "{6A4F723D-C24B-4B16-A230-9C39A379F082}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -75,6 +77,16 @@ Global
{5BDF427E-7ACB-4CE9-95B2-CCD9EA5879CD}.Release|x64.Build.0 = Release|Any CPU
{5BDF427E-7ACB-4CE9-95B2-CCD9EA5879CD}.Release|x86.ActiveCfg = Release|Any CPU
{5BDF427E-7ACB-4CE9-95B2-CCD9EA5879CD}.Release|x86.Build.0 = Release|Any CPU
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Debug|Any CPU.ActiveCfg = Debug|Win32
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Debug|x64.ActiveCfg = Debug|x64
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Debug|x64.Build.0 = Debug|x64
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Debug|x86.ActiveCfg = Debug|Win32
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Debug|x86.Build.0 = Debug|Win32
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Release|Any CPU.ActiveCfg = Release|Win32
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Release|x64.ActiveCfg = Release|x64
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Release|x64.Build.0 = Release|x64
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Release|x86.ActiveCfg = Release|Win32
{6A4F723D-C24B-4B16-A230-9C39A379F082}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -3,14 +3,12 @@
#include<set>
#include "CivInp.h"
#define DLLEXPORT __declspec(dllexport)
class CivDbConnection;
/**
* 水力计算类
*/
class DLLEXPORT CivHydrCalc
class CivHydrCalc
{
public:
CivHydrCalc(char* uri, std::string netName);
......@@ -66,3 +64,5 @@ private:
std::string mNetname;
std::string mLastError;
};
#include "CivHydrFuncInterface.h"
#include "CivHydrCalc.h"
bool DLLEXPORT hydrSimulation(char* uri, std::string netName, char* inpFile, char* rptFile, char* binOutFile)
{
CivHydrCalc* calc = new CivHydrCalc(uri, netName);
bool success = calc->hydrSimulation(inpFile, rptFile, binOutFile);
delete calc;
return success;
}
bool DLLEXPORT qualitySimulation(char* uri, std::string netName, char* inpFile, char* rptFile, char* binOutFile)
{
CivHydrCalc* calc = new CivHydrCalc(uri, netName);
bool success = calc->qualitySimulation(inpFile, rptFile, binOutFile);
delete calc;
return success;
}
bool DLLEXPORT simulation(char* uri, char* netName, char* flag)
{
char fileName[20];
char rptR[20];
char outBinFile[20];
const char* file = "test.inp";
strcpy_s(fileName, "test.inp");
strcpy_s(rptR, "test.rpt");
strcpy_s(outBinFile, "test.bin");
if (flag == "HDY")
return hydrSimulation(uri, netName, fileName, rptR, outBinFile);
else if(flag == "QUALITY")
return qualitySimulation(uri, netName, fileName, rptR, outBinFile);
return false;
}
\ No newline at end of file
#pragma once
#include<string>
#define DLLEXPORT __declspec(dllexport)
#if defined(__cplusplus)
extern "C" {
#endif
bool DLLEXPORT simulation(char* uri, char* netName,char* flag);
/**
*@brief 水力模拟计算
*@inpFile:inp文件
*@rptFile: 输出文件
*@binOutFile: 二进制输出文件
*/
bool DLLEXPORT hydrSimulation(char* uri, std::string netName, char* inpFile, char* rptFile, char* binOutFile);
/**
*@brief 水质模拟计算
*@inpFile:inp文件
*@rptFile: 输出文件
*@binOutFile: 二进制输出文件
*/
bool DLLEXPORT qualitySimulation(char* uri, std::string netName, char* inpFile, char* rptFile, char* binOutFile);
#if defined(__cplusplus)
}
#endif
......@@ -148,20 +148,20 @@
<ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary>
</Link>
<PostBuildEvent>
<Command>copy CivHydrCalc.h $(OutDir)..\include /y
copy CivInp.h $(OutDir)..\include /y</Command>
<Command>copy CivHydrFuncInterface.h $(OutDir)..\include /y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\pandaDbManager\CivCommonUtils.cpp" />
<ClCompile Include="CivComponent.cpp" />
<ClCompile Include="CivHydrCalc.cpp" />
<ClCompile Include="CivHydrFuncInterface.cpp" />
<ClCompile Include="CivInp.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="CivComponent.h" />
<ClInclude Include="CivHydrCalc.h" />
<ClInclude Include="CivHydrFuncInterface.h" />
<ClInclude Include="CivInp.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
......@@ -27,7 +27,7 @@
<ClCompile Include="CivComponent.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<ClCompile Include="CivHydrFuncInterface.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
......@@ -41,5 +41,8 @@
<ClInclude Include="CivComponent.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivHydrFuncInterface.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment