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.
335 lines
7.8 KiB
335 lines
7.8 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 05/11/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: LgReport.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of LgReport.cpp
|
|
//----------------------------------------------------------------------------
|
|
#include "stdafx.h"
|
|
#include "LgLibReport.h"
|
|
#include "LgReport.h"
|
|
#include "LgReportDlg.h"
|
|
#include "LgReportStorage.h"
|
|
|
|
#ifdef _DEBUG
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[]=__FILE__;
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
/*
|
|
CLgReportDialog::CLgReportDialog()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
m_pReserved = NULL;
|
|
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgReportDialog::CLgReportDialog") );
|
|
}
|
|
|
|
CLgReportDialog::~CLgReportDialog()
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgReportDialog::~CLgReportDialog") );
|
|
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
Destroy();
|
|
}
|
|
|
|
void CLgReportDialog::Destroy()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return;
|
|
|
|
static_cast<CLgReportDlg*>(m_pReserved)->DestroyWindow();
|
|
|
|
delete static_cast<CLgReportDlg*>(m_pReserved);
|
|
|
|
m_pReserved = NULL;
|
|
}
|
|
|
|
BOOL CLgReportDialog::Create( LPCTSTR pRootPath, HWND hParentWnd )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( m_pReserved )
|
|
return TRUE;
|
|
|
|
m_pReserved = new CLgReportDlg();
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportDlg*>(m_pReserved)->Create( pRootPath, hParentWnd );
|
|
}
|
|
|
|
|
|
BOOL CLgReportDialog::DoModal( LPCTSTR pRootPath, HWND hParentWnd )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
CLgReportDlg dlg;
|
|
return dlg.DoModal( pRootPath, hParentWnd );
|
|
}
|
|
|
|
HWND CLgReportDialog::GetControlEvent()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlEvent() : NULL;
|
|
}
|
|
|
|
HWND CLgReportDialog::GetControlTree()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlTree() : NULL;
|
|
}
|
|
|
|
HWND CLgReportDialog::GetControlFilterEvent()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlFilterEvent() : NULL;
|
|
}
|
|
|
|
HWND CLgReportDialog::GetControlFilterSensor()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlFilterSensor() : NULL;
|
|
}
|
|
|
|
HWND CLgReportDialog::GetControlVideo()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlVideo() : NULL;
|
|
}
|
|
|
|
HWND CLgReportDialog::GetControlSite()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlSite() : NULL;
|
|
}
|
|
|
|
HWND CLgReportDialog::GetControlScroll()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
return m_pReserved ? static_cast<CLgReportDlg*>(m_pReserved)->GetControlScroll() : NULL;
|
|
}
|
|
*/
|
|
CLgReport::CLgReport()
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgReport::CLgReport") );
|
|
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
m_pReserved = new CLgReportStorage();
|
|
}
|
|
|
|
CLgReport::~CLgReport()
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgReport::~CLgReport") );
|
|
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
Destroy();
|
|
|
|
if( m_pReserved )
|
|
delete static_cast<CLgReportStorage*>(m_pReserved);
|
|
}
|
|
|
|
BOOL CLgReport::Create( LPCTSTR pPathRoot, INT nMaxStorageDays )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->Create( pPathRoot, nMaxStorageDays, this );
|
|
}
|
|
|
|
void CLgReport::Destroy()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return;
|
|
|
|
static_cast<CLgReportStorage*>(m_pReserved)->Destroy();
|
|
}
|
|
|
|
BOOL CLgReport::OnSensor( LPCTSTR pName, float x, float y )
|
|
{
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->OnSensor( pName, x, y );
|
|
}
|
|
|
|
BOOL CLgReport::OnFilter( BYTE bId, LPCTSTR pName )
|
|
{
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->OnFilter( bId, pName );
|
|
}
|
|
|
|
BOOL CLgReport::Reset()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->Reset();
|
|
}
|
|
|
|
BOOL CLgReport::StoreEvent(SYSTEMTIME *pST, BYTE bId, BOOL bSensor, WORD wSensorIndex, BOOL bPosition, float x, float y, LARGE_INTEGER *pOffset, LPCTSTR pFormat, ... )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
va_list pMarker;
|
|
va_start( pMarker, pFormat );
|
|
|
|
BOOL bResult = static_cast<CLgReportStorage*>(m_pReserved)->StoreEvent( pST, bId, bSensor, wSensorIndex, bPosition, x, y, pOffset, pFormat, pMarker );
|
|
|
|
va_end( pMarker );
|
|
|
|
return bResult;
|
|
}
|
|
|
|
|
|
BOOL CLgReport::StoreImage( HBITMAP hBitmap, LARGE_INTEGER *pOffset )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->StoreImage( hBitmap, pOffset );
|
|
}
|
|
|
|
BOOL CLgReport::StoreImage( CLgImageDIB& dib, LARGE_INTEGER *pOffset )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->StoreImage( dib, pOffset );
|
|
}
|
|
|
|
BOOL CLgReport::StoreImage( CLgImageJPEG& jpeg, LARGE_INTEGER *pOffset )\
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->StoreImage( jpeg, pOffset );
|
|
}
|
|
|
|
BOOL CLgReport::StoreBackground( CLgImageDIB& dib )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->StoreBackground( dib );
|
|
}
|
|
|
|
BOOL CLgReport::StoreBackground( CLgImageJPEG& jpeg )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->StoreBackground( jpeg );
|
|
}
|
|
|
|
/*
|
|
BOOL CLgReport::StoreSensors()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->StoreSensors();
|
|
}
|
|
|
|
BOOL CLgReport::StoreFilters()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->StoreFilters();
|
|
}
|
|
*/
|
|
|
|
BOOL CLgReport::SetMaxStoreTime( INT nDays )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->SetMaxStoreTime( nDays );
|
|
}
|
|
|
|
BOOL CLgReport::Dlg_Create( HWND hParentWnd )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->Dlg_Create( hParentWnd );
|
|
}
|
|
|
|
BOOL CLgReport::Dlg_DoModal( HWND hParentWnd )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->Dlg_DoModal( hParentWnd );
|
|
}
|
|
|
|
BOOL CLgReport::DlgSetup_DoModal( HWND hParentWnd )
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return static_cast<CLgReportStorage*>(m_pReserved)->DlgSetup_DoModal( hParentWnd );
|
|
}
|
|
|
|
void CLgReport::Dlg_Destroy()
|
|
{
|
|
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
|
|
|
|
if( !m_pReserved )
|
|
return;
|
|
|
|
static_cast<CLgReportStorage*>(m_pReserved)->Dlg_Destroy();
|
|
}
|