| | |
| | | return 0; |
| | | } |
| | | |
| | | int CHsmsActive::hsmsConfigureSpooling(std::map<unsigned int, std::set<unsigned int>>& spoolingConfig) |
| | | { |
| | | IMessage* pMessage = nullptr; |
| | | int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 2 | REPLY, 43, ++m_nSystemByte); |
| | | if (spoolingConfig.size() > 0) { |
| | | for (auto s : spoolingConfig) { |
| | | ISECS2Item* pItemStreamList = pMessage->getBody()->addItem(); |
| | | pItemStreamList->addU1Item(s.first, "STRID"); |
| | | ISECS2Item* pItemFcnList = pItemStreamList->addItem(); |
| | | for (auto f : s.second) { |
| | | pItemFcnList->addU1Item(f, "FCNID"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | m_pActive->sendMessage(pMessage); |
| | | HSMS_Destroy1Message(pMessage); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CHsmsActive::replyAck0(IMessage* pMessage) |
| | | { |
| | | return 0; |
| | |
| | | #include <string> |
| | | #include <vector> |
| | | #include <map> |
| | | #include <set> |
| | | #include "CCollectionEvent.h" |
| | | |
| | | |
| | |
| | | // Line Event Report |
| | | int hsmsLinkEventReport(std::map<unsigned int, std::vector<unsigned int>>& mapEvent); |
| | | |
| | | // Configure Spooling |
| | | int hsmsConfigureSpooling(std::map<unsigned int, std::set<unsigned int>>& spoolingConfig); |
| | | |
| | | // éè¿çreply彿° |
| | | void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName); |
| | | |
| | |
| | | ON_BN_CLICKED(IDC_BUTTON_ED_ALARM_REPORT, &CEAPSimulatorDlg::OnBnClickedButtonEdAlarmReport) |
| | | ON_BN_CLICKED(IDC_BUTTON_DEFINE_REPORT, &CEAPSimulatorDlg::OnBnClickedButtonDefineReport) |
| | | ON_BN_CLICKED(IDC_BUTTON_LINE_REPORT, &CEAPSimulatorDlg::OnBnClickedButtonLineReport) |
| | | ON_BN_CLICKED(IDC_BUTTON_CONFIGURE_SPOOLING, &CEAPSimulatorDlg::OnBnClickedButtonConfigureSpooling) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | GetDlgItem(IDC_BUTTON_ED_ALARM_REPORT)->EnableWindow(enabled); |
| | | GetDlgItem(IDC_BUTTON_DEFINE_REPORT)->EnableWindow(enabled); |
| | | GetDlgItem(IDC_BUTTON_LINE_REPORT)->EnableWindow(enabled); |
| | | GetDlgItem(IDC_BUTTON_CONFIGURE_SPOOLING)->EnableWindow(enabled); |
| | | } |
| | | |
| | | void CEAPSimulatorDlg::OnBnClickedButtonConnect() |
| | |
| | | CLinkReportDlg dlg; |
| | | dlg.DoModal(); |
| | | } |
| | | |
| | | void CEAPSimulatorDlg::OnBnClickedButtonConfigureSpooling() |
| | | { |
| | | std::map<unsigned int, std::set<unsigned int>> spoolingConfig; |
| | | |
| | | // test clear all |
| | | // theApp.m_model.m_pHsmsActive->hsmsConfigureSpooling(spoolingConfig); |
| | | |
| | | |
| | | // test add s2[1,3,5]; |
| | | // spoolingConfig[2].insert(1); |
| | | // spoolingConfig[2].insert(3); |
| | | // spoolingConfig[2].insert(5); |
| | | // spoolingConfig[3].insert(2); |
| | | // spoolingConfig[3].insert(4); |
| | | // spoolingConfig[3].insert(6); |
| | | // theApp.m_model.m_pHsmsActive->hsmsConfigureSpooling(spoolingConfig); |
| | | |
| | | // test clear S2 |
| | | // spoolingConfig[2].clear(); |
| | | // theApp.m_model.m_pHsmsActive->hsmsConfigureSpooling(spoolingConfig); |
| | | |
| | | spoolingConfig[5].insert(66); |
| | | theApp.m_model.m_pHsmsActive->hsmsConfigureSpooling(spoolingConfig); |
| | | } |
| | |
| | | afx_msg void OnBnClickedButtonEdAlarmReport(); |
| | | afx_msg void OnBnClickedButtonDefineReport(); |
| | | afx_msg void OnBnClickedButtonLineReport(); |
| | | afx_msg void OnBnClickedButtonConfigureSpooling(); |
| | | }; |
| | |
| | | #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_EDIT_CEID 1014 |
| | | #define IDC_LIST1 1015 |
| | |
| | | else if (nStream == 2 && pHeader->function == 41) { |
| | | replyCommand(pMessage); |
| | | } |
| | | else if (nStream == 2 && pHeader->function == 43) { |
| | | replyConfigureSpooling(pMessage); |
| | | } |
| | | else if (nStream == 5 && pHeader->function == 3) { |
| | | replyEanbleDisableAlarmReport(pMessage); |
| | | } |
| | |
| | | return 0; |
| | | } |
| | | |
| | | // S2F43 |
| | | int CHsmsPassive::replyConfigureSpooling(IMessage* pRecv) |
| | | { |
| | | if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) { |
| | | return ER_NOTSELECT; |
| | | } |
| | | ISECS2Item* pBody = pRecv->getBody(); |
| | | if (pBody == nullptr || pBody->getType() != SITYPE::L) ER_PARAM_ERROR; |
| | | |
| | | // æ¸
ç©ºææ |
| | | if (pBody->getSubItemSize() == 0) { |
| | | m_spoolingConfig.clear(); |
| | | goto MYREPLY; |
| | | } |
| | | |
| | | // 便¬¡é
ç½®Stream |
| | | for (int i = 0; i < pBody->getSubItemSize(); i++) { |
| | | ISECS2Item* pStreamItem = pBody->getSubItem(i); |
| | | ASSERT(pStreamItem); |
| | | unsigned char STRID, FCNID; |
| | | pStreamItem->getSubItemU1(0, STRID); |
| | | ISECS2Item* pFcnItemList = pStreamItem->getSubItem(1); |
| | | if (pFcnItemList->getSubItemSize() == 0) { |
| | | m_spoolingConfig[STRID].clear(); |
| | | } |
| | | else { |
| | | for (int j = 0; j < pFcnItemList->getSubItemSize(); j++) { |
| | | pFcnItemList->getSubItemU1(j, FCNID); |
| | | m_spoolingConfig[STRID].insert(FCNID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æå°éªè¯ç»æ |
| | | for (auto s : m_spoolingConfig) { |
| | | LOGI("====> stream:%d", s.first); |
| | | for (auto f : s.second) { |
| | | LOGI("function:%d", f); |
| | | } |
| | | } |
| | | MYREPLY: |
| | | replyAck(2, 42, pRecv->getHeader()->systemBytes, BYTE(0), "ERACK"); |
| | | return 0; |
| | | } |
| | | |
| | | // S5F3 |
| | | int CHsmsPassive::replyEanbleDisableAlarmReport(IMessage* pRecv) |
| | | { |
| | |
| | | #include <functional> |
| | | #include <vector> |
| | | #include <map> |
| | | #include <set> |
| | | #include "CCollectionEvent.h" |
| | | |
| | | |
| | |
| | | int replyLinkEventReport(IMessage* pRecv); |
| | | int replyEanbleDisableEventReport(IMessage* pRecv); |
| | | int replyCommand(IMessage* pRecv); |
| | | int replyConfigureSpooling(IMessage* pRecv); |
| | | int replyEanbleDisableAlarmReport(IMessage* pRecv); |
| | | int replyQueryPPIDList(IMessage* pRecv); |
| | | int replyTerminalDisplay(IMessage* pRecv); |
| | |
| | | |
| | | // CollectionEvent vector |
| | | std::vector<SERVO::CCollectionEvent*> m_collectionEvents; |
| | | |
| | | // Spooling Config |
| | | std::map<uint16_t, std::set<uint16_t>> m_spoolingConfig; |
| | | }; |
| | | |