Commit 8963b8ee authored by 刘乐's avatar 刘乐

1,代码修改

parent 47d69698
EPNAET2/x64/ EPNAET2/x64/
pandaAnalysis/x64/ pandaAnalysis/x64/
pandaDbManager/x64/ pandaDbManager/x64/
funcDemo/x64/
*.inp
*.rpt
*.bin
.vs/ .vs/
/pandaHydrCalcMiddle/x64/Release
/pandaHydrDemo/bin/Release
/pandaHydrDemo/obj/Debug
/pandaHydrDemo/obj/Release
/pandaHydrDemo/bin/Debug
/EPNAET2/Release /EPNAET2/Release
.suo .suo
.vs/hydraulicModel/v16/Browse.VC.db .vs/hydraulicModel/v16/Browse.VC.db
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
...@@ -142,12 +142,13 @@ copy epanet2.h $(OutDir)..\include /y</Command> ...@@ -142,12 +142,13 @@ copy epanet2.h $(OutDir)..\include /y</Command>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<Optimization>Disabled</Optimization>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalLibraryDirectories> <AdditionalLibraryDirectories>
</AdditionalLibraryDirectories> </AdditionalLibraryDirectories>
<ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary> <ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary>
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalDependencies>pandaAnalysis.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>pandaAnalysis.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OUTDIR)..\lib</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(OUTDIR)..\lib</AdditionalLibraryDirectories>
</Link> </Link>
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalDependencies>libpq.lib;pandaDbManager.lib;EPNAET2.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>libpq.lib;pandaDbManager.lib;EPNAET2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OUTDIR)..\lib</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(OUTDIR)..\lib</AdditionalLibraryDirectories>
<ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary> <ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary>
......
...@@ -37,6 +37,7 @@ bool CivDbConnection::open() ...@@ -37,6 +37,7 @@ bool CivDbConnection::open()
{ {
mConn = PQconnectdb(mUri); mConn = PQconnectdb(mUri);
if (PQstatus(mConn) == CONNECTION_BAD) { if (PQstatus(mConn) == CONNECTION_BAD) {
mConn = NULL;
PQfinish(mConn); PQfinish(mConn);
return false; return false;
} }
...@@ -88,12 +89,12 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems) ...@@ -88,12 +89,12 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems)
if (!isValid()) if (!isValid())
return false; return false;
if (createTable("__node_result__", "public", NODE_TABLE)) std::stringstream os;
if (createTable(NODERESULTTABLE, "public", NODE_TABLE))
{ {
NodeFieldName filedNames; NodeFieldName filedNames;
std::stringstream os; os << "INSERT INTO public."<< NODERESULTTABLE<<" ( ";
os << "INSERT INTO public.__node_result__ ( ";
os <<filedNames.Number<<","; os <<filedNames.Number<<",";
os<< filedNames.dDemand << ","; os<< filedNames.dDemand << ",";
os<< filedNames.dHead<<","; os<< filedNames.dHead<<",";
...@@ -138,6 +139,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems) ...@@ -138,6 +139,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems)
// 2, 参数值 // 2, 参数值
size_t total = nodeItems.size(); size_t total = nodeItems.size();
os << "update public."<< PIPENODE;
for (int i = 0; i < total; i++) for (int i = 0; i < total; i++)
{ {
NodeResultItem item = nodeItems[i]; NodeResultItem item = nodeItems[i];
...@@ -178,10 +180,10 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems) ...@@ -178,10 +180,10 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems)
return false; return false;
std::stringstream os; std::stringstream os;
if (createTable("__pipe_result__", "public", PIPE_TABLE)) if (createTable(PIPERESULTTABLE, "public", PIPE_TABLE))
{ {
LinkFiledName filedNames; LinkFiledName filedNames;
os<< "INSERT INTO public.__pipe_result__( "; os<< "INSERT INTO public."<< PIPERESULTTABLE <<"( ";
os<< filedNames.szNo<< ","; os<< filedNames.szNo<< ",";
os<< filedNames.dFlow<< ","; os<< filedNames.dFlow<< ",";
/* os<< filedNames.nFlowDirect; /* os<< filedNames.nFlowDirect;
...@@ -597,9 +599,9 @@ bool CivDbConnection::createTable(StrQuote tableName, StrQuote schema,TableType ...@@ -597,9 +599,9 @@ bool CivDbConnection::createTable(StrQuote tableName, StrQuote schema,TableType
tableTemp.addProperty(filedName.dTankVolume, CivTableTemp::FILED_DOUBLE); tableTemp.addProperty(filedName.dTankVolume, CivTableTemp::FILED_DOUBLE);
tableTemp.addProperty(filedName.dTankMaxVolume, CivTableTemp::FILED_DOUBLE); tableTemp.addProperty(filedName.dTankMaxVolume, CivTableTemp::FILED_DOUBLE);
tableTemp.addProperty(filedName.dTankLevel, CivTableTemp::FILED_DOUBLE); tableTemp.addProperty(filedName.dTankLevel, CivTableTemp::FILED_DOUBLE);
tableTemp.addProperty("类型", CivTableTemp::FILED_INT);
tableTemp.addProperty("水质", CivTableTemp::FILED_DOUBLE); tableTemp.addProperty("水质", CivTableTemp::FILED_DOUBLE);
tableTemp.addProperty("时间", CivTableTemp::FILED_DATETIME); tableTemp.addProperty("时间", CivTableTemp::FILED_DATETIME);
tableTemp.addProperty("时段", CivTableTemp::FILED_INT);
} }
break; break;
case PIPE_TABLE: case PIPE_TABLE:
...@@ -618,6 +620,7 @@ bool CivDbConnection::createTable(StrQuote tableName, StrQuote schema,TableType ...@@ -618,6 +620,7 @@ bool CivDbConnection::createTable(StrQuote tableName, StrQuote schema,TableType
tableTemp.addProperty(pipeFileds.szStatus, CivTableTemp::FILED_VARCHAR); tableTemp.addProperty(pipeFileds.szStatus, CivTableTemp::FILED_VARCHAR);
tableTemp.addProperty("水质", CivTableTemp::FILED_DOUBLE); tableTemp.addProperty("水质", CivTableTemp::FILED_DOUBLE);
tableTemp.addProperty("时间", CivTableTemp::FILED_DATETIME); tableTemp.addProperty("时间", CivTableTemp::FILED_DATETIME);
tableTemp.addProperty("时段", CivTableTemp::FILED_INT);
} }
break; break;
case PATTERN_TABLE: case PATTERN_TABLE:
......
...@@ -12,6 +12,9 @@ typedef const std::string& StrQuote; ...@@ -12,6 +12,9 @@ typedef const std::string& StrQuote;
#define RESIVOIR Str("水库") #define RESIVOIR Str("水库")
#define TANK Str("水池") #define TANK Str("水池")
#define PUMP Str("水泵") #define PUMP Str("水泵")
#define NODERESULTTABLE Str("__node_result__")
#define PIPERESULTTABLE Str("__pipe_result__")
#define PATTERNTABLE Str("__pattern__") #define PATTERNTABLE Str("__pattern__")
#define CURVETABLE Str("__curve__") #define CURVETABLE Str("__curve__")
#define OPTIONTTABLE Str("__parameter__") #define OPTIONTTABLE Str("__parameter__")
...@@ -202,8 +205,9 @@ struct NodeFieldName ...@@ -202,8 +205,9 @@ struct NodeFieldName
Str dDemand=" 实际需水量"; Str dDemand=" 实际需水量";
Str dTankVolume=" 水池容量"; Str dTankVolume=" 水池容量";
Str dTankMaxVolume=" 水池最大容量"; Str dTankMaxVolume=" 水池最大容量";
Str dTankLevel=" 液位高度"; Str dTankLevel=" 液位高度";
Str lTime = "时间"; Str lTime = "时间";
Str dInterval = "时段";
}; };
struct LinkFiledName struct LinkFiledName
...@@ -220,6 +224,7 @@ struct LinkFiledName ...@@ -220,6 +224,7 @@ struct LinkFiledName
Str dFrictionHeadloss="摩擦水头损"; Str dFrictionHeadloss="摩擦水头损";
Str szStatus="状态"; Str szStatus="状态";
Str lTime = "时间"; Str lTime = "时间";
Str dInterval = "时段";
}; };
// 水力计算管点结果缓存 // 水力计算管点结果缓存
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
...@@ -137,12 +137,13 @@ ...@@ -137,12 +137,13 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WINDOWS</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WINDOWS</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(OUTDIR)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(OUTDIR)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalDependencies>libpq.lib;json_vc71_libmt.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>libpq.lib;json_vc71_libmt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OUTDIR)..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(OUTDIR)..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary> <ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary>
......
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