DlgPlots.cpp
上传用户:gnaf34
上传日期:2022-04-22
资源大小:1657k
文件大小:4k
源码类别:

IP电话/视频会议

开发平台:

Visual C++

  1. // DlgPlots.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "BeaconClient.h"
  5. #include "DlgPlots.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. extern CString currentTestFolder;
  12. extern CString SaveResult;
  13. /////////////////////////////////////////////////////////////////////////////
  14. // DlgPlots dialog
  15. DlgPlots::DlgPlots(CWnd* pParent /*=NULL*/)
  16. : CDialog(DlgPlots::IDD, pParent)
  17. {
  18. //{{AFX_DATA_INIT(DlgPlots)
  19. // NOTE: the ClassWizard will add member initialization here
  20. //}}AFX_DATA_INIT
  21. }
  22. void DlgPlots::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(DlgPlots)
  26. DDX_Control(pDX, IDC_IMAGE, m_image);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(DlgPlots, CDialog)
  30. //{{AFX_MSG_MAP(DlgPlots)
  31. ON_BN_CLICKED(IDC_LATENCY, OnLatency)
  32. ON_BN_CLICKED(IDC_PACKETLOSS, OnPacketloss)
  33. ON_BN_CLICKED(IDC_JITTER, OnJitter)
  34. //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36. /////////////////////////////////////////////////////////////////////////////
  37. // DlgPlots message handlers
  38. void DlgPlots::OnLatency() 
  39. {
  40. // TODO: Add your control notification handler code here
  41. //MessageBox("Latency");
  42. CString file;
  43. if(atoi(SaveResult)==1){
  44. file = currentTestFolder + "\Latency.bmp";
  45. }else {
  46. file = "Latency.bmp";
  47. }
  48. HBITMAP hGroupBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), 
  49.                                         file,
  50.                                         IMAGE_BITMAP, 
  51.                                         480,360, 
  52.                                         LR_LOADFROMFILE);
  53. m_image.SetBitmap(hGroupBmp);
  54. }
  55. void DlgPlots::OnPacketloss() 
  56. {
  57. // TODO: Add your control notification handler code here
  58. //MessageBox("Packet Loss");
  59. CString file;
  60. if(atoi(SaveResult)==1){
  61. file = currentTestFolder + "\PacketLoss.bmp";
  62. }else {
  63. file = "PacketLoss.bmp";
  64. }
  65. //CString file = currentTestFolder + "\PacketLoss.bmp";
  66. HBITMAP hGroupBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), 
  67.                                         file,
  68.                                         IMAGE_BITMAP, 
  69.                                         480,360, 
  70.                                         LR_LOADFROMFILE);
  71. m_image.SetBitmap(hGroupBmp);
  72. }
  73. void DlgPlots::OnJitter() 
  74. {
  75. // TODO: Add your control notification handler code here
  76. //MessageBox("Jitter");
  77. CString file;
  78. if(atoi(SaveResult)==1){
  79. file = currentTestFolder + "\AudioJitter.bmp";
  80. }else {
  81. file = "AudioJitter.bmp";
  82. }
  83. //CString file = currentTestFolder + "\AudioJitter.bmp";
  84. HBITMAP hGroupBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), 
  85.                                         file,
  86.                                         IMAGE_BITMAP, 
  87.                                         480,360, 
  88.                                         LR_LOADFROMFILE);
  89. m_image.SetBitmap(hGroupBmp);
  90. }
  91. BOOL DlgPlots::OnInitDialog() 
  92. {
  93. CDialog::OnInitDialog();
  94. // TODO: Add extra initialization here
  95. CString file;
  96. if(atoi(SaveResult)==1){
  97. file = currentTestFolder + "\Latency.bmp";
  98. }else {
  99. file = "Latency.bmp";
  100. }
  101. //CString file = currentTestFolder + "\Latency.bmp";
  102. HBITMAP hGroupBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), 
  103.                                         file,
  104.                                         IMAGE_BITMAP, 
  105.                                         480,360, 
  106.                                         LR_LOADFROMFILE);
  107. m_image.SetBitmap(hGroupBmp);
  108. //GetDlgItem(IDC_LATENCY)->
  109. CheckRadioButton(IDC_LATENCY,IDC_JITTER,IDC_LATENCY);
  110. //DlgPlots::UpdateWindow();
  111. return TRUE;  // return TRUE unless you set the focus to a control
  112.               // EXCEPTION: OCX Property Pages should return FALSE
  113. }