ParamSetting.cpp
资源名称:VIS.zip [点击查看]
上传用户:sdgangtie
上传日期:2020-03-07
资源大小:7324k
文件大小:3k
源码类别:
数值算法/人工智能
开发平台:
Visual C++
- // ParamSetting.cpp : implementation file
- //
- #include "stdafx.h"
- #include "VIS.h"
- #include "RunTrack.h"
- #include "ParamSetting.h"
- // CParamSetting dialog
- IMPLEMENT_DYNAMIC(CParamSetting, CDialog)
- CParamSetting::CParamSetting(CWnd* pParent /*=NULL*/)
- : CDialog(CParamSetting::IDD, pParent)
- , m_WMin(0.01)
- , m_HMin(0.01)
- , m_WMax(0.99)
- , m_HMax(0.99)
- , m_Threshold(15)
- , m_Check(TRUE)
- {
- m_FG = 2;
- m_BT = 2;
- m_BPP = 1;
- m_BTA = 0;
- }
- CParamSetting::~CParamSetting()
- {
- }
- void CParamSetting::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_COMBO_FG, m_ComboBoxFG);
- DDX_Control(pDX, IDC_COMBO_BT, m_ComboBoxBT);
- DDX_Control(pDX, IDC_COMBO_BPP, m_ComboBoxBPP);
- DDX_Control(pDX, IDC_COMBO_BTA, m_ComboBoxBTA);
- DDX_Text(pDX, IDC_EDIT_THRESHOLD, m_Threshold);
- DDX_Text(pDX, IDC_EDIT_WMIN, m_WMin);
- DDX_Text(pDX, IDC_EDIT_HMIN, m_HMin);
- DDX_Text(pDX, IDC_EDIT_WMAX, m_WMax);
- DDX_Text(pDX, IDC_EDIT_HMAX, m_HMax);
- DDX_Check(pDX, IDC_CHECK, m_Check);
- DDX_Control(pDX, IDC_EDIT_THRESHOLD, m_EditCtrl);
- }
- BEGIN_MESSAGE_MAP(CParamSetting, CDialog)
- ON_BN_CLICKED(IDOK, &CParamSetting::OnBnClickedOk)
- ON_CBN_SELCHANGE(IDC_COMBO_FG, &CParamSetting::OnCbnSelchangeComboFg)
- END_MESSAGE_MAP()
- // CParamSetting message handlers
- BOOL CParamSetting::OnInitDialog()
- {
- CDialog::OnInitDialog();
- m_ComboBoxFG.InsertString(0,TEXT("NULL"));
- m_ComboBoxFG.InsertString(1,TEXT("Frame Substraction"));
- m_ComboBoxFG.InsertString(2,TEXT("Model of Adaption"));
- m_ComboBoxFG.InsertString(3,TEXT("Model of Gaussion"));
- m_ComboBoxFG.SetCurSel(m_FG);
- m_ComboBoxBT.InsertString(0,TEXT("NULL"));
- m_ComboBoxBT.InsertString(1,TEXT("Connected Components"));
- m_ComboBoxBT.InsertString(2,TEXT("Mean Shift"));
- m_ComboBoxBT.InsertString(3,TEXT("Particle Filter"));
- m_ComboBoxBT.SetCurSel(m_BT);
- m_ComboBoxBPP.InsertString(0,TEXT("NULL"));
- m_ComboBoxBPP.InsertString(1,TEXT("Kalman Filter"));
- m_ComboBoxBPP.InsertString(2,TEXT("Time Average"));
- m_ComboBoxBPP.InsertString(3,TEXT("Time Weight Average"));
- m_ComboBoxBPP.SetCurSel(m_BPP);
- m_ComboBoxBTA.InsertString(0,TEXT("NULL"));
- m_ComboBoxBTA.InsertString(1,TEXT("Track Distance"));
- m_ComboBoxBTA.InsertString(2,TEXT("Track P(Postioin)"));
- m_ComboBoxBTA.InsertString(3,TEXT("Track PV(Velocity)"));
- m_ComboBoxBTA.InsertString(4,TEXT("Track PVS"));
- m_ComboBoxBTA.SetCurSel(m_BTA);
- if (m_ComboBoxFG.GetCurSel() == 1)
- m_EditCtrl.EnableWindow(TRUE);
- else
- m_EditCtrl.EnableWindow(FALSE);
- UpdateData(FALSE);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CParamSetting::OnBnClickedOk()
- {
- UpdateData(TRUE);
- m_FG = m_ComboBoxFG.GetCurSel();
- m_BT = m_ComboBoxBT.GetCurSel();
- m_BPP = m_ComboBoxBPP.GetCurSel();
- m_BTA = m_ComboBoxBTA.GetCurSel();
- UpdateData(FALSE);
- OnOK();
- }
- void CParamSetting::OnCbnSelchangeComboFg()
- {
- if (m_ComboBoxFG.GetCurSel() == 1)
- m_EditCtrl.EnableWindow(TRUE);
- else
- m_EditCtrl.EnableWindow(FALSE);
- }