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.

776 lines
28 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: TabControlDlg.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of TabControlDlg.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "MultiIPIClient.h"
  16. #include "TabControlDlg.h"
  17. #include "MainDlg.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CTabControlDlg dialog
  25. CTabControlDlg::CTabControlDlg(CWnd* pParent /*=NULL*/)
  26. : CDialog(CTabControlDlg::IDD, pParent)
  27. {
  28. //{{AFX_DATA_INIT(CTabControlDlg)
  29. m_RadioSensitivity = -1;
  30. //}}AFX_DATA_INIT
  31. }
  32. void CTabControlDlg::DoDataExchange(CDataExchange* pDX)
  33. {
  34. CDialog::DoDataExchange(pDX);
  35. //{{AFX_DATA_MAP(CTabControlDlg)
  36. DDX_Control(pDX, IDC_BUTTON_REPORT, m_ButtonReport);
  37. DDX_Control(pDX, IDC_BUTTON_PHOTO, m_ButtonPhoto);
  38. DDX_Control(pDX, IDC_CHECK_IRIS_NIGHT, m_CheckIrisNight);
  39. DDX_Control(pDX, IDC_CHECK_IRIS_DAY, m_CheckIrisDay);
  40. DDX_Control(pDX, IDC_CHECK_MUTE, m_CheckMute);
  41. DDX_Control(pDX, IDC_CHECK_HIDDEN_4, m_CheckHidden4);
  42. DDX_Control(pDX, IDC_CHECK_HIDDEN_3, m_CheckHidden3);
  43. DDX_Control(pDX, IDC_CHECK_HIDDEN_2, m_CheckHidden2);
  44. DDX_Control(pDX, IDC_CHECK_HIDDEN_1, m_CheckHidden1);
  45. DDX_Control(pDX, IDC_BUTTON_CLEAR, m_ButtonClear);
  46. DDX_Control(pDX, IDC_BUTTON_RESET, m_ButtonReset);
  47. DDX_Control(pDX, IDC_SLIDER, m_Slider);
  48. DDX_Control(pDX, IDC_STATIC_VIDEO, m_StaticVideo);
  49. DDX_Control(pDX, IDC_STATIC_LOCATOR, m_StaticLocator);
  50. DDX_Control(pDX, IDC_BUTTON_DOWN, m_ButtonDown);
  51. DDX_Control(pDX, IDC_BUTTON_UP, m_ButtonUp);
  52. DDX_Control(pDX, IDC_BUTTON_LEFT, m_ButtonLeft);
  53. DDX_Control(pDX, IDC_BUTTON_RIGHT, m_ButtonRight);
  54. DDX_Control(pDX, IDC_BUTTON_WIDE, m_ButtonWide);
  55. DDX_Control(pDX, IDC_BUTTON_TELE, m_ButtonTele);
  56. DDX_Radio(pDX, IDC_RADIO_SENSITIVITY, m_RadioSensitivity);
  57. //}}AFX_DATA_MAP
  58. }
  59. BEGIN_MESSAGE_MAP(CTabControlDlg, CDialog)
  60. //{{AFX_MSG_MAP(CTabControlDlg)
  61. ON_WM_PAINT()
  62. ON_BN_CLICKED(IDC_BUTTON_CLEAR, OnButtonClear)
  63. ON_BN_CLICKED(IDC_BUTTON_RESET, OnButtonReset)
  64. ON_WM_SHOWWINDOW()
  65. ON_BN_CLICKED(IDC_RADIO_SENSITIVITY, OnRadioSensitivity)
  66. ON_BN_CLICKED(IDC_CHECK_HIDDEN_1, OnCheckHidden)
  67. ON_BN_CLICKED(IDC_CHECK_MUTE, OnCheckMute)
  68. ON_BN_CLICKED(IDC_CHECK_IRIS_DAY, OnCheckIrisDay)
  69. ON_BN_CLICKED(IDC_CHECK_IRIS_NIGHT, OnCheckIrisNight)
  70. ON_WM_SIZE()
  71. ON_BN_CLICKED(IDC_BUTTON_PHOTO, OnButtonPhoto)
  72. ON_BN_CLICKED(IDC_RADIO_SENSITIVITY_MEDIUM, OnRadioSensitivity)
  73. ON_BN_CLICKED(IDC_RADIO_SENSITIVITY_HIGH, OnRadioSensitivity)
  74. ON_BN_CLICKED(IDC_CHECK_HIDDEN_2, OnCheckHidden)
  75. ON_BN_CLICKED(IDC_CHECK_HIDDEN_3, OnCheckHidden)
  76. ON_BN_CLICKED(IDC_CHECK_HIDDEN_4, OnCheckHidden)
  77. ON_BN_CLICKED(IDC_BUTTON_REPORT, OnButtonReport)
  78. //}}AFX_MSG_MAP
  79. ON_MESSAGE( LG_BUTTON_BM_SET_STATE, OnLgButtonSetState )
  80. ON_MESSAGE( LG_CAMERA_POSITION_CHANGED, OnLgCameraPositionChanged )
  81. ON_MESSAGE( WM_VIDEO_READY, OnVideoReady )
  82. END_MESSAGE_MAP()
  83. BOOL CTabControlDlg::OnInitDialog()
  84. {
  85. CDialog::OnInitDialog();
  86. m_Slider.SetRange( 0, 100 );
  87. m_Slider.SetPos( 20 );
  88. CRect rect;
  89. m_StaticLocator.GetClientRect( &rect );
  90. m_StaticLocator.MapWindowPoints( this, &rect );
  91. m_CameraPositionWnd.Create( this, m_CameraPositionWndRect );
  92. m_Locator.SetCameraPositionWnd( &m_CameraPositionWnd );
  93. m_Locator.Create( this, rect );
  94. m_StaticVideo.GetClientRect( &rect );
  95. // m_VideoDC.Create( rect.Width(), rect.Height(), RGB(0,0,0) );
  96. m_VideoWnd.Create( this, rect );
  97. m_CheckHidden1.SetBitmaps( IDB_BITMAP_USEVIEWZONE1, IDB_BITMAP_NOUSEVIEWZONE1 );
  98. m_CheckHidden2.SetBitmaps( IDB_BITMAP_USEVIEWZONE2, IDB_BITMAP_NOUSEVIEWZONE2 );
  99. m_CheckHidden3.SetBitmaps( IDB_BITMAP_USEVIEWZONE3, IDB_BITMAP_NOUSEVIEWZONE3 );
  100. m_CheckHidden4.SetBitmaps( IDB_BITMAP_USEVIEWZONE4, IDB_BITMAP_NOUSEVIEWZONE4 );
  101. m_ButtonUp.SetBitmaps( IDB_BITMAP_UP, IDB_BITMAP_UP );
  102. m_ButtonDown.SetBitmaps( IDB_BITMAP_DOWN, IDB_BITMAP_DOWN );
  103. m_ButtonLeft.SetBitmaps( IDB_BITMAP_LEFT, IDB_BITMAP_LEFT );
  104. m_ButtonRight.SetBitmaps( IDB_BITMAP_RIGHT, IDB_BITMAP_RIGHT );
  105. m_ButtonTele.SetBitmaps( IDB_BITMAP_TELE, IDB_BITMAP_TELE );
  106. m_ButtonWide.SetBitmaps( IDB_BITMAP_WIDE, IDB_BITMAP_WIDE );
  107. m_ButtonPhoto.SetBitmaps( IDB_BITMAP_CAPTURE, IDB_BITMAP_CAPTURE );
  108. m_CheckIrisDay.SetBitmaps( IDB_BITMAP_DAY, IDB_BITMAP_DAY );
  109. m_CheckIrisNight.SetBitmaps( IDB_BITMAP_NIGHT, IDB_BITMAP_NIGHT );
  110. // m_pMainDlg->GetDeviceClient()->DoRemoteLgsSensitivity( LG_TCP_PACKET_LGS::LGS_SENSITIVITY_LOW );
  111. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsHiddenOn( FALSE, 0 ) )
  112. {
  113. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnInitDialog"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsHiddenOn failed") );
  114. }
  115. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsConnect() )
  116. {
  117. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnInitDialog"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsConnect failed") );
  118. }
  119. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsVoltage() )
  120. {
  121. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnInitDialog"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsVoltage failed") );
  122. }
  123. if( !m_pMainDlg->GetDeviceClient()->DoRemotePtzIris( FALSE, 0 ) )
  124. {
  125. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnInitDialog"), _T("m_pMainDlg->GetDeviceClient()->DoRemotePtzIris failed") );
  126. }
  127. UpdateControlPosition();
  128. return TRUE;
  129. }
  130. void CTabControlDlg::OnPaint()
  131. {
  132. CPaintDC dc(this); // device context for painting
  133. OnDraw( &dc );
  134. RECT rect;
  135. GetClientRect( &rect );
  136. // get skin info
  137. CProgramSkin::SKIN skin;
  138. if( !m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL, skin ) )
  139. return;
  140. DIBSECTION DibSection;
  141. if( !::GetObject( skin.hBitmap, sizeof(DibSection), &DibSection ) )
  142. return;
  143. HDC hMemDC = ::CreateCompatibleDC( dc.GetSafeHdc() );
  144. if( !hMemDC )
  145. return;
  146. HBITMAP hBitmap = (HBITMAP)::SelectObject( hMemDC, skin.hBitmap );
  147. ::BitBlt( dc.GetSafeHdc(), rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, hMemDC, 0, 0, SRCCOPY );
  148. ::SelectObject( hMemDC, hBitmap );
  149. ::DeleteDC( hMemDC );
  150. }
  151. void CTabControlDlg::OnDraw( CDC *pDC )
  152. {
  153. // CRect rect;
  154. // m_StaticVideo.GetClientRect( &rect );
  155. // m_StaticVideo.MapWindowPoints( this, &rect );
  156. // m_VideoDIB.Draw( pDC->GetSafeHdc(), &rect, TRUE );
  157. }
  158. LRESULT CTabControlDlg::OnLgCameraPositionChanged( WPARAM wParam, LPARAM lParam )
  159. {
  160. return GetParent()->SendMessage( LG_CAMERA_POSITION_CHANGED, wParam, lParam );
  161. }
  162. void CTabControlDlg::OnVideo( CLgImageDIB *pDIB, BYTE bSequence )
  163. {
  164. // update image
  165. if( IsWindowVisible() )
  166. {
  167. m_VideoWnd.UpdateVideoDIB( pDIB, bSequence );
  168. }
  169. }
  170. LRESULT CTabControlDlg::OnVideoReady( WPARAM wParam, LPARAM lParam )
  171. {
  172. if( !m_pMainDlg->GetDeviceClient()->DoRemoteVideo( m_Slider.GetPos(), wParam ) )
  173. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnVideoReady"), _T("DoRemoteVideo failed") );
  174. return TRUE;
  175. }
  176. LRESULT CTabControlDlg::OnLgButtonSetState( WPARAM wParam, LPARAM lParam )
  177. {
  178. CLgButton *pButton = (CLgButton*)GetDlgItem( lParam );
  179. switch( pButton->GetDlgCtrlID() )
  180. {
  181. case IDC_BUTTON_LEFT: m_Locator.MovePTZ( wParam ? CLocatorWnd::PAN_LEFT : CLocatorWnd::PAN_STOP ); break;
  182. case IDC_BUTTON_RIGHT: m_Locator.MovePTZ( wParam ? CLocatorWnd::PAN_RIGTH : CLocatorWnd::PAN_STOP ); break;
  183. case IDC_BUTTON_WIDE: m_Locator.MovePTZ( wParam ? CLocatorWnd::ZOOM_WIDE : CLocatorWnd::ZOOM_STOP ); break;
  184. case IDC_BUTTON_TELE: m_Locator.MovePTZ( wParam ? CLocatorWnd::ZOOM_TELE : CLocatorWnd::ZOOM_STOP ); break;
  185. case IDC_BUTTON_UP: m_Locator.MovePTZ( wParam ? CLocatorWnd::TILT_UP : CLocatorWnd::TILT_STOP ); break;
  186. case IDC_BUTTON_DOWN: m_Locator.MovePTZ( wParam ? CLocatorWnd::TILT_DOWN : CLocatorWnd::TILT_STOP ); break;
  187. }
  188. return 0;
  189. }
  190. BOOL CTabControlDlg::PreTranslateMessage( MSG* pMsg )
  191. {
  192. switch( pMsg->message )
  193. {
  194. case WM_KEYDOWN:
  195. switch( pMsg->wParam )
  196. {
  197. case VK_UP: SendDlgItemMessage( IDC_BUTTON_UP, BM_SETSTATE, TRUE ); return TRUE;
  198. case VK_DOWN: SendDlgItemMessage( IDC_BUTTON_DOWN, BM_SETSTATE, TRUE ); return TRUE;
  199. case VK_LEFT: SendDlgItemMessage( IDC_BUTTON_LEFT, BM_SETSTATE, TRUE ); return TRUE;
  200. case VK_RIGHT: SendDlgItemMessage( IDC_BUTTON_RIGHT, BM_SETSTATE, TRUE ); return TRUE;
  201. case VK_HOME:
  202. case VK_ADD: SendDlgItemMessage( IDC_BUTTON_TELE, BM_SETSTATE, TRUE ); return TRUE;
  203. case VK_END:
  204. case VK_SUBTRACT: SendDlgItemMessage( IDC_BUTTON_WIDE, BM_SETSTATE, TRUE ); return TRUE;
  205. case VK_SPACE:
  206. m_pMainDlg->AlarmStop();
  207. return TRUE;
  208. }
  209. break;
  210. case WM_KEYUP:
  211. switch( pMsg->wParam )
  212. {
  213. case VK_UP: SendDlgItemMessage( IDC_BUTTON_UP, BM_SETSTATE, FALSE ); return TRUE;
  214. case VK_DOWN: SendDlgItemMessage( IDC_BUTTON_DOWN, BM_SETSTATE, FALSE ); return TRUE;
  215. case VK_LEFT: SendDlgItemMessage( IDC_BUTTON_LEFT, BM_SETSTATE, FALSE ); return TRUE;
  216. case VK_RIGHT: SendDlgItemMessage( IDC_BUTTON_RIGHT, BM_SETSTATE, FALSE ); return TRUE;
  217. case VK_HOME:
  218. case VK_ADD: SendDlgItemMessage( IDC_BUTTON_TELE, BM_SETSTATE, FALSE ); return TRUE;
  219. case VK_END:
  220. case VK_SUBTRACT: SendDlgItemMessage( IDC_BUTTON_WIDE, BM_SETSTATE, FALSE ); return TRUE;
  221. }
  222. break;
  223. }
  224. return CDialog::PreTranslateMessage(pMsg);
  225. }
  226. void CTabControlDlg::OnButtonClear()
  227. {
  228. m_Locator.Clear();
  229. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsClear() )
  230. {
  231. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnButtonClear"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsClear failed") );
  232. }
  233. m_pMainDlg->AlarmReset();
  234. }
  235. void CTabControlDlg::OnButtonReset()
  236. {
  237. if( m_pMainDlg->GetDeviceClient()->DoRemoteLgsReset() )
  238. m_ButtonReset.EnableWindow( FALSE );
  239. else
  240. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnButtonReset"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsReset failed") );
  241. m_pMainDlg->AlarmReset();
  242. }
  243. void CTabControlDlg::OnShowWindow(BOOL bShow, UINT nStatus)
  244. {
  245. CDialog::OnShowWindow(bShow, nStatus);
  246. if( bShow )
  247. {
  248. if( !m_pMainDlg->GetDeviceClient()->DoRemoteVideo( m_Slider.GetPos(), 0 ) )
  249. {
  250. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnShowWindow"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteVideo failed") );
  251. }
  252. }
  253. }
  254. void CTabControlDlg::OnConnect(BOOL bConnected)
  255. {
  256. if( IsWindowVisible() )
  257. {
  258. if( !m_pMainDlg->GetDeviceClient()->DoRemoteVideo( m_Slider.GetPos(), 0 ) )
  259. {
  260. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnConnect"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteVideo failed") );
  261. }
  262. }
  263. // m_pMainDlg->GetDeviceClient()->DoRemoteLgsSensitivity( LG_TCP_PACKET_LGS::LGS_SENSITIVITY_LOW );
  264. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsHiddenOn( FALSE, 0 ) )
  265. {
  266. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnConnect"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsHiddenOn failed") );
  267. }
  268. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsConnect() )
  269. {
  270. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnConnect"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsConnect failed") );
  271. }
  272. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsVoltage() )
  273. {
  274. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnConnect"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsVoltage failed") );
  275. }
  276. if( !m_pMainDlg->GetDeviceClient()->DoRemotePtzIris( FALSE, 0 ) )
  277. {
  278. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnConnect"), _T("m_pMainDlg->GetDeviceClient()->DoRemotePtzIris failed") );
  279. }
  280. if( bConnected )
  281. {
  282. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsBorder() )
  283. {
  284. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnConnect"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsBorder failed") );
  285. }
  286. if( !m_pMainDlg->GetDeviceClient()->DoRemoteReportList( REMOTE_CONTEXT_CLIENT, NULL, 0 ) )
  287. {
  288. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnConnect"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteReportList failed") );
  289. }
  290. if( !m_pMainDlg->GetDeviceClient()->DoRemotePtzPosition( FALSE, 0,0,0 ) )
  291. {
  292. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnConnect"), _T("m_pMainDlg->GetDeviceClient()->DoRemotePtzPosition failed") );
  293. }
  294. }
  295. }
  296. void CTabControlDlg::OnRadioSensitivity()
  297. {
  298. UpdateData( TRUE );
  299. switch( m_RadioSensitivity )
  300. {
  301. case 0:
  302. // m_pMainDlg->GetDeviceClient()->DoRemoteLgsSensitivity( LG_TCP_PACKET_LGS::LGS_SENSITIVITY_LOW );
  303. break;
  304. case 1:
  305. // m_pMainDlg->GetDeviceClient()->DoRemoteLgsSensitivity( LG_TCP_PACKET_LGS::LGS_SENSITIVITY_MEDIUM );
  306. break;
  307. case 2:
  308. // m_pMainDlg->GetDeviceClient()->DoRemoteLgsSensitivity( LG_TCP_PACKET_LGS::LGS_SENSITIVITY_HIGH );
  309. break;
  310. }
  311. }
  312. void CTabControlDlg::OnCheckHidden()
  313. {
  314. BYTE bOn = 0;
  315. if( m_CheckHidden1.GetCheck() )
  316. bOn |= LG_TCP_PACKET_LGS::LGS_HIDDEN_ON_ZONE_1;
  317. if( m_CheckHidden2.GetCheck() )
  318. bOn |= LG_TCP_PACKET_LGS::LGS_HIDDEN_ON_ZONE_2;
  319. if( m_CheckHidden3.GetCheck() )
  320. bOn |= LG_TCP_PACKET_LGS::LGS_HIDDEN_ON_ZONE_3;
  321. if( m_CheckHidden4.GetCheck() )
  322. bOn |= LG_TCP_PACKET_LGS::LGS_HIDDEN_ON_ZONE_4;
  323. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsHiddenOn( TRUE, bOn ) )
  324. {
  325. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnCheckHidden"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsHiddenOn failed") );
  326. }
  327. }
  328. void CTabControlDlg::OnCheckMute()
  329. {
  330. m_pMainDlg->AlarmMute( !m_CheckMute.GetCheck() );
  331. CProgramSkin::SKIN skin;
  332. if( m_CheckMute.GetCheck() )
  333. {
  334. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_SOUND_OFF, skin ) )
  335. m_CheckMute.SetBitmap( skin.hBitmap );
  336. }
  337. else
  338. {
  339. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_SOUND_ON, skin ) )
  340. m_CheckMute.SetBitmap( skin.hBitmap );
  341. }
  342. }
  343. BOOL CTabControlDlg::SetIris(BOOL bDay)
  344. {
  345. m_CheckIrisDay.SetCheck( bDay );
  346. m_CheckIrisNight.SetCheck( !bDay );
  347. return TRUE;
  348. }
  349. void CTabControlDlg::OnCheckIrisDay()
  350. {
  351. SetIris( TRUE );
  352. if( !m_pMainDlg->GetDeviceClient()->DoRemotePtzIris( TRUE, TRUE ) )
  353. {
  354. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnCheckIrisDay"), _T("m_pMainDlg->GetDeviceClient()->DoRemotePtzIris failed") );
  355. }
  356. }
  357. void CTabControlDlg::OnCheckIrisNight()
  358. {
  359. SetIris( FALSE );
  360. if( !m_pMainDlg->GetDeviceClient()->DoRemotePtzIris( TRUE, FALSE ) )
  361. {
  362. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnCheckIrisNight"), _T("m_pMainDlg->GetDeviceClient()->DoRemotePtzIris failed") );
  363. }
  364. }
  365. void CTabControlDlg::OnSize(UINT nType, int cx, int cy)
  366. {
  367. CDialog::OnSize(nType, cx, cy);
  368. }
  369. void CTabControlDlg::UpdateControlPosition()
  370. {
  371. CProgramSkin::SKIN skin;
  372. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_VIDEO, skin ) )
  373. {
  374. m_StaticVideo.MoveWindow( &skin.rect );
  375. // m_VideoDC.Create( skin.rect.right - skin.rect.left, skin.rect.bottom - skin.rect.top, RGB(0,0,0) );
  376. m_VideoWnd.MoveWindow( &skin.rect );
  377. }
  378. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_LOCATOR, skin ) && m_Locator.GetSafeHwnd() )
  379. {
  380. m_StaticLocator.MoveWindow( &skin.rect );
  381. m_Locator.MoveWindow( &skin.rect );
  382. }
  383. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_CLEAR, skin ) )
  384. {
  385. m_ButtonClear.MoveWindow( &skin.rect );
  386. m_ButtonClear.SetBitmap( skin.hBitmap );
  387. }
  388. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_SOUND_ON, skin ) )
  389. {
  390. m_CheckMute.MoveWindow( &skin.rect );
  391. m_CheckMute.SetBitmap( skin.hBitmap );
  392. }
  393. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_RESET, skin ) )
  394. {
  395. m_ButtonReset.MoveWindow( &skin.rect );
  396. m_ButtonReset.SetBitmap( skin.hBitmap );
  397. }
  398. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_REPORT, skin ) )
  399. {
  400. m_ButtonReport.MoveWindow( &skin.rect );
  401. m_ButtonReport.SetBitmap( skin.hBitmap );
  402. }
  403. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_PTZ_TILT, skin ) )
  404. m_CameraPositionWnd.MoveWindow( &skin.rect );
  405. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_QUALITY, skin ) )
  406. m_Slider.MoveWindow( &skin.rect );
  407. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_MASK, skin ) )
  408. {
  409. CRect br;
  410. m_CheckHidden1.GetWindowRect( &br );
  411. INT nWidth = skin.rect.right - skin.rect.left;
  412. INT nHeight = skin.rect.bottom - skin.rect.top;
  413. INT nSpace = 3;
  414. INT nDeltaX = ( nWidth - ( br.Width() * 2 + nSpace ) ) / 2 + skin.rect.left;
  415. INT nDeltaY = ( nHeight - ( br.Height() * 2 + nSpace ) ) / 2 + skin.rect.top;
  416. CRect rh1( nDeltaX, nDeltaY, nDeltaX + br.Width(), nDeltaY + br.Height() );
  417. m_CheckHidden1.MoveWindow( &rh1 );
  418. CRect rh2( rh1.right + nSpace, nDeltaY, rh1.right + nSpace + br.Width(), nDeltaY + br.Height() );
  419. m_CheckHidden2.MoveWindow( &rh2 );
  420. CRect rh3( rh1.left, rh1.bottom + nSpace, rh1.right, rh1.bottom + nSpace + br.Height() );
  421. m_CheckHidden3.MoveWindow( &rh3 );
  422. CRect rh4( rh1.right + nSpace, rh1.bottom + nSpace, rh1.right + nSpace + br.Width(), rh1.bottom + nSpace + br.Height() );
  423. m_CheckHidden4.MoveWindow( &rh4 );
  424. }
  425. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_SENSITIVITY, skin ) )
  426. {
  427. CRect br;
  428. GetDlgItem( IDC_RADIO_SENSITIVITY_HIGH )->GetWindowRect( &br );
  429. INT nWidth = skin.rect.right - skin.rect.left;
  430. INT nHeight = skin.rect.bottom - skin.rect.top;
  431. INT nSpace = 3;
  432. INT nDeltaX = ( nWidth - br.Width() ) / 2 + skin.rect.left;
  433. INT nDeltaY = ( nHeight - ( br.Height() * 3 + nSpace * 2 ) ) / 2 + skin.rect.top;
  434. CRect rh1( nDeltaX, nDeltaY, nDeltaX + br.Width(), nDeltaY + br.Height() );
  435. GetDlgItem( IDC_RADIO_SENSITIVITY_HIGH )->MoveWindow( &rh1 );
  436. CRect rh2( nDeltaX, rh1.bottom + nSpace, nDeltaX + br.Width(), rh1.bottom + nSpace + br.Height() );
  437. GetDlgItem( IDC_RADIO_SENSITIVITY_MEDIUM )->MoveWindow( &rh2 );
  438. CRect rh3( nDeltaX, rh2.bottom + nSpace, nDeltaX + br.Width(), rh2.bottom + nSpace + br.Height() );
  439. GetDlgItem( IDC_RADIO_SENSITIVITY )->MoveWindow( &rh3 );
  440. }
  441. if( m_pSkin->GetSkin( CProgramSkin::SKIN_CONTROL_PTZ, skin ) )
  442. {
  443. CRect br;
  444. m_ButtonUp.GetWindowRect( &br );
  445. INT nWidth = skin.rect.right - skin.rect.left;
  446. INT nHeight = skin.rect.bottom - skin.rect.top;
  447. INT nSpace = 0;
  448. INT nDeltaX = ( nWidth - ( br.Width() * 3 + nSpace * 2 ) ) / 2 + skin.rect.left;
  449. INT nDeltaY = ( nHeight - ( br.Height() * 5 + nSpace * 4 ) ) / 2 + skin.rect.top;
  450. CRect rh1( nDeltaX + nSpace + br.Width(), nDeltaY, nDeltaX + nSpace + br.Width() * 2, nDeltaY + br.Height() );
  451. m_ButtonUp.MoveWindow( &rh1 );
  452. CRect rh2( nDeltaX, rh1.bottom + nSpace, nDeltaX + br.Width(), rh1.bottom + nSpace + br.Height() );
  453. m_ButtonLeft.MoveWindow( &rh2 );
  454. CRect rh3( rh1.right + nSpace, rh2.top, rh1.right + nSpace + br.Width(), rh2.bottom );
  455. m_ButtonRight.MoveWindow( &rh3 );
  456. CRect rh4( rh1.left, rh2.bottom + nSpace, rh1.right, rh2.bottom + nSpace + br.Height() );
  457. m_ButtonDown.MoveWindow( &rh4 );
  458. CRect rh5( rh2.left, rh4.bottom + nSpace, rh2.right, rh4.bottom + nSpace + br.Height() );
  459. m_ButtonTele.MoveWindow( &rh5 );
  460. CRect rh6( rh2.left, rh5.bottom + nSpace, rh2.right, rh5.bottom + nSpace + br.Height() );
  461. m_ButtonWide.MoveWindow( &rh6 );
  462. CRect rh7( rh3.left, rh5.top, rh3.right, rh5.bottom );
  463. m_CheckIrisDay.MoveWindow( &rh7 );
  464. CRect rh8( rh3.left, rh6.top, rh3.right, rh6.bottom );
  465. m_CheckIrisNight.MoveWindow( &rh8 );
  466. CRect rh9( rh1.left, rh6.top, rh1.right, rh6.bottom );
  467. m_ButtonPhoto.MoveWindow( &rh9 );
  468. }
  469. /*
  470. // space between controls
  471. INT nSpace = 5;
  472. // store client rect of control
  473. CRect ClientRect;
  474. GetClientRect( &ClientRect );
  475. // set video frame
  476. CRect VideoRect;
  477. VideoRect.SetRect( nSpace, nSpace,
  478. nSpace + ( ClientRect.Width() - nSpace ) * 4 / 7,
  479. nSpace + ( ClientRect.Width() - nSpace ) * 3 / 7 );
  480. m_StaticVideo.MoveWindow( &VideoRect );
  481. m_VideoDC.Create( VideoRect.Width(), VideoRect.Height(), RGB(0,0,0) );
  482. // set locator frame
  483. CRect LocatorRect;
  484. LocatorRect.SetRect( VideoRect.right + nSpace, nSpace,
  485. ClientRect.right - nSpace, VideoRect.bottom );
  486. m_StaticLocator.MoveWindow( &LocatorRect );
  487. if( m_Locator.GetSafeHwnd() )
  488. m_Locator.MoveWindow( &LocatorRect );
  489. // calculate control button size
  490. CRect LgButtonRect;
  491. m_ButtonUp.GetWindowRect( &LgButtonRect );
  492. LgButtonRect.OffsetRect( -LgButtonRect.TopLeft() );
  493. // control shift
  494. INT nControlSpace = (VideoRect.Width() - LgButtonRect.Width() * 10 - nSpace * 9) / 2;
  495. // set slider rect
  496. CRect SliderRect;
  497. SliderRect.SetRect( nControlSpace + nSpace, VideoRect.bottom + nSpace,
  498. nControlSpace + nSpace + LgButtonRect.Width(),
  499. VideoRect.bottom + nSpace * 2 + LgButtonRect.Height() * 2 );
  500. m_Slider.MoveWindow( &SliderRect );
  501. // set button up rect
  502. CRect ButtonUpRect;
  503. ButtonUpRect.SetRect( SliderRect.right + nSpace * 3 + LgButtonRect.Width() * 2, VideoRect.bottom + nSpace,
  504. SliderRect.right + nSpace * 3 + LgButtonRect.Width() * 3,
  505. VideoRect.bottom + nSpace + LgButtonRect.Height() );
  506. m_ButtonUp.MoveWindow( &ButtonUpRect );
  507. // set button down rect
  508. CRect ButtonDownRect;
  509. ButtonDownRect.SetRect( SliderRect.right + nSpace * 3 + LgButtonRect.Width() * 2, VideoRect.bottom + nSpace*2 + LgButtonRect.Width(),
  510. SliderRect.right + nSpace * 3 + LgButtonRect.Width() * 3,
  511. VideoRect.bottom + nSpace*2 + LgButtonRect.Height()*2 );
  512. m_ButtonDown.MoveWindow( &ButtonDownRect );
  513. // set button left rect
  514. CRect ButtonLeftRect;
  515. ButtonLeftRect.SetRect( SliderRect.right + nSpace * 2 + LgButtonRect.Width(), VideoRect.bottom + nSpace*2 + LgButtonRect.Width(),
  516. SliderRect.right + nSpace * 2 + LgButtonRect.Width() * 2,
  517. VideoRect.bottom + nSpace*2 + LgButtonRect.Height()*2 );
  518. m_ButtonLeft.MoveWindow( &ButtonLeftRect );
  519. // set button right rect
  520. CRect ButtonRightRect;
  521. ButtonRightRect.SetRect( SliderRect.right + nSpace * 4 + LgButtonRect.Width()* 3, VideoRect.bottom + nSpace*2 + LgButtonRect.Width(),
  522. SliderRect.right + nSpace * 4 + LgButtonRect.Width() * 4,
  523. VideoRect.bottom + nSpace * 2 + LgButtonRect.Height()*2 );
  524. m_ButtonRight.MoveWindow( &ButtonRightRect );
  525. // set button wide rect
  526. CRect ButtonTeleRect;
  527. ButtonTeleRect.SetRect( ButtonRightRect.right + nSpace * 2 + LgButtonRect.Width(), VideoRect.bottom + nSpace,
  528. ButtonRightRect.right + nSpace * 2 + LgButtonRect.Width() * 2,
  529. VideoRect.bottom + nSpace + LgButtonRect.Height() );
  530. m_ButtonTele.MoveWindow( &ButtonTeleRect );
  531. // set button wide rect
  532. CRect ButtonWideRect;
  533. ButtonWideRect.SetRect( ButtonRightRect.right + nSpace * 2 + LgButtonRect.Width(), VideoRect.bottom + nSpace * 2 + LgButtonRect.Height(),
  534. ButtonRightRect.right + nSpace * 2 + LgButtonRect.Width() * 2,
  535. VideoRect.bottom + nSpace * 2 + LgButtonRect.Height() * 2 );
  536. m_ButtonWide.MoveWindow( &ButtonWideRect );
  537. // set button day rect
  538. CRect ButtonDayRect;
  539. ButtonDayRect.SetRect( ButtonTeleRect.right + nSpace * 2 + LgButtonRect.Width(), VideoRect.bottom + nSpace,
  540. ButtonTeleRect.right + nSpace * 2 + LgButtonRect.Width() * 2,
  541. VideoRect.bottom + nSpace + LgButtonRect.Height() );
  542. m_CheckIrisDay.MoveWindow( &ButtonDayRect );
  543. // set button night rect
  544. CRect ButtonNightRect;
  545. ButtonNightRect.SetRect( ButtonTeleRect.right + nSpace * 2 + LgButtonRect.Width(),
  546. VideoRect.bottom + nSpace*2 + LgButtonRect.Height(),
  547. ButtonTeleRect.right + nSpace * 2 + LgButtonRect.Width() * 2,
  548. VideoRect.bottom + nSpace*2 + LgButtonRect.Height()*2 );
  549. m_CheckIrisNight.MoveWindow( &ButtonNightRect );
  550. // set button photo rect
  551. CRect ButtonPhotoRect;
  552. ButtonPhotoRect.SetRect( ButtonTeleRect.right + nSpace * 3 + LgButtonRect.Width()*2, VideoRect.bottom + nSpace,
  553. ButtonTeleRect.right + nSpace * 3 + LgButtonRect.Width() * 3,
  554. VideoRect.bottom + nSpace + LgButtonRect.Height() );
  555. m_ButtonPhoto.MoveWindow( &ButtonPhotoRect );
  556. // locator space
  557. INT nLocatorSpace = (LocatorRect.Width() - LgButtonRect.Width() * 8 - nSpace * 7) / 2;
  558. // set sensitivity buttons height
  559. INT nButtonSensitivityHeight = ( nSpace + LgButtonRect.Height() * 2 ) / 3;
  560. // set sensitivity1 rect
  561. CRect Sensitivity1Rect;
  562. Sensitivity1Rect.SetRect( LocatorRect.left + nLocatorSpace, LocatorRect.bottom + nSpace,
  563. LocatorRect.left + nLocatorSpace + LgButtonRect.Width() * 2 + nSpace,
  564. LocatorRect.bottom + nSpace + nButtonSensitivityHeight );
  565. GetDlgItem( IDC_RADIO_SENSITIVITY )->MoveWindow( &Sensitivity1Rect );
  566. // set sensitivity2 rect
  567. CRect Sensitivity2Rect;
  568. Sensitivity2Rect.SetRect( LocatorRect.left + nLocatorSpace, LocatorRect.bottom + nSpace + nButtonSensitivityHeight,
  569. LocatorRect.left + nLocatorSpace + LgButtonRect.Width() * 2 + nSpace,
  570. LocatorRect.bottom + nSpace + nButtonSensitivityHeight * 2 );
  571. GetDlgItem( IDC_RADIO_SENSITIVITY_MEDIUM )->MoveWindow( &Sensitivity2Rect );
  572. // set sensitivity3 rect
  573. CRect Sensitivity3Rect;
  574. Sensitivity3Rect.SetRect( LocatorRect.left + nLocatorSpace, LocatorRect.bottom + nSpace + nButtonSensitivityHeight * 2,
  575. LocatorRect.left + nLocatorSpace + LgButtonRect.Width() * 2 + nSpace,
  576. LocatorRect.bottom + nSpace + nButtonSensitivityHeight * 3 );
  577. GetDlgItem( IDC_RADIO_SENSITIVITY_HIGH )->MoveWindow( &Sensitivity3Rect );
  578. // store full sensitivity rect
  579. m_CameraPositionWndRect.SetRect( Sensitivity1Rect.TopLeft(), Sensitivity3Rect.BottomRight() );
  580. if( m_CameraPositionWnd.GetSafeHwnd() )
  581. m_CameraPositionWnd.MoveWindow( &m_CameraPositionWndRect );
  582. // set hidden 1 rect
  583. CRect Hidden1Rect;
  584. Hidden1Rect.SetRect( Sensitivity3Rect.right + nSpace * 2 + LgButtonRect.Width(),
  585. LocatorRect.bottom + nSpace,
  586. Sensitivity3Rect.right + nSpace * 2 + LgButtonRect.Width()*2,
  587. LocatorRect.bottom + nSpace + LgButtonRect.Height() );
  588. m_CheckHidden1.MoveWindow( &Hidden1Rect );
  589. // set hidden 2 rect
  590. CRect Hidden2Rect;
  591. Hidden2Rect.SetRect( Sensitivity3Rect.right + nSpace * 3 + LgButtonRect.Width()*2,
  592. LocatorRect.bottom + nSpace,
  593. Sensitivity3Rect.right + nSpace * 3 + LgButtonRect.Width()*3,
  594. LocatorRect.bottom + nSpace + LgButtonRect.Height() );
  595. m_CheckHidden2.MoveWindow( &Hidden2Rect );
  596. // set hidden 3 rect
  597. CRect Hidden3Rect;
  598. Hidden3Rect.SetRect( Sensitivity3Rect.right + nSpace * 2 + LgButtonRect.Width(),
  599. LocatorRect.bottom + nSpace*2 + LgButtonRect.Height(),
  600. Sensitivity3Rect.right + nSpace * 2 + LgButtonRect.Width()*2,
  601. LocatorRect.bottom + nSpace*2 + LgButtonRect.Height()*2 );
  602. m_CheckHidden3.MoveWindow( &Hidden3Rect );
  603. // set hidden 4 rect
  604. CRect Hidden4Rect;
  605. Hidden4Rect.SetRect( Sensitivity3Rect.right + nSpace * 3 + LgButtonRect.Width()*2,
  606. LocatorRect.bottom + nSpace*2 + LgButtonRect.Height(),
  607. Sensitivity3Rect.right + nSpace * 3 + LgButtonRect.Width()*3,
  608. LocatorRect.bottom + nSpace*2 + LgButtonRect.Height()*2 );
  609. m_CheckHidden4.MoveWindow( &Hidden4Rect );
  610. // set clear rect
  611. CRect ClearRect;
  612. ClearRect.SetRect( Hidden4Rect.right + nSpace * 2 + LgButtonRect.Width(),
  613. LocatorRect.bottom + nSpace,
  614. Hidden4Rect.right + nSpace * 3 + LgButtonRect.Width()*3,
  615. LocatorRect.bottom + nSpace + nButtonSensitivityHeight );
  616. m_ButtonClear.MoveWindow( &ClearRect );
  617. // set reset rect
  618. CRect ResetRect;
  619. ResetRect.SetRect( ClearRect.left,
  620. ClearRect.bottom,
  621. ClearRect.right,
  622. ClearRect.bottom + nButtonSensitivityHeight );
  623. m_ButtonReset.MoveWindow( &ResetRect );
  624. // set mute rect
  625. CRect MuteRect;
  626. MuteRect.SetRect( ResetRect.left,
  627. ResetRect.bottom,
  628. ResetRect.right,
  629. ResetRect.bottom + nButtonSensitivityHeight );
  630. m_CheckMute.MoveWindow( &MuteRect );
  631. */
  632. }
  633. void CTabControlDlg::OnButtonPhoto()
  634. {
  635. if( !m_pMainDlg->GetDeviceClient()->DoRemoteLgsPhoto() )
  636. {
  637. LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CTabControlDlg::OnButtonPhoto"), _T("m_pMainDlg->GetDeviceClient()->DoRemoteLgsPhoto failed") );
  638. }
  639. }
  640. void CTabControlDlg::SetSkin(CProgramSkin *pProgramSkin)
  641. {
  642. m_pSkin = pProgramSkin;
  643. }
  644. void CTabControlDlg::OnButtonReport()
  645. {
  646. m_pMainDlg->ShowReport( TRUE );
  647. }