LAPTOP-SNT8I5JK\Boounion
2025-08-06 d5c8d6545efe0ab2026a4127fde0fa2bad659ccd
1.实现EAP中ProceedWithCarrier和CarrierRelease的功能模拟及测试;
已修改13个文件
186 ■■■■■ 文件已修改
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/CMaster.cpp 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.cpp 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.h 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Model.cpp 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | 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);
    // 閫氳繃鐨剅eply鍑芥暟
    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/CMaster.cpp
@@ -1703,4 +1703,24 @@
    {
        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;
    }
}
SourceCode/Bond/Servo/CMaster.h
@@ -81,6 +81,8 @@
        void enableEventReport(bool bEnable);
        void enableAlarmReport(bool bEnable);
        bool isAlarmReportEnable();
        int proceedWithCarrier(unsigned int port);
        int carrierRelease(unsigned int port);
    private:
        inline void lock() { EnterCriticalSection(&m_criticalSection); }
SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -542,6 +542,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);
        }
@@ -1234,6 +1237,57 @@
    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;
}
// S5F3
int CHsmsPassive::replyEanbleDisableAlarmReport(IMessage* pRecv)
{
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;
@@ -173,6 +191,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);
SourceCode/Bond/Servo/Servo.rc
Binary files differ