Commit d6aa5e6c authored by 刘乐's avatar 刘乐

1,增加余氯分析接口

parent 50cbba70
......@@ -167,5 +167,13 @@ bool PANDANALYSIS_API optimalSchedulingSimulation(char* uri, char* condition, in
// 复制
strcpy(result, resultStr.c_str());
return true;
}
bool PANDANALYSIS_API residualChlorineAnalysis(char* uri, char* conditionMap,char* error)
{
std::string uriStr = uri;
std::string conditionMapStr = conditionMap;
return true;
}
\ No newline at end of file
......@@ -69,6 +69,14 @@ extern "C" {
*@param [out] result: 模拟的调度结果
*/
bool PANDANALYSIS_API optimalSchedulingSimulation(char* uri, char* condition, int timeInterval, char* result);
/**
*@brief 优化调度模拟
* @param [in] uri:condition
* @param [in] condition:约束条件, 格式: json字符串 {"startTime":'',"endTime":'',"水池":[{"code":'',"余氯量":},{"code":'',"余氯量":}]}
* @param [error] 错误警告
*/
bool PANDANALYSIS_API residualChlorineAnalysis(char* uri, char* conditionMap,char* error);
#if defined(__cplusplus)
}
#endif
......
......@@ -189,14 +189,14 @@ void CivOptSchedEngine::schedulingResultToJson(string& json)
szNo = pumpIter->second;
}
json.append(szNo + ":" + to_string(iter->second));
json.append("\""+szNo + "\":" + to_string(iter->second));
json.append(",");
}
json = json.substr(0, json.length() - 1);
json.append("},");
// 调度组合
json.append("\"监测点:\"");
json.append("\"监测点\":");
json.append("{");
for (auto iter = mBforeSchedulingResults.begin(); iter != mBforeSchedulingResults.end(); iter++)
......@@ -226,7 +226,7 @@ void CivOptSchedEngine::schedulingResultToJson(string& json)
}
json = json.substr(0, json.length() - 1);
json.append("}");
json.append("}}");
}
......
#include "CivResidualChlorineAnalysis.h"
CivResidualChlorineAnalysis::CivResidualChlorineAnalysis(const std::string& uri,
const std::string& startTime, const std::string& endTime)
:mUri(uri),mStartTime(startTime),mEndTile(endTime)
{
}
bool CivResidualChlorineAnalysis::convertToInp()
{
}
bool CivResidualChlorineAnalysis::analysisChlorine()
{
}
\ No newline at end of file
#pragma once
#include <string>
/**
余氯分析类
*/
class CivResidualChlorineAnalysis
{
public:
/**
* @brief 余氯分析构造函数
* @param [uri] 数据库链接地址
* @param [startTime] 开始时刻
* @param [endTime] 结束时刻
*/
CivResidualChlorineAnalysis(const std::string& uri,const std::string& startTime,const std::string& endTime);
bool analysisChlorine();
/**
返回错误信息
*/
std::string lastError() const { return mLastError; }
private:
/**
转inp文件
*/
bool convertToInp();
private:
std::string mUri;
std::string mStartTime;
std::string mEndTile;
std::string mLastError;
};
......@@ -134,19 +134,12 @@ void CivPumpHelper::getMonitors(vector<string>& monitors,map<string,string>& mon
map<string, string> tempMap = tempMapVec[i];
string szNo = tempMap.find("本点号")->second;
string code = tempMap.find("code")->second;
auto mIter = std::find(monitors.begin(), monitors.end(), szNo);
if (mIter != monitors.end())
{
monitorMap.insert(pair<string, string>(szNo, code));
}
mIter = std::find(monitors.begin(), monitors.end(), code);
if (mIter != monitors.end())
vector<string>::iterator iter = std::find(monitors.begin(), monitors.end(), code);
if (iter != monitors.end())
{
monitorMap.insert(pair<string, string>(szNo, code));
*iter = szNo;
monitorMap.insert(pair<string, string>(szNo,code));
}
}
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ public:
typedef map<string, CivVariant> Params;
CivAttributes() = default;
CivAttributes(const Params& params);
explicit CivAttributes(const Params& params);
/**
* @brief 添加单个属性
......
#pragma once
#include "CivAttributes.h"
#include "CivGeometry.h"
#include "pandaWaterCore.h"
......
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