当前位置: 首页>>代码示例>>C++>>正文


C++ TimeRange::GetStartTime方法代码示例

本文整理汇总了C++中TimeRange::GetStartTime方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeRange::GetStartTime方法的具体用法?C++ TimeRange::GetStartTime怎么用?C++ TimeRange::GetStartTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimeRange的用法示例。


在下文中一共展示了TimeRange::GetStartTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PushBackExitEnrouteQCapacity

bool EnrouteQueueCapacityInSim::PushBackExitEnrouteQCapacity( const ElapsedTime& eTime, AirsideFlightInSim* pFlight )
{
	TaxiRouteInSim* pTaxiRoute = pFlight->GetAndAssignOutBoundRoute();
	if (pTaxiRoute == NULL)
		return true;

	
	pTaxiRoute->InitRoute(pFlight,eTime);
	FlightHoldListInTaxiRoute& taxiRouteList = pTaxiRoute->GetHoldList();

	CString strTime = eTime.printTime();

	for (int i = 0; i < taxiRouteList.GetCount(); i++)
	{
		const HoldInTaxiRoute& theHold = taxiRouteList.ItemAt(i);
		if (theHold.m_pNode->GetNodeInput().GetRunwayIntersectItemList().size() == 0)
			continue;
		
		RunwayIntersectItem* pRwItem = theHold.m_pNode->GetNodeInput().GetRunwayIntersectItemList()[0];
		int nRwID = pRwItem->GetObjectID();
		RunwayInSim* pRunway = pFlight->GetAirTrafficController()->GetAirsideResourceManager()->GetAirportResource()->getRunwayResource()->GetRunwayByID(nRwID);
		HoldPositionInSim* pCrossHold = pRunway->GetHoldPosition( theHold.m_nHoldId );
		if (pCrossHold == NULL)
			continue;
			
		size_t nCount = m_pEnrouteQueueCapacity->GetElementCount();

		for (size_t i = 0; i < nCount; i++)
		{
			AirsideEnrouteQCapacityTimeRange* pQCapacityTimeRange = m_pEnrouteQueueCapacity->GetItem(i);

			TimeRange* pTimeRange = pQCapacityTimeRange->getTimeRange();
			if (eTime < pTimeRange->GetStartTime() || eTime > pTimeRange->GetEndTime())
				continue;

			size_t iEnrouteCount = pQCapacityTimeRange->getEnrouteQCapacity()->GetElementCount();

			for (size_t j = 0; j < iEnrouteCount; j++)
			{
				AirsideEnrouteQCapacityItem* pCapacityItem = pQCapacityTimeRange->getEnrouteQCapacity()->GetItem(j);

				int nExitID = pCapacityItem->getTakeOffPosition()->GetID();
				if(nExitID < 0)
					continue;

				LogicRunwayInSim* pRwyPort = m_pAirportres->getRunwayResource()->GetLogicRunway(pCapacityItem->getTakeOffPosition()->GetRunwayID(),pCapacityItem->getTakeOffPosition()->GetRunwayMark());
				if(!pRwyPort)
					continue;
				RunwayExitInSim* pRwyExit = pRwyPort->GetExitByID(nExitID); 
				if(!pRwyExit)
					continue;

				HoldPositionInSim* pHold = pRwyExit->getHoldPosition();
				if(!pHold)
					continue;

				if (pCrossHold != pHold)
					continue;
				
				if(!pHold->IsFlightInQueue(pFlight))
				{
					double dQueueLength = pHold->GetTakeoffQueueLength();
					double dMaxQueue = pCapacityItem->getMaxLength() * 100;
					if (dQueueLength > dMaxQueue )
					{
						pHold->AddEnrouteWaitList(pFlight);
						return false;
					}
				}
			}
		}
	}
	
	
	return true;
}
开发者ID:chenbk85,项目名称:tphProjects,代码行数:76,代码来源:EnrouteQueueCapacityInSim.cpp


注:本文中的TimeRange::GetStartTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。