LAPTOP-SNT8I5JK\Boounion
2025-05-22 02fe6422964aab86753818744b901b2c299c06a4
1.Port cmd功能和界面操作实现;
2.操作提示框界面实现;
已添加12个文件
已修改11个文件
996 ■■■■■ 文件已修改
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.5(5).xlsx 补丁 | 查看 | 原始文档 | blame | 历史
Document/simulator/SEComSimulator.Conf 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CGlass.h 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.cpp 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.h 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPagePortProperty.cpp 274 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPagePortProperty.h 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Common.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/MsgDlg.cpp 303 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/MsgDlg.h 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.vcxproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.vcxproj.filters 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoCommo.h 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/EqsGraph.ini 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Master.dat 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Res/msgbox_error.ico 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Res/msgbox_question.ico 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Res/msgbox_succeed.ico 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Res/msgbox_tip.ico 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Res/msgbox_warning.ico 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Servo.ini 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.5(5).xlsx
Binary files differ
Document/simulator/SEComSimulator.Conf
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<SEComSimulatorConfiguration>
  <LASTSELECT>
    <LASTSEComID>A</LASTSEComID>
  </LASTSELECT>
  <SEComID>
    <A>
      <DRVINFO>
        <DEVICEID>1</DEVICEID>
        <IDENTITY>Host</IDENTITY>
      </DRVINFO>
      <LOGINFO>
        <DIR>D:\Chenluhua\dazi\a</DIR>
        <SECSIMODE>D</SECSIMODE>
        <SECSIIMODE>D</SECSIIMODE>
        <XMLMODE />
        <DRIVERMODE>N</DRIVERMODE>
        <DRIVERLEVEL>5</DRIVERLEVEL>
        <BACKUP>2</BACKUP>
      </LOGINFO>
      <SECSMODE MODE="HSMS">
        <HSMS>
          <HSMSMODE>Active</HSMSMODE>
          <REMOTEIP>127.0.0.1</REMOTEIP>
          <REMOTEPORT>7000</REMOTEPORT>
          <LOCALPORT>
          </LOCALPORT>
        </HSMS>
        <SECS1>
          <MASTER>True</MASTER>
          <COMPORT>COM1</COMPORT>
          <AUTOBAUD>False</AUTOBAUD>
          <BAUDRATE>9600</BAUDRATE>
          <INTERLEAVE>False</INTERLEAVE>
          <RETRYCOUNT>3</RETRYCOUNT>
        </SECS1>
      </SECSMODE>
      <TIMEOUT>
        <T1>0.5</T1>
        <T2>10</T2>
        <T3>45</T3>
        <T4>45</T4>
        <T5>10</T5>
        <T6>5</T6>
        <T7>10</T7>
        <T8>10</T8>
      </TIMEOUT>
      <EXT>
        <LINKTEST>120</LINKTEST>
      </EXT>
    </A>
  </SEComID>
</SEComSimulatorConfiguration>
SourceCode/Bond/Servo/CGlass.h
@@ -6,15 +6,10 @@
#include "CJobDataB.h"
#include "CJobDataC.h"
#include "CJobDataS.h"
#include "ServoCommo.h"
namespace SERVO {
    enum MaterialsType {
        G1 = 0,
        G2 = 1,
        G1G2 = 2
    };
    class CGlass : public CContext
    {
    public:
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -682,6 +682,180 @@
        return nRet;
    }
    int CLoadPort::setPortType(PortType type, ONWRITED onWritedBlock/* = nullptr*/)
    {
        static char* pszName[] = { STEP_PORT1_TYPE_CHANGE, STEP_PORT2_TYPE_CHANGE, STEP_PORT3_TYPE_CHANGE, STEP_PORT4_TYPE_CHANGE };
        SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(pszName[m_nIndex]);
        if (pStep == nullptr) {
            return -1;
        }
        LOGI("<CLoadPort-%d>准备设置Port type<%d>", m_nIndex, (int)type);
        short value = (short)type;
        if (onWritedBlock != nullptr) {
            pStep->writeDataEx((const char*)&value, sizeof(short), onWritedBlock);
        }
        else {
            pStep->writeDataEx((const char*)&value, sizeof(short), [&](int code) -> int {
                if (code == WOK) {
                    LOGI("<CLoadPort-%d>设置Port type成功.", m_nIndex);
                }
                else {
                    LOGI("<CLoadPort-%d>设置Port type失败,code:%d", m_nIndex, code);
                }
                return 0;
                });
        }
        return 0;
    }
    int CLoadPort::eablePort(BOOL bEnable, ONWRITED onWritedBlock/* = nullptr*/)
    {
        static char* pszName[] = { STEP_PORT1_ENABLE_MODE_CHANGE, STEP_PORT2_ENABLE_MODE_CHANGE, STEP_PORT3_ENABLE_MODE_CHANGE, STEP_PORT4_ENABLE_MODE_CHANGE };
        SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(pszName[m_nIndex]);
        if (pStep == nullptr) {
            return -1;
        }
        LOGI("<CLoadPort-%d>准备%s Port", m_nIndex, bEnable ? _T("启用") : _T("禁用"));
        short value = bEnable ? 1 : 2;
        if (onWritedBlock != nullptr) {
            pStep->writeDataEx((const char*)&value, sizeof(short), onWritedBlock);
        }
        else {
            pStep->writeDataEx((const char*)&value, sizeof(short), [&](int code) -> int {
                if (code == WOK) {
                    LOGI("<CLoadPort-%d>%s Port成功.", m_nIndex, bEnable ? _T("启用") : _T("禁用"));
                }
                else {
                    LOGI("<CLoadPort-%d>%s  Port失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code);
                }
                return 0;
                });
        }
        return 0;
    }
    int CLoadPort::setPortMode(PortMode mode, ONWRITED onWritedBlock/* = nullptr*/)
    {
        static char* pszName[] = { STEP_PORT1_MODE_CHANGE, STEP_PORT2_MODE_CHANGE, STEP_PORT3_MODE_CHANGE, STEP_PORT4_MODE_CHANGE };
        SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(pszName[m_nIndex]);
        if (pStep == nullptr) {
            return -1;
        }
        LOGI("<CLoadPort-%d>准备设置Port mode<%d>", m_nIndex, (int)mode);
        short value = (short)mode;
        if (onWritedBlock != nullptr) {
            pStep->writeDataEx((const char*)&value, sizeof(short), onWritedBlock);
        }
        else {
            pStep->writeDataEx((const char*)&value, sizeof(short), [&](int code) -> int {
                if (code == WOK) {
                    LOGI("<CLoadPort-%d>设置Port mode成功.", m_nIndex);
                }
                else {
                    LOGI("<CLoadPort-%d>设置Port mode失败,code:%d", m_nIndex, code);
                }
                return 0;
                });
        }
        return 0;
    }
    int CLoadPort::setCassetteType(CassetteType type, ONWRITED onWritedBlock/* = nullptr*/)
    {
        static char* pszName[] = { STEP_PORT1_CASSETTE_TYPE_CHANGE, STEP_PORT2_CASSETTE_TYPE_CHANGE, STEP_PORT3_CASSETTE_TYPE_CHANGE, STEP_PORT4_CASSETTE_TYPE_CHANGE };
        SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(pszName[m_nIndex]);
        if (pStep == nullptr) {
            return -1;
        }
        LOGI("<CLoadPort-%d>准备设置Cassette Type<%d>", m_nIndex, (int)type);
        short value = (short)type;
        if (onWritedBlock != nullptr) {
            pStep->writeDataEx((const char*)&value, sizeof(short), onWritedBlock);
        }
        else {
            pStep->writeDataEx((const char*)&value, sizeof(short), [&](int code) -> int {
                if (code == WOK) {
                    LOGI("<CLoadPort-%d>设置Cassette Type成功.", m_nIndex);
                }
                else {
                    LOGI("<CLoadPort-%d>设置Cassette Type失败,code:%d", m_nIndex, code);
                }
                return 0;
                });
        }
        return 0;
    }
    int CLoadPort::setTransferMode(TransferMode mode, ONWRITED onWritedBlock/* = nullptr*/)
    {
        static char* pszName[] = { STEP_PORT1_TRANSFER_MODE_CHANGE, STEP_PORT2_TRANSFER_MODE_CHANGE, STEP_PORT3_TRANSFER_MODE_CHANGE, STEP_PORT4_TRANSFER_MODE_CHANGE };
        SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(pszName[m_nIndex]);
        if (pStep == nullptr) {
            return -1;
        }
        LOGI("<CLoadPort-%d>准备设置Transfer mode<%d>", m_nIndex, (int)mode);
        short value = (short)mode;
        if (onWritedBlock != nullptr) {
            pStep->writeDataEx((const char*)&value, sizeof(short), onWritedBlock);
        }
        else {
            pStep->writeDataEx((const char*)&value, sizeof(short), [&](int code) -> int {
                if (code == WOK) {
                    LOGI("<CLoadPort-%d>设置Transfer mode成功.", m_nIndex + 1);
                }
                else {
                    LOGI("<CLoadPort-%d>设置Transfer mode失败,code:%d", m_nIndex + 1, code);
                }
                return 0;
                });
        }
        return 0;
    }
    int CLoadPort::eableAutoChange(BOOL bEnable, ONWRITED onWritedBlock/* = nullptr*/)
    {
        static char* pszName[] = { STEP_PORT1_TYPE_AUTO_CHANGE, STEP_PORT2_TYPE_AUTO_CHANGE, STEP_PORT3_TYPE_AUTO_CHANGE, STEP_PORT4_TYPE_AUTO_CHANGE };
        SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(pszName[m_nIndex]);
        if (pStep == nullptr) {
            return -1;
        }
        LOGI("<CLoadPort-%d>准备%s Auto Change", m_nIndex, bEnable ? _T("启用") : _T("禁用"));
        short value = bEnable ? 1 : 2;
        if (onWritedBlock != nullptr) {
            pStep->writeDataEx((const char*)&value, sizeof(short), onWritedBlock);
        }
        else {
            pStep->writeDataEx((const char*)&value, sizeof(short), [&](int code) -> int {
                if (code == WOK) {
                    LOGI("<CLoadPort-%d>%s Auto Change成功.", m_nIndex, bEnable ? _T("启用") : _T("禁用"));
                }
                else {
                    LOGI("<CLoadPort-%d>%s  Auto Change失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code);
                }
                return 0;
                });
        }
        return 0;
    }
    /*
     * ç”Ÿæˆæµ‹è¯•用的玻璃列表
     */
SourceCode/Bond/Servo/CLoadPort.h
@@ -1,5 +1,6 @@
#pragma once
#include "CEquipment.h"
#include "ServoCommo.h"
namespace SERVO {
@@ -24,6 +25,14 @@
        virtual void onReceiveLBData(const char* pszData, size_t size);
    public:
        int setPortType(PortType type, ONWRITED onWritedBlock = nullptr);
        int eablePort(BOOL bEnable, ONWRITED onWritedBlock = nullptr);
        int setPortMode(PortMode mode, ONWRITED onWritedBlock = nullptr);
        int setCassetteType(CassetteType type, ONWRITED onWritedBlock = nullptr);
        int setTransferMode(TransferMode mode, ONWRITED onWritedBlock = nullptr);
        int eableAutoChange(BOOL bEnable, ONWRITED onWritedBlock = nullptr);
    public:
        void setIndex(unsigned int index);
        unsigned int getIndex();
        BOOL isEnable();
SourceCode/Bond/Servo/CPagePortProperty.cpp
@@ -5,6 +5,8 @@
#include "Servo.h"
#include "CPagePortProperty.h"
#include "afxdialogex.h"
#include "Log.h"
#include "MsgDlg.h"
// CPagePortProperty å¯¹è¯æ¡†
@@ -32,6 +34,11 @@
    ON_WM_DESTROY()
    ON_WM_SIZE()
    ON_BN_CLICKED(IDC_CHECK_ENABLE, &CPagePortProperty::OnBnClickedCheckEnable)
    ON_CBN_SELCHANGE(IDC_COMBO_PORT_TYPE, &CPagePortProperty::OnCbnSelchangeComboPortType)
    ON_CBN_SELCHANGE(IDC_COMBO_PORT_MODE, &CPagePortProperty::OnCbnSelchangeComboPortMode)
    ON_CBN_SELCHANGE(IDC_COMBO_PORT_CASSERT_TYPE, &CPagePortProperty::OnCbnSelchangeComboPortCassertType)
    ON_CBN_SELCHANGE(IDC_COMBO_PORT_TRANSFER_MODE, &CPagePortProperty::OnCbnSelchangeComboPortTransferMode)
    ON_BN_CLICKED(IDC_CHECK_AUTO_CHANGE, &CPagePortProperty::OnBnClickedCheckAutoChange)
END_MESSAGE_MAP()
@@ -61,12 +68,12 @@
    }
    pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_PORT_MODE);
    for (int i = 1; i <= 3; i++) {
    for (int i = 0; i <= 5; i++) {
        pComboBox->InsertString(i - 1, SERVO::CLoadPort::getPortModeDescription(i, strTemp).c_str());
    }
    int portMode = m_pPort->getPortMode();
    if (1 <= portMode && portMode <= 3) {
        pComboBox->SetCurSel(portMode - 1);
    if (0 <= portMode && portMode <= 5) {
        pComboBox->SetCurSel(portMode);
    }
    pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_PORT_CASSERT_TYPE);
@@ -127,6 +134,266 @@
{
    BOOL bCheck = ((CButton*)GetDlgItem(IDC_CHECK_ENABLE))->GetCheck() == BST_CHECKED;
    EnableCtrls(bCheck);
    // enable port
    CMsgDlg msgDlg("请等待", "正在操作,请等待...");
    ASSERT(m_pPort != nullptr);
    m_pPort->eablePort(bCheck, [&](int code) -> int {
        Sleep(100);
        CString strMsg;
        if (code == WOK) {
            LOGI("%s Port æˆåŠŸ.", bCheck ? _T("enable") : _T("disable"));
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("%s Port æˆåŠŸ."), bCheck ? _T("enable") : _T("disable"));
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_SUCCEED);
            msgDlg.SetTitle(_T("操作成功"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(0);
        }
        else {
            LOGI("%s Port å¤±è´¥ï¼Œcode:%d", bCheck ? _T("enable") : _T("disable"), code);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("%s Port å¤±è´¥ï¼Œcode:%d"), bCheck ? _T("enable") : _T("disable"), code);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_ERROR);
            msgDlg.SetTitle(_T("操作失败"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(-1);
            // è¿˜åŽŸæŽ§ä»¶çŠ¶æ€
            EnableCtrls(!bCheck);
            ((CButton*)GetDlgItem(IDC_CHECK_ENABLE))->SetCheck(!bCheck ? BST_CHECKED : BST_UNCHECKED);
        }
        return 0;
        });
    msgDlg.DoModal();
}
void CPagePortProperty::OnCbnSelchangeComboPortType()
{
    CMsgDlg msgDlg("请等待", "正在操作,请等待...");
    msgDlg.SetData((DWORD_PTR)this);
    ASSERT(m_pPort != nullptr);
    int index = ((CComboBox*)GetDlgItem(IDC_COMBO_PORT_TYPE))->GetCurSel();
    m_pPort->setPortType(SERVO::PortType(index + 1), [&](int code) -> int {
        Sleep(100);
        CString strMsg;
        if (code == WOK) {
            LOGI("设置Port Type(%d)成功.", index + 1);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("设置Port Type(%d)成功"), index + 1);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_SUCCEED);
            msgDlg.SetTitle(_T("操作成功"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(0);
        }
        else {
            LOGI("设置Port Type(%d)失败,code:%d", index + 1, code);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("设置Port Type(%d)失败,code:%d"), index + 1, code);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_ERROR);
            msgDlg.SetTitle(_T("操作失败"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(-1);
        }
        return 0;
    });
    msgDlg.DoModal();
}
void CPagePortProperty::OnCbnSelchangeComboPortMode()
{
    CMsgDlg msgDlg("请等待", "正在操作,请等待...");
    msgDlg.SetData((DWORD_PTR)this);
    ASSERT(m_pPort != nullptr);
    int index = ((CComboBox*)GetDlgItem(IDC_COMBO_PORT_MODE))->GetCurSel();
    m_pPort->setPortMode(SERVO::PortMode(index), [&](int code) -> int {
        Sleep(100);
        CString strMsg;
        if (code == WOK) {
            LOGI("设置Port Mode(%d)成功.", index);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("设置Port Mode(%d)成功"), index);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_SUCCEED);
            msgDlg.SetTitle(_T("操作成功"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(0);
        }
        else {
            LOGI("设置Port Mode(%d)失败,code:%d", index, code);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("设置Port Mode(%d)失败,code:%d"), index, code);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_ERROR);
            msgDlg.SetTitle(_T("操作失败"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(-1);
        }
        return 0;
        });
    msgDlg.DoModal();
}
void CPagePortProperty::OnCbnSelchangeComboPortCassertType()
{
    CMsgDlg msgDlg("请等待", "正在操作,请等待...");
    msgDlg.SetData((DWORD_PTR)this);
    ASSERT(m_pPort != nullptr);
    int index = ((CComboBox*)GetDlgItem(IDC_COMBO_PORT_CASSERT_TYPE))->GetCurSel();
    m_pPort->setPortMode(SERVO::PortMode(index + 1), [&](int code) -> int {
        Sleep(100);
        CString strMsg;
        if (code == WOK) {
            LOGI("设置Cassette type(%d)成功.", index + 1);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("设置Cassette type(%d)成功"), index + 1);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_SUCCEED);
            msgDlg.SetTitle(_T("操作成功"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(0);
        }
        else {
            LOGI("设置Cassette type(%d)失败,code:%d", index + 1, code);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("设置Cassette type(%d)失败,code:%d"), index + 1, code);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_ERROR);
            msgDlg.SetTitle(_T("操作失败"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(-1);
        }
        return 0;
        });
    msgDlg.DoModal();
}
void CPagePortProperty::OnCbnSelchangeComboPortTransferMode()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
    CMsgDlg msgDlg("请等待", "正在操作,请等待...");
    msgDlg.SetData((DWORD_PTR)this);
    ASSERT(m_pPort != nullptr);
    int index = ((CComboBox*)GetDlgItem(IDC_COMBO_PORT_TRANSFER_MODE))->GetCurSel();
    m_pPort->setPortMode(SERVO::PortMode(index + 1), [&](int code) -> int {
        Sleep(100);
        CString strMsg;
        if (code == WOK) {
            LOGI("设置Transfer mode(%d)成功.", index + 1);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("设置Transfer mode(%d)成功"), index + 1);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_SUCCEED);
            msgDlg.SetTitle(_T("操作成功"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(0);
        }
        else {
            LOGI("设置Transfer mode(%d)失败,code:%d", index + 1, code);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("设置Transfer mode(%d)失败,code:%d"), index + 1, code);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_ERROR);
            msgDlg.SetTitle(_T("操作失败"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(-1);
        }
        return 0;
        });
    msgDlg.DoModal();
}
void CPagePortProperty::OnBnClickedCheckAutoChange()
{
    BOOL bCheck = ((CButton*)GetDlgItem(IDC_CHECK_AUTO_CHANGE))->GetCheck() == BST_CHECKED;
    EnableCtrls(bCheck);
    // enable port
    CMsgDlg msgDlg("请等待", "正在操作,请等待...");
    ASSERT(m_pPort != nullptr);
    m_pPort->eableAutoChange(bCheck, [&](int code) -> int {
        Sleep(100);
        CString strMsg;
        if (code == WOK) {
            LOGI("%s Auto Change æˆåŠŸ.", bCheck ? _T("enable") : _T("disable"));
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("%s Auto Change æˆåŠŸ."), bCheck ? _T("enable") : _T("disable"));
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_SUCCEED);
            msgDlg.SetTitle(_T("操作成功"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(0);
        }
        else {
            LOGI("%s Auto Change å¤±è´¥ï¼Œcode:%d", bCheck ? _T("enable") : _T("disable"), code);
            msgDlg.DelayClose(3000);
            strMsg.Format(_T("%s Auto Change å¤±è´¥ï¼Œcode:%d"), bCheck ? _T("enable") : _T("disable"), code);
            msgDlg.DelayClose(3000);
            msgDlg.SetIcon(MSG_BOX_ERROR);
            msgDlg.SetTitle(_T("操作失败"));
            msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg);
            msgDlg.SetMarquee(FALSE, 0);
            msgDlg.SetCompleteCode(-1);
            // è¿˜åŽŸæŽ§ä»¶çŠ¶æ€
            ((CButton*)GetDlgItem(IDC_CHECK_AUTO_CHANGE))->SetCheck(!bCheck ? BST_CHECKED : BST_UNCHECKED);
        }
        return 0;
        });
    msgDlg.DoModal();
}
void CPagePortProperty::EnableCtrls(BOOL bEnable)
@@ -137,3 +404,4 @@
    GetDlgItem(IDC_COMBO_PORT_TRANSFER_MODE)->EnableWindow(bEnable);
    GetDlgItem(IDC_CHECK_AUTO_CHANGE)->EnableWindow(bEnable);
}
SourceCode/Bond/Servo/CPagePortProperty.h
@@ -37,4 +37,9 @@
    afx_msg void OnDestroy();
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnBnClickedCheckEnable();
    afx_msg void OnCbnSelchangeComboPortType();
    afx_msg void OnCbnSelchangeComboPortMode();
    afx_msg void OnCbnSelchangeComboPortCassertType();
    afx_msg void OnCbnSelchangeComboPortTransferMode();
    afx_msg void OnBnClickedCheckAutoChange();
};
SourceCode/Bond/Servo/Common.h
@@ -34,6 +34,9 @@
#define EQ_BOX_ONLINE                        RGB(0, 176, 80)
#define EQ_BOX_FRAME1                        RGB(22, 22, 22)
#define EQ_BOX_FRAME2                        RGB(255, 127, 39)
#define CR_MSGBOX_BKGND                        RGB(7, 71, 166)
#define CR_MSGBOX_TITLE                        RGB(200, 216, 246)
#define CR_MSGBOX_MESSAGE                    RGB(200, 216, 246)
/* LOG BTN */
SourceCode/Bond/Servo/MsgDlg.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,303 @@
// MsgDlg.cpp: å®žçŽ°æ–‡ä»¶
//
#include "stdafx.h"
#include "Servo.h"
#include "MsgDlg.h"
#include "afxdialogex.h"
// CMsgDlg å¯¹è¯æ¡†
IMPLEMENT_DYNAMIC(CMsgDlg, CDialogEx)
CMsgDlg::CMsgDlg(CWnd* pParent /*=nullptr*/)
    : CDialogEx(IDD_DIALOG_MSG, pParent)
{
    m_nCompleteCode = 0;
    m_dwData = 0;
    m_dwDataEx = 0;
    m_crBkgnd = CR_MSGBOX_BKGND;
    m_brBkgnd.CreateSolidBrush(m_crBkgnd);
    m_crTitle = CR_MSGBOX_TITLE;
    m_crMessage = CR_MSGBOX_MESSAGE;
    m_nIcon = MSG_BOX_TIP;
}
CMsgDlg::CMsgDlg(CString strTitle, CString strMessage)
    : CDialogEx(IDD_DIALOG_MSG, NULL)
{
    m_strTitle = strTitle;
    m_strMessage = strMessage;
    m_crBkgnd = CR_MSGBOX_BKGND;
    m_brBkgnd.CreateSolidBrush(m_crBkgnd);
    m_crTitle = CR_MSGBOX_TITLE;
    m_crMessage = CR_MSGBOX_MESSAGE;
    m_nIcon = MSG_BOX_TIP;
}
CMsgDlg::CMsgDlg(int nIcon, CString strTitle, CString strMessage)
    : CDialogEx(IDD_DIALOG_MSG, NULL)
{
    m_strTitle = strTitle;
    m_strMessage = strMessage;
    m_crBkgnd = CR_MSGBOX_BKGND;
    m_brBkgnd.CreateSolidBrush(m_crBkgnd);
    m_crTitle = CR_MSGBOX_TITLE;
    m_crMessage = CR_MSGBOX_MESSAGE;
    m_nIcon = nIcon;
}
CMsgDlg::~CMsgDlg()
{
}
void CMsgDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CMsgDlg, CDialogEx)
    ON_WM_TIMER()
    ON_WM_CTLCOLOR()
    ON_WM_SIZE()
END_MESSAGE_MAP()
// CMsgDlg æ¶ˆæ¯å¤„理程序
void CMsgDlg::SetCompleteCode(int code)
{
    m_nCompleteCode = code;
    CWnd* pProgressCtrl = GetDlgItem(IDC_PROGRESS1);
    if(pProgressCtrl != nullptr) pProgressCtrl->ShowWindow(SW_HIDE);
}
int CMsgDlg::GetCompleteCode()
{
    return m_nCompleteCode;
}
void CMsgDlg::SetData(DWORD_PTR dwData)
{
    m_dwData = dwData;
}
DWORD_PTR CMsgDlg::GetData()
{
    return m_dwData;
}
void CMsgDlg::SetDataEx(DWORD_PTR dwData)
{
    m_dwDataEx = dwData;
}
DWORD_PTR CMsgDlg::GetDataEx()
{
    return m_dwDataEx;
}
void CMsgDlg::SetIcon(int nIcon)
{
    m_nIcon = nIcon;
    if (::IsWindow(m_hWnd)) {
        UpdateIcon();
    }
}
void CMsgDlg::UpdateIcon()
{
    static char* pszFile[] = { "msgbox_tip.ico", "msgbox_question.ico", "msgbox_warning.ico", "msgbox_error.ico",
    "msgbox_succeed.ico"};
    if (MSG_BOX_TIP <= m_nIcon && m_nIcon <= MSG_BOX_SUCCEED) {
        CStatic* pStatic = (CStatic*)GetDlgItem(IDC_ICON_MAIN);
        if (pStatic != NULL) {
            CString strFile;
            strFile.Format(_T("%s\\res\\%s"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir, pszFile[m_nIcon]);
            HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), strFile, IMAGE_ICON,
                48, 48, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE);
            pStatic->SetIcon(hIcon);
            SetMarquee(TRUE, 1);
        }
    }
}
void CMsgDlg::SetTitle(CString strTitle)
{
    m_strTitle = strTitle;
    if (::IsWindow(m_hWnd) && GetDlgItem(IDC_LABEL_TITLE) != NULL) {
        SetWindowText(m_strTitle);
        SetDlgItemText(IDC_LABEL_TITLE, m_strTitle);
    }
}
void CMsgDlg::SetMessage(CString strMessage)
{
    m_strMessage = strMessage;
    if (::IsWindow(m_hWnd) && GetDlgItem(IDC_LABEL_MSG) != NULL) {
        SetDlgItemText(IDC_LABEL_MSG, m_strMessage);
    }
}
void CMsgDlg::SetMarquee(_In_ BOOL fMarqueeMode, _In_ int nInterval)
{
    if (!::IsWindow(m_hWnd)) {
        return;
    }
    CProgressCtrl* pProgressCtrl = (CProgressCtrl*)GetDlgItem(IDC_PROGRESS1);
    if (pProgressCtrl != NULL) {
        pProgressCtrl->SendMessage(PBM_SETMARQUEE, (WPARAM)fMarqueeMode, (LPARAM)nInterval);
        if (!fMarqueeMode) {
            pProgressCtrl->ModifyStyle(PBS_MARQUEE, 0);
            pProgressCtrl->SetRange32(0, 100);
            pProgressCtrl->SetPos(0);
        }
        else {
            pProgressCtrl->ModifyStyle(0, PBS_MARQUEE);
        }
    }
}
void CMsgDlg::BeginThread(AFX_THREADPROC pfnThreadProc)
{
    CWinThread* pThread = AfxBeginThread(pfnThreadProc, (LPVOID)this,
        THREAD_PRIORITY_NORMAL, 0, DEBUG_PROCESS);
}
void CMsgDlg::DelayClose(int nDelay)
{
    SetTimer(1, nDelay, NULL);
}
void CMsgDlg::ShowCloseButton(BOOL bVisible)
{
    if (::IsWindow(m_hWnd) && GetDlgItem(IDCANCEL) != NULL) {
        GetDlgItem(IDCANCEL)->ShowWindow(bVisible ? SW_SHOW : SW_HIDE);
    }
}
BOOL CMsgDlg::OnInitDialog()
{
    CDialogEx::OnInitDialog();
    SetWindowText(m_strTitle);
    SetDlgItemText(IDC_LABEL_TITLE, m_strTitle);
    SetDlgItemText(IDC_LABEL_MSG, m_strMessage);
    // å­—体
    HFONT hFontDefault = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
    CFont* pFont = CFont::FromHandle(hFontDefault);
    LOGFONT lf;
    pFont->GetLogFont(&lf);
    lf.lfHeight -= 12;
    lf.lfWeight = FW_SEMIBOLD;
    m_fontTitle.CreateFontIndirect(&lf);
    GetDlgItem(IDC_LABEL_TITLE)->SetFont(&m_fontTitle);
    pFont->GetLogFont(&lf);
    lf.lfHeight -= 2;
    m_fontMsg.CreateFontIndirect(&lf);
    GetDlgItem(IDC_LABEL_MSG)->SetFont(&m_fontMsg);
    // å›¾æ ‡
    UpdateIcon();
    SetMarquee(TRUE, 1);
    MoveWindow(0, 0, 320, 268);
    CenterWindow();
    Resize();
    return TRUE;  // return TRUE unless you set the focus to a control
                  // å¼‚常: OCX å±žæ€§é¡µåº”返回 FALSE
}
void CMsgDlg::OnTimer(UINT_PTR nIDEvent)
{
    // TODO: åœ¨æ­¤æ·»åŠ æ¶ˆæ¯å¤„ç†ç¨‹åºä»£ç å’Œ/或调用默认值
    if (nIDEvent == 1) {
        KillTimer(1);
        PostMessage(WM_CLOSE);
    }
    CDialogEx::OnTimer(nIDEvent);
}
BOOL CMsgDlg::PreTranslateMessage(MSG* pMsg)
{
    // TODO: åœ¨æ­¤æ·»åŠ ä¸“ç”¨ä»£ç å’Œ/或调用基类
    if (pMsg->message == WM_KEYDOWN) {
        if ((pMsg->wParam == VK_RETURN) || (pMsg->wParam == VK_ESCAPE) || (pMsg->wParam == VK_SPACE)) {
            return TRUE;
        }
    }
    return CDialogEx::PreTranslateMessage(pMsg);
}
HBRUSH CMsgDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
    if (nCtlColor == CTLCOLOR_STATIC) {
        pDC->SetBkColor(m_crBkgnd);
        int nID = pWnd->GetDlgCtrlID();
        if (nID == IDC_LABEL_TITLE) {
            pDC->SetTextColor(CR_MSGBOX_TITLE);
        }
        else if (nID == IDC_LABEL_MSG) {
            pDC->SetTextColor(CR_MSGBOX_MESSAGE);
        }
    }
    return m_brBkgnd;
}
void CMsgDlg::OnSize(UINT nType, int cx, int cy)
{
    CDialogEx::OnSize(nType, cx, cy);
    if (GetDlgItem(IDC_LABEL_TITLE) == nullptr) return;
    Resize();
}
void CMsgDlg::Resize()
{
    int x = 28;
    int y = 28;
    CWnd* pItem;
    CRect rcClient, rcIcon, rcItem;
    GetClientRect(&rcClient);
    pItem = GetDlgItem(IDC_ICON_MAIN);
    pItem->GetWindowRect(&rcIcon);
    pItem->MoveWindow(x, y, rcIcon.Width(), rcIcon.Height());
    x += rcIcon.Width();
    x += 12;
    // title
    pItem->GetWindowRect(&rcIcon);
    ScreenToClient(&rcIcon);
    pItem = GetDlgItem(IDC_LABEL_TITLE);
    pItem->GetWindowRect(&rcItem);
    pItem->MoveWindow(x, rcIcon.top + rcIcon.Height() / 2  - rcItem.Height() / 2,
        rcClient.Width() - 24 - x, rcItem.Height());
    x = rcIcon.left;
    y += rcIcon.Height();
    y += 18;
    // msg
    pItem = GetDlgItem(IDC_LABEL_MSG);
    pItem->GetClientRect(&rcItem);
    pItem->MoveWindow(x, y, rcClient.Width() - 24 - x, rcItem.Height());
    y = rcClient.bottom - 12;
    pItem = GetDlgItem(IDC_PROGRESS1);
    pItem->GetClientRect(&rcItem);
    pItem->MoveWindow(12, y - rcItem.Height(), rcClient.Width() - 24, rcItem.Height());
}
SourceCode/Bond/Servo/MsgDlg.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
#pragma once
// CMsgDlg å¯¹è¯æ¡†
#define MSG_BOX_TIP            0x00
#define MSG_BOX_QUESTION    0x01
#define MSG_BOX_WARNING        0x02
#define MSG_BOX_ERROR        0x03
#define MSG_BOX_SUCCEED        0x04
class CMsgDlg : public CDialogEx
{
    DECLARE_DYNAMIC(CMsgDlg)
public:
    CMsgDlg(CWnd* pParent = nullptr);   // æ ‡å‡†æž„造函数
    CMsgDlg(CString strTitle, CString strMessage);
    CMsgDlg(int nIcon, CString strTitle, CString strMessage);
    virtual ~CMsgDlg();
public:
    void BeginThread(AFX_THREADPROC pfnThreadProc);
    void SetIcon(int nIcon);
    void SetTitle(CString strTitle);
    void SetMessage(CString strMessage);
    void DelayClose(int nDelay);
    void SetMarquee(_In_ BOOL fMarqueeMode, _In_ int nInterval);
    void ShowCloseButton(BOOL bVisible);
    void SetCompleteCode(int code);
    int GetCompleteCode();
    void SetData(DWORD_PTR dwData);
    DWORD_PTR GetData();
    void SetDataEx(DWORD_PTR dwData);
    DWORD_PTR GetDataEx();
private:
    void Resize();
    void UpdateIcon();
private:
    COLORREF m_crBkgnd;
    CBrush m_brBkgnd;
    int m_nIcon;
    CString m_strTitle;
    CString m_strMessage;
    COLORREF m_crTitle;
    COLORREF m_crMessage;
    CFont m_fontTitle;
    CFont m_fontMsg;
    int m_nCompleteCode;
    DWORD_PTR m_dwData;
    DWORD_PTR m_dwDataEx;
// å¯¹è¯æ¡†æ•°æ®
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_DIALOG_MSG };
#endif
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV æ”¯æŒ
    DECLARE_MESSAGE_MAP()
public:
    virtual BOOL OnInitDialog();
    afx_msg void OnTimer(UINT_PTR nIDEvent);
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
    afx_msg void OnSize(UINT nType, int cx, int cy);
};
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/Servo.vcxproj
@@ -201,6 +201,7 @@
    <ClInclude Include="CEquipmentPage3.h" />
    <ClInclude Include="CGlassPool.h" />
    <ClInclude Include="CPortStatusReport.h" />
    <ClInclude Include="MsgDlg.h" />
    <ClInclude Include="PageRecipe.h" />
    <ClInclude Include="CDoubleGlass.h" />
    <ClInclude Include="CProcessData.h" />
@@ -301,6 +302,7 @@
    <ClCompile Include="CEquipmentPage3.cpp" />
    <ClCompile Include="CGlassPool.cpp" />
    <ClCompile Include="CPortStatusReport.cpp" />
    <ClCompile Include="MsgDlg.cpp" />
    <ClCompile Include="PageRecipe.cpp" />
    <ClCompile Include="CDoubleGlass.cpp" />
    <ClCompile Include="CProcessData.cpp" />
SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -106,6 +106,7 @@
    <ClCompile Include="CGlassPool.cpp" />
    <ClCompile Include="CEquipmentPage3.cpp" />
    <ClCompile Include="CPortStatusReport.cpp" />
    <ClCompile Include="MsgDlg.cpp" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="AlarmManager.h" />
@@ -210,6 +211,7 @@
    <ClInclude Include="CGlassPool.h" />
    <ClInclude Include="CEquipmentPage3.h" />
    <ClInclude Include="CPortStatusReport.h" />
    <ClInclude Include="MsgDlg.h" />
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Servo.rc" />
SourceCode/Bond/Servo/ServoCommo.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
#pragma once
namespace SERVO {
    enum PortType {
        Loading = 1,
        Unloading,
        Both,
        Buffer,
        LoaderInBuffer,
        UnloaderInBuffer,
        UnloadingPartial
    };
    enum PortMode {
        OutOfService = 0,
        TransferBlocked,
        ReadyToLoad,
        ReadyToUnload,
        InService,
        TransferReady
    };
    enum MaterialsType {
        G1 = 0,
        G2 = 1,
        G1G2 = 2
    };
    typedef MaterialsType CassetteType;
    enum TransferMode {
        MGVMode = 1,
        AGVMode,
        StockerInlineMode
    };
}
SourceCode/Bond/Servo/resource.h
Binary files differ
SourceCode/Bond/x64/Debug/EqsGraph.ini
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
[LoadPort 1]
Left=23
Top=88
[LoadPort 2]
Left=23
Top=437
[LoadPort 3]
Left=1253
Top=297
[LoadPort 4]
Left=1253
Top=457
[EFEM(ROBOT)]
Left=294
Top=63
[Bonder 1]
Left=659
Top=297
[Bonder 2]
Left=659
Top=437
[Fliper]
Left=279
Top=297
[Aligner]
Left=446
Top=363
[VacuumBake]
Left=279
Top=437
[BakeCooling]
Left=853
Top=363
[ARM]
Left=628
Top=63
[Arm Tray1]
Left=467
Top=63
[Arm Tray2]
Left=467
Top=166
[Fliper(G2)]
Left=238
Top=251
[VacuumBake(G1)]
Left=238
Top=386
[Measurement]
Left=1041
Top=363
SourceCode/Bond/x64/Debug/Master.dat
Binary files differ
SourceCode/Bond/x64/Debug/Res/msgbox_error.ico
SourceCode/Bond/x64/Debug/Res/msgbox_question.ico
SourceCode/Bond/x64/Debug/Res/msgbox_succeed.ico
SourceCode/Bond/x64/Debug/Res/msgbox_tip.ico
SourceCode/Bond/x64/Debug/Res/msgbox_warning.ico
SourceCode/Bond/x64/Debug/Servo.ini
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
[App]
MasterPanelWidth=245
AttributesPanelWidth=306
EquipmentPanelWidth=277