LAPTOP-SNT8I5JK\Boounion
2025-04-28 fc881732b096f1c5a6dfcb9751c89f0ffca90768
1.LoadPort增加 mode, type, cassette type, transfer mode等属性值,并增加对应属性页;
已添加2个文件
已修改9个文件
411 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CEqReadIntStep.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEqVcrEventStep.cpp 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.cpp 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.h 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageGraph2.cpp 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPagePortProperty.cpp 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPagePortProperty.h 40 ●●●●● 补丁 | 查看 | 原始文档 | 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/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEqReadIntStep.cpp
@@ -62,7 +62,7 @@
    int CEqReadIntStep::onComplete()
    {
        CReadStep::onComplete();
        LOGI("<CEQPortChangeStep> onComplete.");
        LOGI("<CEqReadIntStep> onComplete.");
        return 0;
    }
@@ -70,7 +70,7 @@
    int CEqReadIntStep::onTimeout()
    {
        CReadStep::onTimeout();
        LOGI("<CEQPortChangeStep> onTimeout.");
        LOGI("<CEqReadIntStep> onTimeout.");
        return 0;
    }
SourceCode/Bond/Servo/CEqVcrEventStep.cpp
@@ -83,6 +83,8 @@
    {
        memcpy(m_szReturnBuf, &code, sizeof(short));
        m_nReturnDataSize = sizeof(short);
        return 0;
    }
}
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -5,7 +5,12 @@
namespace SERVO {
    CLoadPort::CLoadPort() : CEquipment()
    {
        m_nType = 0;
        m_nMode = 0;
        m_nCassetteType = 0;
        m_nTransferMode = 4;
        m_bEnable = FALSE;
        m_bAutoChangeEnable = FALSE;
    }
    CLoadPort::~CLoadPort()
@@ -121,4 +126,184 @@
        return pStep;
    }
    BOOL CLoadPort::isEnable()
    {
        return m_bEnable;
    }
    int CLoadPort::getPortType()
    {
        return m_nType;
    }
    int CLoadPort::getPortMode()
    {
        return m_nMode;
    }
    int CLoadPort::getCessetteType()
    {
        return m_nCassetteType;
    }
    int CLoadPort::getTransferMode()
    {
        return m_nTransferMode;
    }
    BOOL CLoadPort::isAutoChange()
    {
        return m_bAutoChangeEnable;
    }
    /*
     1: Loading Port
     2: Unloading Port
     3: Both Port
     4: Buffer Port-Buffer Type
     5: Buffer Port-Loader in Buffer Type
     6: Buffer Port-Un-loader in Buffer Type
     7: Unloading Partial Port
     */
    std::string& CLoadPort::getPortTypeDescription(int portType, std::string& strDescription)
    {
        switch (portType) {
        case 1:
            strDescription = _T("Loading Port");
            break;
        case 2:
            strDescription = _T("Unloading Port");
            break;
        case 3:
            strDescription = _T("Both Port");
            break;
        case 4:
            strDescription = _T("Buffer Port - Buffer Type");
            break;
        case 5:
            strDescription = _T("Buffer Port - Loader in Buffer Type");
            break;
        case 6:
            strDescription = _T("Buffer Port - Un-loader in Buffer Type");
            break;
        case 7:
            strDescription = _T("Unloading Partial Port");
            break;
        default:
            strDescription = _T("");
            break;
        }
        return strDescription;
    }
    /*
     0: OutOfService
     1: TransferBlocked
     2: ReadyToLoad
     3: ReadyToUnload
     4: InService
     5: TransferReady
     */
    std::string& CLoadPort::getPortModeDescription(int portMode, std::string& strDescription)
    {
        switch (portMode) {
        case 0:
            strDescription = _T("OutOfService");
            break;
        case 1:
            strDescription = _T("TransferBlocked");
            break;
        case 2:
            strDescription = _T("ReadyToLoad");
            break;
        case 3:
            strDescription = _T("ReadyToUnload");
            break;
        case 4:
            strDescription = _T("InService");
            break;
        case 5:
            strDescription = _T("TransferReady");
            break;
        default:
            strDescription = _T("");
            break;
        }
        return strDescription;
    }
    /*
     1: G1
     2: G2
     3: G1&G2
     */
    std::string& CLoadPort::getPortCassetteTypeDescription(int casseteType, std::string& strDescription)
    {
        switch (casseteType) {
        case 1:
            strDescription = _T("G1");
            break;
        case 2:
            strDescription = _T("G2");
            break;
        case 3:
            strDescription = _T("G1&G2");
            break;
        default:
            strDescription = _T("");
            break;
        }
        return strDescription;
    }
    /*
     1: MGV Mode
     2: AGV Mode
     3: Stocker Inline Mode
     */
    std::string& CLoadPort::getPortTransferModeDescription(int mode, std::string& strDescription)
    {
        switch (mode) {
        case 1:
            strDescription = _T("MGV Mode");
            break;
        case 2:
            strDescription = _T("AGV Mode");
            break;
        case 3:
            strDescription = _T("Stocker Inline Mode");
            break;
        default:
            strDescription = _T("");
            break;
        }
        return strDescription;
    }
    /*
     1 : Enable
     2 : Disable
     */
    std::string& CLoadPort::getEnableModeDescription(int mode, std::string& strDescription)
    {
        switch (mode) {
        case 1:
            strDescription = _T("Enable");
            break;
        case 2:
            strDescription = _T("Disable");
            break;
        default:
            strDescription = _T("");
            break;
        }
        return strDescription;
    }
}
SourceCode/Bond/Servo/CLoadPort.h
@@ -22,6 +22,21 @@
        virtual BOOL glassWillArrive(CGlass* pGlass);
    public:
        BOOL isEnable();
        int getPortType();
        int getPortMode();
        int getCessetteType();
        int getTransferMode();
        BOOL isAutoChange();
    public:
        static std::string& getPortTypeDescription(int portType, std::string& strDescription);
        static std::string& getPortModeDescription(int portMode, std::string& strDescription);
        static std::string& getPortCassetteTypeDescription(int casseteType, std::string& strDescription);
        static std::string& getPortTransferModeDescription(int mode, std::string& strDescription);
        static std::string& getEnableModeDescription(int mode, std::string& strDescription);
    public:
        virtual int outputGlass(int port);
        int sendCassetteCtrlCmd(short cmd,
            short* jobExistence,
@@ -30,6 +45,14 @@
            short jopCount,
            CJobDataA* pJobDataA);
        CStep* getCassetteCtrlCmdStep();
    private:
        int m_nType;
        int m_nMode;
        int m_nCassetteType;
        int m_nTransferMode;
        BOOL m_bEnable;
        BOOL m_bAutoChangeEnable;
    };
}
SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -8,6 +8,7 @@
#include "CHMPropertyDlg.h"
#include "CEquipmentPage1.h"
#include "CEquipmentPage2.h"
#include "CPagePortProperty.h"
#include "CPageCassetteCtrlCmd.h"
@@ -87,10 +88,13 @@
        SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
        CHMPropertyDlg dlg(pEquipment->getName().c_str(), 600, 680);
        CEquipmentPage1* pPage1 = new CEquipmentPage1();
        pPage1->setEquipment(pEquipment);
        pPage1->Create(IDD_PAGE_EQUIPMENT1);
        dlg.addPage(pPage1, "test1");
        if (_strcmpi(pEquipment->getClassName(), "CLoadPort") == 0) {
            CPagePortProperty* pPage1 = new CPagePortProperty();
            pPage1->setLoadPort((SERVO::CLoadPort*)pEquipment);
            pPage1->Create(IDD_PAGE_PORT_PROPERTY);
            dlg.addPage(pPage1, "属性");
        }
        CEquipmentPage2* pPage2 = new CEquipmentPage2();
        pPage2->setEquipment(pEquipment);
SourceCode/Bond/Servo/CPagePortProperty.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,139 @@
// CPagePortProperty.cpp: å®žçŽ°æ–‡ä»¶
//
#include "stdafx.h"
#include "Servo.h"
#include "CPagePortProperty.h"
#include "afxdialogex.h"
// CPagePortProperty å¯¹è¯æ¡†
IMPLEMENT_DYNAMIC(CPagePortProperty, CHMPropertyPage)
CPagePortProperty::CPagePortProperty(CWnd* pParent /*=nullptr*/)
    : CHMPropertyPage(IDD_PAGE_PORT_PROPERTY, pParent)
{
    m_pPort = nullptr;
}
CPagePortProperty::~CPagePortProperty()
{
}
void CPagePortProperty::DoDataExchange(CDataExchange* pDX)
{
    CHMPropertyPage::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CPagePortProperty, CHMPropertyPage)
    ON_WM_CTLCOLOR()
    ON_WM_DESTROY()
    ON_WM_SIZE()
    ON_BN_CLICKED(IDC_CHECK_ENABLE, &CPagePortProperty::OnBnClickedCheckEnable)
END_MESSAGE_MAP()
// CPagePortProperty æ¶ˆæ¯å¤„理程序
void CPagePortProperty::setLoadPort(SERVO::CLoadPort* pPort)
{
    m_pPort = pPort;
}
BOOL CPagePortProperty::OnInitDialog()
{
    CHMPropertyPage::OnInitDialog();
    ASSERT(m_pPort);
    CComboBox* pComboBox;
    std::string strTemp;
    pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_PORT_TYPE);
    for (int i = 1; i <= 7; i++) {
        pComboBox->InsertString(i - 1, SERVO::CLoadPort::getPortTypeDescription(i, strTemp).c_str());
    }
    int portType = m_pPort->getPortType();
    if (1 <= portType && portType <= 7) {
        pComboBox->SetCurSel(portType - 1);
    }
    pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_PORT_MODE);
    for (int i = 1; i <= 3; 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);
    }
    pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_PORT_CASSERT_TYPE);
    for (int i = 1; i <= 3; i++) {
        pComboBox->InsertString(i - 1, SERVO::CLoadPort::getPortCassetteTypeDescription(i, strTemp).c_str());
    }
    int cessetteType = m_pPort->getCessetteType();
    if (1 <= cessetteType && cessetteType <= 3) {
        pComboBox->SetCurSel(cessetteType - 1);
    }
    pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_PORT_TRANSFER_MODE);
    for (int i = 1; i <= 3; i++) {
        pComboBox->InsertString(i - 1, SERVO::CLoadPort::getPortTransferModeDescription(i, strTemp).c_str());
    }
    int transferMode = m_pPort->getTransferMode();
    if (1 <= transferMode && transferMode <= 3) {
        pComboBox->SetCurSel(transferMode - 1);
    }
    ((CButton*)GetDlgItem(IDC_CHECK_AUTO_CHANGE))->SetCheck(m_pPort->isAutoChange() ? BST_CHECKED : BST_UNCHECKED);
    EnableCtrls(m_pPort->isEnable());
    return TRUE;  // return TRUE unless you set the focus to a control
                  // å¼‚常: OCX å±žæ€§é¡µåº”返回 FALSE
}
HBRUSH CPagePortProperty::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    HBRUSH hbr = CHMPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);
    // TODO:  åœ¨æ­¤æ›´æ”¹ DC çš„任何特性
    // TODO:  å¦‚果默认的不是所需画笔,则返回另一个画笔
    return hbr;
}
void CPagePortProperty::OnDestroy()
{
    CHMPropertyPage::OnDestroy();
    // TODO: åœ¨æ­¤å¤„添加消息处理程序代码
}
void CPagePortProperty::OnSize(UINT nType, int cx, int cy)
{
    CHMPropertyPage::OnSize(nType, cx, cy);
    // TODO: åœ¨æ­¤å¤„添加消息处理程序代码
}
void CPagePortProperty::OnBnClickedCheckEnable()
{
    BOOL bCheck = ((CButton*)GetDlgItem(IDC_CHECK_ENABLE))->GetCheck() == BST_CHECKED;
    EnableCtrls(bCheck);
}
void CPagePortProperty::EnableCtrls(BOOL bEnable)
{
    GetDlgItem(IDC_COMBO_PORT_TYPE)->EnableWindow(bEnable);
    GetDlgItem(IDC_COMBO_PORT_MODE)->EnableWindow(bEnable);
    GetDlgItem(IDC_COMBO_PORT_CASSERT_TYPE)->EnableWindow(bEnable);
    GetDlgItem(IDC_COMBO_PORT_TRANSFER_MODE)->EnableWindow(bEnable);
    GetDlgItem(IDC_CHECK_AUTO_CHANGE)->EnableWindow(bEnable);
}
SourceCode/Bond/Servo/CPagePortProperty.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
#pragma once
#include "CHMPropertyPage.h"
// CPagePortProperty å¯¹è¯æ¡†
class CPagePortProperty : public CHMPropertyPage
{
    DECLARE_DYNAMIC(CPagePortProperty)
public:
    CPagePortProperty(CWnd* pParent = nullptr);   // æ ‡å‡†æž„造函数
    virtual ~CPagePortProperty();
public:
    void setLoadPort(SERVO::CLoadPort* pPort);
private:
    void EnableCtrls(BOOL bEnable);
private:
    SERVO::CLoadPort* m_pPort;
// å¯¹è¯æ¡†æ•°æ®
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_PAGE_PORT_PROPERTY };
#endif
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV æ”¯æŒ
    DECLARE_MESSAGE_MAP()
public:
    virtual BOOL OnInitDialog();
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
    afx_msg void OnDestroy();
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnBnClickedCheckEnable();
};
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/Servo.vcxproj
@@ -238,6 +238,7 @@
    <ClInclude Include="CPageCassetteCtrlCmd.h" />
    <ClInclude Include="CPageGraph1.h" />
    <ClInclude Include="CPageGraph2.h" />
    <ClInclude Include="CPagePortProperty.h" />
    <ClInclude Include="CPanelAttributes.h" />
    <ClInclude Include="CPanelEquipment.h" />
    <ClInclude Include="CPanelMaster.h" />
@@ -323,6 +324,7 @@
    <ClCompile Include="CPageCassetteCtrlCmd.cpp" />
    <ClCompile Include="CPageGraph1.cpp" />
    <ClCompile Include="CPageGraph2.cpp" />
    <ClCompile Include="CPagePortProperty.cpp" />
    <ClCompile Include="CPanelAttributes.cpp" />
    <ClCompile Include="CPanelEquipment.cpp" />
    <ClCompile Include="CPanelMaster.cpp" />
SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -91,6 +91,7 @@
    <ClCompile Include="CJobDataS.cpp" />
    <ClCompile Include="CVcrEventReport.cpp" />
    <ClCompile Include="CEqVcrEventStep.cpp" />
    <ClCompile Include="CPagePortProperty.cpp" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="AlarmManager.h" />
@@ -180,6 +181,7 @@
    <ClInclude Include="CJobDataS.h" />
    <ClInclude Include="CVcrEventReport.h" />
    <ClInclude Include="CEqVcrEventStep.h" />
    <ClInclude Include="CPagePortProperty.h" />
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Servo.rc" />
SourceCode/Bond/Servo/resource.h
Binary files differ