Пример #1
0
void CTrackContrl::SameSizeCtr()
{
	if(m_selectRectTracker.GetSize()<=1)
	{
		return;
	}
	int *coorWidth = new int[m_selectRectTracker.GetSize()];
	int *coorHeight = new int[m_selectRectTracker.GetSize()];

	int nFirstHeight = m_selectRectTracker[0]->m_rect.Height();//第一个控件的高
	int nFirstWidth = m_selectRectTracker[0]->m_rect.Width();//宽

	for(int i=0;i<m_selectRectTracker.GetSize();i++)
	{
		coorHeight[i] = m_selectRectTracker[i]->m_rect.Height();
		coorWidth[i] = m_selectRectTracker[i]->m_rect.Width();
	}

	int mostWidth = FindRate(coorWidth,m_selectRectTracker.GetSize());//找出出现次数最多的坐标
	int mostHeight = FindRate(coorHeight,m_selectRectTracker.GetSize());

	delete [] coorWidth;
	delete [] coorHeight;

	if(mostWidth == 0 || mostHeight == 0)
	{
		AlterRectSameSize(nFirstWidth,nFirstHeight);
	}
	else
	{
		AlterRectSameSize(mostWidth,mostHeight);
	}
}
void
MinstrelWifiManager::DoReportDataOk (WifiRemoteStation *st,
                                     double ackSnr, WifiMode ackMode, double dataSnr)
{
  MinstrelWifiRemoteStation *station = (MinstrelWifiRemoteStation *) st;

  station->m_isSampling = false;
  station->m_sampleRateSlower = false;

  CheckInit (station);
  if (!station->m_initialized)
    {
      return;
    }

  m_minstrelTable[station->m_txrate].numRateSuccess++;
  m_minstrelTable[station->m_txrate].numRateAttempt++;

  UpdateRetry (station);

  m_minstrelTable[station->m_txrate].numRateAttempt += station->m_retry;
  station->m_packetCount++;

  if (m_nsupported >= 1)
    {
      station->m_txrate = FindRate (station);
    }
}
Пример #3
0
void CTrackContrl::AlignBottomCtr()
{
	if(m_selectRectTracker.GetSize()<=1)
	{
		return;
	}
	int *coor = new int[m_selectRectTracker.GetSize()];

	int maxBottomCoor = m_selectRectTracker[0]->m_rect.bottom;//第一个控件的底
	for(int i=0;i<m_selectRectTracker.GetSize();i++)
	{
		maxBottomCoor = maxBottomCoor < m_selectRectTracker[i]->m_rect.bottom ? 
			m_selectRectTracker[i]->m_rect.bottom : maxBottomCoor;

		coor[i] = m_selectRectTracker[i]->m_rect.bottom;		
	}

	int most = FindRate(coor,m_selectRectTracker.GetSize());//找出出现次数最多的坐标

	delete [] coor;

	if(most==0)
	{
		AlterRectBottom(maxBottomCoor);
	}
	else
	{
		AlterRectBottom(most);
	}
}
Пример #4
0
void CTrackContrl::AlignTopCtr()
{
	if(m_selectRectTracker.GetSize()<=1)
	{
		return;
	}
	int *coor = new int[m_selectRectTracker.GetSize()];

	int minTopCoor = m_selectRectTracker[0]->m_rect.top;//第一个控件的顶
	for(int i=0;i<m_selectRectTracker.GetSize();i++)
	{
		
		minTopCoor = minTopCoor > m_selectRectTracker[i]->m_rect.top ? 
			m_selectRectTracker[i]->m_rect.top : minTopCoor; 
		coor[i] = m_selectRectTracker[i]->m_rect.top;
	}

	int most = FindRate(coor,m_selectRectTracker.GetSize());//找出出现次数最多的坐标

	delete [] coor;

	if(most==0)
	{
		AlterRectTop(minTopCoor);
	}
	else
	{
		AlterRectTop(most);
	}
}
Пример #5
0
void CTrackContrl::SameHeightCtr()
{
	if(m_selectRectTracker.GetSize()<=1)
	{
		return;
	}
	int *coor = new int[m_selectRectTracker.GetSize()];

	int nFirstHeight = m_selectRectTracker[0]->m_rect.Height();//第一个控件的高
	for(int i=0;i<m_selectRectTracker.GetSize();i++)
	{
		coor[i] = m_selectRectTracker[i]->m_rect.Height();		
	}

	int most = FindRate(coor,m_selectRectTracker.GetSize());//找出出现次数最多的坐标

	delete [] coor;

	if(most==0)
	{
		AlterRectHeight(nFirstHeight);
	}
	else
	{
		AlterRectHeight(most);
	}
}
Пример #6
0
void CTrackContrl::AlignRightCtr()
{
	if(m_selectRectTracker.GetSize()<=1)
	{
		return;
	}
	int *coor = new int[m_selectRectTracker.GetSize()];

	int maxRightCoor = m_selectRectTracker[0]->m_rect.right;//右坐标
	for(int i=0;i<m_selectRectTracker.GetSize();i++)
	{
		maxRightCoor = maxRightCoor < m_selectRectTracker[i]->m_rect.right ? 
			m_selectRectTracker[i]->m_rect.right : maxRightCoor; 
		coor[i] = m_selectRectTracker[i]->m_rect.right;		
	}

	int most = FindRate(coor,m_selectRectTracker.GetSize());//找出出现次数最多的坐标

	delete [] coor;

	if(most==0)
	{
		AlterRectRight(maxRightCoor);
	}
	else
	{
		AlterRectRight(most);
	}
}
Пример #7
0
void CTrackContrl::AlignLeftCtr()
{
	if(m_selectRectTracker.GetSize()<=1)
	{
		return;
	}

	int *coor = new int[m_selectRectTracker.GetSize()];

	int minLeftCoor = m_selectRectTracker[0]->m_rect.left;//左坐标

	for(int i=0;i<m_selectRectTracker.GetSize();i++)
	{
		minLeftCoor = minLeftCoor > m_selectRectTracker[i]->m_rect.left ? 
			m_selectRectTracker[i]->m_rect.left : minLeftCoor; 
		coor[i] = m_selectRectTracker[i]->m_rect.left;		
	}

	int most = FindRate(coor,m_selectRectTracker.GetSize());//找出出现次数最多的坐标
	delete [] coor;
	
	if(most==0)
	{
		AlterRectLeft(minLeftCoor);
	}
	else
	{
		AlterRectLeft(most);
	}
}
void
MinstrelWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st)
{
  MinstrelWifiRemoteStation *station = (MinstrelWifiRemoteStation *) st;
  NS_LOG_DEBUG ("DoReportFinalDataFailed m_txrate=" << station->m_txrate);

  station->m_isSampling = false;
  station->m_sampleRateSlower = false;

  UpdateRetry (station);

  m_minstrelTable[station->m_txrate].numRateAttempt += station->m_retry;
  station->m_err++;

  if (m_nsupported >= 1)
    {
      station->m_txrate = FindRate (station);
    }
}