From 326d3e312c74726814c39c9d112faab03c4a167c Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期日, 16 一月 2022 13:53:57 +0800 Subject: [PATCH] add status show function dialog --- MTerm2/MTerm2Doc.cpp | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/MTerm2/MTerm2Doc.cpp b/MTerm2/MTerm2Doc.cpp index 4eab988..067073d 100644 --- a/MTerm2/MTerm2Doc.cpp +++ b/MTerm2/MTerm2Doc.cpp @@ -27,6 +27,8 @@ #include <propkey.h> #include "CDialogCommSet1.h" +#include "CDialogStatusShow.h" + #include "HvSerialPort.h" #include <functional> @@ -122,9 +124,6 @@ {OP_MUL,"MUL",3,KLParamWord,"X"}, {OP_DIV,"DIV",3,KLParamWord,"/"}, - - - }; int CMTerm2Doc::nOpDefCount = sizeof(CMTerm2Doc::OpDef) / sizeof(stOpDef); @@ -150,8 +149,11 @@ ON_COMMAND(ID_MENU_SHOW_CONSOLE, &CMTerm2Doc::OnMenuShowConsole) ON_COMMAND(ID_MENU_COMM_TEST, &CMTerm2Doc::OnMenuCommTest) + + ON_COMMAND(ID_SIMULATE, &CMTerm2Doc::OnSimulate) ON_UPDATE_COMMAND_UI(ID_SIMULATE, &CMTerm2Doc::OnUpdateSimulate) + ON_COMMAND(ID_MENU_STATUS_SHOW, &CMTerm2Doc::OnMenuStatusShow) END_MESSAGE_MAP() @@ -163,7 +165,7 @@ MyKLink1.SetSendCallBackFunc(std::bind(&CMTerm2Doc::SendPacket, this, std::placeholders::_1, std::placeholders::_2)); MyKLink1.SetRecvCallBackFunc(std::bind(&CMTerm2Doc::RecvPacket, this, std::placeholders::_1, std::placeholders::_2)); - StartTime = myHvSerialPort1.GetTimeMs(); + StartTime = myHvSerialPort1.GetTimemS(); } CMTerm2Doc::~CMTerm2Doc() @@ -1912,12 +1914,25 @@ void CMTerm2Doc::OnTimer(UINT_PTR nIDEvent) { + CString s1; +// s1.Format(_T("Doc::OntTimer")); +// SysLog(s1); if (m_bSimulate && m_bPlcRunning) { //ProcessPLCProg(Progs, m_nProgSteps); myKMachine1.ProcPLC(); // update PLC Stat + } +} + +void CMTerm2Doc::OnMenuStatusShow() +{ + // TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜 + CDialogStatusShow dialog1; + INT_PTR r = dialog1.DoModal(); + if (r == IDOK) + { } } -- Gitblit v1.9.1