SourceCode/Bond/Servo/ServoDlg.cpp
@@ -21,6 +21,7 @@
#include "SystemLogManagerDlg.h"
#include "UserManager.h"
#include "SystemLogManager.h"
#include "PortConfigurationDlg.h"
#ifdef _DEBUG
@@ -190,6 +191,18 @@
               GetRuntimeFormatText(strText, "");
               m_pMyStatusbar->setRunTimeText((LPTSTR)(LPCTSTR)strText);
            }
            else if (state == SERVO::MASTERSTATE::STARTING) {
               m_pMyStatusbar->setBackgroundColor(STATUSBAR_BK_STARTING);
               m_pMyStatusbar->setForegroundColor(RGB(0, 0, 0));
               m_pMyStatusbar->setRunTimeText("正在启动...");
            }
            else if (state == SERVO::MASTERSTATE::MSERROR) {
               m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(TRUE);
               m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(FALSE);
               m_pMyStatusbar->setBackgroundColor(STATUSBAR_BK_ALARM);
               m_pMyStatusbar->setForegroundColor(RGB(0, 0, 0));
               m_pMyStatusbar->setRunTimeText("启动失败.");
            }
            else if (state == SERVO::MASTERSTATE::RUNNING) {
               m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(FALSE);
               m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(TRUE);
@@ -221,6 +234,9 @@
                  m_pMyStatusbar->setCurTaskBtnText("无");
               }
               else if (exCode == ROBOT_EVENT_ABORT) {
                  m_pMyStatusbar->setCurTaskBtnText("无");
               }
               else if (exCode == ROBOT_EVENT_RESTORE) {
                  m_pMyStatusbar->setCurTaskBtnText("无");
               }
            }
@@ -267,6 +283,10 @@
   //  执行此操作
   SetIcon(m_hIcon, TRUE);         // 设置大图标
   SetIcon(m_hIcon, FALSE);      // 设置小图标
   // model init
   theApp.m_model.init();
   // 菜单
@@ -338,9 +358,6 @@
   MoveWindow((width - rcWnd.Width()) / 2, 0, rcWnd.Width(), rcWnd.Height(), TRUE);
   // model init
   theApp.m_model.init();
   SetTimer(TIMER_ID_CREATE_TERMINAL, 3000, nullptr);
   InitRxWindows();
@@ -349,6 +366,7 @@
   // 相当于延时调用master的初始化
   theApp.m_model.m_master.init();
   theApp.m_model.loadPortParams();
   // 初始化master以后需要控件绑定数据
@@ -855,19 +873,41 @@
{
   int id = (int)lParam;
   if (id == IDC_BUTTON_RUN) {
      theApp.m_model.getMaster().start();
      m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(FALSE);
      if (theApp.m_model.getMaster().getState() == SERVO::MASTERSTATE::MSERROR) {
         AfxMessageBox("当前有机台发生错误,不能启动,请确认解决问题后再尝试重新启动!");
      }
      else {
         if (theApp.m_model.getMaster().start() == 0) {
            m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(FALSE);
         }
      }
   }
   else if (id == IDC_BUTTON_STOP) {
      theApp.m_model.getMaster().stop();
      m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(FALSE);
      if (theApp.m_model.getMaster().stop() == 0) {
         m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(FALSE);
      }
   }
   else if (id == IDC_BUTTON_PORT_CONFIG) {
      CPortConfigurationDlg dlg;
      dlg.DoModal();
   }
   else if (id == IDC_BUTTON_ROBOT) {
      theApp.m_model.getMaster().clearError();
      SERVO::CEFEM* pEFEM = (SERVO::CEFEM*)theApp.m_model.getMaster().getEquipment(EQ_ID_EFEM);
      CRobotCmdTestDlg dlg;
      dlg.SetEFEM(pEFEM);
      dlg.DoModal();
   }
   else if (id == IDC_BUTTON_SETTINGS) {
      SERVO::CEquipment* pEq = theApp.m_model.m_master.getEquipment(EQ_ID_EFEM);
      ((SERVO::CEFEM*)pEq)->printDebugRobotState();
      pEq->printDebugString001();
      pEq = theApp.m_model.m_master.getEquipment(EQ_ID_Bonder1);
      pEq->printDebugString001();
      pEq = theApp.m_model.m_master.getEquipment(EQ_ID_Bonder2);
      pEq->printDebugString001();
   }
   else if (id == IDC_BUTTON_OPERATOR) {
      int menuId = (int)wParam;
      SystemLogManager& logManager = SystemLogManager::getInstance();