Commit d635cb68 authored by 刘乐's avatar 刘乐

1, 代码整理

parent 5acd729c
......@@ -21,10 +21,10 @@ void CivConQuaTest::test(char* uri)
// 追踪分析
void CivConTrackTest::test(char* uri)
{
char result[1024 * 32];
char result[1024 * 128];
char sn[32];
strcpy_s(sn, "JD00000016");
strcpy_s(sn, "JD0000006");
int succ = trackingSimulation(uri, sn, 12, result);
......@@ -36,9 +36,9 @@ void CivUpstreamTrackingTest::test(char* uri)
{
// 追踪节点编号
char sn[32];
strcpy(sn, "JD00000016");
strcpy(sn, "JD0000006");
char result[1024 * 32];
char result[1024 * 128];
bool isSucc = upstreamTracking(uri, sn, result);
......@@ -54,7 +54,7 @@ void CivDownStreamTrackingTest::test(char* uri)
{
// 追踪节点编号
char sn[32];
strcpy(sn, "JD00000016");
strcpy(sn, "JD0000006");
char result[1024 * 128];
......@@ -72,7 +72,7 @@ void CivWaterSupplyScopeTest::test(char* uri)
{
// 追踪节点编号
char sn[32];
strcpy(sn, "JD00000016");
strcpy(sn, "JD0000006");
char result[1024 * 32];
......
......@@ -18,38 +18,26 @@ int main(int argc, char* argv[])
char* findUri = const_cast<char*>(uri);
// 测试水力
CivTestContext context(new CivConHydrTest());
context.contextTest(findUri);
/*CivTestContext context(new CivConHydrTest());
context.contextTest(findUri);*/
// 测试水质
/*CivTestContext context(new CivConQuaTest());
context.contextTest(findUri);*/
CivTestContext context(new CivConQuaTest());
context.contextTest(findUri);
/*CivTestContext context(new CivModelHydrTest());
context.contextTest(findUri);*/
// 测试追踪分析
/*CivTestContext context(new CivConTrackTest());
/* CivTestContext context(new CivConTrackTest());
context.contextTest(findUri);*/
// 测试根据时段获取值
/*
CivTestContext context(new CivConGetDataTest());
context.contextTest(findUri);
*/
// 测试根据
/*
CivTestContext context(new CivConGetRptTest());
context.contextTest(findUri);
*/
// 上游追踪
/*CivTestContext context(new CivUpstreamTrackingTest());
/* CivTestContext context(new CivUpstreamTrackingTest());
context.contextTest(findUri);*/
// 下游追踪
/*CivTestContext context(new CivDownStreamTrackingTest());
/*CivTestContext context(new CivDownStreamTrackingTest());
context.contextTest(findUri);*/
......
......@@ -5,7 +5,6 @@
#include "CivAssembly.h"
#include "CivInpDbHelper.h"
#define ASSERT(A,B) if ((A) == nullptr || (B) == nullptr) return
CivBaseInpBuilder::CivBaseInpBuilder(const std::string & uri)
:CivInpBuilder(uri)
......
#include "CivGraphFactory.h"
#include "CivGraphList.h"
#include "CivInpDbHelper.h"
#include "CivTrackingResultCache.h"
CivGraphFactory::CivGraphFactory()
{
}
bool CivGraphFactory::initGraph(CivInpDbHelper* dbConn, ALGraph<CivGraphJunction, CivGraphEdage>* graph)
{
if (graph == nullptr)
return false;
if (dbConn == nullptr)
return false;
// 顶点坐标
CivCoordinates coords;
dbConn->getCoordinates(coords);
std::list<CivCoordinates::CoordTable> coordTableLis = coords.mTables;
std::list<CivCoordinates::CoordTable>::iterator iter;
for (iter = coordTableLis.begin(); iter != coordTableLis.end(); iter++)
{
CivCoordinates::CoordTable coordTable = *iter;
// 插入顶点数据
CivGraphJunction graphJunction(coordTable.ID, coordTable.XCoord, coordTable.YCoord);
graph->insertAVertex(graphJunction);
}
// 管段
CivPipe civPipe;
dbConn->getPipe(civPipe);
std::list<CivPipe::PipesTable> pipesTableLis = civPipe.mTables;
std::list<CivPipe::PipesTable>::iterator pIter;
for (pIter = pipesTableLis.begin(); pIter != pipesTableLis.end(); pIter++)
{
CivPipe::PipesTable pipeTable = *pIter;
// 获取管段起点坐标
CivGraphJunction graphJunction1(pipeTable.Node1);
int index1 = graph->getVertexIndex(graphJunction1);
CivGraphJunction sStartjuction = graph->getData(index1);
// 获取管段终点坐标值
CivGraphJunction graphJunction2(pipeTable.Node2);
int index2 = graph->getVertexIndex(graphJunction2);
CivGraphJunction endJunction = graph->getData(index2);
if (sStartjuction.getHead() > endJunction.getHead())
{
CivGraphEdage edAge(pipeTable.ID, pipeTable.Length, { sStartjuction.getXCoord(),sStartjuction.getYCoord(),endJunction.getXCoord(),endJunction.getYCoord() });
graph->insertAEdge(sStartjuction, endJunction, edAge);
}
else
{
CivGraphEdage edAge(pipeTable.ID, pipeTable.Length, {endJunction.getXCoord(),endJunction.getYCoord(), sStartjuction.getXCoord(),sStartjuction.getYCoord() });
graph->insertAEdge(endJunction, sStartjuction, edAge);
}
}
return true;
}
\ No newline at end of file
#pragma once
#include "CivHydDataType.h"
#include "CivGraphList.h"
// 声明模板图类型
class CivGraphJunction;
class CivGraphEdage;
class CivInpDbHelper;
class CivGraphFactory
{
public:
CivGraphFactory();
/**
*@brief 根据水力模型管网数据创建有向图
*@param dbConn 数据库连接
*@param graph 有向图
*/
bool initGraph(CivInpDbHelper* dbConn, ALGraph<CivGraphJunction, CivGraphEdage>* graph);
};
......@@ -204,6 +204,8 @@ void CivHydrCompute::dateAndTime(int time,std::string& nowDate,std::string& nowT
nowTime = ("0" + std::to_string(a) + ":00");
else
nowTime = (std::to_string(a) + ":00");
nowTime = nowDate + " " + nowTime;
}
void CivHydrCompute::getNodeResult(short time)
......@@ -317,11 +319,10 @@ void CivHydrCompute::getLinkQuality(short time)
int* typeCode = (int*)malloc(sizeof(int));
for (int i = 1; i <= nLinkCount; i++)
{
ENgetlinktype(i, typeCode);
if (*typeCode != EN_PIPE)
continue;
ENgetlinktype(i, typeCode);
char lnkNo[35];
ENgetlinkid(i, lnkNo);// 编号
float quality;
......
......@@ -59,5 +59,10 @@ bool FUNEXPORT downstreamTracking(char* uri, char* sn, char* result)
bool FUNEXPORT waterSupplyScopeAnalysis(char* uri, char* sn, char* result)
{
return true;
}
bool FUNEXPORT projSimulation(char* uri, char* projCode, char* time)
{
return true;
}
\ No newline at end of file
......@@ -54,6 +54,15 @@ extern "C" {
*/
bool FUNEXPORT trackingSimulation(char* uri, char* sN, int hours,char* result);
/**
*@brief 方案模拟
*@param uri:数据库连接地址
*@param sN:追踪节点
*@param time:追踪小时
*/
bool FUNEXPORT projSimulation(char* uri, char* projCode, char* time);
#if defined(__cplusplus)
}
#endif
......
......@@ -2,7 +2,6 @@
#include "CivTypes.h"
#include "CivAssembly.h"
#define ASSERT(A,B) if ((A) == nullptr || (B) == nullptr) return;
CivInpBuilder::CivInpBuilder(const std::string & uri)
:mNewInp(new CivNewInp()), mUri(uri)
......@@ -19,29 +18,25 @@ CivInpBuilder::~CivInpBuilder()
delete mHelper;
}
void CivInpBuilder::setOption(const std::string& name,
const std::string& val)
void CivInpBuilder::setOption(const std::string& name, const std::string& val)
{
CivParameter::ParamTable table = { name,val };
mOptions.addItem(table);
}
void CivInpBuilder::setTimes(const std::string& name,
const std::string& val)
void CivInpBuilder::setTimes(const std::string& name, const std::string& val)
{
CivParameter::ParamTable table = { name,val };
mTimes.addItem(table);
}
void CivInpBuilder::setReport(const std::string& name,
const std::string& val)
void CivInpBuilder::setReport(const std::string& name, const std::string& val)
{
CivParameter::ParamTable table = { name,val };
mReport.addItem(table);
}
void CivInpBuilder::setReaction(const std::string& name,
const std::string& val)
void CivInpBuilder::setReaction(const std::string& name, const std::string& val)
{
CivParameter::ParamTable table = { name,val };
mReactions.addItem(table);
......@@ -67,6 +62,10 @@ void CivInpBuilder::buildParamter()
for (int i = 0; i < total; i++)
{
CivParameter param = parameters[i];
param.merge(mTimes);
param.merge(mOptions);
param.merge(mReactions);
param.merge(mReport);
mNewInp->setParamter(param, param.mType);
}
}
......@@ -79,4 +78,28 @@ void CivInpBuilder::resetAllToZero()
void CivInpBuilder::setQuality(const std::string& name, const std::string& val)
{
mInitQuality.addItem({ name ,val });
}
void CivInpBuilder::buildCurves()
{
}
void CivInpBuilder::buildTags()
{
}
void CivInpBuilder::buildBackDrop()
{
}
void CivInpBuilder::buildLabels()
{
}
void CivInpBuilder::buildVertices()
{
}
\ No newline at end of file
......@@ -3,6 +3,7 @@
#include "CivNewInp.h"
#include "CivInpHelperAbs.h"
#define ASSERT(A,B) if ((A) == nullptr || (B) == nullptr) return
/**
* 抽象建造者
*/
......@@ -40,6 +41,12 @@ public:
bool getNewInp(std::string& infile);
void buildParamter();
virtual void buildCurves();
virtual void buildTags();
virtual void buildBackDrop();
virtual void buildLabels();
virtual void buildVertices();
virtual void buildNode()=0;
virtual void buildPipe()=0;
virtual void buildTank()=0;
......@@ -49,14 +56,9 @@ public:
virtual void buildEmitter()=0;
virtual void buildPatterns()=0;
virtual void buildCoordnates()=0;
virtual void buildVertices()=0;
virtual void buildLabels()=0;
virtual void buildTags()=0;
virtual void buildBackDrop()=0;
virtual void buildQuality()=0;
virtual void buildSources()=0;
virtual void buildMixing()=0;
virtual void buildCurves()=0;
virtual void buildStatus()=0;
virtual void buildControls()=0;
virtual void buildRules()=0;
......
......@@ -3,6 +3,7 @@
#include "CivInpDirector.h"
#include "CivBaseInpBuilder.h"
#include "CivCommonUtils.h"
#include "CivHydrTableHelper.h"
CivInpConvertor::CivInpConvertor(const std::string& uri)
:mUri(uri)
......@@ -19,6 +20,12 @@ std::string CivInpConvertor::convertPorjInp(
const std::string& projCode,
const std::string& start)
{
CivHydrTableHelper helper(mUri);
if (!helper.mainTain())
{
return "";
}
CivProjInpBuilder* builder = new CivProjInpBuilder(mUri);
builder->setProjCode(projCode);
builder->setTimes("Duration", "0");
......@@ -41,6 +48,12 @@ std::string CivInpConvertor::convertPorjInp(
std::string CivInpConvertor::convertBaseInp()
{
CivHydrTableHelper helper(mUri);
if (!helper.mainTain())
{
return "";
}
CivInpBuilder* builder = new CivBaseInpBuilder(mUri);
CivInpDirector director;
director.setBuilder(builder);
......@@ -60,8 +73,14 @@ std::string CivInpConvertor::convertBaseInp()
std::string CivInpConvertor::convertTrackInp(const std::string& sn,
const std::string& hours)
{
CivHydrTableHelper helper(mUri);
if (!helper.mainTain())
{
return "";
}
CivInpBuilder* builder = new CivBaseInpBuilder(mUri);
builder->setOption("Quality Tracking", sn);
builder->setOption("Quality", "TRACE "+sn);
builder->setTimes("Duration", hours);
builder->resetAllToZero();
builder->setQuality(sn, "1");
......@@ -71,10 +90,10 @@ std::string CivInpConvertor::convertTrackInp(const std::string& sn,
director.create();
std::string inpFile = CivCommonUtils::getExePath() + "\\test.inp";
if (builder->getNewInp(inpFile))
if (!builder->getNewInp(inpFile))
{
delete builder;
return NULL;
return "";
}
delete builder;
......
......@@ -99,6 +99,18 @@ void CivNewInp::setPipes(const CivPipe& pipes)
for (auto iter = tables.rbegin(); iter != tables.rend(); iter++)
{
CivPipe::PipesTable pipesTable = *iter;
if (pipesTable.ID.empty() ||
pipesTable.Node1.empty() ||
pipesTable.Node2.empty()||
pipesTable.Length.empty()||
pipesTable.Diameter.empty())
continue;
if (pipesTable.MinorLoss.empty())
pipesTable.MinorLoss = "0";
if (pipesTable.Status.empty())
pipesTable.Status = "Open";
writeStringFormat(pipesTable.ID);
writeStringFormat(pipesTable.Node1);
writeStringFormat(pipesTable.Node2);
......
......@@ -11,94 +11,195 @@ CivProjInpBuilder::~CivProjInpBuilder()
{
}
void CivProjInpBuilder::buildNode()
{
CivNode node;
if (!mHelper->getNode(node))
return;
mNewInp->setNode(node);
}
void CivProjInpBuilder::buildPipe()
{
ASSERT(mHelper, mNewInp);
CivPipe pipe;
if (!mHelper->getPipe(pipe))
return;
mNewInp->setPipes(pipe);
}
void CivProjInpBuilder::buildTank()
{
ASSERT(mHelper, mNewInp);
CivTank tank;
if (!mHelper->getTank(tank))
return;
mNewInp->setTank(tank);
}
void CivProjInpBuilder::buildVavle()
{
ASSERT(mHelper, mNewInp);
CivValve valve;
if (!mHelper->getValve(valve))
return;
mNewInp->setValves(valve);
}
void CivProjInpBuilder::buildPump()
{
ASSERT(mHelper, mNewInp);
CivPumps valve;
if (!mHelper->getPumps(valve))
return;
mNewInp->setPumps(valve);
}
void CivProjInpBuilder::buildReservoir()
{
ASSERT(mHelper, mNewInp);
CivReservoirs res;
if (!mHelper->getReservoirs(res))
return;
mNewInp->setReservoirs(res);
}
void CivProjInpBuilder::buildEmitter()
{
ASSERT(mHelper, mNewInp);
CivEmitters emmiters;
if (!mHelper->getEmitters(emmiters))
return;
mNewInp->setEmitters(emmiters);
}
void CivProjInpBuilder::buildPatterns()
{
ASSERT(mHelper, mNewInp);
CivPatterns pattern;
if (!mHelper->getPatterns(pattern))
return;
mNewInp->setPatterns(pattern);
}
void CivProjInpBuilder::buildCoordnates()
{
ASSERT(mHelper, mNewInp);
CivCoordinates coords;
if (!mHelper->getCoordinates(coords))
return;
mNewInp->setCoordnates(coords);
}
void CivProjInpBuilder::buildVertices()
{
return;
}
void CivProjInpBuilder::buildLabels()
{
ASSERT(mHelper, mNewInp);
CivLabels labels;
if (!mHelper->getLabels(labels))
return;
mNewInp->setLabels(labels);
}
void CivProjInpBuilder::buildTags()
{
ASSERT(mHelper, mNewInp);
CivTags tag;
if (!mHelper->getTags(tag))
return;
mNewInp->setTags(tag);
}
void CivProjInpBuilder::buildBackDrop()
{
return;
}
void CivProjInpBuilder::buildQuality()
{
ASSERT(mHelper, mNewInp);
if (mResetToZero)
{
mNewInp->setQuality(mInitQuality);
return;
}
CivQuality quality;
if (!mHelper->getQuality(quality))
return;
mNewInp->setQuality(quality);
}
void CivProjInpBuilder::buildSources()
{
ASSERT(mHelper, mNewInp);
CivSources sources;
if (!mHelper->getSources(sources))
return;
mNewInp->setSources(sources);
}
void CivProjInpBuilder::buildMixing()
{
ASSERT(mHelper, mNewInp);
CivMixing mixing;
if (!mHelper->getMixing(mixing))
return;
mNewInp->setMixing(mixing);
}
void CivProjInpBuilder::buildCurves()
{
ASSERT(mHelper, mNewInp);
CivCurves curves;
if (!mHelper->getCurves(curves))
return;
mNewInp->setCurves(curves);
}
void CivProjInpBuilder::buildStatus()
{
ASSERT(mHelper, mNewInp);
CivStatus status;
if (!mHelper->getStatus(status))
return;
mNewInp->setStatus(status);
}
void CivProjInpBuilder::buildControls()
......@@ -113,10 +214,19 @@ void CivProjInpBuilder::buildRules()
void CivProjInpBuilder::buildDemands()
{
ASSERT(mHelper, mNewInp);
CivDemands mand;
if (!mHelper->getDemands(mand))
return;
mNewInp->setDemands(mand);
}
void CivProjInpBuilder::setProjCode(const std::string& projCode)
{
mProjCode = projCode;
CivProjInpDbHelper* helper = static_cast<CivProjInpDbHelper*>(mHelper);
if (helper != nullptr)
helper->setProjCode(projCode);
}
#include "CivProjSimulation.h"
bool CivProjSimulation::simulationProj()
CivProjSimulation::CivProjSimulation()
{
return true;
}
bool CivProjSimulation::averPressureChange()
{
return true;
}
bool CivProjSimulation::averFlowChange()
CivProjSimulation::~CivProjSimulation()
{
return true;
}
bool CivProjSimulation::pressChangeDMA()
{
return true;
}
bool CivProjSimulation::flowChangeDMA()
bool CivProjSimulation::simulationProj()
{
return true;
}
void CivProjSimulation::getDMADatas(std::map<std::string, std::vector<std::string>>& nodes)
{
}
\ No newline at end of file
......@@ -9,21 +9,11 @@
class CivProjSimulation
{
public:
explicit CivProjSimulation();
~CivProjSimulation();
bool simulationProj();
bool averPressureChange();
bool averFlowChange();
bool pressChangeDMA();
bool flowChangeDMA();
private:
/**
*@brief 获取dma分区所对应的点
*/
void getDMADatas(std::map<std::string, std::vector<std::string>>& nodes);
bool simulationProj();
private:
......
#include "CivProject.h"
CivProject::CivProject()
{
}
CivProject::~CivProject()
{
}
\ No newline at end of file
#pragma once
/*
*/
class CivProject
{
public:
explicit CivProject();
~CivProject();
};
......@@ -49,6 +49,7 @@ void CivSimulResultCache::getPipesSnsByQuality(std::vector<std::vector<std::stri
if (item.dQuality > 0)
vec.push_back(item.szNo);
}
sns.push_back(vec);
}
}
......
#include "CivTrackingAnalysis.h"
#include "CivSimulResultCache.h"
#include "CivHydrSimulation.h"
#include "CivGraphFactory.h"
#include "CivInpConvertor.h"
#include "CivInpDbHelper.h"
......
#pragma once
#include "CivHydDataType.h"
#include "CivGraphList.h"
#include "CivTrackingResultCache.h"
#include <vector>
#include <string>
#define ALGORITHMEXPORT __declspec(dllexport)
......
......@@ -136,7 +136,7 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)pandaDbManager;$(OUTDIR)..\include</AdditionalIncludeDirectories>
<Optimization>MaxSpeed</Optimization>
<Optimization>Disabled</Optimization>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
......@@ -153,7 +153,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="CivBaseInpBuilder.cpp" />
<ClCompile Include="CivGraphFactory.cpp" />
<ClCompile Include="CivHydDataType.cpp" />
<ClCompile Include="CivHydrCompute.cpp" />
<ClCompile Include="CivHydrFuncInter.cpp" />
......@@ -163,7 +162,6 @@
<ClCompile Include="CivInpDirector.cpp" />
<ClCompile Include="CivNewInp.cpp" />
<ClCompile Include="CivOptSchedSimulation.cpp" />
<ClCompile Include="CivProject.cpp" />
<ClCompile Include="CivProjInpBuilder.cpp" />
<ClCompile Include="CivProjManager.cpp" />
<ClCompile Include="CivProjSimulation.cpp" />
......@@ -172,7 +170,6 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="CivBaseInpBuilder.h" />
<ClInclude Include="CivGraphFactory.h" />
<ClInclude Include="CivGraphList.h" />
<ClInclude Include="CivHydDataType.h" />
<ClInclude Include="CivHydrCompute.h" />
......@@ -183,7 +180,6 @@
<ClInclude Include="CivInpDirector.h" />
<ClInclude Include="CivNewInp.h" />
<ClInclude Include="CivOptSchedSimulation.h" />
<ClInclude Include="CivProject.h" />
<ClInclude Include="CivProjInpBuilder.h" />
<ClInclude Include="CivProjManager.h" />
<ClInclude Include="CivProjSimulation.h" />
......
......@@ -36,15 +36,9 @@
<ClCompile Include="CivHydDataType.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CivGraphFactory.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CivProjManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CivProject.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CivProjInpBuilder.cpp">
<Filter>源文件</Filter>
</ClCompile>
......@@ -92,15 +86,9 @@
<ClInclude Include="CivHydDataType.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivGraphFactory.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivProjManager.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivProject.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivProjInpBuilder.h">
<Filter>头文件</Filter>
</ClInclude>
......
......@@ -233,11 +233,36 @@ public:
*/
Str name;
Str val;
bool operator==(const Table& oterhtable)
{
return name == oterhtable.name;
}
} ParamTable;
void addItem(const ParamTable& table);
void setType(const std::string& type) { mType = type; }
void merge(const CivParameter& otherParam)
{
if (mType != otherParam.mType)
return;
std::list<ParamTable> tables = otherParam.mTables;
for (auto iter = tables.begin(); iter != tables.end(); iter++)
{
std::string name = iter->name;
std::list<ParamTable>::iterator findIter = std::find(mTables.begin(), mTables.end(),*iter);
if (findIter == mTables.end())
{
mTables.push_back({ iter->name,iter->val });
continue;
}
findIter->val =iter->val;
}
}
std::string mType;
std::list<ParamTable> mTables;
};
......
......@@ -28,7 +28,8 @@ bool CivConnection::update(const std::string& table, const std::map<std::string,
sql = sql.substr(0, sql.length() - 1);
std::string utf8Sql = CivCommonUtils::string_To_UTF8(sql);
if (!execSql(sql))
if (!execSql(utf8Sql))
return false;
return true;
......@@ -39,9 +40,9 @@ bool CivConnection::del(const std::string& table, const std::string& where)
if (table.empty() || where.empty())
return false;
std::string sql = "delete from "+table +"where "+where;
std::string sql = "delete from "+table +" where "+where;
std::string utf8Sql = CivCommonUtils::string_To_UTF8(sql);
if (!execSql(sql))
if (!execSql(utf8Sql))
return false;
return true;
......
#include "CivHydrTableHelper.h"
#include "CivTableFields.h"
#include "CivCommonUtils.h"
#include "CivPgDbConnection.h"
CivHydrTableHelper::CivHydrTableHelper(const std::string& uri)
{
mConn = new CivPgDbConnection();
mConn->connect(uri);
}
CivHydrTableHelper::~CivHydrTableHelper()
{
mConn->disconnect();
delete mConn;
mConn == nullptr;
}
bool CivHydrTableHelper::mainTain()
{
unTopoMaintain();
// 节点
updateAssem(TABLE_NODE, std::string("本点号"), "JD");
updateAssem(TABLE_PIPE, std::string("编号"), "GD");
updateAssem(TABLE_TANK, std::string("本点号"), "TK");
updateAssem(TABLE_VALVEE, std::string("本点号"), "VA");
updateAssem(TABLE_RESERVOIR, std::string("本点号"), "RE");
if (!topoMaintain())
return false;
return true;
}
void CivHydrTableHelper::updateAssem(const std::string& table, const std::string& filed,const std::string& prefix)
{
// 节点
std::vector<std::map<std::string, std::string>> resVec;
if (!mConn->query(table, { "id" }, resVec))
{
mErrInfo = mConn->getLastError();
return;
}
if (resVec.size() <= 0)
return;
std::vector<std::string> sNs;
CivCommonUtils::genSeqNo(prefix, resVec.size(), sNs);
std::string sql = "update "+ table +" set "+ filed +" = tmp."+ filed +" from(values";
for (int i = 0; i < sNs.size(); i++)
{
std::map<std::string,std::string> resMap = resVec[i];
std::string id = resMap.find("id")->second;
sql.append("(");
sql.append(id);
sql.append(",\'");
sql.append(sNs[i]);
sql.append("\'),");
}
sql = sql.substr(0, sql.length() - 1);
sql += ") as tmp(id, \""+ filed +"\") where "+ table +".id = tmp.id; ";
std::string utfsql = CivCommonUtils::string_To_UTF8(sql);
if (mConn && mConn->execSql(utfsql))
{
mErrInfo = mConn->getLastError();
return;
}
}
bool CivHydrTableHelper::topoMaintain()
{
topoMainTable(TABLE_PIPE, TABLE_NODE, std::string("起始节点"), std::string("本点号"), std::string("from_code"));
topoMainTable(TABLE_PIPE, TABLE_NODE, std::string("终止节点"), std::string("本点号"), std::string("to_code"));
topoMainTable(TABLE_PIPE, TABLE_RESERVOIR, std::string("起始节点"), std::string("本点号"), std::string("from_code"));
topoMainTable(TABLE_PIPE, TABLE_TANK, std::string("起始节点"), std::string("本点号"), std::string("from_code"));
topoValve(std::string("起始节点"),std::string("from_code"),std::string("to_code"));
topoValve(std::string("终止节点"), std::string("to_code"), std::string("from_code"));
std::string delSql = std::string("update \"管段\" \
set \"起始节点\" = null,\"终止节点\" = null \
from \"阀门\" t1 where\
\"to_code\" = t1.\"code\" or \"from_code\" = t1.\"code\"");
std::string utfsql = CivCommonUtils::string_To_UTF8(delSql);
if (mConn && !mConn->execSql(utfsql))
{
mErrInfo = mConn->getLastError();
return false;
}
return true;
}
bool CivHydrTableHelper::unTopoMaintain()
{
unTopoTable(TABLE_NODE, {std::string("本点号")});
unTopoTable(TABLE_PIPE, { std::string("编号"),std::string("起始节点"),std::string("终止节点") });
unTopoTable(TABLE_RESERVOIR, { std::string("本点号")});
unTopoTable(TABLE_TANK, { std::string("本点号") });
unTopoTable(TABLE_VALVEE, { std::string("本点号"),std::string("起始节点"),std::string("终止节点") });
return true;
}
bool CivHydrTableHelper::topoMainTable(const std::string& sourceTable,
const std::string& targetTable,
const std::string& pipesn,
const std::string& nodeSn,
const std::string& code)
{
std::string sql = "UPDATE \"" + sourceTable + "\" \
SET \"" + pipesn + "\" = cqt.\"" + nodeSn + "\" FROM \"" + targetTable + "\" cqt WHERE \
\""+sourceTable+"\".\"" + code + "\" = cqt.\"code\"";
std::string utfsql = CivCommonUtils::string_To_UTF8(sql);
if (mConn && !mConn->execSql(utfsql))
{
mErrInfo = mConn->getLastError();
return false;
}
return true;
}
bool CivHydrTableHelper::topoValve(const std::string& sn,
const std::string& fromcode,
const std::string& tocode)
{
std::string sql = "update \"";
sql.append(TABLE_VALVEE);
sql.append("\" set \"" + sn + "\" = dd.\"本点号\"\
from(select node.\"本点号\" \"本点号\", node.\"code\" \"nodecode\", tt.\"code\" \"vacode\" from \
\""+TABLE_NODE+"\" node, (select t2.\""+tocode+"\" \""+tocode+"\", t1.\"code\" \"code\" from \""+TABLE_PIPE+"\" t2, \""+TABLE_VALVEE+"\" t1 where t2.\""+fromcode+"\" = t1.\"code\") tt\
where node.\"code\" = tt.\""+tocode+"\") dd\
where \"code\" = dd.\"vacode\"");
std::string utfsql = CivCommonUtils::string_To_UTF8(sql);
if (mConn && !mConn->execSql(utfsql))
{
mErrInfo = mConn->getLastError();
return false;
}
return false;
}
bool CivHydrTableHelper::unTopoTable(const std::string& table, const std::vector<std::string>& fields)
{
if (fields.size() < 1)
{
mErrInfo = "fileds is empty";
return false;
}
std::string sql = "update \""+ table +"\" set ";
for (int i = 0; i < fields.size(); i++)
{
sql.append(fields[i]);
sql.append("= null");
sql.append(",");
}
sql = sql.substr(0, sql.length() - 1);
std::string utfsql = CivCommonUtils::string_To_UTF8(sql);
if (mConn && !mConn->execSql(utfsql))
{
mErrInfo = mConn->getLastError();
return false;
}
return false;
}
#pragma once
#include<string>
#include<vector>
#include<map>
#include "CivConnection.h"
#define HYDRTABLEEXPORT __declspec(dllexport)
class HYDRTABLEEXPORT CivHydrTableHelper
{
public:
explicit CivHydrTableHelper(const std::string& uri);
~CivHydrTableHelper();
bool mainTain();
private:
void updateAssem(const std::string& table, const std::string& filed, const std::string& prefix);
bool topoMaintain();
bool unTopoMaintain();
bool unTopoTable(const std::string& table, const std::vector<std::string>& fields);
/**
*@brief 维护线图层与点图层表之间的拓扑维护关系
*@param lineTable 线图层表
*@param pointTable 点图层表
*@param linesn 线图层字段
*@param pointSn 点图层字段
*@param code 线图层标识
*/
bool topoMainTable(const std::string& lineTable,
const std::string& pointTable,
const std::string& linesn,
const std::string& pointSn,
const std::string& code);
/**
*@brief 拓扑维护阀门,需要特殊处理
*/
bool topoValve(const std::string& sn,const std::string& fromcode,const std::string& tocode );
private:
std::vector<std::string> mNecessTables;
std::map<std::string, std::string> mNeedTableMap;
std::string mErrInfo;
CivConnection* mConn;
};
......@@ -7,7 +7,7 @@
CivInpDbHelper::CivInpDbHelper(const std::string& uri)
:CivInpHelperAbs(uri)
{
mCondtion = "where " + PROJFILED + " is null or " + PROJFILED + "=\"\"";
}
CivInpDbHelper::~CivInpDbHelper()
......@@ -25,8 +25,9 @@ bool CivInpDbHelper::getNode(CivNode& node)
nodeTableFields.baseDemand,
nodeTableFields.demandPattern
};
std::vector<std::map<std::string,std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector);
std::vector<std::map<std::string,std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector, mCondtion);
// ༭װ
size_t total = resultVector.size();
......@@ -61,7 +62,7 @@ bool CivInpDbHelper::getPipe(CivPipe& pipes)
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPELINE, fields, resultVector);
mDbConn->query(PIPELINE, fields, resultVector, mCondtion);
size_t total = resultVector.size();
for (int i = 0; i < total; i++)
......@@ -100,7 +101,7 @@ bool CivInpDbHelper::getTank(CivTank& tanks)
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(TANK, fields, resultVector);
mDbConn->query(TANK, fields, resultVector, mCondtion);
size_t total = resultVector.size();
for (int i = 0; i < total; i++)
......@@ -136,7 +137,7 @@ bool CivInpDbHelper::getValve(CivValve& valves)
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(VALVE, fields, resultVector);
mDbConn->query(VALVE, fields, resultVector, mCondtion);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
......@@ -169,7 +170,7 @@ bool CivInpDbHelper::getPumps(CivPumps& pumps)
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PUMP, fields, resultVector);
mDbConn->query(PUMP, fields, resultVector, mCondtion);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
......@@ -207,7 +208,7 @@ bool CivInpDbHelper::getReservoirs(CivReservoirs& reservoirs)
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(RESIVOIR, fields, resultVector);
mDbConn->query(RESIVOIR, fields, resultVector, mCondtion);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
......@@ -235,9 +236,9 @@ bool CivInpDbHelper::getCoordinates(CivCoordinates& coord)
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector);
mDbConn->query(TANK, fields, resultVector);
mDbConn->query(RESIVOIR, fields, resultVector);
mDbConn->query(PIPENODE, fields, resultVector, mCondtion);
mDbConn->query(TANK, fields, resultVector, mCondtion);
mDbConn->query(RESIVOIR, fields, resultVector, mCondtion);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
......@@ -266,7 +267,7 @@ bool CivInpDbHelper::getQuality(CivQuality& quality)
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector);
mDbConn->query(PIPENODE, fields, resultVector, mCondtion);
size_t totals = resultVector.size();
......
......@@ -20,4 +20,6 @@ public:
bool getReservoirs(CivReservoirs& reservoirs) override;
bool getCoordinates(CivCoordinates& coord) override;
bool getQuality(CivQuality& quality) override;
private:
std::string mCondtion;
};
#include "CivProjInpDbHelper.h"
#include "CivConnection.h"
#include "CivTableFields.h"
CivProjInpDbHelper::CivProjInpDbHelper(const std::string& uri)
:CivInpHelperAbs(uri)
{
}
CivProjInpDbHelper::~CivProjInpDbHelper()
......@@ -11,44 +13,279 @@ CivProjInpDbHelper::~CivProjInpDbHelper()
}
void CivProjInpDbHelper::setProjCode(const std::string& projCode)
{
mPorjCode = projCode;
std::string mCondition = PROJFILED + " = " + projCode + "or "+PROJFILED +" is null or "+ PROJFILED +"=\"\"";
}
bool CivProjInpDbHelper::getNode(CivNode& node)
{
JunctionTable nodeTableFields;
std::vector<std::string> fields =
{
nodeTableFields.sn,
nodeTableFields.elev,
nodeTableFields.baseDemand,
nodeTableFields.demandPattern
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector,mCondition);
// ༭װ
size_t total = resultVector.size();
for (int i = 0; i < total; i++)
{
std::map<std::string, std::string> map = resultVector[i];
CivNode::NodeTable nodeTable;
nodeTable.ID = map.find(nodeTableFields.sn)->second;
nodeTable.Elev = map.find(nodeTableFields.elev)->second;
nodeTable.Demand = map.find(nodeTableFields.baseDemand)->second;
nodeTable.PatternId = map.find(nodeTableFields.demandPattern)->second;
node.addItem(nodeTable);
}
return true;
}
bool CivProjInpDbHelper::getPipe(CivPipe& pipe)
bool CivProjInpDbHelper::getPipe(CivPipe& pipes)
{
PipeTable pipeTable;
std::vector<std::string> fields = {
pipeTable.snNo,
pipeTable.startPoint,
pipeTable.endPoint,
pipeTable.length,
pipeTable.diameter,
pipeTable.friction,
pipeTable.localLoss,
pipeTable.status
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPELINE, fields, resultVector);
size_t total = resultVector.size();
for (int i = 0; i < total; i++)
{
CivPipe::PipesTable pipe;
std::map<std::string, std::string> map = resultVector[i];
pipe.ID = map.find(pipeTable.snNo)->second;
pipe.Node1 = map.find(pipeTable.startPoint)->second;
pipe.Node2 = map.find(pipeTable.endPoint)->second;
pipe.Length = map.find(pipeTable.length)->second;
pipe.Diameter = map.find(pipeTable.diameter)->second;
pipe.Roughness = map.find(pipeTable.friction)->second;
pipe.MinorLoss = map.find(pipeTable.localLoss)->second;
pipe.Status = map.find(pipeTable.status)->second;
pipes.addItem(pipe);
}
return true;
}
bool CivProjInpDbHelper::getTank(CivTank& tank)
bool CivProjInpDbHelper::getTank(CivTank& tanks)
{
TankTable tankTable;
std::vector<std::string> fields = {
tankTable.sn,
tankTable.elev,
tankTable.initLevel,
tankTable.minLevel,
tankTable.maxLevel,
tankTable.diametor,
tankTable.minVolume,
tankTable.volumeCurve
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(TANK, fields, resultVector);
size_t total = resultVector.size();
for (int i = 0; i < total; i++)
{
CivTank::TankTable tank;
std::map<std::string, std::string>map = resultVector[i];
tank.ID = map.find(tankTable.sn)->second;
tank.Elev = map.find(tankTable.elev)->second;
tank.InitLevel = map.find(tankTable.initLevel)->second;
tank.MinLevel = map.find(tankTable.minLevel)->second;
tank.MaxLevel = map.find(tankTable.maxLevel)->second;
tank.Diameter = map.find(tankTable.diametor)->second;
tank.MinVol = map.find(tankTable.minVolume)->second;
tank.VolCurve = map.find(tankTable.volumeCurve)->second;
tanks.addItem(tank);
}
return true;
}
bool CivProjInpDbHelper::getValve(CivValve& valve)
bool CivProjInpDbHelper::getValve(CivValve& valves)
{
ValveTable vaveTable;
std::vector<std::string> fields = {
vaveTable.sn,
vaveTable.startPoint,
vaveTable.endPoint,
vaveTable.length,
vaveTable.type,
vaveTable.setting,
vaveTable.lossCoeff
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(VALVE, fields, resultVector);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
{
CivValve::ValveTable vave;
std::map<std::string, std::string> map = resultVector[i];
vave.ID = map.find(vaveTable.sn)->second;
vave.Node1 = map.find(vaveTable.startPoint)->second;
vave.Node2 = map.find(vaveTable.endPoint)->second;
vave.Diameter = map.find(vaveTable.length)->second;
vave.Type = map.find(vaveTable.type)->second;
vave.Setting = map.find(vaveTable.setting)->second;
vave.MinorLoss = map.find(vaveTable.lossCoeff)->second;
valves.addItem(vave);
}
return true;
}
bool CivProjInpDbHelper::getPumps(CivPumps& pump)
bool CivProjInpDbHelper::getPumps(CivPumps& pumps)
{
PumpTable pmTable;
std::vector<std::string> fields = {
pmTable.sn,
pmTable.startPoint,
pmTable.endPoint,
pmTable.headCurve,
pmTable.power
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PUMP, fields, resultVector);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
{
CivPumps::PumpTable pump;
std::map<std::string, std::string> map = resultVector[i];
pump.ID = map.find(pmTable.sn)->second;
pump.Node1 = map.find(pmTable.startPoint)->second;
pump.Node2 = map.find(pmTable.endPoint)->second;
std::string param = "Head 1";
std::string curve = map.find(pmTable.headCurve)->second;
if (curve != "")
param = "head " + curve;
std::string power = map.find(pmTable.power)->second;
if (power != "")
param.append(" power " + power);
pump.Parameters = param;
pumps.addItem(pump);
}
return true;
}
bool CivProjInpDbHelper::getReservoirs(CivReservoirs& reservoirs)
{
ResourcesTable restemTable;
std::vector<std::string> fields = {
restemTable.sn,
restemTable.totalHead,
restemTable.headPattern
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(RESIVOIR, fields, resultVector);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
{
CivReservoirs::ReservoirsTable resTable;
std::map<std::string, std::string> map = resultVector[i];
resTable.ID = map.find(restemTable.sn)->second;
resTable.Head = map.find(restemTable.totalHead)->second;
resTable.Pattern = map.find(restemTable.headPattern)->second;
reservoirs.addItem(resTable);
}
return true;
}
bool CivProjInpDbHelper::getCoordinates(CivCoordinates& coord)
{
JunctionTable nodeTable;
std::vector<std::string> fields = {
nodeTable.sn,
nodeTable.xCoord,
nodeTable.yCoord
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector);
mDbConn->query(TANK, fields, resultVector);
mDbConn->query(RESIVOIR, fields, resultVector);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
{
CivCoordinates::CoordTable coordTable;
std::map<std::string, std::string> map = resultVector[i];
coordTable.ID = map.find(fields[0])->second;
coordTable.XCoord = map.find(fields[1])->second;
coordTable.YCoord = map.find(fields[2])->second;
coord.addItem(coordTable);
}
return true;
}
bool CivProjInpDbHelper::getQuality(CivQuality& quality)
{
JunctionTable nodeTable;
std::vector<std::string> fields =
{
nodeTable.sn,
nodeTable.initQuality
};
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
{
CivQuality::QualityTable quliTable;
std::map<std::string, std::string> map = resultVector[i];
quliTable.ID = map.find(fields[0])->second;
quliTable.InitQuality = map.find(fields[1])->second;;
quality.addItem(quliTable);
}
return true;
}
......@@ -19,4 +19,9 @@ public:
bool getReservoirs(CivReservoirs& reservoirs) override;
bool getCoordinates(CivCoordinates& coord) override;
bool getQuality(CivQuality& quality) override;
void setProjCode(const std::string& projCode);
private:
std::string mPorjCode;
std::string mCondition;
};
......@@ -45,6 +45,7 @@ CivSimulResDbHelper::~CivSimulResDbHelper()
bool CivSimulResDbHelper::insertNodes(const NodeResultItems& nodeitems)
{
std::vector<std::vector<std::string>> vecVec;
std::string condition;
for (auto iter = nodeitems.begin(); iter != nodeitems.end(); iter++)
{
NodeResultItem nodeItem = iter->second;
......@@ -61,9 +62,13 @@ bool CivSimulResDbHelper::insertNodes(const NodeResultItems& nodeitems)
"\'" + nodeItem.dTime + "\'",
"\'" + CurrentTime + "\'"
};
vecVec.push_back(vecRes);
vecVec.push_back(vecRes);
condition = "\'" + nodeItem.dTime + "\'";
}
if (!mConn->del(NODERESULTTABLE, " 时间点 = "+condition))
return false;
if (!mConn->insertBulk(NODERESULTTABLE, mNodeFields, vecVec))
return false;
......@@ -73,6 +78,7 @@ bool CivSimulResDbHelper::insertNodes(const NodeResultItems& nodeitems)
bool CivSimulResDbHelper::insertLinks(const LinkResultItems& linkMap)
{
std::vector<std::vector<std::string>> vecVec;
std::string condition;
for (auto iter = linkMap.begin(); iter != linkMap.end(); iter++)
{
LinkResultItem linkItem = iter->second;
......@@ -91,7 +97,10 @@ bool CivSimulResDbHelper::insertLinks(const LinkResultItems& linkMap)
"\'" + CurrentTime + "\'"
};
vecVec.push_back(vecRes);
condition = "\'" + linkItem.dTime + "\'";
}
if (!mConn->del(PIPERESULTTABLE, " 时间点 = " + condition))
return false;
if (!mConn->insertBulk(PIPERESULTTABLE, mLinkFileds, vecVec))
return false;
......@@ -148,12 +157,12 @@ void CivSimulResDbHelper::getAllPipeCoords(PipeCoords& pipeCoords)
{
std::map<std::string, std::string> nodeInfo = res[i];
PipeCoord pipeCoord;
std::string key = nodeInfo.find("startx")->second;
std::string key = nodeInfo.find("编号")->second;
pipeCoord.startX = nodeInfo.find("startx")->second;
pipeCoord.startY = nodeInfo.find("starty")->second;
pipeCoord.endX = nodeInfo.find("endX")->second;
pipeCoord.endY = nodeInfo.find("endY")->second;
pipeCoord.endX = nodeInfo.find("endx")->second;
pipeCoord.endY = nodeInfo.find("endy")->second;
pipeCoords[key] = pipeCoord;
}
}
\ No newline at end of file
......@@ -6,10 +6,28 @@
#include<map>
#include<string>
#include "CivTypes.h"
#define Str std::string
// 水力模型系统表名
#define TABLE_NODE "节点"
#define TABLE_PIPE "管段"
#define TABLE_TANK "水池"
#define TABLE_VALVEE "阀门"
#define TABLE_RESERVOIR "水库"
#define TABLE_PROJ "方案表"
#define TABLE_PIPESIMUL "管段模拟值"
#define TABLE_NODESIMUL "节点模拟值"
#define TABLE_MOALPARAM "模型参数"
#define TABLE_MODELCURVE "曲线"
#define TABLE_MODELPATTERN "水力模式"
#define TABLE_MONITORPARESS "压力监测点"
#define TABLE_MONITORFLOW "流量监测点"
#define TABLE_MONITORQUALITY "水质监测点"
#define TABLE_PIPEMATERIAL "管材"
#define TABLE_ECONOMICVELOCITY "经济流速"
#define TABLE_TYPE_ASSEMBLY "管网组件"
#define TABLE_TYPE_ATTRIBUTR "模型属性"
/**
节点表模板
*/
......@@ -31,7 +49,6 @@ typedef struct JunctionTableFileds
Str demand = "实际需水量";
Str waterConsump = "用水量";
Str waterShortage = "用水缺额";
Str waterShortageP = "用水缺额(%)";
Str totalWater = "总水量";
Str totalHead = "总水头";
Str pressure = "压力";
......@@ -250,7 +267,6 @@ typedef struct ProjNodeTableField
Str ProjDemand = "实际需水量";
Str ProjConsumption = "用水量";
Str ProjLackWater = "用水缺额";
Str ProjLackWaterPer = "用水缺额(%)";
Str ProjTotalWater = "总水量";
Str ProjTotalHead = "总水头";
Str ProjPressure = "压力";
......
#include "CivTrackingResultCache.h"
#include "CivConnection.h"
void CivTrackingResultCache::cacheInfoFromDb(CivConnection* dbConn)
{
if (dbConn == nullptr)
return;
cacheJunctionInfoFromDb(dbConn);
cachePipeInfoFromDb(dbConn);
}
void CivTrackingResultCache::getNodeInfoBySn(const std::string& sn, Junctions& junctions)
{
auto iterm = mNodeCache.find(sn);
if (iterm == mNodeCache.end())
return;
junctions = iterm->second;
}
void CivTrackingResultCache::getPipeInfoBySn(const std::string& sn, Pipes& pipes)
{
auto iterm = mPipesCache.find(sn);
if (iterm == mPipesCache.end())
return;
pipes = iterm->second;
}
void CivTrackingResultCache::transformToJsonStr(std::string jsonStr)
{
jsonStr.append("{node:[");
// 拼接节点缓存数据
jsonStr.append("{");
for (auto iter = mNodeCache.begin(); iter != mNodeCache.end(); iter++)
{
std::string sNo = iter->first;
Junctions junctions = iter->second;
}
jsonStr.append("}");
jsonStr.append("],link:[");
// 拼接管段缓存数据
jsonStr.append("{");
for (auto iter = mPipesCache.begin(); iter != mPipesCache.end(); iter++)
{
}
jsonStr.append("}]");
jsonStr.append("}");
}
void CivTrackingResultCache::cacheJunctionInfoFromDb(CivConnection* dbConn)
{
if (dbConn == nullptr)
return;
std::vector<std::vector<std::string>> nodeResult;
std::vector<std::string> fileds;
fileds.push_back("本点号");
fileds.push_back("ST_X(geom) as xCoord");
fileds.push_back("ST_Y(geom) as yCoord");
/*if (!dbConn->getFieldValueFromTable(PIPENODE, fileds, nodeResult))
{
return;
}*/
// 缓存节点数据
int rows = nodeResult.size();
for (int i = 0; i < rows; i++)
{
if (nodeResult[i].size() < 3)
return;
Junctions junction;
std::string sn = nodeResult[i][0];
junction.sNo = sn;
junction.xCoord = nodeResult[i][1];
junction.yCoord = nodeResult[i][2];
mNodeCache[sn] = junction;
}
}
void CivTrackingResultCache::cachePipeInfoFromDb(CivConnection* dbConn)
{
if (dbConn == nullptr)
return;
std::vector<std::vector<std::string>> pipeResult;
std::vector<std::string> fileds;
fileds.push_back("编号");
fileds.push_back("ST_X(ST_StartPoint(ST_GeometryN(geom, 1))) as startX");
fileds.push_back("ST_Y(ST_StartPoint(ST_GeometryN(geom, 1))) as startY");
fileds.push_back("ST_X(ST_EndPoint(ST_GeometryN(geom, 1))) as endX");
fileds.push_back("ST_Y(ST_EndPoint(ST_GeometryN(geom, 1))) as endY");
/*if (!dbConn->getFieldValueFromTable(PIPELINE,fileds, pipeResult))
{
return;
}*/
// 缓存节点数据
int rows = pipeResult.size();
for (int i = 0; i < rows; i++)
{
if (pipeResult[i].size() < 5)
return;
Pipes pipes;
std::string sn = pipeResult[i][0];
pipes.sNo = sn;
pipes.startX= pipeResult[i][1];
pipes.startY = pipeResult[i][2];
pipes.endX = pipeResult[i][3];
pipes.endY = pipeResult[i][4];
mPipesCache[sn] = pipes;
}
}
#pragma once
#include <map>
#include <string>
#include <vector>
class CivConnection;
#define CACHEEXPORT __declspec(dllexport)
// 节点
typedef struct
{
std::string sNo; // 本点号
std::string xCoord; // x坐标
std::string yCoord; // y坐标
} Junctions;
// 管段
typedef struct
{
std::string sNo; // 编号
std::string startX; // 起始节点x
std::string startY; // 起始节点Y
std::string endX;// 终止节点X
std::string endY;// 终止节点Y
}Pipes;
/**
*追踪节点,管段信息缓存类
*/
class CACHEEXPORT CivTrackingResultCache
{
public:
/**
*@brief 缓存数据库的信息
*@param dbConn 数据库连接
*/
void cacheInfoFromDb(CivConnection* dbConn);
/**
*@brief 缓存信息转json字符串
*@param jsonStr 转的结果值
*/
void transformToJsonStr(std::string jsonStr);
/**
*@brief 根据本点号获取节点坐标信息
*@param sn 本点号
*@param junctions, 输出参数,获取的节点信息
*/
void getNodeInfoBySn(const std::string& sn, Junctions& junctions);
/**
*@brief 根据本点号获取管段坐标信息
*@param sn 本点号
*@param junctions, 输出参数,获取的管段信息
*/
void getPipeInfoBySn(const std::string& sn, Pipes& pipes);
private:
/**
*@brief 缓存数据库的节点数据
*@param dbConn 数据库连接
*/
void cacheJunctionInfoFromDb(CivConnection* dbConn);
/**
*@brief 缓存数据管段信息
*@param dbConn
*/
void cachePipeInfoFromDb(CivConnection* dbConn);
private:
std::map<std::string, Junctions> mNodeCache; // 节点信息缓存
std::map<std::string, Pipes> mPipesCache;// 管段信息缓存
};
......@@ -7,6 +7,7 @@
#include <set>
#define Str std::string
// 水力模型表名
#define PIPELINE Str("管段")
#define PIPENODE Str("节点")
......@@ -20,12 +21,13 @@
#define CURVETABLE Str("曲线")
#define OPTIONTTABLE Str("模型参数")
#define PROJTABLE Str("方案表")
#define PROJNODETABLE Str("方案点设备")
#define PROJPIPETABLE Str("方案线设备")
#define PRESSURETABLE Str("压力监测点")
#define FLOWTABLE Str("流量监测点")
#define QUALITYTABLE Str("水质监测点")
// 一些常用字段
#define PROJFILED Str("方案编码")
#endif // !CIVTYPES_H
......
......@@ -157,12 +157,14 @@ copy CivProjInpDbHelper.h $(OutDir)..\include /y
copy CivSimuResStruct.h $(OutDir)..\include /y
copy CivSimulResHelperAbs.h $(OutDir)..\include /y
copy CivSimulResDbHelper.h $(OutDir)..\include /y
copy CivHydrTableHelper.h $(OutDir)..\include /y
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="CivAssembly.h" />
<ClInclude Include="CivConnection.h" />
<ClInclude Include="CivHydrTableHelper.h" />
<ClInclude Include="CivInpDbHelper.h" />
<ClInclude Include="CivInpHelperAbs.h" />
<ClInclude Include="CivPgDbConnection.h" />
......@@ -171,19 +173,18 @@ copy CivSimulResDbHelper.h $(OutDir)..\include /y
<ClInclude Include="CivSimulResHelperAbs.h" />
<ClInclude Include="CivSimuResStruct.h" />
<ClInclude Include="CivTableFields.h" />
<ClInclude Include="CivTrackingResultCache.h" />
<ClInclude Include="CivTypes.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="CivAssembly.cpp" />
<ClCompile Include="CivConnection.cpp" />
<ClCompile Include="CivHydrTableHelper.cpp" />
<ClCompile Include="CivInpDbHelper.cpp" />
<ClCompile Include="CivInpHelperAbs.cpp" />
<ClCompile Include="CivPgDbConnection.cpp" />
<ClCompile Include="CivProjInpDbHelper.cpp" />
<ClCompile Include="CivSimulResDbHelper.cpp" />
<ClCompile Include="CivSimulResHelperAbs.cpp" />
<ClCompile Include="CivTrackingResultCache.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
......
......@@ -21,9 +21,6 @@
<ClInclude Include="CivAssembly.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivTrackingResultCache.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivConnection.h">
<Filter>头文件</Filter>
</ClInclude>
......@@ -51,14 +48,14 @@
<ClInclude Include="CivSimuResStruct.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivHydrTableHelper.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="CivAssembly.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CivTrackingResultCache.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CivConnection.cpp">
<Filter>源文件</Filter>
</ClCompile>
......@@ -80,5 +77,8 @@
<ClCompile Include="CivSimulResDbHelper.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="CivHydrTableHelper.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
#include "CivCommonUtils.h"
#ifdef _WIN32
#include <Windows.h>
#include <wchar.h>
#endif // _WIN32
#include <time.h>
std::string CivCommonUtils::string_To_UTF8(const std::string& str)
{
#ifdef _WIN32
int nwLen = ::MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, NULL, 0);
wchar_t* pwBuf = new wchar_t[nwLen + 1]; //一定要加1,不然会出现尾巴
......@@ -23,13 +26,17 @@ std::string CivCommonUtils::string_To_UTF8(const std::string& str)
delete[]pBuf;
pwBuf = NULL;
pBuf = NULL;
return strRet;
#elif
return str;
#endif // _WIND32
}
std::string CivCommonUtils::UTF8_To_string(const std::string& str)
{
#ifdef _WIN32
int nwLen = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, NULL, 0);
wchar_t* pwBuf = new wchar_t[nwLen + 1]; //一定要加1,不然会出现尾巴
memset(pwBuf, 0, nwLen * 2 + 2);
......@@ -45,8 +52,24 @@ std::string CivCommonUtils::UTF8_To_string(const std::string& str)
delete[]pwBuf;
pBuf = NULL;
pwBuf = NULL;
return strRet;
#elif
return str;
#endif // _WIN32
}
void CivCommonUtils::genSeqNo(const std::string& prefix, int size,std::vector<std::string>& resVec)
{
int base = 10000001;
for (int i = base; i < base + size; i++)
{
std::string res = std::to_string(i);
res = prefix + res.substr(1, res.length());
resVec.push_back(res);
}
}
std::string CivCommonUtils::currentTime()
......@@ -119,10 +142,12 @@ std::string CivCommonUtils::lstrip(char aa[], char c)
std::string CivCommonUtils::getExePath(void)
{
#ifdef _WIN32
char szFilePath[MAX_PATH + 1] = { 0 };
GetModuleFileNameA(NULL, szFilePath, MAX_PATH);
(strrchr(szFilePath, '\\'))[0] = 0; // 删除文件名,只获得路径字串
std::string path = szFilePath;
return path;
#endif // _WIN32
}
\ No newline at end of file
#pragma once
#include<string>
#include<map>
// #include<json/reader.h>
#include<vector>
#define UTILSEXPORT __declspec(dllexport)
// 字符串转编码
......@@ -29,6 +31,8 @@ public:
*/
static std::string UTF8_To_string(const std::string& str);
static void genSeqNo(const std::string& prefix, int size, std::vector<std::string>& res);
/**
*@brief 获取系统当前时间
*/
......
#include "CivCommonUtils.h"
#include <Windows.h>
#include <wchar.h>
#include <time.h>
std::string string_To_UTF8(const std::string& str)
{
int nwLen = ::MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, NULL, 0);
wchar_t* pwBuf = new wchar_t[nwLen + 1]; //一定要加1,不然会出现尾巴
ZeroMemory(pwBuf, nwLen * 2 + 2);
::MultiByteToWideChar(CP_ACP, 0, str.c_str(), str.length(), pwBuf, nwLen);
int nLen = ::WideCharToMultiByte(CP_UTF8, 0, pwBuf, -1, NULL, NULL, NULL, NULL);
char* pBuf = new char[nLen + 1];
ZeroMemory(pBuf, nLen + 1);
::WideCharToMultiByte(CP_UTF8, 0, pwBuf, nwLen, pBuf, nLen, NULL, NULL);
std::string strRet(pBuf);
delete[]pwBuf;
delete[]pBuf;
pwBuf = NULL;
pBuf = NULL;
return strRet;
}
std::string UTF8_To_string(const std::string& str)
{
int nwLen = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, NULL, 0);
wchar_t* pwBuf = new wchar_t[nwLen + 1]; //一定要加1,不然会出现尾巴
memset(pwBuf, 0, nwLen * 2 + 2);
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), pwBuf, nwLen);
int nLen = WideCharToMultiByte(CP_ACP, 0, pwBuf, -1, NULL, NULL, NULL, NULL);
char* pBuf = new char[nLen + 1];
memset(pBuf, 0, nLen + 1);
WideCharToMultiByte(CP_ACP, 0, pwBuf, nwLen, pBuf, nLen, NULL, NULL);
std::string strRet = pBuf;
delete[]pBuf;
delete[]pwBuf;
pBuf = NULL;
pwBuf = NULL;
return strRet;
}
//std::map<std::string, std::string> CivCommonUtils::parseJson(std::string jsonStr)
//{
// std::map<std::string, std::string> map;
//
// return map;
//}
std::string currentTime()
{
time_t rawtime;
struct tm* timeinfo;
char s[100];
time(&rawtime);
timeinfo = localtime(&rawtime);
time_t tick = mktime(timeinfo);
strftime(s, sizeof(s), "%Y-%m-%d %H:%M:%S", timeinfo);
return s;
}
std::string currentDate()
{
time_t rawtime;
struct tm* timeinfo;
char s[100];
time(&rawtime);
timeinfo = localtime(&rawtime);
time_t tick = mktime(timeinfo);
strftime(s, sizeof(s), "%Y-%m-%d", timeinfo);
return s;
}
std::string currentHour()
{
time_t rawtime;
struct tm* timeinfo;
char s[100];
time(&rawtime);
timeinfo = localtime(&rawtime);
time_t tick = mktime(timeinfo);
strftime(s, sizeof(s), "%H", timeinfo);
std::string res = lstrip(s,'0');
return res;
}
std::string lstrip(char aa[], char c)
{
int i = 0, j = 0, k = 0, z = 0;
k = strlen(aa);
z = k - 1;
while (aa[z] == c)
{
--z;
}
int x = 0, y = 0;
while (aa[y] == c)
{
y++;
}
char bb[256];
int leng = 0;
for (x = y; x < z + 1; x++)
{
bb[leng] = aa[x];
}
std::string res = bb;
return res;
}
\ No newline at end of file
#pragma once
#include<string>
#include<map>
// #include<json/reader.h>
#define LIBEXPORT extern
// 字符串转编码
#define TransUTFCoding(name) string_To_UTF8(name)
#define UTFTransCoding(name) UTF8_To_string(name)
// 当前系统日期
#define CurrentDate currentDate()
// 获取当前系统时间
#define CurrentTime currentTime()
#define CurrentHour currentHour()
// std:string转UTF8
LIBEXPORT std::string string_To_UTF8(const std::string& str);
/**
* UTF8转std:string
* 转换过程:先将utf8转双字节Unicode编码,
* 再通过WideCharToMultiByte将宽字符转换为多字节。
*/
LIBEXPORT std::string UTF8_To_string(const std::string& str);
/**
*@brief 获取系统当前时间
*/
LIBEXPORT std::string currentTime();
/**
*@brief 获取系统当前日期
*/
LIBEXPORT std::string currentDate();
LIBEXPORT std::string currentHour();
LIBEXPORT std::string lstrip(char str[], char c);
<?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>{7786a13a-338a-4d91-b6bf-dc751e55f018}</ProjectGuid>
<RootNamespace>pandasUtils</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>StaticLibrary</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\lib</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;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy CivCommonUtils.h $(OutDir)..\include /y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="CivCommonUtils.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="CivCommonUtils.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>
<ClInclude Include="CivCommonUtils.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="CivCommonUtils.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
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