| | |
| | | int CDialogStatusShow::ShowParams()
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | m_liststatus1.SetExtendedStyle(LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_ONECLICKACTIVATE | LVS_EX_LABELTIP);
|
| | | m_liststatus1.SetExtendedStyle( LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_ONECLICKACTIVATE | LVS_EX_LABELTIP);
|
| | | m_liststatus1.DeleteAllItems();
|
| | | while (m_liststatus1.DeleteColumn(0));
|
| | | m_liststatus1.InsertColumn(0, _T("NO"), LVCFMT_LEFT, 96, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | |
| | | m_liststatus1.InsertColumn(6, _T("子机5"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(7, _T("子机6"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(8, _T("子机7"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(10, _T("子机8"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(9, _T("子机8"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(10, _T("子机9"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(11, _T("子机10"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(12, _T("子机11"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(13, _T("子机12"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(14, _T("子机13"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | | m_liststatus1.InsertColumn(15, _T("子机14"), LVCFMT_LEFT, 128, -1);//LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER
|
| | |
|
| | | m_liststatus1.InsertItem(0, _T("状态"));
|
| | | m_liststatus1.InsertItem(1, _T("发送包计数"));
|
| | |
| | | m_liststatus1.InsertItem(5, _T("连续丢包"));
|
| | | m_liststatus1.InsertItem(6, _T("最大连续"));
|
| | | m_liststatus1.InsertItem(7, _T("非包计数"));
|
| | | // m_liststatus1.InsertItem(8, _T("无结尾包"));
|
| | | m_liststatus1.InsertItem(8, _T("包长错误"));
|
| | | m_liststatus1.InsertItem(9, _T("校验错误"));
|
| | | m_liststatus1.InsertItem(10, _T("超时错误"));
|
| | | m_liststatus1.InsertItem(11, _T("返回延迟(uS)"));
|
| | | m_liststatus1.InsertItem(12, _T("最大延迟(uS)"));
|
| | | m_liststatus1.InsertItem(13, _T("循环时间(uS)"));
|
| | | m_liststatus1.InsertItem(11, _T("返回延迟(mS)"));
|
| | | m_liststatus1.InsertItem(12, _T("最大延迟(mS)"));
|
| | | m_liststatus1.InsertItem(13, _T("循环时间(mS)"));
|
| | | m_liststatus1.InsertItem(14, _T("子机接收"));
|
| | | m_liststatus1.InsertItem(15, _T("子机发送"));
|
| | | m_liststatus1.InsertItem(16, _T("子机非包"));
|
| | | m_liststatus1.InsertItem(17, _T("子机非ID"));
|
| | | // m_liststatus1.InsertItem(18, _T("子机无尾"));
|
| | | m_liststatus1.InsertItem(18, _T("子机包长"));
|
| | | m_liststatus1.InsertItem(19, _T("子机校验"));
|
| | | m_liststatus1.InsertItem(20, _T("子机超时"));
|
| | |
|
| | | m_liststatus1.InsertItem(21, _T("子机超时"));
|
| | | m_liststatus1.InsertItem(22, _T("子机超时"));
|
| | | m_liststatus1.InsertItem(23, _T("子机超时"));
|
| | | m_liststatus1.InsertItem(24, _T("子机超时"));
|
| | | m_liststatus1.InsertItem(25, _T("子机超时"));
|
| | | m_liststatus1.InsertItem(26, _T("子机超时"));
|
| | | m_liststatus1.InsertItem(27, _T("子机超时"));
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
| | | int nOffset = 0;
|
| | | KLink1::pChnStat pchnstat1;
|
| | | unsigned int nSendPackets;
|
| | | int nChilds = 8;
|
| | | int nChilds = 14;
|
| | | //子机1
|
| | | //子机2
|
| | | for (int i = 0; i < nChilds; i++)
|
| | | for (int i = 0; i <= nChilds; i++)
|
| | | {
|
| | | nOffset = 0 + sizeof(KLink1::stChnStat) * i;
|
| | | pchnstat1 = (KLink1::pChnStat)&(pDoc->KBDB[nOffset + 0]);
|
| | |
| | | m_liststatus1.SetItemText(9, 1 + i, s1);
|
| | | s1.Format(_T("%u (%.3f%%)"), pchnstat1->TimeOutErr, pchnstat1->TimeOutErr * 100.0 / nSendPackets);
|
| | | m_liststatus1.SetItemText(10, 1 + i, s1);
|
| | | s1.Format(_T("%u"), pchnstat1->Delay);
|
| | | s1.Format(_T("%.1f"), pchnstat1->Delay/10.0f);
|
| | | m_liststatus1.SetItemText(11, 1 + i, s1);
|
| | | s1.Format(_T("%u"), pchnstat1->MaxDelay);
|
| | | s1.Format(_T("%.1f"), pchnstat1->MaxDelay/10.0f);
|
| | | m_liststatus1.SetItemText(12, 1 + i, s1);
|
| | | s1.Format(_T("%u"), pchnstat1->SendTimeInterval);
|
| | | s1.Format(_T("%.1f"), pchnstat1->SendTimeInterval/10.0f);
|
| | | m_liststatus1.SetItemText(13, 1 + i, s1);
|
| | |
|
| | |
|
| | |
| | | CDialogEx::OnClose();
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | void CDialogStatusShow::OnBnClickedButtonClearStatistics()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | |
| | | CView *pV = (CView*)pChild->GetActiveView();
|
| | | CMTerm1Doc* pDoc = (CMTerm1Doc *)(pV->GetDocument());
|
| | |
|
| | | pDoc->MyKLink1.ClearStatistics(1, 0);
|
| | | theApp.MyKLink1.ClearStatistics(1, 0);
|
| | |
|
| | | }
|