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

1,代码修改

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