Browse Source

巡检指令功能调试完成

master
lm 2 months ago
parent
commit
352bceccf4
  1. 2
      LKJPort/LKJPort.vcxproj
  2. 22
      LKJPort/LKJPortDlg.cpp
  3. 1
      LKJPort/LKJPortDlg.h

2
LKJPort/LKJPort.vcxproj

@ -166,6 +166,7 @@
<PreprocessorDefinitions>_WINDOWS;NDEBUG;H_OS_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>.\;.\3rd\include</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -173,6 +174,7 @@
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>.\3rd\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>fmt\fmt.lib;co\co.lib;evpp\evpp_static.lib;glog\glog.lib;event2\event.lib;event2\event_core.lib;event2\event_extra.lib</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>

22
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))

1
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};

Loading…
Cancel
Save