📄 wintertimer.cpp
字号:
/* WinterTimer.cpp *//******************************************************************************************* Copyright 2002-2003 ATMEL Corporation. This file is part of ATMEL Wireless LAN Drivers. ATMEL Wireless LAN Drivers is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ATMEL Wireless LAN Drivers is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ATMEL Wireless LAN Drivers; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*******************************************************************************************/#include "WinterTimer.h"#include "WinterFrame.h"#include "WinterSetup.h"#include "MonitorPage.h"#include "StatisticsPage.h"#include "Accessor.h"#include "Decls.h"// debug:#include "WinterDebug.h"// CWinterTimer class implementation//===================================CWinterTimer::CWinterTimer( ) : wxTimer( ){ mIsActive = false;}CWinterTimer::~CWinterTimer( ){}void CWinterTimer::Notify( ){ CWinterRuf ruf; static wxString devid = wxString(""); CVnetDeviceBase* curdev = (CVnetDeviceBase*) CAccessor::Access(AID_CURRENTDEVICE); CVnetDeviceManager *devman =(CVnetDeviceManager*)CAccessor::Access(AID_DEVICEMANAGER); ruf.Log( "Tick!" ); if( mIsActive == true ) {// debug :ruf.Log( "Yes, the timer is active." ); CWinterFrame *frame = ( CWinterFrame * ) CAccessor::Access( AID_FRAME ); CMonitorPage *pg_monitor = ( CMonitorPage * ) frame->FindWindowById( ID_PN_MONITORPAGE ); if( pg_monitor->OnUpdateGauge( true ) == false && devid != curdev->GetDevName() ) { devid = curdev->GetDevName(); CAutoChoice* devlist = (CAutoChoice*)frame->FindWindowById(ID_CH_WHICHDEVICE); devlist->Delete(devlist->GetSelection()); if( devman->GetDeviceCount() < 1 ) { devlist->SetSelection(-1); if( ::wxMessageBox( _( "It seems that the device has been removed. It is recommended quitting as soon as possible.\nDo you want to quit?" ), _( "Device removal" ), wxICON_QUESTION | wxYES_NO, frame ) == wxYES ) { frame->ExitASAP( ); } } else { devman->RemoveDevice(curdev); frame->UpdateIFaceList(); devlist->SetSelection(0); } return; } pg_monitor->OnUpdateStatus( false ); CStatisticsPage *pg_statistics = ( CStatisticsPage * ) frame->FindWindowById( ID_PN_STATISTICSPAGE ); pg_statistics->UpdateWinterPage( ); } return;}void CWinterTimer::Activate( ){ if( mIsActive != true ) { mIsActive = true; Start( MAIN_TIMER_INTERVAL ); } return;}void CWinterTimer::DeActivate( ){ mIsActive = false; Stop( ); return;}// CWinterTimerSingleton class implementation//============================================CWinterTimer *CWinterTimerSingleton::mTimer = NULL;CWinterTimerSingleton::CWinterTimerSingleton( ){}CWinterTimerSingleton::~CWinterTimerSingleton( ){}CWinterTimer *CWinterTimerSingleton::Get( ){ if( mTimer == NULL ) { mTimer = new CWinterTimer( ); } return mTimer;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -