SelectDSP.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // SelectDSP.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "HKVision.h"
  5. #include "SelectDSP.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CSelectDSP dialog
  13. CSelectDSP::CSelectDSP(CWnd* pParent /*=NULL*/)
  14. : CDialog(CSelectDSP::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CSelectDSP)
  17. m_ImageFile = _T("");
  18. m_LogFile = _T("");
  19. //}}AFX_DATA_INIT
  20. }
  21. void CSelectDSP::DoDataExchange(CDataExchange* pDX)
  22. {
  23. CDialog::DoDataExchange(pDX);
  24. //{{AFX_DATA_MAP(CSelectDSP)
  25. //}}AFX_DATA_MAP
  26. }
  27. BEGIN_MESSAGE_MAP(CSelectDSP, CDialog)
  28. //{{AFX_MSG_MAP(CSelectDSP)
  29. //}}AFX_MSG_MAP
  30. END_MESSAGE_MAP()
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CSelectDSP message handlers
  33. void CSelectDSP::DSPPreset(BOOLEAN *bPreset, int iNumberOfDSPs)
  34. {
  35. ZeroMemory(m_bDSPPreset, sizeof(m_bDSPPreset));
  36. for( int i = 0; i < iNumberOfDSPs; i++){
  37. m_bDSPPreset[i] = bPreset[i];
  38. }
  39. m_iTotalDSPs = iNumberOfDSPs;
  40. }
  41. BOOL CSelectDSP::OnInitDialog()
  42. {
  43. CDialog::OnInitDialog();
  44. for(int i =0; i < MAX_DSPS_SUPPORT; i++)
  45. GetDlgItem(IDC_CHECK1 + i)->EnableWindow(FALSE);
  46. // TODO: Add extra initialization here
  47. for( i =0; i < m_iTotalDSPs; i++){
  48. GetDlgItem(IDC_CHECK1 + i)->EnableWindow(TRUE);
  49. if(m_bDSPPreset[i])
  50. CheckDlgButton(IDC_CHECK1 + i, BST_CHECKED);
  51. }
  52. return TRUE; // return TRUE unless you set the focus to a control
  53. // EXCEPTION: OCX Property Pages should return FALSE
  54. }
  55. void CSelectDSP::GetDSPsChoiced(BOOLEAN *bList)
  56. {
  57. for(int i = 0; i < m_iTotalDSPs; i++){
  58. bList[i] = m_bDSPPreset[i];
  59. }
  60. }
  61. void CSelectDSP::OnOK()
  62. {
  63. // TODO: Add extra validation here
  64. for(int i =0; i < m_iTotalDSPs; i++){
  65. m_bDSPPreset[i] = IsDlgButtonChecked(IDC_CHECK1 + i);
  66. }
  67. CDialog::OnOK();
  68. }