chenluhua1980
2026-01-08 d3e6607623a258e26e579731713407737f96a392
1.查询状态EAP模拟及测试;
已修改7个文件
48 ■■■■ 文件已修改
SourceCode/Bond/EAPSimulator/CHsmsActive.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CHsmsActive.h 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulator.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/Resource.h 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
@@ -342,7 +342,7 @@
    IMessage* pMessage = nullptr;
    int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 1 | REPLY, 3, ++m_nSystemByte);
    pMessage->getBody()->addU4Item(SVID, "SVID");
    pMessage->getBody()->addU2Item(static_cast<unsigned short>(SVID), "SVID");
    m_pActive->sendMessage(pMessage);
    HSMS_Destroy1Message(pMessage);
SourceCode/Bond/EAPSimulator/CHsmsActive.h
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <string>
#include <vector>
#include <map>
@@ -7,6 +7,7 @@
#include "ProcessJob.h"
#define SVID_ControlState           600
#define SVID_CJobSpace                5001
#define SVID_PJobSpace                5002
#define SVID_PJobQueued                5003
@@ -36,7 +37,7 @@
    // Deselect Request
    int hsmsDeselectRequest();
    // 建立通讯(S1F13)
    // 建立通讯(S1F13)
    int hsmsEstablishCommunications();
    // Are You There
@@ -71,18 +72,18 @@
    // Configure Spooling
    int hsmsConfigureSpooling(std::map<unsigned int, std::set<unsigned int>>& spoolingConfig);
    // 发送或清空缓存的消息
    // 发送或清空缓存的消息
    int hsmsTransmitSpooledData();
    int hsmsPurgeSpooledData();
    // 查询变量
    // 查询变量
    int hsmsSelectedEquipmentStatusRequest(unsigned int SVID);
    // 查询PPID List
    // 查询PPID List
    int hsmsQueryPPIDList();
    // S3F17
    // 卡匣动作请求
    // 卡匣动作请求
    int hsmsCarrierActionRequest(unsigned int DATAID, 
        const char* pszCarrierAction,
        const char* pszCarrierId,
@@ -106,7 +107,7 @@
    // S14F9
    int hsmsCreateControlJob(const char* pszControlJobId, std::vector<std::string>& processJobIds);
    // 通过的reply函数
    // 通过的reply函数
    void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName);
    // reply ack0
SourceCode/Bond/EAPSimulator/EAPSimulator.rc
Binary files differ
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp
@@ -101,6 +101,7 @@
    ON_BN_CLICKED(IDC_BUTTON_CTRL_OFFLINE, &CEAPSimulatorDlg::OnBnClickedButtonCtrlOffline)
    ON_BN_CLICKED(IDC_BUTTON_CTRL_ONLINE_LOCAL, &CEAPSimulatorDlg::OnBnClickedButtonCtrlOnlineLocal)
    ON_BN_CLICKED(IDC_BUTTON_CTRL_ONLINE_REMOTE, &CEAPSimulatorDlg::OnBnClickedButtonCtrlOnlineRemote)
    ON_BN_CLICKED(IDC_BUTTON_QUERY_CONTROL_STATE, &CEAPSimulatorDlg::OnBnClickedButtonQueryControlState)
END_MESSAGE_MAP()
@@ -220,6 +221,19 @@
            if (hBtn != nullptr) {
                ::SendMessage(hBtn, WM_SETFONT, (WPARAM)GetFont()->GetSafeHandle(), TRUE);
            }
        }
    }
    // S1F3 Query ControlState (SVID=600) button (runtime add to avoid touching UTF-16 RC)
    {
        // Place on its own row to avoid overlapping with control-mode buttons.
        CRect rc(14, 136, 14 + 140, 136 + 14); // dialog units
        MapDialogRect(&rc);
        HWND hBtn = ::CreateWindow(_T("BUTTON"), _T("S1F3_QueryControlState"),
            WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
            rc.left, rc.top, rc.Width(), rc.Height(),
            m_hWnd, (HMENU)IDC_BUTTON_QUERY_CONTROL_STATE, AfxGetInstanceHandle(), nullptr);
        if (hBtn != nullptr) {
            ::SendMessage(hBtn, WM_SETFONT, (WPARAM)GetFont()->GetSafeHandle(), TRUE);
        }
    }
@@ -344,6 +358,9 @@
    }
    if (GetDlgItem(IDC_BUTTON_CTRL_ONLINE_REMOTE) != nullptr) {
        GetDlgItem(IDC_BUTTON_CTRL_ONLINE_REMOTE)->EnableWindow(enabled);
    }
    if (GetDlgItem(IDC_BUTTON_QUERY_CONTROL_STATE) != nullptr) {
        GetDlgItem(IDC_BUTTON_QUERY_CONTROL_STATE)->EnableWindow(enabled);
    }
}
@@ -509,3 +526,8 @@
    theApp.m_model.m_pHsmsActive->hsmsRequestOnline();
    theApp.m_model.m_pHsmsActive->hsmsGoRemote();
}
void CEAPSimulatorDlg::OnBnClickedButtonQueryControlState()
{
    theApp.m_model.m_pHsmsActive->hsmsSelectedEquipmentStatusRequest(SVID_ControlState);
}
SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h
@@ -67,4 +67,5 @@
    afx_msg void OnBnClickedButtonCtrlOffline();
    afx_msg void OnBnClickedButtonCtrlOnlineLocal();
    afx_msg void OnBnClickedButtonCtrlOnlineRemote();
    afx_msg void OnBnClickedButtonQueryControlState();
};
SourceCode/Bond/EAPSimulator/Resource.h
@@ -61,6 +61,7 @@
#define IDC_BUTTON_CTRL_OFFLINE         1043
#define IDC_BUTTON_CTRL_ONLINE_LOCAL    1044
#define IDC_BUTTON_CTRL_ONLINE_REMOTE   1045
#define IDC_BUTTON_QUERY_CONTROL_STATE  1046
// Next default values for new objects
// 
@@ -68,7 +69,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        143
#define _APS_NEXT_COMMAND_VALUE         32771
#define _APS_NEXT_CONTROL_VALUE         1046
#define _APS_NEXT_CONTROL_VALUE         1047
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -1784,10 +1784,15 @@
        goto MYREPLY;
    }
    if (!pBody->getSubItemU2(0, SVID)) {
        // also accept I2 or U4 to be tolerant with host implementations
        if (!pBody->getSubItemI2(0, (short&)SVID)) {
            unsigned int svidU4 = 0;
            if (!pBody->getSubItemU4(0, svidU4)) {
            pMessage->getBody()->addU1Item(SVU1, "SV");
            goto MYREPLY;
        }
            SVID = static_cast<unsigned short>(svidU4);
        }
    }
    SERVO::CVariable* pVariable = getVariable((int)SVID);