📄 interface.cpp
字号:
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003, Ulink Telecom Equipment Co., Ltd. All rights reserved.
//
// File:
//
// Interface.cpp
//
// Abstract:
//
// implementation of the CInterface class. It's a wrap of the physical interface.
//
// History:
//
// V1.0 2003-03-31 Alex Duan Original version.
// V1.1 2003-11-06 Alex Duan Replace EInterfaceType enum with macros
// V1.2 2003-11-12 Alex Duan Replace >>/<< with OnSaveData/OnLoadData
//
///////////////////////////////////////////////////////////////////////////////
#include "Interface.h"
#include "APPCORE.H"
///////////////////////////////////////////////////////////////////////////////
// CInterface
IMPLEMENT_DYNAMIC(CInterface, CRTObject)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CInterface::CInterface()
{
m_wIndex = 0;
m_nLoopbackCounter = 0;
m_nLoopbackMode = LOOPBACK_OFF;
}
CInterface::~CInterface()
{
}
///////////////////////////////////////////////////////////////////////////////
// Parameters:
// nIDEvent Specifies the identifier of the timer.
// Remarks:
// The framework calls this member function after each interval specified
// in the CreateTimer member function of CRTObject used to install a timer.
void CInterface::OnTimer(UINT nIDEvent)
{
UNUSED(nIDEvent);
TRACE("Interface Timer\n");
UINT nLoopbackTime = GetApp()->GetDevice()->GetLoopbackTime();
if (nLoopbackTime != 0 && m_nLoopbackMode != LOOPBACK_OFF)
{
if (++m_nLoopbackCounter > nLoopbackTime)
{
SetLoopbackMode(LOOPBACK_OFF);
}
}
}
BOOL CInterface::OnInitInterface()
{
return TRUE;
}
BOOL CInterface::SetLoopbackMode(int nMode)
{
m_nLoopbackMode = nMode;
m_nLoopbackCounter = 0;
if (FindTimer("LoopbackTimer"))
{
if (nMode == LOOPBACK_OFF)
{
VERIFY(DeleteTimer("LoopbackTimer"));
}
}
else if (nMode != LOOPBACK_OFF)
{
VERIFY(CreateTimer("LoopbackTimer", 1, 1000, 1000));
}
return TRUE;
}
// load parameters
void CInterface::OnLoadData()
{
}
// save parameters
void CInterface::OnSaveData()
{
ASSERT(!GetSectionString().IsEmpty());
GetApp()->WriteProfileInt(GetSectionString(), "Type", GetType());
SAVE_INT(m_wIndex);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -