LAPTOP-SNT8I5JK\Boounion
2025-08-04 58cacfbd91dc444a6e5fda92b524643a526022b1
1.EAP模拟获取/返回配方列表,测试验证OK;
已修改12个文件
86 ■■■■ 文件已修改
.gitignore 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Document/SECS通讯整理.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CHsmsActive.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CHsmsActive.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulator.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/Resource.h 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Common.h 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.cpp 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Model.cpp 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -58,3 +58,5 @@
*.tlog
*.pch
SourceCode/Bond/EAPSimulator/x64/
Document/___CEID_________________.csv
Document/______CEID__.csv
Document/SECSͨѶÕûÀí.xlsx
Binary files differ
SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
@@ -289,6 +289,16 @@
    return 0;
}
int CHsmsActive::hsmsQueryPPIDList()
{
    IMessage* pMessage = nullptr;
    int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 7 | REPLY, 19, ++m_nSystemByte);
    m_pActive->sendMessage(pMessage);
    HSMS_Destroy1Message(pMessage);
    return 0;
}
int CHsmsActive::replyAck0(IMessage* pMessage)
{
    return 0;
SourceCode/Bond/EAPSimulator/CHsmsActive.h
@@ -61,6 +61,9 @@
    int hsmsTransmitSpooledData();
    int hsmsPurgeSpooledData();
    // æŸ¥è¯¢PPID List
    int hsmsQueryPPIDList();
    // é€šè¿‡çš„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
@@ -87,6 +87,7 @@
    ON_BN_CLICKED(IDC_BUTTON_CONFIGURE_SPOOLING, &CEAPSimulatorDlg::OnBnClickedButtonConfigureSpooling)
    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)
END_MESSAGE_MAP()
@@ -273,6 +274,7 @@
    GetDlgItem(IDC_BUTTON_CONFIGURE_SPOOLING)->EnableWindow(enabled);    
    GetDlgItem(IDC_BUTTON_TRANSMIT_SPOOLED_DATA)->EnableWindow(enabled);
    GetDlgItem(IDC_BUTTON_PURGE_SPOOLED_DATA)->EnableWindow(enabled);
    GetDlgItem(IDC_BUTTON_QUERY_PPID_LIST)->EnableWindow(enabled);
}
void CEAPSimulatorDlg::OnBnClickedButtonConnect()
@@ -369,3 +371,8 @@
{
    theApp.m_model.m_pHsmsActive->hsmsPurgeSpooledData();
}
void CEAPSimulatorDlg::OnBnClickedButtonQueryPpidList()
{
    theApp.m_model.m_pHsmsActive->hsmsQueryPPIDList();
}
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h
@@ -56,4 +56,5 @@
    afx_msg void OnBnClickedButtonConfigureSpooling();
    afx_msg void OnBnClickedButtonTransmitSpooledData();
    afx_msg void OnBnClickedButtonPurgeSpooledData();
    afx_msg void OnBnClickedButtonQueryPpidList();
};
SourceCode/Bond/EAPSimulator/Resource.h
@@ -22,31 +22,32 @@
#define IDC_BUTTON_DATETIME_SYNC        1006
#define IDC_BUTTON_TERMINAL_DISPLAY     1007
#define IDC_COMBO_TID                   1008
#define IDC_BUTTON_ED_EVENT_REPORT      1008
#define IDC_EDIT_TEXT                   1009
#define IDC_BUTTON_ED_ALARM_REPORT      1009
#define IDC_BUTTON_SEND                 1010
#define IDC_BUTTON_DEFINE_REPORT        1010
#define IDC_BUTTON_LINE_REPORT          1011
#define IDC_RADIO_ENABLE                1012
#define IDC_BUTTON_LINE_REPORT2         1012
#define IDC_BUTTON_CONFIGURE_SPOOLING   1012
#define IDC_RADIO_DISABLE               1013
#define IDC_BUTTON_TRANSMIT_SPOOLED_DATA 1013
#define IDC_EDIT_CEID                   1014
#define IDC_BUTTON_PURGE_SPOOLED_DATA   1014
#define IDC_LIST1                       1015
#define IDC_EDIT_CE_NAME                1015
#define IDC_LIST2                       1016
#define IDC_EDIT_CE_DESCRIPTIONS        1016
#define IDC_BUTTON_ADD_RPTID            1017
#define IDC_EDIT_CE_RPTID               1017
#define IDC_BUTTON_DEL_REPORT           1018
#define IDC_BUTTON_ADD_VID              1019
#define IDC_BUTTON_DEL_VID              1020
#define IDC_GROUP_IDS                   1021
#define IDC_EDIT_ID                     1022
#define IDC_BUTTON1                     1023
#define IDC_EDIT_CE_DESCRIPTIONS        1023
#define IDC_BUTTON_ED_EVENT_REPORT      1025
#define IDC_BUTTON_ED_ALARM_REPORT      1026
#define IDC_BUTTON_DEFINE_REPORT        1027
#define IDC_BUTTON_LINE_REPORT2         1028
#define IDC_BUTTON_CONFIGURE_SPOOLING   1029
#define IDC_BUTTON_PURGE_SPOOLED_DATA   1030
#define IDC_EDIT_CE_NAME                1031
#define IDC_BUTTON_QUERY_PPID_LIST        1032
#define IDC_EDIT_CE_RPTID               1033
#define IDC_BUTTON_TRANSMIT_SPOOLED_DATA 1034
// Next default values for new objects
// 
@@ -54,7 +55,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        141
#define _APS_NEXT_COMMAND_VALUE         32771
#define _APS_NEXT_CONTROL_VALUE         1025
#define _APS_NEXT_CONTROL_VALUE         1035
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
SourceCode/Bond/Servo/Common.h
@@ -548,4 +548,8 @@
#define ROBOT_EVENT_FINISH        1   // æ­£å¸¸å®Œæˆ
#define ROBOT_EVENT_ERROR        2   // å‡ºçŽ°é”™è¯¯
#define ROBOT_EVENT_ABORT        3   // äººä¸ºä¸­æ­¢
#define ROBOT_EVENT_RESTORE        4   // å›žæ’¤
#define ROBOT_EVENT_RESTORE        4   // å›žæ’¤
/* PPID名字最大长度 */
#define PPID_NAME_MAX            80
SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -1314,19 +1314,20 @@
    if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
        return ER_NOTSELECT;
    }
    if (m_listener.onQueryPPIDList == nullptr) {
        return ER_NO_PPID_LIST;
    }
    IMessage* pMessage = NULL;
    HSMS_Create1Message(pMessage, m_nSessionId, 7, 20, pRecv->getHeader()->systemBytes);
    ASSERT(pMessage);
    ISECS2Item* pItem = pMessage->getBody();
    pItem->addItem("banana1", "PPID1");
    pItem->addItem("banana2", "PPID2");
    pItem->addF8Item(-123.45, "PPID2");
    pItem->addF4Item(-568.99f, "PPID2");
    pItem->addF8Item(456.456, "PPID2");
    pItem->addF4Item(123.123f, "PPID2");
    auto ppids = m_listener.onQueryPPIDList(this);
    for (auto item : ppids) {
        pItem->addItem(item.c_str(), "PPID");
    }
    m_pPassive->sendMessage(pMessage);
    LOGI("<HSMS>[SECS Msg SEND]S7F20 (SysByte=%u)", pMessage->getHeader()->systemBytes);
    HSMS_Destroy1Message(pMessage);
SourceCode/Bond/Servo/HsmsPassive.h
@@ -22,6 +22,7 @@
#define ER_PARAM_ERROR            -3
#define ER_NO_EVENT                -4
#define ER_UNLINK_EVENT_REPORT    -5
#define ER_NO_PPID_LIST            -6
/*
@@ -67,6 +68,7 @@
typedef std::function<void(void* pFrom, SYSTEMTIME& time)> DATETIMESYNC;
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 struct _SECSListener
{
    SECSEQOFFLINE                onEQOffLine;
@@ -77,6 +79,7 @@
    DATETIMESYNC                onDatetimeSync;
    EDEVENTREPORT                onEnableDisableEventReport;
    EDALARMREPORT                onEnableDisableAlarmReport;
    QUERYPPIDLIST                onQueryPPIDList;
} SECSListener;
SourceCode/Bond/Servo/Model.cpp
@@ -7,6 +7,7 @@
#include "AlarmManager.h"
#include "CGlassPool.h"
#include "TransferManager.h"
#include "RecipeManager.h"
CModel::CModel()
@@ -137,6 +138,19 @@
            m_master.enableAlarmReport(bEnable);
        }
    };
    listener.onQueryPPIDList = [&](void* pFrom) ->std::vector<std::string> {
        std::vector<std::string> ppids;
        auto temp = RecipeManager::getInstance().getAllPPID();
        for (auto item : temp) {
            if (item.length() > PPID_NAME_MAX) {
                ppids.push_back(item.substr(0, PPID_NAME_MAX));
            }
            else {
                ppids.push_back(item);
            }
        }
        return ppids;
    };
    m_hsmsPassive.setListener(listener);
    m_hsmsPassive.setEquipmentModelType((LPTSTR)(LPCTSTR)strModeType);
    m_hsmsPassive.setSoftRev((LPTSTR)(LPCTSTR)strSoftRev);