mrDarker
2025-08-09 a8fb417ef1fb696723c8b8d5a340e8ca2e0312ae
Merge branch 'clh' into liuyang
已修改29个文件
522 ■■■■■ 文件已修改
Document/Panel Bonder八零联合 SecsTest CheckList_v3.0.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CHsmsActive.cpp 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CHsmsActive.h 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulator.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/Resource.h 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CCollectionEvent.cpp 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CCollectionEvent.h 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.cpp 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.cpp 136 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.h 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPagePortProperty.cpp 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPortStatusReport.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPortStatusReport.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CVariable.cpp 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CVariable.h 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Configuration.cpp 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Configuration.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.cpp 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.h 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Model.cpp 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/PageLog.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/CollectionEventList.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/ReportList.txt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/VariableList.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Document/Panel Bonder°ËÁãÁªºÏ SecsTest CheckList_v3.0.xlsx
Binary files differ
SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
@@ -299,6 +299,38 @@
    return 0;
}
int CHsmsActive::hsmsCarrierActionRequest(unsigned int DATAID,
    const char* pszCarrierAction,
    const char* pszCarrierId,
    unsigned char PTN)
{
    IMessage* pMessage = nullptr;
    int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 3 | REPLY, 17, ++m_nSystemByte);
    pMessage->getBody()->addU4Item(DATAID, "DATAID");
    pMessage->getBody()->addItem(pszCarrierAction, "CARRIERACTION");
    pMessage->getBody()->addItem(pszCarrierId, "CARRIERID");
    pMessage->getBody()->addU1Item(PTN, "PTN");
    pMessage->getBody()->addItem();
    m_pActive->sendMessage(pMessage);
    HSMS_Destroy1Message(pMessage);
    return 0;
}
int CHsmsActive::hsmsProceedWithCarrier(unsigned int DATAID,
    const char* pszCarrierId,
    unsigned char PTN)
{
    return hsmsCarrierActionRequest(DATAID, "ProceedWithCarrier", pszCarrierId, PTN);
}
int CHsmsActive::hsmsCarrierRelease(unsigned int DATAID,
    const char* pszCarrierId,
    unsigned char PTN)
{
    return hsmsCarrierActionRequest(DATAID, "CarrierRelease", pszCarrierId, PTN);
}
int CHsmsActive::replyAck0(IMessage* pMessage)
{
    return 0;
SourceCode/Bond/EAPSimulator/CHsmsActive.h
@@ -64,6 +64,20 @@
    // æŸ¥è¯¢PPID List
    int hsmsQueryPPIDList();
    // S3F17
    // å¡åŒ£åŠ¨ä½œè¯·æ±‚
    int hsmsCarrierActionRequest(unsigned int DATAID,
        const char* pszCarrierAction,
        const char* pszCarrierId,
        unsigned char PTN);
    int hsmsProceedWithCarrier(unsigned int DATAID,
        const char* pszCarrierId,
        unsigned char PTN);
    int CHsmsActive::hsmsCarrierRelease(unsigned int DATAID,
        const char* pszCarrierId,
        unsigned char PTN);
    // é€šè¿‡çš„reply函数
    void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName);
SourceCode/Bond/EAPSimulator/EAPSimulator.rc
Binary files differ
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp
@@ -88,6 +88,8 @@
    ON_BN_CLICKED(IDC_BUTTON_TRANSMIT_SPOOLED_DATA, &CEAPSimulatorDlg::OnBnClickedButtonTransmitSpooledData)
    ON_BN_CLICKED(IDC_BUTTON_PURGE_SPOOLED_DATA, &CEAPSimulatorDlg::OnBnClickedButtonPurgeSpooledData)
    ON_BN_CLICKED(IDC_BUTTON_QUERY_PPID_LIST, &CEAPSimulatorDlg::OnBnClickedButtonQueryPpidList)
    ON_BN_CLICKED(IDC_BUTTON_PROCEED_WITH_CARRIER, &CEAPSimulatorDlg::OnBnClickedButtonProceedWithCarrier)
    ON_BN_CLICKED(IDC_BUTTON_CARRIER_RELEASE, &CEAPSimulatorDlg::OnBnClickedButtonCarrierRelease)
END_MESSAGE_MAP()
@@ -275,6 +277,8 @@
    GetDlgItem(IDC_BUTTON_TRANSMIT_SPOOLED_DATA)->EnableWindow(enabled);
    GetDlgItem(IDC_BUTTON_PURGE_SPOOLED_DATA)->EnableWindow(enabled);
    GetDlgItem(IDC_BUTTON_QUERY_PPID_LIST)->EnableWindow(enabled);    
    GetDlgItem(IDC_BUTTON_PROCEED_WITH_CARRIER)->EnableWindow(enabled);
    GetDlgItem(IDC_BUTTON_CARRIER_RELEASE)->EnableWindow(enabled);
}
void CEAPSimulatorDlg::OnBnClickedButtonConnect()
@@ -376,3 +380,14 @@
{
    theApp.m_model.m_pHsmsActive->hsmsQueryPPIDList();
}
static int DATAID = 1;
void CEAPSimulatorDlg::OnBnClickedButtonProceedWithCarrier()
{
    theApp.m_model.m_pHsmsActive->hsmsProceedWithCarrier(DATAID++, "CSX 52078", 1);
}
void CEAPSimulatorDlg::OnBnClickedButtonCarrierRelease()
{
    theApp.m_model.m_pHsmsActive->hsmsCarrierRelease(DATAID++, "CSX 52078", 2);
}
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h
@@ -57,4 +57,6 @@
    afx_msg void OnBnClickedButtonTransmitSpooledData();
    afx_msg void OnBnClickedButtonPurgeSpooledData();
    afx_msg void OnBnClickedButtonQueryPpidList();
    afx_msg void OnBnClickedButtonProceedWithCarrier();
    afx_msg void OnBnClickedButtonCarrierRelease();
};
SourceCode/Bond/EAPSimulator/Resource.h
@@ -46,8 +46,10 @@
#define IDC_EDIT_CE_NAME                1031
#define IDC_BUTTON_QUERY_PPID_LIST        1032
#define IDC_EDIT_CE_RPTID               1033
#define IDC_BUTTON_PROCEED_WITH_CARRIER 1033
#define IDC_BUTTON_TRANSMIT_SPOOLED_DATA 1034
#define IDC_BUTTON_PROCEED_WITH_CARRIER2 1035
#define IDC_BUTTON_CARRIER_RELEASE      1035
// Next default values for new objects
// 
SourceCode/Bond/Servo/CCollectionEvent.cpp
@@ -59,7 +59,7 @@
        }
    }
    unsigned int CCollectionEvent::getPortID()
    unsigned int CCollectionEvent::getFirstPortID()
    {
        if (m_reports.empty()) return -1;
        return m_reports.front()->getReportId();
@@ -90,6 +90,12 @@
        return nullptr;
    }
    CReport* CCollectionEvent::getFirstReport()
    {
        if (m_reports.empty()) return nullptr;
        return m_reports.front();
    }
    std::vector<CReport*>& CCollectionEvent::getReports()
    {
        return m_reports;
SourceCode/Bond/Servo/CCollectionEvent.h
@@ -23,7 +23,9 @@
        /* å¦‚果一个CEID只有一个Report的场景,调用此函数设置或取消 */
        void setReport(CReport* pReport);
        unsigned int getPortID();
        unsigned int getFirstPortID();
        CReport* getFirstReport();
    private:
        unsigned int m_nCEID;
        std::string m_strName;
SourceCode/Bond/Servo/CEquipment.cpp
@@ -1990,14 +1990,14 @@
     */
    int CEquipment::onSendAble(int port)
    {
        LOGI("<CEquipment-%s>onSendAble.port:%d", m_strName.c_str(), port);
        // LOGI("<CEquipment-%s>onSendAble.port:%d", m_strName.c_str(), port);
        return 0;
    }
    int CEquipment::onReceiveAble(int port)
    {
        LOGI("<CEquipment-%s>onReceiveAble.port:%d", m_strName.c_str(), port);
        // LOGI("<CEquipment-%s>onReceiveAble.port:%d", m_strName.c_str(), port);
        return 0;
    }
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -350,17 +350,30 @@
    {
        CEquipment::onTimer(nTimerid);
        // ä»Žé…ç½®è¯»å‡ºçš„enable,初始化时写给efem
        static int i_enable[4] = { 0 };
        if ((++i_enable[m_nIndex]) == 10 + m_nIndex) {
            eablePort(m_bEnable, [&](int code) -> int {
                LOGI("<LoadPort-%d>eablePort:code=%d", m_nIndex, code);
                return 0;
                });
        }
        // æ¨¡æ‹Ÿæµ‹è¯•
        /*
        if (m_nIndex == 0) {
            static int ii = 0;
            ii++;
            if (ii == 20) {
            if (ii == 50) {
                char szBuffer[64] = {0};
                CStep* pStep = getStepWithName(STEP_EQ_PORT1_INUSE);
                CPortStatusReport portStatusReport;
                portStatusReport.setPortStatus(PORT_UNLOAD_READY);
                portStatusReport.setPortStatus(PORT_INUSE);
                portStatusReport.setJobExistenceSlot(0xf);
                portStatusReport.setCassetteId("CID1984113");
                int nRet = portStatusReport.serialize(szBuffer, 64);
                decodePortStatusReport(pStep, szBuffer, 64);
            }
@@ -913,13 +926,12 @@
            else {
                // æŠ›å‡ºåˆ°åº”用层做选择要加工的片子
                generateGlassList(getScanCassetteMap());
            }
        }
                if (m_listener.onPortStatusChanged != nullptr) {
                    m_listener.onPortStatusChanged(this, portStatusReport.getPortStatus(),
                        getScanCassetteMap());
                }
            }
        }
        // ç¼“å­˜Attribute,用于调试时显示信息
SourceCode/Bond/Servo/CMaster.cpp
@@ -55,6 +55,8 @@
        m_bEnableEventReport = true;
        m_bEnableAlarmReport = true;
        m_bContinuousTransfer = false;
        m_nContinuousTransferCount = 0;
        m_nContinuousTransferStep = CTStep_begin;
        InitializeCriticalSection(&m_criticalSection);
    }
@@ -294,7 +296,7 @@
    ULONGLONG CMaster::getRunTime()
    {
        if (m_state == MASTERSTATE::RUNNING)
        if (m_state == MASTERSTATE::RUNNING || m_state == MASTERSTATE::RUNNING_CONTINUOUS_TRANSFER)
            return m_ullRunTime + (GetTickCount64() - m_ullStartTime);
        else
            return m_ullRunTime;
@@ -345,7 +347,7 @@
        while (1) {
            // å¾…退出信号或时间到
            HANDLE hEvents[] = { m_hEventDispatchThreadExit[0], m_hDispatchEvent };
            int nRet = WaitForMultipleObjects(2, hEvents, FALSE, 1000);
            int nRet = WaitForMultipleObjects(2, hEvents, FALSE, 500);
            if (nRet == WAIT_OBJECT_0) {
                break;
            }
@@ -713,6 +715,7 @@
                            m_pActiveRobotTask = createTransferTask_continuous_transfer(pMeasurement,
                                0, pLoadPorts[s], slot);
                            if (m_pActiveRobotTask != nullptr) {
                                m_nContinuousTransferStep = CTStep_end;
                                goto CT_PORT_PUT;
                            }
                        }
@@ -727,6 +730,9 @@
                if (!rmd.armState[0]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pBakeCooling,
                        3, pMeasurement, 0);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(BakeCooling -> Measurement)...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
@@ -735,44 +741,75 @@
                if (!rmd.armState[0]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pBakeCooling,
                        2, pBakeCooling, 3);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(BakeCooling-2 -> BakeCooling-3)...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
                if (!rmd.armState[0]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pBakeCooling,
                        1, pBakeCooling, 2);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(BakeCooling-1 -> BakeCooling-2)...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
                if (!rmd.armState[0]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pBakeCooling,
                        0, pBakeCooling, 1);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(BakeCooling-0 -> BakeCooling-1)...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
                // Bonder2 -> BakeCooling
                // VacuumBake(G1) -> BakeCooling
                if (!rmd.armState[0]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pVacuumBake,
                        1, pBakeCooling, 0);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(VacuumBake(G1) -> BakeCooling)...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
                // VacuumBake(G1) -> VacuumBake(G1)
                if (!rmd.armState[0]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pVacuumBake,
                        0, pVacuumBake, 1);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(VacuumBake(G1-0) -> VacuumBake(G1-1))...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
                // Bonder2 -> VacuumBake(G1)
                if (!rmd.armState[0]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pBonder2,
                        0, pBakeCooling, 0);
                        1, pVacuumBake, 0);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(Bonder2 -> VacuumBake(G1))...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
                // Bonder1 -> Bonder2
                if (!rmd.armState[0] && !pBonder2->hasBondClass()) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pBonder1,
                        0, pBonder2, 0);
                        1, pBonder2, 1);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(Bonder1 -> Bonder2)...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
                // VacuumBake(G1) -> Bonder1
                // Fliper(G2) -> Bonder1
                if (!rmd.armState[0] && !pBonder1->hasBondClass()) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pVacuumBake,
                        0, pBonder1, 0);
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
                // Fliper(G2) -> VacuumBake(G1)
                if (!rmd.armState[0]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pFliper,
                        0, pVacuumBake, 0);
                        0, pBonder1, 1, 2);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(Fliper(G2) -> Bonder1)...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
@@ -780,6 +817,9 @@
                if (!rmd.armState[1]) {
                    m_pActiveRobotTask = createTransferTask_continuous_transfer(pAligner,
                        0, pFliper, 0);
                    if (m_pActiveRobotTask != nullptr) {
                        LOGI("<ContinuousTransfer>千传测试,开始搬送任务(Aligner -> Fliper(G2))...");
                    }
                    CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
                }
@@ -793,6 +833,7 @@
                            m_pActiveRobotTask = createTransferTask_continuous_transfer(pLoadPorts[s], 
                                slot, pAligner, 0);
                            if (m_pActiveRobotTask != nullptr) {
                                LOGI("<ContinuousTransfer>千传测试,开始搬送任务(LoadPort -> Aligner)...");
                                pEFEM->setContext(m_pActiveRobotTask->getContext());
                                goto CT_PORT_GET;
                            }
@@ -801,6 +842,10 @@
                }
            CT_PORT_GET:
                if (m_pActiveRobotTask != nullptr) {
                    m_nContinuousTransferStep = CTStep_begin;
                    LOGI("<ContinuousTransfer>千传测试,开始第 %d è½®", m_nContinuousTransferCount + 1);
                }
                CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
@@ -822,6 +867,16 @@
    unsigned CMaster::ReadBitsProc()
    {
        // æ ‡å¿—位清0复位
        {
            StationIdentifier station;
            station.nNetNo = 0;
            station.nStNo = 255;
            char szBuffer[528] = { 0 };    // 0x0, 0x1087
            m_cclink.WriteData(station, (long)DeviceType::B, 0, 528, (short*)szBuffer);
        }
        while (1) {
            // å¾…退出信号或时间到
            int nRet = ::WaitForSingleObject(m_hEventReadBitsThreadExit[0], 1000);
@@ -882,6 +937,8 @@
        listener.onPreFethedOutJob = [&](void* pEquipment, int port, CJobDataB* pJobDataB) -> BOOL {
            CEquipment* p = (CEquipment*)pEquipment;
            // å¯èƒ½è¦åŠ è¿™ä¸€å¥
            Sleep(750);
            // å–片,更新当前搬送任务
            BOOL bOk = FALSE;
@@ -915,6 +972,8 @@
        listener.onPreStoredJob = [&](void* pEquipment, int port, CJobDataB* pJobDataB, short& slot) -> BOOL {
            CEquipment* p = (CEquipment*)pEquipment;
            // å¯èƒ½è¦åŠ è¿™ä¸€å¥
            Sleep(750);
            // æ”¾ç‰‡ï¼Œæ›´æ–°å½“前搬送任务
            BOOL bOk = FALSE;
@@ -992,6 +1051,17 @@
                    && m_pActiveRobotTask->getTarPosition() == p->getID()) {
                    m_pActiveRobotTask->stored();
                    m_pActiveRobotTask->completed();
                    if (m_state == MASTERSTATE::RUNNING_CONTINUOUS_TRANSFER) {
                        if (m_nContinuousTransferStep == CTStep_end) {
                            m_nContinuousTransferCount++;
                            LOGI("<ContinuousTransfer>千传测试,第 %d è½®ç»“束", m_nContinuousTransferCount);
                            if (m_listener.onCTRoundEnd != nullptr) {
                                m_listener.onCTRoundEnd(this, m_nContinuousTransferCount);
                            }
                        }
                    }
                    LOGI("放片完成...");
                    // å®Œæˆæ­¤æ¡æ¬é€ä»»åŠ¡ï¼Œä½†è¦æŠŠæ•°æ®å’Œæ¶ˆæ¯ä¸ŠæŠ›åº”ç”¨å±‚
                    unlock();
@@ -1034,7 +1104,7 @@
                ((CEquipment*)pEquipment)->getName().c_str(), scanMap, downMap);
        };
        listener.onPortStatusChanged = [&](void* pEquipment, short status, __int64 data) {
            LOGE("<Master-%s>Port InUse。status=%d, data=%lld", ((CEquipment*)pEquipment)->getName().c_str(), status);
            LOGE("<Master-%s>onPortStatusChanged。status=%d, data=%lld", ((CEquipment*)pEquipment)->getName().c_str(), status);
            if (m_listener.onLoadPortStatusChanged != nullptr) {
                m_listener.onLoadPortStatusChanged(this, (CEquipment*)pEquipment, status, data);
            }
@@ -1582,8 +1652,12 @@
        }
        CRobotTask* pTask = nullptr;
        CSlot* pTarSlot = pTarEq->isSlotAvailable(nTarSlot);
        CSlot* pSrcSlot = pSrcEq->getProcessedSlotCt(nSrcSlot);
        if (pSrcSlot != nullptr && pSrcEq->getID() == EQ_ID_MEASUREMENT
            && (pTarEq->getID() == EQ_ID_LOADPORT1 || pTarEq->getID() == EQ_ID_LOADPORT2 || pTarEq->getID() == EQ_ID_LOADPORT3 || pTarEq->getID() == EQ_ID_LOADPORT4)) {
            pTarEq->removeGlass(1);
        }
        CSlot* pTarSlot = pTarEq->isSlotAvailable(nTarSlot);
        if (pSrcSlot != nullptr && nullptr != pTarSlot) {
            pTask = new CRobotTask();
            pTask->setContext(pSrcSlot->getContext());
@@ -1703,4 +1777,34 @@
    {
        return m_bEnableAlarmReport;
    }
    int CMaster::proceedWithCarrier(unsigned int port)
    {
        if (port >= 4) return -1;
        static int pid[] = { EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4};
        CLoadPort* pPort = (CLoadPort*)getEquipment(pid[port]);
        pPort->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr);
        return 0;
    }
    int CMaster::carrierRelease(unsigned int port)
    {
        if (port >= 4) return -1;
        static int pid[] = { EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4 };
        CLoadPort* pPort = (CLoadPort*)getEquipment(pid[port]);
        pPort->sendCassetteCtrlCmd(CCC_PROCESS_CANCEL, nullptr, 0, 0, 0, nullptr, nullptr);
        return 0;
    }
    int CMaster::getContinuousTransferCount()
    {
        return m_nContinuousTransferCount;
    }
    void CMaster::setContinuousTransferCount(int round)
    {
        m_nContinuousTransferCount = round;
    }
}
SourceCode/Bond/Servo/CMaster.h
@@ -15,6 +15,9 @@
#include "CRobotTask.h"
#define CTStep_begin        0
#define CTStep_end          99
namespace SERVO {
    enum class MASTERSTATE {
        READY = 0,
@@ -33,6 +36,7 @@
    typedef std::function<void(void* pMaster, CEquipment* pEquipment, int code)> ONEQDATACHANGED;
    typedef std::function<void(void* pMaster, CRobotTask* pTask, int code)> ONROBOTTASKEVENT;
    typedef std::function<void(void* pMaster, CEquipment* pEquipment, short status, __int64 data)> ONLOADPORTSTATUSCHANGED;
    typedef std::function<void(void* pMaster, int round)> ONCTROUNDEND;
    typedef struct _MasterListener
    {
        ONMASTERSTATECHANGED    onMasterStateChanged;
@@ -43,6 +47,7 @@
        ONEQDATACHANGED         onEqDataChanged;
        ONROBOTTASKEVENT        onRobotTaskEvent;
        ONLOADPORTSTATUSCHANGED    onLoadPortStatusChanged;
        ONCTROUNDEND            onCTRoundEnd;
    } MasterListener;
    class CMaster
@@ -81,6 +86,10 @@
        void enableEventReport(bool bEnable);
        void enableAlarmReport(bool bEnable);
        bool isAlarmReportEnable();
        int proceedWithCarrier(unsigned int port);
        int carrierRelease(unsigned int port);
        int getContinuousTransferCount();
        void setContinuousTransferCount(int round);
    private:
        inline void lock() { EnterCriticalSection(&m_criticalSection); }
@@ -148,6 +157,11 @@
        // åœ¨å¼€å§‹å·¥è‰ºå‰æ˜¯å¦å…ˆéœ€è¦å…ˆæ¯”较map
        BOOL m_isCompareMapsBeforeProceeding;
        // åƒä¼ åœˆæ•°è®¡æ•°
        int m_nContinuousTransferCount;
        int m_nContinuousTransferStep;
    private:
        bool m_bEnableEventReport;
        bool m_bEnableAlarmReport;
SourceCode/Bond/Servo/CPagePortProperty.cpp
@@ -290,13 +290,11 @@
    theApp.m_model.setPortCassetteType(m_pPort->getIndex(), SERVO::CassetteType(index + 1));
    /*
    g_nMsgDlgShow = 0;
    CMsgDlg msgDlg("请等待", "正在操作,请等待...");
    msgDlg.SetData((DWORD_PTR)this);
    ASSERT(m_pPort != nullptr);
    int index = ((CComboBox*)GetDlgItem(IDC_COMBO_PORT_CASSERT_TYPE))->GetCurSel();
    m_pPort->setCassetteType(SERVO::CassetteType(index + 1), [&](int code) -> int {
        Sleep(100);
        CString strMsg;
@@ -333,7 +331,6 @@
    msgDlg.DoModal();
    g_nMsgDlgShow = 1;
    */
}
void CPagePortProperty::OnCbnSelchangeComboPortTransferMode()
SourceCode/Bond/Servo/CPortStatusReport.cpp
@@ -249,6 +249,11 @@
        m_nJobExistenceSlot[0] = map;
    }
    void CPortStatusReport::setCassetteId(const char* pszId)
    {
        m_strCassetteID = pszId;
    }
    void CPortStatusReport::WriteString(CArchive& ar, std::string& string)
    {
        CString strTemp = string.c_str();
SourceCode/Bond/Servo/CPortStatusReport.h
@@ -31,6 +31,7 @@
        bool isJobExistenceSlot();
        short getJobExistenceSlot();
        void setJobExistenceSlot(short map);
        void setCassetteId(const char* pszId);
    private:
        void WriteString(CArchive& ar, std::string& string);
SourceCode/Bond/Servo/CVariable.cpp
@@ -7,6 +7,7 @@
    {
        m_nVarialbeId = 0;
        m_format = SVFromat::U1;
        m_nValue = 0;
    }
    CVariable::CVariable(const char* pszId, const char* pszName, const char* pszFormat, const char* pszRemark)
@@ -87,4 +88,41 @@
    {
        return m_strRemark;
    }
    void CVariable::setValue(__int64 value)
    {
        if (m_format == SVFromat::U1 || m_format == SVFromat::U2 || m_format == SVFromat::I2) {
            m_nValue = value;
        }
    }
    void CVariable::setValue(const char* pszValue)
    {
        std::string strTemp = pszValue;
        if (m_format == SVFromat::A20) {
            if (strTemp.length() > 20) {
                strTemp = strTemp.substr(0, 20);
            }
        }
        else if (m_format == SVFromat::A50) {
            if (strTemp.length() > 50) {
                strTemp = strTemp.substr(0, 50);
            }
        }
        m_strValue = strTemp;
    }
    std::string CVariable::getValue()
    {
        std::string strRet;
        if (m_format == SVFromat::U1 || m_format == SVFromat::U2 || m_format == SVFromat::I2) {
            strRet = std::to_string(m_nValue);
        }
        else if(m_format == SVFromat::A20 || m_format == SVFromat::A50) {
            strRet = m_strValue;
        }
        return strRet;
    }
}
SourceCode/Bond/Servo/CVariable.h
@@ -26,12 +26,17 @@
        std::string& getName();
        SVFromat getFormat();
        std::string& getRemark();
        void setValue(__int64 value);
        void setValue(const char* pszValue);
        std::string getValue();
    private:
        unsigned int m_nVarialbeId;
        std::string m_strName;
        SVFromat m_format;
        std::string m_strRemark;
        __int64 m_nValue;
        std::string m_strValue;
    };
}
SourceCode/Bond/Servo/Configuration.cpp
@@ -160,3 +160,14 @@
    return GetPrivateProfileInt(_T("Master"), _T("CompareMapsBeforeProceeding"), 0, m_strFilepath);
}
void CConfiguration::setContinuousTransferCount(int round)
{
    WritePrivateProfileString(_T("Master"), _T("CTRound"),
        std::to_string(round).c_str(), m_strFilepath);
}
int CConfiguration::getContinuousTransferCount()
{
    return GetPrivateProfileInt(_T("Master"), _T("CTRound"), 0, m_strFilepath);
}
SourceCode/Bond/Servo/Configuration.h
@@ -27,6 +27,8 @@
    BOOL setPortCassetteType(unsigned int index, int cassetteType);
    BOOL setPortEnable(unsigned int index, BOOL bEnable);
    BOOL isCompareMapsBeforeProceeding();
    void setContinuousTransferCount(int round);
    int getContinuousTransferCount();
public:
    void setP2RemoteEqReconnectInterval(int second);
SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -256,12 +256,39 @@
    return nullptr;
}
SERVO::CVariable* CHsmsPassive::getVariable(const char* pszName)
{
    for (auto item : m_variabels) {
        if (item->getName().compare(pszName) == 0) {
            return item;
        }
    }
    return nullptr;
}
void CHsmsPassive::clearAllVariabel()
{
    for (auto item : m_variabels) {
        delete item;
    }
    m_variabels.clear();
}
void CHsmsPassive::setVariableValue(const char* pszName, __int64 value)
{
    auto v = getVariable(pszName);
    if (v != nullptr) {
        v->setValue(value);
    }
}
void CHsmsPassive::setVariableValue(const char* pszName, const char* value)
{
    auto v = getVariable(pszName);
    if (v != nullptr) {
        v->setValue(value);
    }
}
int CHsmsPassive::loadReports(const char* pszFilepath)
@@ -541,6 +568,9 @@
        }
        else if (nStream == 2 && pHeader->function == 43) {
            replyConfigureSpooling(pMessage);
        }
        else if (nStream == 3 && pHeader->function == 17) {
            replyCarrierAction(pMessage);
        }
        else if (nStream == 5 && pHeader->function == 3) {
            replyEanbleDisableAlarmReport(pMessage);
@@ -1092,7 +1122,7 @@
    // æ£€éªŒç»“果是否正确
    for (auto item : m_collectionEvents) {
        LOGE("=== ceid:%d, prtid:%d", item->getEventId(), item->getPortID());
        LOGE("=== ceid:%d, prtid:%d", item->getEventId(), item->getFirstPortID());
    }
    
MYREPLY:
@@ -1231,6 +1261,57 @@
    }
MYREPLY:
    replyAck(2, 42, pRecv->getHeader()->systemBytes, BYTE(0), "ERACK");
    return 0;
}
// S3F17
int CHsmsPassive::replyCarrierAction(IMessage* pRecv)
{
    if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
        return ER_NOTSELECT;
    }
    unsigned char CAACK = CAACK_0;
    unsigned int ERRCODE = 0;
    std::string strError = "no error";
    if (m_listener.onCarrierAction == nullptr) {
        CAACK = 5;
        ERRCODE = CAACK_5;
        strError = "Not supported";
        goto MYREPLY;
    }
    ISECS2Item* pBody = pRecv->getBody();
    if (pBody == nullptr || pBody->getType() != SITYPE::L) ER_PARAM_ERROR;
    unsigned int DATAID;
    unsigned char PTN;
    const char* pszCarrierAction, *pszCarrierId;
    pBody->getSubItemU4(0, DATAID);
    pBody->getSubItemString(1, pszCarrierAction);
    pBody->getSubItemString(2, pszCarrierId);
    pBody->getSubItemU1(3, PTN);
    ERRCODE = m_listener.onCarrierAction(this,
        DATAID,
        pszCarrierAction,
        pszCarrierId,
        PTN,
        strError);
    CAACK = ERRCODE;
    // å›žå¤
MYREPLY:
    IMessage* pMessage = NULL;
    HSMS_Create1Message(pMessage, m_nSessionId, 3, 18, pRecv->getHeader()->systemBytes);
    pMessage->getBody()->addU1Item(CAACK, "CAACK");
    ISECS2Item* pErrItem = pMessage->getBody()->addItem();
    pErrItem->addU4Item(ERRCODE, "ERRCODE");
    pErrItem->addItem(strError.c_str(), "ERRTEXT");
    m_pPassive->sendMessage(pMessage);
    LOGI("<HSMS>[SECS Msg SEND]S3F18 (SysByte=%u)", pMessage->getHeader()->systemBytes);
    HSMS_Destroy1Message(pMessage);
    return 0;
}
@@ -1396,15 +1477,19 @@
}
// S6F11
int CHsmsPassive::requestEventReportSend(unsigned int DATAID, unsigned int CEID, const std::vector<std::string>& values)
static unsigned int DATAID = 1;
int CHsmsPassive::requestEventReportSend(unsigned int CEID)
{
    SERVO::CCollectionEvent* pEvent = getEvent(CEID);
    if (pEvent == nullptr) {
        return ER_NO_EVENT;
    }
    if (pEvent == nullptr) {
    SERVO::CReport* pReport = pEvent->getFirstReport();
    if (pReport == nullptr) {
        return ER_UNLINK_EVENT_REPORT;
    }
    Lock();
    CHsmsAction* pAction = new CHsmsAction(ACTION_EVENT_REPORT, TRUE, m_nActionTimeout);
@@ -1412,14 +1497,16 @@
    HSMS_Create1Message(pMessage, m_nSessionId, 6 | REPLY, 11, ++m_nSystemByte);
    ASSERT(pMessage);
    ISECS2Item* pItem = pMessage->getBody();
    pItem->addU4Item(DATAID, "DATAID");
    pItem->addU4Item(++DATAID, "DATAID");
    pItem->addU4Item(CEID, "CEID");
    ISECS2Item* pItemList1 = pItem->addItem();
    ISECS2Item* pItemList2 = pItemList1->addItem();
    pItemList2->addU4Item(pEvent->getPortID(), "RPTID");
    pItemList2->addU4Item(pReport->getReportId(), "RPTID");
    ISECS2Item* pItemList3 = pItemList2->addItem();
    auto values = pReport->getVariables();
    for (auto item : values) {
        pItemList3->addItem(item.c_str(), "V");
        pItemList3->addItem(item->getValue().c_str(), "V");
    }
    pAction->setSendMessage(pMessage);
    if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
@@ -1434,5 +1521,26 @@
    return ER_NOERROR;
}
int CHsmsPassive::requestEventReportSend(const char* pszEventName)
{
    SERVO::CCollectionEvent* pEvent = nullptr;
    for (auto e : m_collectionEvents) {
        if (e->getName().compare(pszEventName) == 0) {
            pEvent = e;
            break;
        }
    }
    if (pEvent == nullptr) {
        return ER_NO_EVENT;
    }
    return requestEventReportSend(pEvent->getEventId());
}
int CHsmsPassive::requestEventReportSend_CarrierID_Readed()
{
    return requestEventReportSend("CarrierID_Readed");
}
SourceCode/Bond/Servo/HsmsPassive.h
@@ -23,7 +23,18 @@
#define ER_NO_EVENT                -4
#define ER_UNLINK_EVENT_REPORT    -5
#define ER_NO_PPID_LIST            -6
#define ER_NOT_SUPPORTED        -7
/* CAACK */
#define CAACK_0                    0        /* ok */
#define CAACK_1                    1        /* invalid command */
#define CAACK_2                    2        /* cannot perform now */
#define CAACK_3                    3        /* invalid data or argument */
#define CAACK_4                    4        /* initiated for asynchronous completion */
#define CAACK_5                    5        /* rejected - invalid state */
#define CAACK_6                    6        /* command performed with errors */
/*
 * å¸¸é‡æ•°æ®ç»“æž„
@@ -69,6 +80,12 @@
typedef std::function<void(void* pFrom, bool bEnable, std::vector<unsigned int>& ids)> EDEVENTREPORT;
typedef std::function<void(void* pFrom, bool bEnable, unsigned int id)> EDALARMREPORT;
typedef std::function<std::vector<std::string> (void* pFrom)> QUERYPPIDLIST;
typedef std::function<unsigned int (void* pFrom,
    unsigned int DATAID,
    const char* pszCarrierAction,
    const char* pszCarrierId,
    unsigned char PTN,
    std::string& strErrorTxt)> CARRIERACTION;
typedef struct _SECSListener
{
    SECSEQOFFLINE                onEQOffLine;
@@ -80,6 +97,7 @@
    EDEVENTREPORT                onEnableDisableEventReport;
    EDALARMREPORT                onEnableDisableAlarmReport;
    QUERYPPIDLIST                onQueryPPIDList;
    CARRIERACTION                onCarrierAction;
} SECSListener;
@@ -118,6 +136,11 @@
    // å–得指定Variable
    SERVO::CVariable* getVariable(int variableId);
    SERVO::CVariable* getVariable(const char* pszName);
    // è®¾ç½®å˜é‡å€¼
    void setVariableValue(const char* pszName, __int64 value);
    void setVariableValue(const char* pszName, const char* value);
    // ä»Žæ–‡ä»¶ä¸­åŠ è½½CReport列表
    int loadReports(const char* pszFilepath);
@@ -155,7 +178,9 @@
    /* request开头的函数为主动发送数据的函数 */
    int requestAreYouThere();
    int requestAlarmReport(int ALCD, int ALID, const char* ALTX);
    int requestEventReportSend(unsigned int DATAID, unsigned int CEID, const std::vector<std::string>& values);
    int requestEventReportSend(unsigned int CEID);
    int requestEventReportSend(const char* pszEventName);
    int requestEventReportSend_CarrierID_Readed();
private:
    void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName);
@@ -173,6 +198,7 @@
    int replyEanbleDisableEventReport(IMessage* pRecv);
    int replyCommand(IMessage* pRecv);
    int replyConfigureSpooling(IMessage* pRecv);
    int replyCarrierAction(IMessage* pRecv);
    int replyEanbleDisableAlarmReport(IMessage* pRecv);
    int replyPurgeSpooledData(IMessage* pRecv);
    int replyQueryPPIDList(IMessage* pRecv);
SourceCode/Bond/Servo/Model.cpp
@@ -151,6 +151,30 @@
        }
        return ppids;
    };
    listener.onCarrierAction = [&](void* pFrom,
        unsigned int DATAID,
        const char* pszCarrierAction,
        const char* pszCarrierId,
        unsigned char PTN,
        std::string& strErrorTxt) -> unsigned int {
            if (PTN < 1 || 4 < PTN) {
                strErrorTxt = "invalid data or argument";
                return CAACK_3;
            }
            if (_strcmpi(pszCarrierAction, "ProceedWithCarrier") == 0) {
                m_master.proceedWithCarrier(PTN);
                return CAACK_0;
            }
            else if (_strcmpi(pszCarrierAction, "CarrierRelease") == 0) {
                m_master.carrierRelease(PTN);
                return CAACK_0;
            }
            strErrorTxt = "rejected - invalid state";
            return CAACK_5;
            LOGI("<Model>onCarrierAction %d, %s, %d, %d", DATAID, pszCarrierAction, pszCarrierId, PTN);
    };
    m_hsmsPassive.setListener(listener);
    m_hsmsPassive.setEquipmentModelType((LPTSTR)(LPCTSTR)strModeType);
    m_hsmsPassive.setSoftRev((LPTSTR)(LPCTSTR)strSoftRev);
@@ -329,9 +353,20 @@
    };
    masterListener.onLoadPortStatusChanged = [&] (void* pMaster, SERVO::CEquipment* pEquipment, short status, __int64 data) {
        LOGE("<CModel>onLoadPortStatusChanged. status = %d", status);
        if (status == PORT_INUSE) {
            SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment);
            if (pLoadPort != nullptr) {
                m_hsmsPassive.setVariableValue("CarrierID", pLoadPort->getCassetteId().c_str());
            }
            m_hsmsPassive.requestEventReportSend_CarrierID_Readed();
        }
        notifyPtr(RX_CODE_LOADPORT_STATUS_CHANGED, pEquipment);
    };
    masterListener.onCTRoundEnd = [&](void* pMaster, int round) {
        m_configuration.setContinuousTransferCount(round);
    };
    m_master.setListener(masterListener);
    m_master.setContinuousTransferCount(m_configuration.getContinuousTransferCount());
    // master è®¾ç½®ç¼“存文件
SourceCode/Bond/Servo/PageLog.cpp
@@ -79,9 +79,14 @@
                            else {
                                CString strTemp = strText;
                                strTemp.TrimRight();
                                try {
                                bMatch = std::regex_match((LPTSTR)(LPCTSTR)strTemp,
                                    std::regex((LPTSTR)(LPCTSTR)m_strFilterText));
                            }
                                catch (const std::regex_error& e) {
                                }
                            }
                            if (m_filterMode == FilterMode::Exclude) {
                                bMatch = !bMatch;
                            }
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -235,7 +235,15 @@
                        pEq2 = theApp.m_model.getMaster().getEquipment(pTask->getTarPosition());
                        if (pEq1 != nullptr && pEq2 != nullptr) {
                            CString strText;
                            strText.Format(_T("%s --> %s"), pEq1->getName().c_str(), pEq2->getName().c_str());
                            if (theApp.m_model.getMaster().getContinuousTransferCount() > 0) {
                                strText.Format(_T("[%d]%s --> %s"),
                                    theApp.m_model.getMaster().getContinuousTransferCount(),
                                    pEq1->getName().c_str(), pEq2->getName().c_str());
                            }
                            else {
                                strText.Format(_T("%s --> %s"),
                                    pEq1->getName().c_str(), pEq2->getName().c_str());
                            }
                            m_pMyStatusbar->setCurTaskBtnText((LPTSTR)(LPCTSTR)strText);
                        }
                    }
SourceCode/Bond/x64/Debug/CollectionEventList.txt
@@ -37,3 +37,4 @@
31032,CJobResume,,(31000)
40000,E90_SPSM_NoState_To_NeedsProcessing,,(40000)
40001,E90_SPSM_InProcess_To_ProcessCompleted,,(40000)
50000,CarrierID_Readed,,(50000)
SourceCode/Bond/x64/Debug/ReportList.txt
@@ -15,3 +15,5 @@
30000,(1,30000,30001)
31000,(1,31000,31001)
40000,(1,10203,20000)
50000,(5000)
SourceCode/Bond/x64/Debug/VariableList.txt
@@ -35,3 +35,4 @@
2023,OCREnable,U2,"OCR使能:O:开启 1:屏蔽"
2024,CCDEnable,U2,"CCD使能:O:开启 1:屏蔽"
2025,FFUParameter,U2,FFU设定值
5000,CarrierID,A20,卡匣ID