LAPTOP-SNT8I5JK\Boounion
2025-06-12 552b0d6e5d9f02c5f50e7407f0b274f4b926a043
Merge branch 'clh'

# Conflicts:
# SourceCode/Bond/Servo/Servo.rc
# SourceCode/Bond/Servo/Servo.vcxproj.filters
# SourceCode/Bond/Servo/resource.h
已添加4个文件
已修改11个文件
359 ■■■■■ 文件已修改
.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Document/ESWIN_Machine_Data_Collection_Bonder_VendorName_Machine_v1.1_yymmdd.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
Document/Echint _EFEM_SECSGEM(最新版).xls 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CBonder.cpp 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEFEM.cpp 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageGraph2.cpp 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageLinkSignal.cpp 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageLinkSignal.h 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Common.h 4 ●●●● 补丁 | 查看 | 原始文档 | 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 | 历史
.gitignore
@@ -53,3 +53,4 @@
Document/共享文件夹/
Document/共享文件夹.rar
SourceCode/Bond/x64/Debug/Master.dat
SourceCode/Bond/x64/Debug/Config/signals.csv
Document/ESWIN_Machine_Data_Collection_Bonder_VendorName_Machine_v1.1_yymmdd.xlsx
Binary files differ
Document/Echint _EFEM_SECSGEM£¨×îа棩.xls
Binary files differ
SourceCode/Bond/Servo/CBonder.cpp
@@ -334,6 +334,40 @@
                }
            }
        }
        {
            // Panel Data Report
            CEqReadStep* pStep = new CEqReadStep(0xA17f, 386 * 2,
                [&](void* pFrom, int code, const char* pszData, size_t size) -> int {
                    if (code == ROK && pszData != nullptr && size > 0) {
                        decodePanelDataReport((CStep*)pFrom, pszData, size);
                    }
                    return -1;
                });
            pStep->setName(STEP_EQ_PANEL_DATA_REPORT);
            pStep->setProp("Port", (void*)1);
            pStep->setWriteSignalDev(0x45e);
            if (addStep(STEP_ID_PANEL_DATA_REPORT, pStep) != 0) {
                delete pStep;
            }
        }
        {
            // FAC Data Report
            CEqReadStep* pStep = new CEqReadStep(0xA60E, 108 * 2,
                [&](void* pFrom, int code, const char* pszData, size_t size) -> int {
                    if (code == ROK && pszData != nullptr && size > 0) {
                        decodePanelDataReport((CStep*)pFrom, pszData, size);
                    }
                    return -1;
                });
            pStep->setName(STEP_EQ_FAC_DATA_REPORT);
            pStep->setProp("Port", (void*)1);
            pStep->setWriteSignalDev(0x34d);
            if (addStep(STEP_ID_FAC_DATA_REPORT, pStep) != 0) {
                delete pStep;
            }
        }
    }
    // å¿…须要实现的虚函数,在此初始化Slot信息
SourceCode/Bond/Servo/CEFEM.cpp
@@ -626,6 +626,40 @@
                delete pStep;
            }
        }
        {
            // Panel Data Report
            CEqReadStep* pStep = new CEqReadStep(0x617f, 386 * 2,
                [&](void* pFrom, int code, const char* pszData, size_t size) -> int {
                    if (code == ROK && pszData != nullptr && size > 0) {
                        decodePanelDataReport((CStep*)pFrom, pszData, size);
                    }
                    return -1;
                });
            pStep->setName(STEP_EQ_PANEL_DATA_REPORT);
            pStep->setProp("Port", (void*)1);
            pStep->setWriteSignalDev(0x15e);
            if (addStep(STEP_ID_PANEL_DATA_REPORT, pStep) != 0) {
                delete pStep;
            }
        }
        {
            // FAC Data Report
            CEqReadStep* pStep = new CEqReadStep(0x6301, 108 * 2,
                [&](void* pFrom, int code, const char* pszData, size_t size) -> int {
                    if (code == ROK && pszData != nullptr && size > 0) {
                        decodePanelDataReport((CStep*)pFrom, pszData, size);
                    }
                    return -1;
                });
            pStep->setName(STEP_EQ_FAC_DATA_REPORT);
            pStep->setProp("Port", (void*)1);
            pStep->setWriteSignalDev(0x04d);
            if (addStep(STEP_ID_FAC_DATA_REPORT, pStep) != 0) {
                delete pStep;
            }
        }
    }
    // å¿…须要实现的虚函数,在此初始化Slot信息
SourceCode/Bond/Servo/CEquipment.cpp
@@ -1470,6 +1470,57 @@
        return 0;
    }
    int CEquipment::decodePanelDataReport(CStep* pStep, const char* pszData, size_t size)
    {
        short cassetteNo, jobSequenceNo;
        int index = 0;
        std::string strPanelJudgeData, strPanelGradeData;
        memcpy(&cassetteNo, &pszData[index], sizeof(short));
        index += sizeof(short);
        memcpy(&jobSequenceNo, &pszData[index], sizeof(short));
        index += sizeof(short);
        CToolUnits::convertString(&pszData[index], 128 * 2, strPanelJudgeData);
        index += 128 * 2;
        CToolUnits::convertString(&pszData[index], 256 * 2, strPanelJudgeData);
        index += 256 * 2;
        // ç¼“å­˜Attribute,用于调试时显示信息
        unsigned int weight = 201;
        pStep->addAttribute(new CAttribute("CassetteNo",
            std::to_string(cassetteNo).c_str(), "", weight++));
        pStep->addAttribute(new CAttribute("JobSequenceNo",
            std::to_string(jobSequenceNo).c_str(), "", weight++));
        pStep->addAttribute(new CAttribute("PanelJudgeData",
            strPanelJudgeData.c_str(), "", weight++));
        pStep->addAttribute(new CAttribute("PanelGradeData",
            strPanelGradeData.c_str(), "", weight++));
        return 0;
    }
    int CEquipment::decodeFacDataReport(CStep* pStep, const char* pszData, size_t size)
    {
        int index = 0;
        std::string strSvTimeRecord, strSvData;
        CToolUnits::convertString(&pszData[index], 8 * 2, strSvTimeRecord);
        index += 128 * 2;
        CToolUnits::convertString(&pszData[index], 640 * 2, strSvData);
        index += 256 * 2;
        // ç¼“å­˜Attribute,用于调试时显示信息
        unsigned int weight = 201;
        pStep->addAttribute(new CAttribute("SV Time Record",
            strSvTimeRecord.c_str(), "", weight++));
        pStep->addAttribute(new CAttribute("SV Data",
            strSvData.c_str(), "", weight++));
        return 0;
    }
    int CEquipment::onPreStoredJob(int port, CJobDataB* pJobDataB, short& putSlot)
    {
        LOGI("<CEquipment-%s>onPreStoredJob:port:%d|GlassId:%s",
SourceCode/Bond/Servo/CEquipment.h
@@ -216,6 +216,8 @@
        int decodeFetchedOutJobReport(CStep* pStep, int port, const char* pszData, size_t size);
        int decodeStoredJobReport(CStep* pStep, int port, const char* pszData, size_t size);
        int decodeVCREventReport(CStep* pStep, const char* pszData, size_t size);
        int decodePanelDataReport(CStep* pStep, const char* pszData, size_t size);
        int decodeFacDataReport(CStep* pStep, const char* pszData, size_t size);
        int addJobDataB(CJobDataB* pJobDataB);
        int removeJobDataB(int nCassetteSequenceNo, int nJobSequenceNo);
        CJobDataB* getJobDataB(int nCassetteSequenceNo, int nJobSequenceNo);
SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -9,6 +9,7 @@
#include "CEquipmentPage1.h"
#include "CEquipmentPage2.h"
#include "CEquipmentPage3.h"
#include "CPageLinkSignal.h"
#include "CPagePortProperty.h"
#include "CPagePortStatus.h"
#include "CPageCassetteCtrlCmd.h"
@@ -128,9 +129,9 @@
        CHMPropertyDlg dlg(pEquipment->getName().c_str(), 658, 788);
        CEquipmentPage1* pPage1 = new CEquipmentPage1();
        CPageLinkSignal* pPage1 = new CPageLinkSignal();
        pPage1->setEquipment(pEquipment);
        pPage1->Create(IDD_PAGE_EQUIPMENT1);
        pPage1->Create(IDD_PAGE_LINK_SIGNAL);
        dlg.addPage(pPage1, "Link Signal");
        if (_strcmpi(pEquipment->getClassName(), "CLoadPort") == 0) {
@@ -292,6 +293,10 @@
                pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_TROUBLE, TRUE);
                pEquipment->setLinkSignal(0, SIGNAL_INTERLOCK, TRUE);
                pEquipment->setLinkSignal(0, SIGNAL_SEND_ABLE, FALSE);
                pEquipment->setLinkSignal(1, SIGNAL_UPSTREAM_INLINE, TRUE);
                pEquipment->setLinkSignal(1, SIGNAL_UPSTREAM_TROUBLE, TRUE);
                pEquipment->setLinkSignal(1, SIGNAL_INTERLOCK, TRUE);
                pEquipment->setLinkSignal(1, SIGNAL_SEND_ABLE, FALSE);
            }
        }
        else if (nCmd == ID_EQSGRAPHITEM_TEST6) {
SourceCode/Bond/Servo/CPageLinkSignal.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,180 @@
// CPageLinkSignal.cpp: å®žçŽ°æ–‡ä»¶
//
#include "stdafx.h"
#include "Servo.h"
#include "CPageLinkSignal.h"
#include "afxdialogex.h"
#define FACECOLOR_ON        RGB(34, 177, 76)
#define FACECOLOR_OFF        RGB(195, 195, 195)
#define TIMER_ID_SIGNAL_UPDATE  1001
#define TIMER_INTERVAL_MS       1000  // æ¯ 1 ç§’更新一次
// CPageLinkSignal å¯¹è¯æ¡†
IMPLEMENT_DYNAMIC(CPageLinkSignal, CHMPropertyPage)
CPageLinkSignal::CPageLinkSignal(CWnd* pParent /*=nullptr*/)
    : CHMPropertyPage(IDD_PAGE_LINK_SIGNAL, pParent)
{
    m_pEquipment = nullptr;
}
CPageLinkSignal::~CPageLinkSignal()
{
}
void CPageLinkSignal::DoDataExchange(CDataExchange* pDX)
{
    CHMPropertyPage::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CPageLinkSignal, CHMPropertyPage)
    ON_WM_CTLCOLOR()
    ON_WM_DESTROY()
    ON_WM_SIZE()
    ON_WM_TIMER()
END_MESSAGE_MAP()
// CPageLinkSignal æ¶ˆæ¯å¤„理程序
void CPageLinkSignal::setEquipment(SERVO::CEquipment* pEquipment)
{
    m_pEquipment = pEquipment;
}
BOOL CPageLinkSignal::OnInitDialog()
{
    CHMPropertyPage::OnInitDialog();
    CreateSignalButtons();
    KillTimer(TIMER_ID_SIGNAL_UPDATE);
    SetTimer(TIMER_ID_SIGNAL_UPDATE, TIMER_INTERVAL_MS, nullptr);
    return TRUE;  // return TRUE unless you set the focus to a control
                  // å¼‚常: OCX å±žæ€§é¡µåº”返回 FALSE
}
HBRUSH CPageLinkSignal::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    HBRUSH hbr = CHMPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);
    // TODO:  åœ¨æ­¤æ›´æ”¹ DC çš„任何特性
    // TODO:  å¦‚果默认的不是所需画笔,则返回另一个画笔
    return hbr;
}
void CPageLinkSignal::OnDestroy()
{
    CHMPropertyPage::OnDestroy();
    // TODO: åœ¨æ­¤å¤„添加消息处理程序代码
    for (int i = 0; i < 8; i++) {
        for (int j = 0; j < 8; j++) {
            if (m_pBtn[i][j] != nullptr) {
                m_pBtn[i][j]->DestroyWindow();
                delete m_pBtn[i][j];
                m_pBtn[i][j] = nullptr;
            }
        }
    }
}
void CPageLinkSignal::OnSize(UINT nType, int cx, int cy)
{
    CHMPropertyPage::OnSize(nType, cx, cy);
    // TODO: åœ¨æ­¤å¤„添加消息处理程序代码
}
#define BTN_X        98
#define BTN_Y        80
#define BTN_WIDTH    36
void CPageLinkSignal::CreateSignalButtons()
{
    int x = 100;
    int y = 100;
    int marginx = 32;
    int marginy = 12;
    for (int row = 0; row < 8; row++) {
        y = BTN_Y + (BTN_WIDTH + marginy) * row;
        for (int col = 0; col < 8; col++) {
            x = BTN_X + (BTN_WIDTH + marginx) * col;
            m_pBtn[row][col] = new CBlButton();
            m_pBtn[row][col]->Create("", WS_VISIBLE, { x, y, x + 36, y + 36 }, this, 1000);
            m_pBtn[row][col]->SetFaceColor(FACECOLOR_OFF);
            m_pBtn[row][col]->SetFrameColor(RGB(28, 28, 28));
            m_pBtn[row][col]->SetTextColor(RGB(238, 238, 238));
        }
    }
    CWnd* pItem;
    CRect rcItem;
    int idx[] = { IDC_LABEL_PATH1, IDC_LABEL_PATH2, IDC_LABEL_PATH3, IDC_LABEL_PATH4, IDC_LABEL_PATH5,
        IDC_LABEL_PATH6, IDC_LABEL_PATH7, IDC_LABEL_PATH8};
    for (int i = 0; i < 8; i++) {
        pItem = GetDlgItem(idx[i]);
        pItem->GetWindowRect(&rcItem);
        pItem->MoveWindow(BTN_X - rcItem.Width() - 18,
            BTN_Y + (36 - rcItem.Height()) / 2 + (BTN_WIDTH + marginy) * i,
            rcItem.Width(), rcItem.Height());
    }
    int idy[] = { IDC_LABEL_NAME1, IDC_LABEL_NAME2, IDC_LABEL_NAME3, IDC_LABEL_NAME4, IDC_LABEL_NAME5,
        IDC_LABEL_NAME6, IDC_LABEL_NAME7, IDC_LABEL_NAME8 };
    for (int i = 0; i < 8; i++) {
        pItem = GetDlgItem(idy[i]);
        pItem->GetWindowRect(&rcItem);
        pItem->MoveWindow(BTN_X + (BTN_WIDTH + marginx) * i,
            BTN_Y - 36,
            rcItem.Width(), rcItem.Height());
    }
}
void CPageLinkSignal::OnTimer(UINT_PTR nIDEvent)
{
    if (nIDEvent == TIMER_ID_SIGNAL_UPDATE) {
        if (m_pEquipment) {
            UpdateAllSignalStatesFromDevice();
        }
    }
    CHMPropertyPage::OnTimer(nIDEvent);
}
void CPageLinkSignal::UpdateAllSignalStatesFromDevice()
{
    ASSERT(m_pEquipment);
    for (int nRow = 0; nRow < 8; ++nRow) {
        for (int nCol = 0; nCol < 8; ++nCol) {
            BOOL bCurrentState = m_pEquipment->isLinkSignalOn(nRow, nCol);
            UpdateSignalState(nRow, nCol, bCurrentState);
        }
    }
}
void CPageLinkSignal::UpdateSignalState(int nRow, int nCol, bool bNewState)
{
    if (!::IsWindow(m_pBtn[nRow][nCol]->GetSafeHwnd())) {
        return;
    }
    bool bState = ::GetProp(m_pBtn[nRow][nCol]->GetSafeHwnd(), _T("State")) == (void*)1;
    if (bState != bNewState) {
        m_pBtn[nRow][nCol]->SetFaceColor(bNewState ? FACECOLOR_ON : FACECOLOR_OFF);
        ::SetProp(m_pBtn[nRow][nCol]->GetSafeHwnd(), _T("State"), bNewState ? (void*)1 : (void*)0);
    }
}
SourceCode/Bond/Servo/CPageLinkSignal.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
#pragma once
#include "CHMPropertyPage.h"
#include "BlButton.h"
// CPageLinkSignal å¯¹è¯æ¡†
class CPageLinkSignal : public CHMPropertyPage
{
    DECLARE_DYNAMIC(CPageLinkSignal)
public:
    CPageLinkSignal(CWnd* pParent = nullptr);   // æ ‡å‡†æž„造函数
    virtual ~CPageLinkSignal();
    void setEquipment(SERVO::CEquipment* pEquipment);
    void CreateSignalButtons();
    void UpdateAllSignalStatesFromDevice();
    void UpdateSignalState(int nRow, int nCol, bool bNewState);
private:
    SERVO::CEquipment* m_pEquipment;
    CBlButton* m_pBtn[8][8];
// å¯¹è¯æ¡†æ•°æ®
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_PAGE_LINK_SIGNAL };
#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 OnTimer(UINT_PTR nIDEvent);
};
SourceCode/Bond/Servo/Common.h
@@ -243,6 +243,8 @@
#define STEP_PORT2_CASSETTE_TYPE_CHANGE    _T("Port2CassetteTypeChange")
#define STEP_PORT3_CASSETTE_TYPE_CHANGE    _T("Port3CassetteTypeChange")
#define STEP_PORT4_CASSETTE_TYPE_CHANGE    _T("Port4CassetteTypeChange")
#define STEP_EQ_PANEL_DATA_REPORT        _T("EQPanelDataReport")
#define STEP_EQ_FAC_DATA_REPORT            _T("EQFacDataReport")
/* Step ID */
@@ -267,6 +269,7 @@
#define STEP_ID_VCR1_EVENT_REPORT                0x56A
#define STEP_ID_MASTER_RECIPE_LIST_REPORT        0x56B
#define STEP_ID_RECIPE_PARAMETER_REPORT            0x56C
#define STEP_ID_FAC_DATA_REPORT                    0x56D
#define STEP_ID_RECIVE_JOB_UPS1                    0x580
#define STEP_ID_RECIVE_JOB_UPS2                    0x581
#define STEP_ID_RECIVE_JOB_UPS3                    0x582
@@ -315,6 +318,7 @@
#define STEP_ID_FETCHED_OUT_JOB_REPORT13        0x5BB
#define STEP_ID_FETCHED_OUT_JOB_REPORT14        0x5BC
#define STEP_ID_FETCHED_OUT_JOB_REPORT15        0x5BD
#define STEP_ID_PANEL_DATA_REPORT                0x5D1
#define STEP_ID_IN_OP_CMD_REPLY                    0x5F0
#define STEP_ID_DISPATCHING_MODE_CHANGE_REPLY    0x5F1
#define STEP_ID_PORT1_TYPE_CHANGE                0x600
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/Servo.vcxproj
@@ -203,6 +203,7 @@
    <ClInclude Include="CGlassPool.h" />
    <ClInclude Include="ChangePasswordDlg.h" />
    <ClInclude Include="CMyStatusbar.h" />
    <ClInclude Include="CPageLinkSignal.h" />
    <ClInclude Include="CRobotCmdContainerDlg.h" />
    <ClInclude Include="CRobotCmdTestDlg.h" />
    <ClInclude Include="CPagePortStatus.h" />
@@ -342,6 +343,7 @@
    <ClCompile Include="CGlassPool.cpp" />
    <ClCompile Include="ChangePasswordDlg.cpp" />
    <ClCompile Include="CMyStatusbar.cpp" />
    <ClCompile Include="CPageLinkSignal.cpp" />
    <ClCompile Include="CRobotCmdContainerDlg.cpp" />
    <ClCompile Include="CRobotCmdTestDlg.cpp" />
    <ClCompile Include="CPagePortStatus.cpp" />
SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -159,6 +159,7 @@
    <ClCompile Include="PageTransferLog.cpp" />
    <ClCompile Include="ServoMemDC.cpp" />
    <ClCompile Include="ChangePasswordDlg.cpp" />
    <ClCompile Include="CPageLinkSignal.cpp" />
    <ClCompile Include="LoginDlg.cpp" />
    <ClCompile Include="SystemLogManagerDlg.cpp" />
    <ClCompile Include="UserManagerDlg.cpp" />
@@ -330,6 +331,7 @@
    <ClInclude Include="PageTransferLog.h" />
    <ClInclude Include="ServoMemDC.h" />
    <ClInclude Include="ChangePasswordDlg.h" />
    <ClInclude Include="CPageLinkSignal.h" />
    <ClInclude Include="LoginDlg.h" />
    <ClInclude Include="SystemLogManagerDlg.h" />
    <ClInclude Include="UserManagerDlg.h" />
SourceCode/Bond/Servo/resource.h
Binary files differ