// DialRollCallCable.cpp : implementation file // #include "stdafx.h" #include "GeoMative.h" #include "DialRollCallCable.h" #include "CtrlProtocolDef.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDialRollCallCable dialog extern int g_UIOffset; extern CGeoMativeApp theApp; extern int g_iUILanguage; extern int g_iOnLineVersion; //CDialRollCallCable::CDialRollCallCable(CWnd* pParent /*=NULL*/) // : CNetRequestDialog(CDialRollCallCable::IDD, pParent) //{ // //{{AFX_DATA_INIT(CDialRollCallCable) // // NOTE: the ClassWizard will add member initialization here // //}}AFX_DATA_INIT // memset(m_chData, 0, sizeof(m_chData)); // m_iRecvLen = 0; // m_uiDevID = 0; // m_bRollCallFin = false; //} void CDialRollCallCable::DoDataExchange(CDataExchange* pDX) { CNetRequestDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDialRollCallCable) DDX_Control(pDX, IDC_LIST_ROLLCALL_CABLE, m_listRollCall); //}}AFX_DATA_MAP DDX_Control(pDX, IDC_BUTTON_SERVER_CABLE, m_CButtonServer); DDX_Control(pDX, IDC_BUTTON_CALL_LEADER, m_CButtonCable); } BEGIN_MESSAGE_MAP(CDialRollCallCable, CNetRequestDialog) //{{AFX_MSG_MAP(CDialRollCallCable) ON_WM_CLOSE() //}}AFX_MSG_MAP ON_BN_CLICKED(IDC_BUTTON_SERVER_CABLE, &CDialRollCallCable::OnBnClickedButtonServerCable) ON_BN_CLICKED(IDC_BUTTON_CALL_LEADER, &CDialRollCallCable::OnBnClickedButtonCallLeader) ON_MESSAGE(WM_MSG_SEND_CABLE_ROLLCALL, &CDialRollCallCable::OnMsgCableRollCall) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDialRollCallCable message handlers BOOL CDialRollCallCable::OnInitDialog() { CNetRequestDialog::OnInitDialog(); if (LANG_ZHCN == g_iUILanguage) { SetWindowText(_T("电缆头点名")); GetDlgItem(IDC_STATIC_ROLLCALL)->SetWindowText(_T("点名状态:")); GetDlgItem(IDC_BUTTON_SERVER_CABLE)->SetWindowText(_T("服务端信息")); GetDlgItem(IDC_BUTTON_CALL_LEADER)->SetWindowText(_T("搜索电缆头")); } // TODO: Add extra initialization here CString strColTitle; int iColIndex = 0; m_listRollCall.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_ONECLICKACTIVATE | LVS_EX_GRIDLINES); strColTitle = _T("ID"); m_listRollCall.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 50); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_RC_CABLE_POS + g_UIOffset); m_listRollCall.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 80); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_RC_CABLE_DEV_ID + g_UIOffset); m_listRollCall.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 120); iColIndex++; strColTitle.Empty(); strColTitle.LoadString(IDS_RC_CABLE_VOLTAGE + g_UIOffset); m_listRollCall.InsertColumn(iColIndex, strColTitle, LVCFMT_LEFT, 150); if (EN_ON_LIEN_VERSION_1 == g_iOnLineVersion) { //灰化并隐藏二期的按钮 m_CButtonServer.EnableWindow(FALSE); m_CButtonServer.ShowWindow(FALSE); m_CButtonCable.EnableWindow(FALSE); m_CButtonCable.ShowWindow(FALSE); rollcallCable(); } else { searchSwitchRelay(); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDialRollCallCable::ShowCableInfo() { if (m_iRecvLen < 1) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { AfxMessageBox(_T("集中式电缆头信息错误")); GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("集中式电缆头信息错误")); } else { AfxMessageBox(_T("电缆头信息错误")); GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("电缆头信息错误")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { MessageBoxEx(NULL, _T("Switch Box leader info error!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("Switch Box leader info error!")); } else { MessageBoxEx(NULL, _T("Switch Relay leader info error!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("Switch Relay leader info error!")); } } return; } CString strInfo = _T(""); BYTE ucCableNum = (BYTE)(m_chData[0]); //或者只接收到一个字节 if (ucCableNum < 1 || m_iRecvLen == 1) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("未获取到集中式电缆头信息")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("未获取到电缆头信息")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("no switch box found.")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("no cable leader found.")); } } return; } if (m_iRecvLen != (1 + 3 * ucCableNum)) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { if (LANG_ZHCN == g_iUILanguage) AfxMessageBox(_T("集中式电缆头点名失败")); else MessageBoxEx(NULL, _T("Switch Box roll call failed"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); } else { if (LANG_ZHCN == g_iUILanguage) AfxMessageBox(_T("电缆头点名失败")); else MessageBoxEx(NULL, _T("Switch Relay roll call failed"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); } return; } m_listRollCall.DeleteAllItems(); BYTE* pData = (BYTE*)m_chData; BYTE ucData = 0; CString strLog; strLog.Format(_T("CDialRollCallCable::ShowCableInfo pRecvData= ")); int j = 0; do { strLog.AppendFormat(_T("%02x "), m_chData[j]); j++; } while (m_chData[j] != NULL); CFileOperTools::GetInstance()->WriteComLog(strLog); for (int i = 0; i < ucCableNum; i++) { m_listRollCall.InsertItem(i, _T("")); strInfo.Empty(); strInfo.Format(_T("%d"), i + 1); m_listRollCall.SetItemText(i, 0, strInfo); ucData = pData[1 + 3 * i]; if (LANG_ZHCN == g_iUILanguage) { if (0x4C == ucData) strInfo = _T("左"); else if (0x52 == ucData) strInfo = _T("右"); else strInfo = _T("未知"); } else { if (0x4C == ucData) strInfo = _T("L"); else if (0x52 == ucData) strInfo = _T("R"); else strInfo = _T("Unknow"); } m_listRollCall.SetItemText(i, 1, strInfo); ucData = pData[2 + 3 * i]; strInfo.Format(_T("%d"), ucData); m_listRollCall.SetItemText(i, 2, strInfo); ucData = pData[3 + 3 * i]; strInfo.Format(_T("%d"), ucData); m_listRollCall.SetItemText(i, 3, strInfo); } } void CDialRollCallCable::NotifyFuc(LPARAM lMsgType, LPARAM lResStatus, LPVOID lpParam) { if (NULL == lpParam) { return; } CDialRollCallCable* pDialRollCall = (CDialRollCallCable*)lpParam; CString str = _T(""); pDialRollCall->m_bRollCallFin = true; if (EN_ON_LIEN_VERSION_1 == g_iOnLineVersion || TRUE == pDialRollCall->m_bSearchFlg) { pDialRollCall->m_bSearchFlg = false; if (EN_RECV_SUCCESS != lResStatus) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == pDialRollCall->m_byCableType) { str.Format(_T("搜索集中式电缆头失败,出错代码为(%d,%d)"), lMsgType, lResStatus); } else { str.Format(_T("搜索电缆头失败,出错代码为(%d,%d)"), lMsgType, lResStatus); } } else { if (EN_30_SINGLE_TAP_LINES == pDialRollCall->m_byCableType) { str.Format(_T("Failed to search switch box , error code(%d,%d)"), lMsgType, lResStatus); } else { str.Format(_T("Failed to search cable leader , error code(%d,%d)"), lMsgType, lResStatus); } } pDialRollCall->GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(str); return; } if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == pDialRollCall->m_byCableType) { str = _T("搜索集中式电缆头成功."); } else { str = _T("搜索电缆头成功."); } } else { if (EN_30_SINGLE_TAP_LINES == pDialRollCall->m_byCableType) { str = _T("Switch Box checked successfully."); } else { str = _T("Switch Relay checked successfully."); } } } else { if (EN_RECV_SUCCESS != lResStatus) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == pDialRollCall->m_byCableType) { str.Format(_T("获取服务端集中式电缆头信息失败,出错代码为(%d,%d)"), lMsgType, lResStatus); } else { str.Format(_T("获取服务端电缆头信息失败,出错代码为(%d,%d)"), lMsgType, lResStatus); } } else { if (EN_30_SINGLE_TAP_LINES == pDialRollCall->m_byCableType) { str.Format(_T("Failed to get switch box information , error code(%d,%d)"), lMsgType, lResStatus); } else { str.Format(_T("Failed to get cable leader information , error code(%d,%d)"), lMsgType, lResStatus); } } pDialRollCall->GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(str); return; } if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == pDialRollCall->m_byCableType) { str = _T("获取服务端集中式电缆头信息成功."); } else { str = _T("获取服务端电缆头信息成功."); } } else { if (EN_30_SINGLE_TAP_LINES == pDialRollCall->m_byCableType) { str = _T("Get Switch Box information successfully."); } else { str = _T("Get Switch Relay information successfully."); } } } pDialRollCall->GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(str); pDialRollCall->ShowCableInfo(); } void CDialRollCallCable::OnClose() { // TODO: Add your message handler code here and/or call default if (!m_bRollCallFin) { if (LANG_ZHCN == g_iUILanguage) AfxMessageBox(_T("正在进行搜索中,请勿关闭...")); else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { MessageBoxEx(NULL, _T("Switch box in process of checking, do not close"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); } else { MessageBoxEx(NULL, _T("Cable leader in process of checking, do not close"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); } } return; } CNetRequestDialog::OnClose(); } void CDialRollCallCable::OnBnClickedButtonServerCable() { if (LANG_ENUS == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { SetWindowText("It's switch box information from the server."); } else { SetWindowText("It's cable leader information from the server."); } GetDlgItem(IDC_STATIC_ROLLCALL)->SetWindowText(_T("Status:")); } m_listRollCall.DeleteAllItems(); searchSwitchRelay(); } void CDialRollCallCable::OnBnClickedButtonCallLeader() { // TODO: 在此添加控件通知处理程序代码 int nRet = 0; CString strTips; if (g_iUILanguage == LANG_ZHCN) { strTips.Format(_T("此操作会影响正在测试的任务,请确认服务端无正在测试的任务!\n是否继续?")); nRet = AfxMessageBox(strTips, MB_YESNO); } else { strTips.Format(_T("This operation will affect the tasks being tested. Please make sure there are no tasks being tested on the server! \ncontinue ?")); nRet = MessageBoxEx(NULL, strTips, STRING_MESSAGEBOXEX_TITLE, MB_YESNO, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); } if (IDYES != nRet) return; m_listRollCall.DeleteAllItems(); if (LANG_ENUS == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { SetWindowText("Search Switch Box"); } else { SetWindowText("Search Switch Relay"); } } m_bSearchFlg = TRUE; rollcallCable(); } void CDialRollCallCable::rollcallCable() { PostNetRequest(EN_CTRL_ROLLCALL_CABLE, this->m_hWnd, NULL, 0, MAX_ROLLCALL_LEN, WM_NET_RESPONSE, m_uiDevID, EN_DEV_GD10, 600000); /*STSendDataInfo stSendData; stSendData.pData = NULL; stSendData.wDataLen = 0; stSendData.uiDevID = m_uiDevID; // stSendData.uiDevID = 12356987; stSendData.ucDstType = EN_DEV_GD10; STRespDataInfo stRspData; stRspData.pData = m_chData; stRspData.pRecvLen = &m_iRecvLen; stRspData.iMaxRcvLen = MAX_ROLLCALL_LEN; stRspData.iTimeout = 40000; if (false == theApp.m_NetWorkOper.TransferOper(EN_CTRL_ROLLCALL_CABLE, &stSendData, true, &stRspData, NotifyFuc, this)) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("启动搜索集中式电缆头失败,请重试...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("启动搜索电缆头失败,请重试...")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("switch box check failed...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("cable leader check failed...")); } } m_bRollCallFin = true; } else { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("正在搜索集中式电缆头,请稍侯...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("正在搜索电缆头,请稍侯...")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("switch box checking,please wait...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("cable leader checking,please wait...")); } } }*/ } void CDialRollCallCable::searchSwitchRelay() { UINT32 uiDevID = htonl(m_uiDevID); char cData[10] = { 0 }; memcpy(cData, &uiDevID, sizeof(UINT32)); PostNetRequest(EN_REQ_DOWNLOAD_CABLE_INFO, this->m_hWnd, cData, sizeof(UINT32), MAX_ROLLCALL_LEN, WM_NET_RESPONSE, CLOUD_DEV_ID, EN_DEV_CLOUND, 60000); /*STSendDataInfo stSendData; UINT32 uiDevID = htonl(m_uiDevID); char cData[10]; stSendData.pData = cData; memcpy(stSendData.pData, &uiDevID, sizeof(UINT32)); stSendData.wDataLen = sizeof(UINT32); stSendData.uiDevID = CLOUD_DEV_ID; stSendData.ucDstType = EN_DEV_CLOUND; STRespDataInfo stRspData; stRspData.pData = m_chData; stRspData.pRecvLen = &m_iRecvLen; stRspData.iMaxRcvLen = MAX_ROLLCALL_LEN; stRspData.iTimeout = 4000; if (false == theApp.m_NetWorkOper.TransferOper(EN_REQ_DOWNLOAD_CABLE_INFO, &stSendData, true, &stRspData, NotifyFuc, this)) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("获取服务端集中式电缆头历史信息失败,请重试...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("获取服务端电缆头历史信息失败,请重试...")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("Failed to get switch box information from the server...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("Failed to get cable leader information from the server...")); } } m_bRollCallFin = true; } else { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("正在获取服务端集中式电缆头历史信息,请稍侯...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("正在获取服务端电缆头历史信息,请稍侯...")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("It's getting switch box information from the server,please wait...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("It's getting cable leader information from the server,please wait...")); } } }*/ } LRESULT CDialRollCallCable::OnMsgCableRollCall(WPARAM wParam, LPARAM lParam) { if (EN_CTRL_ROLLCALL_CABLE == lParam) { if (11 == wParam)//发送失败 { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("启动搜索集中式电缆头失败,请重试...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("启动搜索电缆头失败,请重试...")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("switch box check failed...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("cable leader check failed...")); } } m_bRollCallFin = true; } else if (-1 == wParam) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("正在搜索集中式电缆头,请稍侯...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("正在搜索电缆头,请稍侯...")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("Searching Switch Box,please wait...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("Searching Switch Relay,please wait...")); } } } } else if (EN_REQ_DOWNLOAD_CABLE_INFO == lParam) { if (11 == wParam)//发送失败 { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("获取服务端集中式电缆头历史信息失败,请重试...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("获取服务端电缆头历史信息失败,请重试...")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("Failed to get switch box information from the server...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("Failed to get cable leader information from the server...")); } } m_bRollCallFin = true; } else if (-1 == wParam) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("正在获取服务端集中式电缆头历史信息,请稍侯...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("正在获取服务端电缆头历史信息,请稍侯...")); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("It's getting switch box information from the server,please wait...")); } else { GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(_T("It's getting cable leader information from the server,please wait...")); } } } } return 0; } void CDialRollCallCable::PreNetResponse(WPARAM wParam, LPARAM lParam) { LPRESPONSEPACKET pResponsePacket = (LPRESPONSEPACKET)lParam; if (pResponsePacket == NULL) { return; } m_bRollCallFin = true; CString str; switch (pResponsePacket->clsPacketBase.ucCmd) { case EN_CTRL_ROLLCALL_CABLE: { m_bSearchFlg = false; if (EN_RECV_SUCCESS != wParam) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { str.Format(_T("搜索集中式电缆头失败,出错代码为(%d)"), wParam); } else { str.Format(_T("搜索电缆头失败,出错代码为(%d)"), wParam); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { str.Format(_T("Failed to search switch box , error code(%d)"), wParam); } else { str.Format(_T("Failed to search cable leader , error code(%d)"), wParam); } } GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(str); return; } if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { str = _T("搜索集中式电缆头成功."); } else { str = _T("搜索电缆头成功."); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { str = _T("Switch box checked successfully."); } else { str = _T("Switch relay checked successfully."); } } } break; case EN_REQ_DOWNLOAD_CABLE_INFO: { if (EN_RECV_SUCCESS != wParam) { if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { str.Format(_T("获取服务端集中式电缆头信息失败,出错代码为(%d)"), wParam); } else { str.Format(_T("获取服务端电缆头信息失败,出错代码为(%d)"), wParam); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { str.Format(_T("Failed to get switch box information , error code(%d)"), wParam); } else { str.Format(_T("Failed to get cable leader information , error code(%d)"), wParam); } } GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(str); return; } if (LANG_ZHCN == g_iUILanguage) { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { str = _T("获取服务端集中式电缆头信息成功."); } else { str = _T("获取服务端电缆头信息成功."); } } else { if (EN_30_SINGLE_TAP_LINES == m_byCableType) { str = _T("Switch box information get to finished."); } else { str = _T("Cable leader information get to finished."); } } } break; default: break; } memcpy(m_chData, pResponsePacket->pData, pResponsePacket->wDataLen); m_iRecvLen = pResponsePacket->wDataLen; GetDlgItem(IDC_STATIC_ROLLCALL_TIPS)->SetWindowText(str); ShowCableInfo(); }