?? csector.cpp
字號:
//CSector.h
//The implemetation of CSector class
///////////////////////////////////////////////////////////
#include "CCell.h"
#include "CSector.h"
#include "CDataMs.h"
///////////////////////////////////////////////////////////
//初始化函數
//completed in 3.19,and reviced in 4.4
void CSector::Initialization(int SectorIndex, CELLID_TYPE CellID,
CCell* pParentCell, int orient)
{
m_iSectorIndex=SectorIndex; //初始化扇區標號
m_stParentCellID=CellID; //初始化父小區標號
m_pParentCell=pParentCell; //初始化父小區指針
m_iSectorOrientation=orient%360; //初始化扇區朝向,保證其值在0-359之間
m_fTxPower=m_fMaxPower; //初始化時,將實際發射功率置為最大功率,保證了所有小區最初以滿功率發射
//wgt
m_fTxPower1=m_fTxPower;
m_fPilotPower=(float)FractionOfPilotChannel*m_fTxPower; //導頻功率=導頻功率比例*實際發射功率
m_fCommonPower=(float)FractionOfCommonChannel*m_fTxPower;//公共信道功率=其它公共信道功率比例*實際發射功率
m_pCurrentDataMs=NULL; //將當前分組用戶指針置空
m_bIsTransmiting=false; //將正在傳輸標志置假
m_iNumOfSector=0; //將每個扇區的用戶數置零
///////////////////////////////// wyf新增成員變量初始化 ////////////////////////////
m_bIsExistHighestPriority=false;
m_fPriorityFactor=0.0; //優先權指標初始化
////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////// oyh新增成員變量初始化 //////////////////////////////
m_iTotalDataMsNum=0; //本扇區總的分組用戶數置零
m_lGoodBitNum=0; //本扇區到目前為止成功傳輸比特數置零
//////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////// zdy新增成員變量初始化 //////////////////////////////
m_fTotalPacketDelay=0.0; //本扇區所傳分組的總的時延置零
m_iTotalSuccessfulPacketNum=0; //本扇區成功傳輸的分組數目置零
//////////////////////////////////////////////////////////////////////////////////////////
///Added by oyh on 20010508
m_fTotalVoicePower=0.0; //總話音功率置零
m_fPacketPower=0.0; //分組功率置零
//wgt
// m_fTotalVoicePower1=0.0;
}
//功率復位函數
//completed in 3.19, reviced in 3.20
//經楊光指點,功率復位將實際發射功率、話音業務總功率
//和分組數據信道功率置零。
void CSector::ResetPower()
{
m_fTotalVoicePower=0.0; //實際的話音業務總功率置零
m_fPacketPower=0.0; //實際的分組數據信道功率置零
}
//話音功率的累加函數
//completed in 3.20
void CSector::VoicePowerCumulate(float SingleVoicePower)
{
m_fTotalVoicePower+=SingleVoicePower;
}
//分組數據信道的功率計算函數
//completed in 3.20
void CSector::PacketPowerCalculte()
{
m_fPacketPower=m_fMaxPower-m_fPilotPower-m_fCommonPower-m_fTotalVoicePower;
//分組信道可使用的功率=BTS最大發射功率-導頻信道發射功率-
//公共信道發射功率-話音業務總功率(不能大于分組數據信道的最大功率)
if (m_fPacketPower>m_fMaxPacketPower) //分組信道可使用的功率不能大于分組數據信道的最大功率
m_fPacketPower=m_fMaxPacketPower; //若大于,則可用功率即為最大功率
//added by oyh on 20010508
if (m_fPacketPower<0) //分組信道可使用的功率不能小于0
m_fPacketPower=0;
}
//實際發射功率計算函數,應oyh要求新增
void CSector::TxPowerCalculte()
{
m_fTxPower=m_fTotalVoicePower+m_fPacketPower+m_fCommonPower+m_fPilotPower;
//wgt
m_fTxPower1=m_fTxPower;
}
////////////////////////////////////////////////////////////////////////////////
// 以下為接口函數
/////////////////////////////////////////////////////////////////////////////////
//返回扇區標號
int CSector::GetSectorIndex()
{
return m_iSectorIndex;
}
//返回父小區標號
CELLID_TYPE CSector::GetParentCellID()
{
return m_stParentCellID;
}
//返回父小區指針
CCell* CSector::GetParentCell()
{
return m_pParentCell;
}
//返回扇區朝向 取值范圍0-359
int CSector::GetSectorOrientation()
{
return m_iSectorOrientation;
}
//設置最大發射功率
void CSector::SetMaxPower(float MaxPower)
{
m_fMaxPower=MaxPower;
}
//返回最大發射功率
float CSector::GetMaxPower()
{
return m_fMaxPower;
}
//設置實際發射功率
void CSector::SetTxPower(float TxPower)
{
m_fTxPower=TxPower;
}
//返回實際發射功率
float CSector::GetTxPower()
{
return m_fTxPower;
}
//返回導頻功率
float CSector::GetPilotPower()
{
return m_fPilotPower;
}
//返回公共信道功率
float CSector::GetCommonPower()
{
return m_fCommonPower;
}
//設置分組數據信道的最大功率
void CSector::SetMaxPacketPower(float MPPower)
{
m_fMaxPacketPower=MPPower;
}
//返回實際的話音業務總功率
float CSector::GetTotalVoicePower()
{
return m_fTotalVoicePower;
}
//設置實際的分組數據信道功率
void CSector::SetPacketPower(float PPower)
{
m_fPacketPower=PPower;
}
//返回實際的分組數據信道功率
float CSector::GetPacketPower()
{
return m_fPacketPower;
}
//設置當前時隙是否正在傳送分組
void CSector::SetIsTransmiting(bool IsTrans)
{
m_bIsTransmiting=IsTrans;
}
//返回當前時隙是否正在傳送分組
bool CSector::IsTransmiting()
{
return m_bIsTransmiting;
}
//設置當前分組數據用戶的指針
void CSector::SetCurrentDataMs(CDataMs* DataMs)
{
m_pCurrentDataMs=DataMs;
}
//返回當前分組數據用戶的指針
CDataMs* CSector::GetCurrentDataMs()
{
return m_pCurrentDataMs;
}
//設置當前的最佳用戶的優先級指標
void CSector::SetPriorityFactor(float PFactor)
{
m_fPriorityFactor=PFactor;
}
//返回當前的最佳用戶的優先級指標
float CSector::GetPriorityFactor()
{
return m_fPriorityFactor;
}
/////////////////////////////// wyf新增成員變量接口函數 //////////////////////////
//設置是否存在最高優先權分組用戶
void CSector::SetIsExistHighestPriority(bool flag)
{
m_bIsExistHighestPriority=flag;
}
//返回是否存在最高優先權分組用戶
bool CSector::IsExistHighestPriority()
{
return m_bIsExistHighestPriority;
}
///////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////// oyh新增成員變量接口函數 //////////////////////////
//設置本扇區到目前為止成功傳輸bit數
void CSector::SetGoodBitNum(long Num)
{
m_lGoodBitNum=Num;
}
//返回本扇區到目前為止成功傳輸bit數
long CSector::GetGoodBitNum()
{
return m_lGoodBitNum;
}
///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////// zdy新增成員變量接口函數 //////////////////////////
void CSector::SetTotalPacketDelay(float fDelay)
//設置本扇區所傳分組的總的時延
{
m_fTotalPacketDelay=fDelay;
}
float CSector::GetTotalPacketDelay()
//返回本扇區所傳分組的總的時延
{
return m_fTotalPacketDelay;
}
void CSector::SetTotalSuccessfulPacketNum(int iNum)
//設置本扇區成功傳輸的分組數目
{
m_iTotalSuccessfulPacketNum=iNum;
}
int CSector::GetTotalSuccessfulPacketNum()
//返回本扇區成功傳輸的分組數目
{
return m_iTotalSuccessfulPacketNum;
}
//wgt
void CSector::SetTxPower1(float temppower)
{
m_fTxPower1=temppower;
}
float CSector::GetTxPower1()
{
return m_fTxPower1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -