void FScriptExecutionNode::UpdateHeatDisplayStats(FScriptExecutionHottestPathParams& HotPathParams)
{
	// Grab local perf data by tracepath.
	FTracePath& TracePath = HotPathParams.GetTracePath();
	TSharedPtr<FScriptPerfData> LocalPerfData = GetOrAddPerfDataByInstanceAndTracePath(HotPathParams.GetInstanceName(), TracePath);
	// Calculate hottest path value
	const float PathHeatLevel = HotPathParams.CalculateHeatLevel();
	LocalPerfData->SetHottestPathHeatLevel(PathHeatLevel);
	// Update the heat thresholds
	LocalPerfData->SetHeatLevels(HotPathParams.GetHeatThresholds());
	NodePerfData.SetHeatLevels(HotPathParams.GetHeatThresholds());
	// Update the time taken so far
	if (!IsEvent() && !HasFlags(EScriptExecutionNodeFlags::ExecPin))
	{
		HotPathParams.AddPathTiming(LocalPerfData->GetAverageTiming(), LocalPerfData->GetSampleCount());
	}
	// Update children and linked nodes
	if (!IsPureNode())
	{
		for (auto ChildIter : ChildNodes)
		{
			ChildIter->UpdateHeatDisplayStats(HotPathParams);
		}
		if (HasFlags(EScriptExecutionNodeFlags::ConditionalBranch))
		{
			for (auto LinkIter : LinkedNodes)
			{
				FScriptExecutionHottestPathParams LinkedHotPathParams(HotPathParams);
				if (!LinkIter.Value->HasFlags(EScriptExecutionNodeFlags::InvalidTrace))
				{
					LinkedHotPathParams.GetTracePath().AddExitPin(LinkIter.Key);
				}
				LinkIter.Value->UpdateHeatDisplayStats(LinkedHotPathParams);
			}
		}
		else
		{
			FTracePath RootTracePath(TracePath);
			for (auto LinkIter : LinkedNodes)
			{
				TracePath = RootTracePath;
				if (!LinkIter.Value->HasFlags(EScriptExecutionNodeFlags::InvalidTrace))
				{
					TracePath.AddExitPin(LinkIter.Key);
				}
				LinkIter.Value->UpdateHeatDisplayStats(HotPathParams);
			}
		}
	}
}
Exemple #2
0
void Time::AddDuration(TMinutes const duration)
{
  if (IsEvent())
  {
    m_event.AddDurationToOffset(duration);
  }
  else if (IsHoursMinutes())
  {
    m_hourMinutes.AddDuration(duration);
  }
  else
  {
    // Undefined behaviour.
  }
}
void TEventEntry::ToStr(TDes& aStr)
	{
	if (IsEvent())  							// Event or Action
		{
		aStr.Append(KLitEvent);
		}
	else
		{
		aStr.Append(KLitAction);
		}

	if (iSequenceNumber>=0)
		{
		aStr.AppendFormat(KLit02D, iSequenceNumber);		
		}

	aStr.Append(KLitColon);

	if (iType!=EActionUserWait)
		{
		aStr.AppendFormat(KLitA02D, iAlarmIdx);	// Alarm idx
		}
	
	aStr.AppendFormat(KLitS, &TypeToStr());	// Event name


	if (iType==EEventVisible)  			// Visibility
		{
		aStr.AppendFormat(KLitS, &BoolToStr(iVisible));
		}
	
	if (iType==EEventSetState) 			// State flags
		{
		aStr.AppendFormat(KLitFlags, iAltSFlags);
		}

	if (iType==EActionUserWait)
		{
		aStr.AppendFormat(KLitDSec, iPeriod);
		if (iAlarmIdx==KBogusAlarmIdx)  aStr.AppendFormat(KLitCompleted);
		}
		
	if (iType==EActionSnooze || iType==EActionPauseSound)
		{
		aStr.AppendFormat(KLitForDMinutes, iPeriod/60);
		}
	}
void handling_events()
{
	if (IsEvent(TIMEMODE))
		Btime=1;
	else
		Btime=0;

	if (IsEvent(TIMERMODE))
		Btimer=1;
	else
		Btimer=0;

	if (IsEvent(ALARMMODE))
		Balarm=1;
	else
		Balarm=0;

	if (IsEvent(SWATCHMODE))
		Bswatch=1;
	else
		Bswatch=0;

	if (IsEvent(PLUS))
		Bplus=1;
	else
		Bplus=0;

	if (IsEvent(MINUS))
		Bminus=1;
	else
		Bminus=0;

	if (IsEvent(START))
		Bstart=1;
	else
		Bstart=0;

	if (IsEvent(STOP))
		Bstop=1;
	else
		Bstop=0;
}
Exemple #5
0
Time::TMinutes Time::GetMinutes() const
{
  if (IsEvent())
    return GetEvent().GetEventTime().GetMinutes();
  return GetHourMinutes().GetMinutes();
}
const EScriptPerfDataType FScriptExecutionNode::GetPerfDataType() const
{
	return IsEvent() ? EScriptPerfDataType::Event : EScriptPerfDataType::Node;
}