From 352bceccf43901a6288bcf3ddf97e84953434ac8 Mon Sep 17 00:00:00 2001
From: lm <2214859663@qq.com>
Date: Fri, 10 Jan 2025 11:36:20 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E6=8C=87=E4=BB=A4=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E8=B0=83=E8=AF=95=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
LKJPort/LKJPort.vcxproj | 2 ++
LKJPort/LKJPortDlg.cpp | 22 ++++++++++++++++------
LKJPort/LKJPortDlg.h | 1 +
3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/LKJPort/LKJPort.vcxproj b/LKJPort/LKJPort.vcxproj
index c03ba25..8f008e6 100644
--- a/LKJPort/LKJPort.vcxproj
+++ b/LKJPort/LKJPort.vcxproj
@@ -166,6 +166,7 @@
_WINDOWS;NDEBUG;H_OS_WINDOWS;%(PreprocessorDefinitions)
pch.h
.\;.\3rd\include
+ Disabled
Windows
@@ -173,6 +174,7 @@
true
.\3rd\lib;%(AdditionalLibraryDirectories)
fmt\fmt.lib;co\co.lib;evpp\evpp_static.lib;glog\glog.lib;event2\event.lib;event2\event_core.lib;event2\event_extra.lib
+ true
false
diff --git a/LKJPort/LKJPortDlg.cpp b/LKJPort/LKJPortDlg.cpp
index 1f7c10b..f7a908e 100644
--- a/LKJPort/LKJPortDlg.cpp
+++ b/LKJPort/LKJPortDlg.cpp
@@ -123,7 +123,7 @@ BOOL CLKJPortDlg::OnInitDialog()
m_RailwayInspect->Start();
Logging("轨检初始化成功");
- m_SubSystemPlugManager.SetPath(FileHelper::GetRootPath());
+ //m_SubSystemPlugManager.SetPath(FileHelper::GetRootPath());
m_SubSystemPlugManager.InitPlug();
TCServer_Initialize();
Logging("巡检和限界初始化成功");
@@ -349,7 +349,11 @@ LRESULT CLKJPortDlg::OnWM_USER_CORE_DESCRIBLE_LOGIN(WPARAM wp, LPARAM lp)
LRESULT CLKJPortDlg::OnHTFun(WPARAM wparam, LPARAM lparam)
{
- Logging("巡检已连接");
+ if (m_flagXJ == false) {
+ Logging("巡检已连接");
+ m_flagXJ = true;
+ }
+
m_onlineTime = epoch::ms();
return 1;
}
@@ -363,7 +367,12 @@ void CLKJPortDlg::CheckOnline()
int64 ms = epoch::ms() - m_onlineTime;
if (m_onlineTime > 0 && ms > 30000)
{
- Logging("巡检已断开");
+ if (m_flagXJ)
+ {
+ Logging("巡检已断开");
+ m_flagXJ = false;
+ }
+
}
sleep::sec(1);
}
@@ -582,13 +591,15 @@ void CLKJPortDlg::OnBnClickedButton4()
CString cstrLineName;
m_editLineName.GetWindowText(cstrLineName);
- std::string strLineName(cstrLineName.GetString(), cstrLineName.GetLength());
+ fastring strLineName(cstrLineName.GetString(), cstrLineName.GetLength());
+ strLineName = strLineName.replace("上行","");
+ strLineName = strLineName.replace("下行", "");
CString cstrLineCode;
m_editLineCode.GetWindowText(cstrLineCode);
std::string strLineCode(cstrLineCode.GetString(), cstrLineCode.GetLength());
- _command._line._line_name = strLineName;
+ _command._line._line_name = strLineName.c_str();
_command._line._line_code = strLineCode;
_command._line._line_xingbie = nCheckType == 0 ? "上行" : "下行";
_command._line._line_name = _command._line.GetDisplayName();
@@ -596,7 +607,6 @@ void CLKJPortDlg::OnBnClickedButton4()
Logging(fmt::format("_line_name:{0}", _command._line._line_name));
Logging(fmt::format("_line_code:{0}", _command._line._line_code));
Logging(fmt::format("_line_xingbie:{0}", _command._line._line_xingbie));
- Logging(fmt::format("_line_name:{0}", _command._line._line_name));
ICTConfigModule::SetTrainCommandParam(_train_number, _command);
if (pTmasTrain->TrainTaskControl(0, _command))
diff --git a/LKJPort/LKJPortDlg.h b/LKJPort/LKJPortDlg.h
index 4ca7e6f..0164f6a 100644
--- a/LKJPort/LKJPortDlg.h
+++ b/LKJPort/LKJPortDlg.h
@@ -72,6 +72,7 @@ private:
public:
+ bool m_flagXJ{false};
int64 m_onlineTime{ -1 };//毫秒
std::thread m_threadCheck;
bool m_Running{true};