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

IP电话/视频会议

开发平台:

Visual C++

  1. // ConfigurePlots.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "BeaconClient.h"
  5. #include "ConfigurePlots.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. extern CString consoleStr;
  12. extern CString laG,laA,laU,loG,loA,loU,jiG,jiA,jiU;
  13. //extern char *laG,*laA,*laU,*loG,*loA,*loU,*jiG,*jiA,*jiU;
  14. extern char exeFolderPath[MAX_PATH];
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CConfigurePlots dialog
  17. CConfigurePlots::CConfigurePlots(CWnd* pParent /*=NULL*/)
  18. : CDialog(CConfigurePlots::IDD, pParent)
  19. {
  20. //{{AFX_DATA_INIT(CConfigurePlots)
  21. // NOTE: the ClassWizard will add member initialization here
  22. //}}AFX_DATA_INIT
  23. }
  24. void CConfigurePlots::DoDataExchange(CDataExchange* pDX)
  25. {
  26. CDialog::DoDataExchange(pDX);
  27. //{{AFX_DATA_MAP(CConfigurePlots)
  28. // NOTE: the ClassWizard will add DDX and DDV calls here
  29. //}}AFX_DATA_MAP
  30. }
  31. BEGIN_MESSAGE_MAP(CConfigurePlots, CDialog)
  32. //{{AFX_MSG_MAP(CConfigurePlots)
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CConfigurePlots message handlers
  37. BOOL CConfigurePlots::OnInitDialog() 
  38. {
  39. CDialog::OnInitDialog();
  40. // TODO: Add extra initialization here
  41. //CConfigurePlots dlg;
  42. //CWnd* handle;
  43. //Get the Path to the folder from where the beaconclient.exe is being executed
  44. char file[MAX_PATH];
  45. char exeFilePath[MAX_PATH]; //a string for GetModuleFileName() to store exe Path
  46. GetModuleFileName( NULL,&exeFilePath[0],sizeof (exeFilePath));
  47. //Extract path by copying without exe string..
  48. for(int i=0; i < abs(strlen(exeFilePath)-16); i++){
  49. file[i] = exeFilePath[i];
  50. }
  51. file[i] = '';
  52. //strcpy(file,exeFolderPath);
  53. strcat(file,"S.conf");
  54. FILE *fp;
  55. fp=fopen(file,"r");
  56. char temp[MAX_PATH];
  57. CString lp;
  58. fscanf(fp,"%s",lp);
  59. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  60. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  61. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  62. fscanf(fp,"%s",lp);
  63. fscanf(fp,"%s",lp);fgets(temp,MAX_PATH,fp);
  64. fscanf(fp,"%s",lp);
  65. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  66. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  67. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  68. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  69. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  70. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  71. fscanf(fp,"%s",lp);
  72. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  73. fscanf(fp,"%s",lp);
  74. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  75. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  76. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  77. fscanf(fp,"%s",lp);
  78. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  79. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  80. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  81. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  82. fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
  83. fscanf(fp,"%s",lp);//Configure_Plots
  84. fscanf(fp,"%s",lp);
  85. fscanf(fp,"%s",lp);
  86. SetDlgItemText(IDC_LATENCY_GOOD,lp);
  87. fscanf(fp,"%s",lp);
  88. fscanf(fp,"%s",lp);
  89. SetDlgItemText(IDC_LATENCY_ACC,lp);
  90. fscanf(fp,"%s",lp);
  91. fscanf(fp,"%s",lp);
  92. SetDlgItemText(IDC_LATENCY_UNACC,lp);
  93. fscanf(fp,"%s",lp);
  94. fscanf(fp,"%s",lp);
  95. SetDlgItemText(IDC_LOSS_GOOD,lp);
  96. fscanf(fp,"%s",lp);
  97. fscanf(fp,"%s",lp);
  98. SetDlgItemText(IDC_LOSS_ACC,lp);
  99. fscanf(fp,"%s",lp);
  100. fscanf(fp,"%s",lp);
  101. SetDlgItemText(IDC_LOSS_UNACC,lp);
  102. fscanf(fp,"%s",lp);
  103. fscanf(fp,"%s",lp);
  104. SetDlgItemText(IDC_JITTER_GOOD,lp);
  105. fscanf(fp,"%s",lp);
  106. fscanf(fp,"%s",lp);
  107. SetDlgItemText(IDC_JITTER_ACC,lp);
  108. fscanf(fp,"%s",lp);
  109. fscanf(fp,"%s",lp);
  110. SetDlgItemText(IDC_JITTER_UNACC,lp);
  111. fclose(fp);
  112. return TRUE;  // return TRUE unless you set the focus to a control
  113.               // EXCEPTION: OCX Property Pages should return FALSE
  114. }
  115. void CConfigurePlots::OnOK() 
  116. {
  117. // TODO: Add extra validation here
  118. CString folderHolder;
  119. // CString text;
  120. CWnd* handle;
  121. //Configure_plots
  122. handle = (CWnd*)GetDlgItem(IDC_LATENCY_GOOD);
  123. handle->GetWindowText(laG);
  124. handle = (CWnd*)GetDlgItem(IDC_LATENCY_ACC);
  125. handle->GetWindowText(laA);
  126. handle = (CWnd*)GetDlgItem(IDC_LATENCY_UNACC);
  127. handle->GetWindowText(laU);
  128. handle = (CWnd*)GetDlgItem(IDC_LOSS_GOOD);
  129. handle->GetWindowText(loG);
  130. handle = (CWnd*)GetDlgItem(IDC_LOSS_ACC);
  131. handle->GetWindowText(loA);
  132. handle = (CWnd*)GetDlgItem(IDC_LOSS_UNACC);
  133. handle->GetWindowText(loU);
  134. handle = (CWnd*)GetDlgItem(IDC_JITTER_GOOD);
  135. handle->GetWindowText(jiG);
  136. handle = (CWnd*)GetDlgItem(IDC_JITTER_ACC);
  137. handle->GetWindowText(jiA);
  138. handle = (CWnd*)GetDlgItem(IDC_JITTER_UNACC);
  139. handle->GetWindowText(jiU);
  140. CDialog::OnOK();
  141. }