ParamSetting.cpp
上传用户:sdgangtie
上传日期:2020-03-07
资源大小:7324k
文件大小:3k
开发平台:

Visual C++

  1. // ParamSetting.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "VIS.h"
  5. #include "RunTrack.h"
  6. #include "ParamSetting.h"
  7. // CParamSetting dialog
  8. IMPLEMENT_DYNAMIC(CParamSetting, CDialog)
  9. CParamSetting::CParamSetting(CWnd* pParent /*=NULL*/)
  10. : CDialog(CParamSetting::IDD, pParent)
  11. , m_WMin(0.01)
  12. , m_HMin(0.01)
  13. , m_WMax(0.99)
  14. , m_HMax(0.99)
  15. , m_Threshold(15)
  16. , m_Check(TRUE)
  17. {
  18. m_FG = 2;
  19. m_BT = 2;
  20. m_BPP = 1;
  21. m_BTA = 0;
  22. }
  23. CParamSetting::~CParamSetting()
  24. {
  25. }
  26. void CParamSetting::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CDialog::DoDataExchange(pDX);
  29. DDX_Control(pDX, IDC_COMBO_FG, m_ComboBoxFG);
  30. DDX_Control(pDX, IDC_COMBO_BT, m_ComboBoxBT);
  31. DDX_Control(pDX, IDC_COMBO_BPP, m_ComboBoxBPP);
  32. DDX_Control(pDX, IDC_COMBO_BTA, m_ComboBoxBTA);
  33. DDX_Text(pDX, IDC_EDIT_THRESHOLD, m_Threshold);
  34. DDX_Text(pDX, IDC_EDIT_WMIN, m_WMin);
  35. DDX_Text(pDX, IDC_EDIT_HMIN, m_HMin);
  36. DDX_Text(pDX, IDC_EDIT_WMAX, m_WMax);
  37. DDX_Text(pDX, IDC_EDIT_HMAX, m_HMax);
  38. DDX_Check(pDX, IDC_CHECK, m_Check);
  39. DDX_Control(pDX, IDC_EDIT_THRESHOLD, m_EditCtrl);
  40. }
  41. BEGIN_MESSAGE_MAP(CParamSetting, CDialog)
  42. ON_BN_CLICKED(IDOK, &CParamSetting::OnBnClickedOk)
  43. ON_CBN_SELCHANGE(IDC_COMBO_FG, &CParamSetting::OnCbnSelchangeComboFg)
  44. END_MESSAGE_MAP()
  45. // CParamSetting message handlers
  46. BOOL CParamSetting::OnInitDialog()
  47. {
  48. CDialog::OnInitDialog();
  49. m_ComboBoxFG.InsertString(0,TEXT("NULL"));
  50. m_ComboBoxFG.InsertString(1,TEXT("Frame Substraction"));
  51. m_ComboBoxFG.InsertString(2,TEXT("Model of Adaption"));
  52. m_ComboBoxFG.InsertString(3,TEXT("Model of Gaussion"));
  53. m_ComboBoxFG.SetCurSel(m_FG);
  54. m_ComboBoxBT.InsertString(0,TEXT("NULL"));
  55. m_ComboBoxBT.InsertString(1,TEXT("Connected Components"));
  56. m_ComboBoxBT.InsertString(2,TEXT("Mean Shift"));
  57. m_ComboBoxBT.InsertString(3,TEXT("Particle Filter"));
  58. m_ComboBoxBT.SetCurSel(m_BT);
  59. m_ComboBoxBPP.InsertString(0,TEXT("NULL"));
  60. m_ComboBoxBPP.InsertString(1,TEXT("Kalman Filter"));
  61. m_ComboBoxBPP.InsertString(2,TEXT("Time Average"));
  62. m_ComboBoxBPP.InsertString(3,TEXT("Time Weight Average"));
  63. m_ComboBoxBPP.SetCurSel(m_BPP);
  64. m_ComboBoxBTA.InsertString(0,TEXT("NULL"));
  65. m_ComboBoxBTA.InsertString(1,TEXT("Track Distance"));
  66. m_ComboBoxBTA.InsertString(2,TEXT("Track P(Postioin)"));
  67. m_ComboBoxBTA.InsertString(3,TEXT("Track PV(Velocity)"));
  68. m_ComboBoxBTA.InsertString(4,TEXT("Track PVS"));
  69. m_ComboBoxBTA.SetCurSel(m_BTA);
  70. if (m_ComboBoxFG.GetCurSel() == 1)
  71. m_EditCtrl.EnableWindow(TRUE);
  72. else
  73. m_EditCtrl.EnableWindow(FALSE);
  74. UpdateData(FALSE);
  75. return TRUE;  // return TRUE unless you set the focus to a control
  76. // EXCEPTION: OCX Property Pages should return FALSE
  77. }
  78. void CParamSetting::OnBnClickedOk()
  79. {
  80. UpdateData(TRUE);
  81. m_FG = m_ComboBoxFG.GetCurSel();
  82. m_BT = m_ComboBoxBT.GetCurSel();
  83. m_BPP = m_ComboBoxBPP.GetCurSel();
  84. m_BTA = m_ComboBoxBTA.GetCurSel();
  85. UpdateData(FALSE);
  86. OnOK();
  87. }
  88. void CParamSetting::OnCbnSelchangeComboFg()
  89. {
  90. if (m_ComboBoxFG.GetCurSel() == 1)
  91. m_EditCtrl.EnableWindow(TRUE);
  92. else
  93. m_EditCtrl.EnableWindow(FALSE);
  94. }