Commit f1ea02ef authored by 刘乐's avatar 刘乐

文档更改

parent 6b0c5bcb
...@@ -86,10 +86,10 @@ void CivProjSimulationTest::test(char* uri) ...@@ -86,10 +86,10 @@ void CivProjSimulationTest::test(char* uri)
{ {
// 追踪节点编号 // 追踪节点编号
char projCode[512]; char projCode[512];
strcpy(projCode, "57cae198-838d-4776-8ec1-c195df12b00b"); strcpy(projCode, "ba01c9a8-f113-4131-b566-5f7f1ce25e5c");
char time[512]; char time[512];
strcpy(time, "2020-09-16 09:00:00"); strcpy(time, "2020-09-24 09:00:00");
bool isSucc = projSimulation(uri, projCode, time); bool isSucc = projSimulation(uri, projCode, time);
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup /> <PropertyGroup>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup>
</Project> </Project>
\ No newline at end of file
#include "CivPgDbConnection.h" #include "CivPgDbConnection.h"
#include "CivCommonUtils.h" #include "CivCommonUtils.h"
#include "StringUtils.h"
#include <iostream> #include <iostream>
...@@ -49,6 +50,9 @@ bool CivPgDbConnection::queryResult(std::vector<std::map<std::string,std::string ...@@ -49,6 +50,9 @@ bool CivPgDbConnection::queryResult(std::vector<std::map<std::string,std::string
std::string filedName = CivCommonUtils::UTF8_To_string(PQfname(mResult, j)); std::string filedName = CivCommonUtils::UTF8_To_string(PQfname(mResult, j));
std::string filedValue = CivCommonUtils::UTF8_To_string(PQgetvalue(mResult, i, j)); std::string filedValue = CivCommonUtils::UTF8_To_string(PQgetvalue(mResult, i, j));
StringUtils::trim(filedName);
StringUtils::trim(filedValue);
map.insert(std::pair<std::string, std::string>(filedName,filedValue)); map.insert(std::pair<std::string, std::string>(filedName,filedValue));
} }
result.push_back(map); result.push_back(map);
......
...@@ -20,7 +20,7 @@ void CivProjInpDbHelper::setProjCode(const std::string& projCode) ...@@ -20,7 +20,7 @@ void CivProjInpDbHelper::setProjCode(const std::string& projCode)
void CivProjInpDbHelper::handlePump() void CivProjInpDbHelper::handlePump()
{ {
// 处理水泵连接的管段
} }
void CivProjInpDbHelper::sortProjDeatil() void CivProjInpDbHelper::sortProjDeatil()
...@@ -273,7 +273,7 @@ void CivProjInpDbHelper::handleValve() ...@@ -273,7 +273,7 @@ void CivProjInpDbHelper::handleValve()
pipeStruct.Length = "2"; pipeStruct.Length = "2";
pipeStruct.Diameter = valveMap.find("阀门直径")->second; pipeStruct.Diameter = valveMap.find("阀门直径")->second;
pipeStruct.Roughness = std::string("130");//valveMap.find("摩阻系数")->second; pipeStruct.Roughness = std::string("130");//valveMap.find("摩阻系数")->second;
pipeStruct.Status = (valveStatus== "开") ? "Open" : "CV"; pipeStruct.Status = (valveStatus== "开") ? "CV" : "Open";
pipeStruct.MinorLoss = "0"; pipeStruct.MinorLoss = "0";
auto pter = std::make_pair(valveSn, pipeStruct); auto pter = std::make_pair(valveSn, pipeStruct);
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ShowAllFiles>true</ShowAllFiles> <ShowAllFiles>false</ShowAllFiles>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
\ No newline at end of file
...@@ -18,3 +18,14 @@ void StringUtils::split(std::string sourceStr, std::vector<std::string>& res, co ...@@ -18,3 +18,14 @@ void StringUtils::split(std::string sourceStr, std::vector<std::string>& res, co
ptr = NULL; ptr = NULL;
} }
} }
void StringUtils::trim(std::string & s)
{
if (!s.empty())
{
s.erase(0, s.find_first_not_of(" "));
s.erase(s.find_last_not_of(" ") + 1);
}
}
...@@ -12,9 +12,15 @@ class PANDALOG_API StringUtils ...@@ -12,9 +12,15 @@ class PANDALOG_API StringUtils
public: public:
/** /**
*@brief 将字符串按照分隔符分割成字符串数组 *@brief 将字符串按照分隔符分割成字符串数组
*@param [std::string] 源字符串 *@param [in] sourceStr源字符串
*@param [std::vector] 分割后的字符串数组 *@param [in] res 分割后的字符串数组
*@param [std::string] delim 分割符,默认空格分割 *@param [in] delim 分割符,默认空格分割
*/ */
static void split(std::string sourceStr, std::vector<std::string>& res, const std::string& delim =" "); static void split(std::string sourceStr, std::vector<std::string>& res, const std::string& delim =" ");
/**
*@brief 去除字符串首尾空格
*@param [in] s 源字符串
*/
static void trim(std::string& s);
}; };
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ShowAllFiles>true</ShowAllFiles> <ShowAllFiles>false</ShowAllFiles>
</PropertyGroup> </PropertyGroup>
</Project> </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