Skip to content

Commit d41be43

Browse files
committed
Added single include info to timeline tooltips
1 parent 2ef052e commit d41be43

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

CompileScore/Shared/Timeline/TimelineNodeTooltip.xaml.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,33 @@ public TimelineNodeTooltip()
2323
InitializeComponent();
2424
}
2525

26+
private string GetThisIncludeDetailsText(TimelineNode node)
27+
{
28+
if ( node.Category == CompilerData.CompileCategory.Include && node.Value is CompileValue && node.Parent != null &&
29+
node.Parent.Category == CompilerData.CompileCategory.Include && node.Parent.Value is CompileValue)
30+
{
31+
CompileValue includeeValue = (node.Value as CompileValue);
32+
CompileValue includerValue = (node.Parent.Value as CompileValue);
33+
34+
int includeeIndex = CompilerData.Instance.GetIndexOf(CompilerData.CompileCategory.Include, includeeValue);
35+
int includerIndex = CompilerData.Instance.GetIndexOf(CompilerData.CompileCategory.Include, includerValue);
36+
37+
IncludersInclValue inclValue = CompilerIncluders.Instance.GetIncludeInclValue(includerIndex,includeeIndex);
38+
39+
if (inclValue != null)
40+
{
41+
return includerValue.Name + " => " + includeeValue.Name + ":\n-"
42+
+ " Max: " + Common.UIConverters.GetTimeStr(inclValue.Max)
43+
+ " Avg: " + Common.UIConverters.GetTimeStr(inclValue.Average)
44+
+ " Acc: " + Common.UIConverters.GetTimeStr(inclValue.Accumulated)
45+
+ " Units: " + inclValue.Count;
46+
}
47+
48+
}
49+
50+
return null;
51+
}
52+
2653
private void OnNode()
2754
{
2855
if (node != null)
@@ -52,7 +79,15 @@ private void OnNode()
5279
+" (Self: " + Common.UIConverters.GetTimeStr(val.SelfMax) + ")"
5380
+" Min: " + Common.UIConverters.GetTimeStr(val.Min)
5481
+" Avg: " + Common.UIConverters.GetTimeStr(val.Average)
82+
+" Acc: " + Common.UIConverters.GetTimeStr(val.Accumulated)
83+
+" (Self: " + Common.UIConverters.GetTimeStr(val.SelfAccumulated) + ")"
5584
+" Units: " + val.Count;
85+
86+
string thisDetailsTxt = GetThisIncludeDetailsText(node);
87+
if (thisDetailsTxt != null)
88+
{
89+
detailsText.Text = thisDetailsTxt + "\nGlobal:\n- " + detailsText.Text;
90+
}
5691
}
5792
else if (node.Value is UnitValue)
5893
{

0 commit comments

Comments
 (0)