ConfigurePlots.cpp
上传用户:gnaf34
上传日期:2022-04-22
资源大小:1657k
文件大小:5k
- // ConfigurePlots.cpp : implementation file
- //
- #include "stdafx.h"
- #include "BeaconClient.h"
- #include "ConfigurePlots.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern CString consoleStr;
- extern CString laG,laA,laU,loG,loA,loU,jiG,jiA,jiU;
- //extern char *laG,*laA,*laU,*loG,*loA,*loU,*jiG,*jiA,*jiU;
- extern char exeFolderPath[MAX_PATH];
- /////////////////////////////////////////////////////////////////////////////
- // CConfigurePlots dialog
- CConfigurePlots::CConfigurePlots(CWnd* pParent /*=NULL*/)
- : CDialog(CConfigurePlots::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CConfigurePlots)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void CConfigurePlots::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CConfigurePlots)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CConfigurePlots, CDialog)
- //{{AFX_MSG_MAP(CConfigurePlots)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CConfigurePlots message handlers
- BOOL CConfigurePlots::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
-
- //CConfigurePlots dlg;
- //CWnd* handle;
- //Get the Path to the folder from where the beaconclient.exe is being executed
- char file[MAX_PATH];
- char exeFilePath[MAX_PATH]; //a string for GetModuleFileName() to store exe Path
- GetModuleFileName( NULL,&exeFilePath[0],sizeof (exeFilePath));
- //Extract path by copying without exe string..
- for(int i=0; i < abs(strlen(exeFilePath)-16); i++){
- file[i] = exeFilePath[i];
- }
- file[i] = ' ';
-
- //strcpy(file,exeFolderPath);
- strcat(file,"S.conf");
-
- FILE *fp;
- fp=fopen(file,"r");
- char temp[MAX_PATH];
- CString lp;
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fgets(temp,MAX_PATH,fp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
-
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
-
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);//Configure_Plots
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_LATENCY_GOOD,lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_LATENCY_ACC,lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_LATENCY_UNACC,lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_LOSS_GOOD,lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_LOSS_ACC,lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_LOSS_UNACC,lp);
-
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_JITTER_GOOD,lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_JITTER_ACC,lp);
- fscanf(fp,"%s",lp);
- fscanf(fp,"%s",lp);
- SetDlgItemText(IDC_JITTER_UNACC,lp);
- fclose(fp);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CConfigurePlots::OnOK()
- {
- // TODO: Add extra validation here
-
- CString folderHolder;
- // CString text;
- CWnd* handle;
- //Configure_plots
-
- handle = (CWnd*)GetDlgItem(IDC_LATENCY_GOOD);
- handle->GetWindowText(laG);
- handle = (CWnd*)GetDlgItem(IDC_LATENCY_ACC);
- handle->GetWindowText(laA);
- handle = (CWnd*)GetDlgItem(IDC_LATENCY_UNACC);
- handle->GetWindowText(laU);
-
-
- handle = (CWnd*)GetDlgItem(IDC_LOSS_GOOD);
- handle->GetWindowText(loG);
- handle = (CWnd*)GetDlgItem(IDC_LOSS_ACC);
- handle->GetWindowText(loA);
- handle = (CWnd*)GetDlgItem(IDC_LOSS_UNACC);
- handle->GetWindowText(loU);
-
-
- handle = (CWnd*)GetDlgItem(IDC_JITTER_GOOD);
- handle->GetWindowText(jiG);
- handle = (CWnd*)GetDlgItem(IDC_JITTER_ACC);
- handle->GetWindowText(jiA);
- handle = (CWnd*)GetDlgItem(IDC_JITTER_UNACC);
- handle->GetWindowText(jiU);
-
-
- CDialog::OnOK();
- }