From d9c3fbc92d2a775674943d4ab882fbd77f0db688 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 08 七月 2025 20:31:34 +0800
Subject: [PATCH] 1.增加日期时间同步功能和测试;
---
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp | 42 ++++++++++++++++++++++++++++++++++--------
1 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp b/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp
index ee40fd2..e67fa2c 100644
--- a/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp
+++ b/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp
@@ -73,6 +73,8 @@
ON_WM_DESTROY()
ON_BN_CLICKED(IDC_BUTTON_CONNECT, &CEAPSimulatorDlg::OnBnClickedButtonConnect)
ON_BN_CLICKED(IDC_BUTTON_DISCONNECT, &CEAPSimulatorDlg::OnBnClickedButtonDisconnect)
+ ON_BN_CLICKED(IDC_BUTTON_ARE_YOU_THERE, &CEAPSimulatorDlg::OnBnClickedButtonAreYouThere)
+ ON_BN_CLICKED(IDC_BUTTON_DATETIME_SYNC, &CEAPSimulatorDlg::OnBnClickedButtonDatetimeSync)
END_MESSAGE_MAP()
@@ -103,13 +105,11 @@
int state;
if (pAny->getIntValue("exCode", state)) {
if ((ACTIVESTATE)state == ACTIVESTATE::SELECTED) {
- GetDlgItem(IDC_BUTTON_DISCONNECT)->EnableWindow(TRUE);
+ SetGroup2Enabled(TRUE);
}
if ((ACTIVESTATE)state == ACTIVESTATE::NOT_CONNECTED) {
- GetDlgItem(IDC_BUTTON_DISCONNECT)->EnableWindow(FALSE);
- GetDlgItem(IDC_EDIT_IP)->EnableWindow(TRUE);
- GetDlgItem(IDC_EDIT_PORT)->EnableWindow(TRUE);
- GetDlgItem(IDC_BUTTON_CONNECT)->EnableWindow(TRUE);
+ SetGroup2Enabled(FALSE);
+ SetGroup1Enabled(TRUE);
}
}
}
@@ -125,6 +125,8 @@
theApp.m_model.getObservable()->observeOn(pRxWindows->mainThread())
->subscribe(m_pObserver);
}
+
+ theApp.m_model.init();
}
BOOL CEAPSimulatorDlg::OnInitDialog()
@@ -158,6 +160,8 @@
SetDlgItemText(IDC_EDIT_IP, _T("127.0.0.1"));
SetDlgItemInt(IDC_EDIT_PORT, 7000);
+ SetGroup2Enabled(FALSE);
+ SetGroup1Enabled(TRUE);
// log edit
@@ -236,6 +240,20 @@
m_pObserver = NULL;
}
+void CEAPSimulatorDlg::SetGroup1Enabled(bool enabled)
+{
+ GetDlgItem(IDC_EDIT_IP)->EnableWindow(enabled);
+ GetDlgItem(IDC_EDIT_PORT)->EnableWindow(enabled);
+ GetDlgItem(IDC_BUTTON_CONNECT)->EnableWindow(enabled);
+}
+
+void CEAPSimulatorDlg::SetGroup2Enabled(bool enabled)
+{
+ GetDlgItem(IDC_BUTTON_DISCONNECT)->EnableWindow(enabled);
+ GetDlgItem(IDC_BUTTON_ARE_YOU_THERE)->EnableWindow(enabled);
+ GetDlgItem(IDC_BUTTON_DATETIME_SYNC)->EnableWindow(enabled);
+}
+
void CEAPSimulatorDlg::OnBnClickedButtonConnect()
{
CString strIp;
@@ -243,12 +261,20 @@
GetDlgItemText(IDC_EDIT_IP, strIp);
port = GetDlgItemInt(IDC_EDIT_PORT);
theApp.m_model.connectEq((LPTSTR)(LPCTSTR)strIp, port);
- GetDlgItem(IDC_EDIT_IP)->EnableWindow(FALSE);
- GetDlgItem(IDC_EDIT_PORT)->EnableWindow(FALSE);
- GetDlgItem(IDC_BUTTON_CONNECT)->EnableWindow(FALSE);
+ SetGroup1Enabled(FALSE);
}
void CEAPSimulatorDlg::OnBnClickedButtonDisconnect()
{
theApp.m_model.disconnect();
}
+
+void CEAPSimulatorDlg::OnBnClickedButtonAreYouThere()
+{
+ theApp.m_model.m_pHsmsActive->hsmsAreYouThere();
+}
+
+void CEAPSimulatorDlg::OnBnClickedButtonDatetimeSync()
+{
+ theApp.m_model.m_pHsmsActive->hsmsDatetimeSync();
+}
--
Gitblit v1.9.3