For DOS Protected Mode version of sensor core software
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.

342 lines
7.7 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 05/11/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LgReport.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of LgReport.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "LgLibReport.h"
  16. #include "LgReport.h"
  17. #include "LgReportDlg.h"
  18. #include "LgReportStorage.h"
  19. #ifdef _DEBUG
  20. #undef THIS_FILE
  21. static char THIS_FILE[]=__FILE__;
  22. #define new DEBUG_NEW
  23. #endif
  24. /*
  25. CLgReportDialog::CLgReportDialog()
  26. {
  27. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  28. m_pReserved = NULL;
  29. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgReportDialog::CLgReportDialog") );
  30. }
  31. CLgReportDialog::~CLgReportDialog()
  32. {
  33. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgReportDialog::~CLgReportDialog") );
  34. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  35. Destroy();
  36. }
  37. void CLgReportDialog::Destroy()
  38. {
  39. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  40. if( !m_pReserved )
  41. return;
  42. static_cast<CLgReportDlg*>(m_pReserved)->DestroyWindow();
  43. delete static_cast<CLgReportDlg*>(m_pReserved);
  44. m_pReserved = NULL;
  45. }
  46. BOOL CLgReportDialog::Create( LPCTSTR pRootPath, HWND hParentWnd )
  47. {
  48. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  49. if( m_pReserved )
  50. return TRUE;
  51. m_pReserved = new CLgReportDlg();
  52. if( !m_pReserved )
  53. return FALSE;
  54. return static_cast<CLgReportDlg*>(m_pReserved)->Create( pRootPath, hParentWnd );
  55. }
  56. BOOL CLgReportDialog::DoModal( LPCTSTR pRootPath, HWND hParentWnd )
  57. {
  58. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  59. CLgReportDlg dlg;
  60. return dlg.DoModal( pRootPath, hParentWnd );
  61. }
  62. HWND CLgReportDialog::GetControlEvent()
  63. {
  64. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  65. return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlEvent() : NULL;
  66. }
  67. HWND CLgReportDialog::GetControlTree()
  68. {
  69. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  70. return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlTree() : NULL;
  71. }
  72. HWND CLgReportDialog::GetControlFilterEvent()
  73. {
  74. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  75. return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlFilterEvent() : NULL;
  76. }
  77. HWND CLgReportDialog::GetControlFilterSensor()
  78. {
  79. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  80. return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlFilterSensor() : NULL;
  81. }
  82. HWND CLgReportDialog::GetControlVideo()
  83. {
  84. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  85. return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlVideo() : NULL;
  86. }
  87. HWND CLgReportDialog::GetControlSite()
  88. {
  89. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  90. return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlSite() : NULL;
  91. }
  92. HWND CLgReportDialog::GetControlScroll()
  93. {
  94. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  95. return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlScroll() : NULL;
  96. }
  97. */
  98. CLgReport::CLgReport()
  99. {
  100. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgReport::CLgReport") );
  101. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  102. m_pReserved = new CLgReportStorage();
  103. }
  104. CLgReport::~CLgReport()
  105. {
  106. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgReport::~CLgReport") );
  107. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  108. Destroy();
  109. if( m_pReserved )
  110. delete static_cast<CLgReportStorage*>(m_pReserved);
  111. }
  112. BOOL CLgReport::Create( LPCTSTR pPathRoot, INT nMaxStorageDays )
  113. {
  114. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  115. if( !m_pReserved )
  116. return FALSE;
  117. return static_cast<CLgReportStorage*>(m_pReserved)->Create( pPathRoot, nMaxStorageDays, this );
  118. }
  119. void CLgReport::Destroy()
  120. {
  121. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  122. if( !m_pReserved )
  123. return;
  124. static_cast<CLgReportStorage*>(m_pReserved)->Destroy();
  125. }
  126. BOOL CLgReport::Export( LPCTSTR pPathFile, LPSYSTEMTIME pStart, LPSYSTEMTIME pEnd ){
  127. if( !m_pReserved ) return FALSE;
  128. static_cast<CLgReportStorage*>(m_pReserved)->Export( pPathFile, pStart, pEnd );
  129. return TRUE;
  130. }
  131. BOOL CLgReport::OnSensor( LPCTSTR pName, float x, float y )
  132. {
  133. if( !m_pReserved )
  134. return FALSE;
  135. return static_cast<CLgReportStorage*>(m_pReserved)->OnSensor( pName, x, y );
  136. }
  137. BOOL CLgReport::OnFilter( BYTE bId, LPCTSTR pName )
  138. {
  139. if( !m_pReserved )
  140. return FALSE;
  141. return static_cast<CLgReportStorage*>(m_pReserved)->OnFilter( bId, pName );
  142. }
  143. BOOL CLgReport::Reset()
  144. {
  145. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  146. if( !m_pReserved )
  147. return FALSE;
  148. return static_cast<CLgReportStorage*>(m_pReserved)->Reset();
  149. }
  150. BOOL CLgReport::StoreEvent(SYSTEMTIME *pST, BYTE bId, BOOL bSensor, WORD wSensorIndex, BOOL bPosition, float x, float y, LARGE_INTEGER *pOffset, LPCTSTR pFormat, ... )
  151. {
  152. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  153. if( !m_pReserved )
  154. return FALSE;
  155. va_list pMarker;
  156. va_start( pMarker, pFormat );
  157. BOOL bResult = static_cast<CLgReportStorage*>(m_pReserved)->StoreEvent( pST, bId, bSensor, wSensorIndex, bPosition, x, y, pOffset, pFormat, pMarker );
  158. va_end( pMarker );
  159. return bResult;
  160. }
  161. BOOL CLgReport::StoreImage( HBITMAP hBitmap, LARGE_INTEGER *pOffset )
  162. {
  163. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  164. if( !m_pReserved )
  165. return FALSE;
  166. return static_cast<CLgReportStorage*>(m_pReserved)->StoreImage( hBitmap, pOffset );
  167. }
  168. BOOL CLgReport::StoreImage( CLgImageDIB& dib, LARGE_INTEGER *pOffset )
  169. {
  170. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  171. if( !m_pReserved )
  172. return FALSE;
  173. return static_cast<CLgReportStorage*>(m_pReserved)->StoreImage( dib, pOffset );
  174. }
  175. BOOL CLgReport::StoreImage( CLgImageJPEG& jpeg, LARGE_INTEGER *pOffset )\
  176. {
  177. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  178. if( !m_pReserved )
  179. return FALSE;
  180. return static_cast<CLgReportStorage*>(m_pReserved)->StoreImage( jpeg, pOffset );
  181. }
  182. BOOL CLgReport::StoreBackground( CLgImageDIB& dib )
  183. {
  184. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  185. if( !m_pReserved )
  186. return FALSE;
  187. return static_cast<CLgReportStorage*>(m_pReserved)->StoreBackground( dib );
  188. }
  189. BOOL CLgReport::StoreBackground( CLgImageJPEG& jpeg )
  190. {
  191. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  192. if( !m_pReserved )
  193. return FALSE;
  194. return static_cast<CLgReportStorage*>(m_pReserved)->StoreBackground( jpeg );
  195. }
  196. /*
  197. BOOL CLgReport::StoreSensors()
  198. {
  199. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  200. if( !m_pReserved )
  201. return FALSE;
  202. return static_cast<CLgReportStorage*>(m_pReserved)->StoreSensors();
  203. }
  204. BOOL CLgReport::StoreFilters()
  205. {
  206. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  207. if( !m_pReserved )
  208. return FALSE;
  209. return static_cast<CLgReportStorage*>(m_pReserved)->StoreFilters();
  210. }
  211. */
  212. BOOL CLgReport::SetMaxStoreTime( INT nDays )
  213. {
  214. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  215. if( !m_pReserved )
  216. return FALSE;
  217. return static_cast<CLgReportStorage*>(m_pReserved)->SetMaxStoreTime( nDays );
  218. }
  219. BOOL CLgReport::Dlg_Create( HWND hParentWnd )
  220. {
  221. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  222. if( !m_pReserved )
  223. return FALSE;
  224. return static_cast<CLgReportStorage*>(m_pReserved)->Dlg_Create( hParentWnd );
  225. }
  226. BOOL CLgReport::Dlg_DoModal( HWND hParentWnd )
  227. {
  228. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  229. if( !m_pReserved )
  230. return FALSE;
  231. return static_cast<CLgReportStorage*>(m_pReserved)->Dlg_DoModal( hParentWnd );
  232. }
  233. BOOL CLgReport::DlgSetup_DoModal( HWND hParentWnd )
  234. {
  235. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  236. if( !m_pReserved )
  237. return FALSE;
  238. return static_cast<CLgReportStorage*>(m_pReserved)->DlgSetup_DoModal( hParentWnd );
  239. }
  240. void CLgReport::Dlg_Destroy()
  241. {
  242. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  243. if( !m_pReserved )
  244. return;
  245. static_cast<CLgReportStorage*>(m_pReserved)->Dlg_Destroy();
  246. }