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.
138 lines
3.2 KiB
138 lines
3.2 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: LgMaskSchedule.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of LgMaskSchedule.cpp
|
|
//----------------------------------------------------------------------------
|
|
#include "stdafx.h"
|
|
#include "LgMaskSchedule.h"
|
|
#include "LgMaskScheduleEngine.h"
|
|
|
|
HANDLE m_hModule = NULL;
|
|
|
|
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
|
|
{
|
|
switch ( ul_reason_for_call )
|
|
{
|
|
case DLL_PROCESS_ATTACH: m_hModule = hModule; break;
|
|
case DLL_THREAD_ATTACH: break;
|
|
case DLL_THREAD_DETACH: break;
|
|
case DLL_PROCESS_DETACH: m_hModule = NULL; break;
|
|
}
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
CLgMaskSchedule::CLgMaskSchedule()
|
|
{
|
|
m_pReserved = new CLgMaskScheduleEngine();
|
|
}
|
|
|
|
CLgMaskSchedule::~CLgMaskSchedule()
|
|
{
|
|
if( m_pReserved )
|
|
delete reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved);
|
|
}
|
|
|
|
static void MaskScheduleCallback( LPVOID lParam, CLgMaskScheduleLgsSwitch& arrSwitch )
|
|
{
|
|
reinterpret_cast<CLgMaskSchedule*>(lParam)->MaskSwitch( arrSwitch );
|
|
}
|
|
|
|
BOOL CLgMaskSchedule::Create()
|
|
{
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->Create( MaskScheduleCallback, this );
|
|
}
|
|
|
|
void CLgMaskSchedule::Destroy()
|
|
{
|
|
if( !m_pReserved )
|
|
return;
|
|
|
|
reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->Destroy();
|
|
}
|
|
|
|
BOOL CLgMaskSchedule::Load( LPCTSTR pFileName )
|
|
{
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->Load( pFileName );
|
|
}
|
|
|
|
BOOL CLgMaskSchedule::Save( LPCTSTR pFileName )
|
|
{
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->Save( pFileName );
|
|
}
|
|
|
|
void CLgMaskSchedule::OnTimer( SYSTEMTIME *pST )
|
|
{
|
|
if( !m_pReserved )
|
|
return;
|
|
|
|
reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->OnTimer( pST );
|
|
}
|
|
|
|
BOOL CLgMaskSchedule::Add( PMASK_SCHEDULE pHzSchedule )
|
|
{
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->Add( pHzSchedule );
|
|
}
|
|
|
|
BOOL CLgMaskSchedule::Delete( INT nIndex )
|
|
{
|
|
if( !m_pReserved )
|
|
return FALSE;
|
|
|
|
return reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->Delete( nIndex );
|
|
}
|
|
|
|
void CLgMaskSchedule::DeleteAll()
|
|
{
|
|
if( !m_pReserved )
|
|
return;
|
|
|
|
reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->DeleteAll();
|
|
}
|
|
|
|
CLgScheduleArray& CLgMaskSchedule::GetScheduleArray()
|
|
{
|
|
if( !m_pReserved )
|
|
{
|
|
static CLgScheduleArray array;
|
|
return array;
|
|
}
|
|
|
|
return reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->GetScheduleArray();
|
|
}
|
|
|
|
void CLgMaskSchedule::MaskSwitch( CLgMaskScheduleLgsSwitch &arrSwitch )
|
|
{
|
|
if( !m_pReserved )
|
|
return;
|
|
|
|
reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->MaskSwitch( arrSwitch );
|
|
}
|
|
|
|
void CLgMaskSchedule::UpdateSchedule( INT nIndex )
|
|
{
|
|
if( !m_pReserved )
|
|
return;
|
|
|
|
reinterpret_cast<CLgMaskScheduleEngine*>(m_pReserved)->UpdateSchedule( nIndex );
|
|
}
|