Commit 5d3ab13d by yahan.li

修改: SigerCalculation/MonitorLogfile.cpp

	修改:     SigerCalculation/RadomForestSAC/RamdomForestCalculate.cpp
	修改:     SigerCalculation/package/E3/SigerCalculation
parent 76e0bf6b
...@@ -14,7 +14,7 @@ void compressLogs() ...@@ -14,7 +14,7 @@ void compressLogs()
} }
// 获取当前日期,找出昨天的日志文件 // 获取当前日期,找出昨天的日志文件
QDate yesterday = QDate::currentDate().addDays(-1); QDate yesterday = QDate::currentDate().addDays(-1);
QString logFileName = QString("SigerCalculation_%1.txt").arg(yesterday.toString("yyyy-MM-dd")); QString logFileName = QString("SigerCalculation_%1.log").arg(yesterday.toString("yyyy-MM-dd"));
QString logFilePath = logDir.filePath(logFileName); QString logFilePath = logDir.filePath(logFileName);
if (!QFile::exists(logFilePath)) { if (!QFile::exists(logFilePath)) {
......
...@@ -160,9 +160,6 @@ RamdomForestCalculate::RamdomForestCalculate(QObject *parent) ...@@ -160,9 +160,6 @@ RamdomForestCalculate::RamdomForestCalculate(QObject *parent)
m_tcpServerManager = new TcpServerManager(); // 实例化 m_tcpServerManager = new TcpServerManager(); // 实例化
m_tcpServerManager->startServer(2026); m_tcpServerManager->startServer(2026);
//dbFunc = new DBFunc(); // 实例化
//dbFunc->startDBThread("RamdomForestFeatureValue");
//2.创建数据库表 //2.创建数据库表
CreatTable(); CreatTable();
...@@ -171,9 +168,8 @@ RamdomForestCalculate::RamdomForestCalculate(QObject *parent) ...@@ -171,9 +168,8 @@ RamdomForestCalculate::RamdomForestCalculate(QObject *parent)
Retrain(); Retrain();
//GLS Test //GLS Test
// StreamInfo info(1,"C$14$1$1$1$101$0","1764733704270-0","0"); // StreamInfo info(1,"C$14$1$1$1$101$0","1764733704270-0","0");
// SendStreamAlarminfo(info); // SendStreamAlarminfo(info);
//连接信号和槽函数 //连接信号和槽函数
QObject::connect(m_tcpServerManager, &TcpServerManager::getdc_sacdata, QObject::connect(m_tcpServerManager, &TcpServerManager::getdc_sacdata,
...@@ -228,9 +224,22 @@ void RamdomForestCalculate::SendStreamAlarminfo(const StreamInfo &alarmInfo) ...@@ -228,9 +224,22 @@ void RamdomForestCalculate::SendStreamAlarminfo(const StreamInfo &alarmInfo)
QString ip("127.0.0.1"); QString ip("127.0.0.1");
TcpClient tcp_client(ip, 5999); TcpClient tcp_client(ip, 5999);
QJsonObject json; QJsonObject json;
QString target = alarmInfo.target;
int pos = 0;
for (int i = 0; i < 7; i++) {
pos = target.indexOf('$', pos + 1);
if (pos == -1)
break;
}
if (pos != -1) {
target.resize(pos);
}
json["source"] = STREAM_MESSAGE; json["source"] = STREAM_MESSAGE;
json["typealarm"] = QString::number(alarmInfo.alarmtype); json["typealarm"] = QString::number(alarmInfo.alarmtype);
json["target"] = alarmInfo.target; json["target"] = target;
json["startIds"] = alarmInfo.startIds; json["startIds"] = alarmInfo.startIds;
json["endIds"] = alarmInfo.endIds; json["endIds"] = alarmInfo.endIds;
......
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