Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

532 lines
15 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: EnableDlg.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of EnableDlg.cpp
  13. //----------------------------------------------------------------------------
  14. // EnableDlg.cpp : implementation file
  15. //
  16. #include "stdafx.h"
  17. #include "chicago.h"
  18. #include "EnableDlg.h"
  19. #include "..\DLIB\SensorSPRU.h"
  20. #include "..\..\LgLib\Version.h"
  21. #ifdef _DEBUG
  22. #define new DEBUG_NEW
  23. #undef THIS_FILE
  24. static char THIS_FILE[] = __FILE__;
  25. #endif
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CEnableDlg dialog
  28. CEnableDlg::CEnableDlg(CWnd* pParent /*=NULL*/)
  29. : CDialog(CEnableDlg::IDD, pParent)
  30. {
  31. //{{AFX_DATA_INIT(CEnableDlg)
  32. // NOTE: the ClassWizard will add member initialization here
  33. //}}AFX_DATA_INIT
  34. m_nMode = COMMON;
  35. m_nZone = -1;
  36. m_nSensor = -1;
  37. m_nBit = -1;
  38. m_pSensorArray = NULL;
  39. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CEnableDlg::CEnableDlg") );
  40. }
  41. void CEnableDlg::DoDataExchange(CDataExchange* pDX)
  42. {
  43. CDialog::DoDataExchange(pDX);
  44. //{{AFX_DATA_MAP(CEnableDlg)
  45. // NOTE: the ClassWizard will add DDX and DDV calls here
  46. //}}AFX_DATA_MAP
  47. }
  48. BEGIN_MESSAGE_MAP(CEnableDlg, CDialog)
  49. //{{AFX_MSG_MAP(CEnableDlg)
  50. ON_CBN_SELCHANGE(IDC_ENABLE_COMBO_ZONE, OnSelchangeEnableComboZone)
  51. ON_CBN_SELCHANGE(IDC_ENABLE_COMBO_SENSOR, OnSelchangeEnableComboSensor)
  52. ON_BN_CLICKED(IDC_ENABLE, OnEnable)
  53. ON_BN_CLICKED(IDC_DISABLE, OnDisable)
  54. ON_CBN_SELCHANGE(IDC_ENABLE_COMBO_DTRBIT, OnSelchangeEnableComboDtrbit)
  55. //}}AFX_MSG_MAP
  56. END_MESSAGE_MAP()
  57. /////////////////////////////////////////////////////////////////////////////
  58. // CEnableDlg message handlers
  59. void CEnableDlg::SetParam( CSensorArray *pSensorArray)
  60. {
  61. m_pSensorArray = pSensorArray;
  62. m_nZone = -1;
  63. m_nSensor = -1;
  64. m_nBit = -1;
  65. m_nMode = COMMON;
  66. }
  67. void CEnableDlg::SetParam( CSensorArray *pSensorArray, CZone *pZone )
  68. {
  69. m_pSensorArray = pSensorArray;
  70. m_nZone = pZone->GetIndex();
  71. m_nSensor = -1;
  72. m_nBit = -1;
  73. m_nMode = ZONE;
  74. }
  75. void CEnableDlg::SetParam( CSensorArray *pSensorArray, CSensor *pSensor )
  76. {
  77. m_pSensorArray = pSensorArray;
  78. m_nZone = pSensor->GetZone()->GetIndex();
  79. m_nSensor = pSensor->GetZone()->GetSensorIndex( pSensor );
  80. m_nBit = -1;
  81. m_nMode = SENSOR;
  82. }
  83. void CEnableDlg::SetParam( CSensorArray *pSensorArray, CSensor *pSensor, int nBit )
  84. {
  85. m_pSensorArray = pSensorArray;
  86. m_nZone = pSensor->GetZone()->GetIndex();
  87. m_nSensor = pSensor->GetZone()->GetSensorIndex( pSensor );
  88. m_nBit = nBit;
  89. m_nMode = DTRBIT;
  90. }
  91. BOOL CEnableDlg::OnInitDialog()
  92. {
  93. CDialog::OnInitDialog();
  94. CComboBox *pCB;
  95. CZone *pZone;
  96. CSensorSPRU *pSensor;
  97. BOOL bAutoSelect = FALSE;
  98. int z, s, b;
  99. switch( m_nMode )
  100. {
  101. case COMMON:
  102. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  103. pCB->ResetContent();
  104. pSensor = NULL;
  105. for( z = 0; z < m_pSensorArray->GetZoneCount(); z++ )
  106. {
  107. pZone = m_pSensorArray->GetZone( z );
  108. if( pZone->GetState() == CVisual::TIMEOUT )
  109. {
  110. m_nZone = z;
  111. bAutoSelect = TRUE;
  112. goto CASE_ZONE;
  113. }
  114. pCB->AddString( pZone->GetName() );
  115. }
  116. pCB->AddString( "- ALL -" );
  117. pCB->SetCurSel( m_nZone = pCB->AddString( "- NONE -" ) );
  118. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  119. pCB->ResetContent();
  120. pCB->AddString( "- ALL -" );
  121. pCB->SetCurSel( m_nSensor = pCB->AddString( "- NONE -" ) );
  122. pCB->EnableWindow( FALSE );
  123. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  124. pCB->ResetContent();
  125. pCB->AddString( "- ALL -" );
  126. pCB->SetCurSel( m_nBit = pCB->AddString( "- NONE -" ) );
  127. pCB->EnableWindow( FALSE );
  128. GetDlgItem( IDC_DISABLE )->EnableWindow(FALSE);
  129. GetDlgItem( IDC_ENABLE )->EnableWindow(FALSE);
  130. break;
  131. CASE_ZONE:
  132. case ZONE:
  133. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  134. pCB->ResetContent();
  135. for( z = 0; z < m_pSensorArray->GetZoneCount(); z++ )
  136. pCB->AddString( m_pSensorArray->GetZone( z )->GetName() );
  137. pCB->AddString( "- ALL -" );
  138. pCB->AddString( "- NONE -" );
  139. pCB->SetCurSel( m_nZone );
  140. pZone = m_pSensorArray->GetZone( m_nZone );
  141. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  142. pCB->ResetContent();
  143. for( s = 0; s < pZone->GetCount(); s++ )
  144. {
  145. pCB->AddString( pZone->GetSensor( s )->GetName() );
  146. if( pZone->GetSensor( s )->GetState() ==CVisual::TIMEOUT )
  147. {
  148. m_nSensor = s;
  149. bAutoSelect = TRUE;
  150. goto CASE_SENSOR;
  151. }
  152. }
  153. pCB->AddString( "- ALL -" );
  154. pCB->SetCurSel( m_nSensor = pCB->AddString( "- NONE -" ) );
  155. pCB->EnableWindow( TRUE );
  156. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  157. pCB->ResetContent();
  158. pCB->AddString( "- ALL -" );
  159. pCB->SetCurSel( m_nBit = pCB->AddString( "- NONE -" ) );
  160. pCB->EnableWindow( FALSE );
  161. GetDlgItem( IDC_DISABLE )->EnableWindow(FALSE);
  162. GetDlgItem( IDC_ENABLE )->EnableWindow(FALSE);
  163. break;
  164. CASE_SENSOR:
  165. case SENSOR:
  166. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  167. pCB->ResetContent();
  168. for( z = 0; z < m_pSensorArray->GetZoneCount(); z++ )
  169. pCB->AddString( m_pSensorArray->GetZone( z )->GetName() );
  170. pCB->AddString( "- ALL -" );
  171. pCB->AddString( "- NONE -" );
  172. pCB->SetCurSel( m_nZone );
  173. pZone = m_pSensorArray->GetZone( m_nZone );
  174. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  175. pCB->ResetContent();
  176. for( s = 0; s < pZone->GetCount(); s++ )
  177. pCB->AddString( pZone->GetSensor( s )->GetName() );
  178. pCB->AddString( "- ALL -" );
  179. pCB->AddString( "- NONE -" );
  180. pCB->SetCurSel( m_nSensor );
  181. pCB->EnableWindow( TRUE );
  182. pSensor = (CSensorSPRU*)pZone->GetSensor( m_nSensor );
  183. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  184. pCB->ResetContent();
  185. for( b = 0; b < pSensor->GetBitCount(); b++ )
  186. {
  187. CString str;
  188. str.Format( "%d", b );
  189. pCB->AddString( str );
  190. }
  191. if( !bAutoSelect )
  192. {
  193. pCB->AddString( "- ALL -" );
  194. pCB->SetCurSel( m_nBit = pCB->AddString( "- NONE -" ) );
  195. GetDlgItem( IDC_DISABLE )->EnableWindow(FALSE);
  196. GetDlgItem( IDC_ENABLE )->EnableWindow(FALSE);
  197. }
  198. else
  199. {
  200. pCB->SetCurSel( m_nBit = pCB->AddString( "- ALL -" ) );
  201. pCB->AddString( "- NONE -" );
  202. GetDlgItem( IDC_DISABLE )->EnableWindow(TRUE);
  203. GetDlgItem( IDC_ENABLE )->EnableWindow(TRUE);
  204. }
  205. pCB->EnableWindow( TRUE );
  206. break;
  207. case DTRBIT:
  208. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  209. pCB->ResetContent();
  210. for( z = 0; z < m_pSensorArray->GetZoneCount(); z++ )
  211. pCB->AddString( m_pSensorArray->GetZone( z )->GetName() );
  212. pCB->AddString( "- ALL -" );
  213. pCB->AddString( "- NONE -" );
  214. pCB->SetCurSel( m_nZone );
  215. pZone = m_pSensorArray->GetZone( m_nZone );
  216. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  217. pCB->ResetContent();
  218. for( s = 0; s < pZone->GetCount(); s++ )
  219. pCB->AddString( pZone->GetSensor( s )->GetName() );
  220. pCB->AddString( "- ALL -" );
  221. pCB->AddString( "- NONE -" );
  222. pCB->SetCurSel( m_nSensor );
  223. pCB->EnableWindow( TRUE );
  224. pSensor = (CSensorSPRU*)pZone->GetSensor( m_nSensor );
  225. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  226. pCB->ResetContent();
  227. for( b = 0; b < pSensor->GetBitCount(); b++ )
  228. {
  229. CString str;
  230. str.Format( "%d", b );
  231. pCB->AddString( str );
  232. }
  233. pCB->AddString( "- ALL -" );
  234. pCB->AddString( "- NONE -" );
  235. pCB->SetCurSel( m_nBit );
  236. pCB->EnableWindow( TRUE );
  237. GetDlgItem( IDC_DISABLE )->EnableWindow(TRUE);
  238. GetDlgItem( IDC_ENABLE )->EnableWindow(TRUE);
  239. break;
  240. }
  241. // SetZone( m_pSensorArray, m_nZone );
  242. return TRUE; // return TRUE unless you set the focus to a control
  243. // EXCEPTION: OCX Property Pages should return FALSE
  244. }
  245. void CEnableDlg::OnSelchangeEnableComboZone()
  246. {
  247. CComboBox *pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  248. m_nZone = pCB->GetCurSel();
  249. if( m_nZone < m_pSensorArray->GetZoneCount() )
  250. {
  251. CZone *pZone = m_pSensorArray->GetZone( m_nZone );
  252. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  253. pCB->ResetContent();
  254. for( int s = 0; s < pZone->GetCount(); s++ )
  255. pCB->AddString( pZone->GetSensor( s )->GetName() );
  256. pCB->AddString( "- ALL -" );
  257. pCB->SetCurSel( m_nSensor = pCB->AddString( "- NONE -" ) );
  258. pCB->EnableWindow( TRUE );
  259. GetDlgItem( IDC_DISABLE )->EnableWindow(FALSE);
  260. GetDlgItem( IDC_ENABLE )->EnableWindow(FALSE);
  261. }
  262. else
  263. if( m_nZone == m_pSensorArray->GetZoneCount() )
  264. {
  265. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  266. pCB->ResetContent();
  267. pCB->SetCurSel( m_nSensor = pCB->AddString( "- ALL -" ) );
  268. pCB->AddString( "- NONE -" );
  269. pCB->EnableWindow( FALSE );
  270. GetDlgItem( IDC_DISABLE )->EnableWindow(TRUE);
  271. GetDlgItem( IDC_ENABLE )->EnableWindow(TRUE);
  272. }
  273. else
  274. {
  275. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  276. pCB->ResetContent();
  277. pCB->AddString( "- ALL -" );
  278. pCB->SetCurSel( m_nSensor = pCB->AddString( "- NONE -" ) );
  279. pCB->EnableWindow( FALSE );
  280. GetDlgItem( IDC_DISABLE )->EnableWindow(FALSE);
  281. GetDlgItem( IDC_ENABLE )->EnableWindow(FALSE);
  282. }
  283. if( m_nZone == m_pSensorArray->GetZoneCount() )
  284. {
  285. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  286. pCB->ResetContent();
  287. pCB->SetCurSel( m_nBit = pCB->AddString( "- ALL -" ) );
  288. pCB->AddString( "- NONE -" );
  289. pCB->EnableWindow( FALSE );
  290. }
  291. else
  292. {
  293. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  294. pCB->ResetContent();
  295. pCB->AddString( "- ALL -" );
  296. pCB->SetCurSel( m_nBit = pCB->AddString( "- NONE -" ) );
  297. pCB->EnableWindow( FALSE );
  298. }
  299. }
  300. void CEnableDlg::OnSelchangeEnableComboSensor()
  301. {
  302. if( m_nZone < m_pSensorArray->GetZoneCount() )
  303. {
  304. CComboBox *pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  305. m_nSensor = pCB->GetCurSel();
  306. CZone *pZone = m_pSensorArray->GetZone( m_nZone );
  307. if( m_nSensor < pZone->GetCount() )
  308. {
  309. CSensorSPRU *pSensor = (CSensorSPRU*)pZone->GetSensor( m_nSensor );
  310. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  311. pCB->ResetContent();
  312. for( int b = 0; b < pSensor->GetBitCount(); b++ )
  313. {
  314. CString str;
  315. str.Format( "%d", b );
  316. pCB->AddString( str );
  317. }
  318. pCB->AddString( "- ALL -" );
  319. pCB->SetCurSel( m_nBit = pCB->AddString( "- NONE -" ) );
  320. pCB->EnableWindow( TRUE );
  321. GetDlgItem( IDC_DISABLE )->EnableWindow(FALSE);
  322. GetDlgItem( IDC_ENABLE )->EnableWindow(FALSE);
  323. }
  324. else
  325. if( m_nSensor == pZone->GetCount() )
  326. {
  327. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  328. pCB->ResetContent();
  329. pCB->SetCurSel( m_nBit = pCB->AddString( "- ALL -" ) );
  330. pCB->AddString( "- NONE -" );
  331. pCB->EnableWindow( FALSE );
  332. GetDlgItem( IDC_DISABLE )->EnableWindow(TRUE);
  333. GetDlgItem( IDC_ENABLE )->EnableWindow(TRUE);
  334. }
  335. else
  336. {
  337. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  338. pCB->ResetContent();
  339. pCB->AddString( "- ALL -" );
  340. pCB->SetCurSel( m_nBit = pCB->AddString( "- NONE -" ) );
  341. pCB->EnableWindow( FALSE );
  342. GetDlgItem( IDC_DISABLE )->EnableWindow(FALSE);
  343. GetDlgItem( IDC_ENABLE )->EnableWindow(FALSE);
  344. }
  345. }
  346. }
  347. void CEnableDlg::OnSelchangeEnableComboDtrbit()
  348. {
  349. CZone *pZone = m_pSensorArray->GetZone( m_nZone );
  350. CSensorSPRU *pSensor = (CSensorSPRU*)pZone->GetSensor( m_nSensor );
  351. CComboBox *pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  352. m_nBit = pCB->GetCurSel();
  353. if( m_nBit <= pSensor->GetBitCount() )
  354. {
  355. GetDlgItem( IDC_DISABLE )->EnableWindow(TRUE);
  356. GetDlgItem( IDC_ENABLE )->EnableWindow(TRUE);
  357. }
  358. else
  359. {
  360. GetDlgItem( IDC_DISABLE )->EnableWindow(FALSE);
  361. GetDlgItem( IDC_ENABLE )->EnableWindow(FALSE);
  362. }
  363. }
  364. void CEnableDlg::OnEnable()
  365. {
  366. CComboBox *pCB;
  367. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  368. m_nZone = pCB->GetCurSel();
  369. if( m_nZone < m_pSensorArray->GetZoneCount() )
  370. {
  371. CZone *pZone = m_pSensorArray->GetZone( m_nZone );
  372. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  373. m_nSensor = pCB->GetCurSel();
  374. if( m_nSensor < pZone->GetCount() )
  375. {
  376. CSensorSPRU *pSensor = (CSensorSPRU*)pZone->GetSensor( m_nSensor );
  377. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  378. m_nBit = pCB->GetCurSel();
  379. if( m_nBit < pSensor->GetBitCount() )
  380. {
  381. pSensor->Enable( TRUE, m_nBit );
  382. }
  383. else
  384. {
  385. pSensor->Enable( TRUE );
  386. }
  387. }
  388. else
  389. {
  390. for( int s = 0; s < pZone->GetCount(); s++ )
  391. pZone->GetSensor( s )->Enable( TRUE );
  392. }
  393. pZone->UpdateState();
  394. }
  395. else
  396. {
  397. for( int z = 0; z < m_pSensorArray->GetZoneCount(); z++ )
  398. m_pSensorArray->GetZone( z )->Enable( TRUE );
  399. }
  400. EndDialog( IDOK );
  401. }
  402. void CEnableDlg::OnDisable()
  403. {
  404. MoveWindow( CRect( -1, -1, -1, -1 ) );
  405. if( !GetParent()->SendMessage( WM_AUTORIZATION, 0, 0 ) )
  406. {
  407. EndDialog( IDOK );
  408. return;
  409. }
  410. CComboBox *pCB;
  411. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  412. m_nZone = pCB->GetCurSel();
  413. if( m_nZone < m_pSensorArray->GetZoneCount() )
  414. {
  415. CZone *pZone = m_pSensorArray->GetZone( m_nZone );
  416. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_SENSOR );
  417. m_nSensor = pCB->GetCurSel();
  418. if( m_nSensor < pZone->GetCount() )
  419. {
  420. CSensorSPRU *pSensor = (CSensorSPRU*)pZone->GetSensor( m_nSensor );
  421. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_DTRBIT );
  422. m_nBit = pCB->GetCurSel();
  423. if( m_nBit < pSensor->GetBitCount() )
  424. {
  425. pSensor->Enable( FALSE, m_nBit );
  426. }
  427. else
  428. {
  429. pSensor->Enable( FALSE );
  430. }
  431. }
  432. else
  433. {
  434. for( int s = 0; s < pZone->GetCount(); s++ )
  435. pZone->GetSensor( s )->Enable( FALSE );
  436. }
  437. pZone->UpdateState();
  438. }
  439. else
  440. {
  441. for( int z = 0; z < m_pSensorArray->GetZoneCount(); z++ )
  442. m_pSensorArray->GetZone( z )->Enable( FALSE );
  443. }
  444. EndDialog( IDOK );
  445. }
  446. /*
  447. void CEnableDlg::OnButtonSoundDisable()
  448. {
  449. CComboBox *pCB;
  450. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  451. m_nZone = pCB->GetCurSel();
  452. if( m_nZone < m_pSensorArray->GetZoneCount() )
  453. {
  454. CZone *pZone = m_pSensorArray->GetZone( m_nZone );
  455. pZone->EnableSoundAlarm( FALSE );
  456. }
  457. else
  458. {
  459. for( int z = 0; z < m_pSensorArray->GetZoneCount(); z++ )
  460. m_pSensorArray->GetZone( z )->EnableSoundAlarm( FALSE );
  461. }
  462. EndDialog( IDOK );
  463. }
  464. void CEnableDlg::OnButtonSoundEnable()
  465. {
  466. CComboBox *pCB;
  467. pCB = (CComboBox*) GetDlgItem( IDC_ENABLE_COMBO_ZONE );
  468. m_nZone = pCB->GetCurSel();
  469. if( m_nZone < m_pSensorArray->GetZoneCount() )
  470. {
  471. CZone *pZone = m_pSensorArray->GetZone( m_nZone );
  472. pZone->EnableSoundAlarm( TRUE );
  473. }
  474. else
  475. {
  476. for( int z = 0; z < m_pSensorArray->GetZoneCount(); z++ )
  477. m_pSensorArray->GetZone( z )->EnableSoundAlarm( TRUE );
  478. }
  479. EndDialog( IDOK );
  480. }
  481. */