Skip to content

Commit

Permalink
delete accumulation of modulegroup which is not present anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcitectus committed Dec 12, 2015
1 parent 885991c commit 6565499
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sanderling/Sanderling.Exe/resource.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ResourceDictionary Source="pack://application:,,,/Sanderling.UI;component/resource.xaml"></ResourceDictionary>

<ResourceDictionary>
<system:String x:Key="AppVersionId">15.11.10</system:String>
<system:String x:Key="AppVersionId">15.11.11</system:String>

<BotEngine.UI.ViewModel:AppProperty
x:Key="AppProperty">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ public class MemoryMeasurementAccumulator : Accumulation.IMemoryMeasurement
{
Int64 EntityIdLast = 0;

int ModuleInvisibleDurationMax = 10000;

readonly List<ShipUiModule> InternShipUiModule = new List<ShipUiModule>();

public IEnumerable<Accumulation.IShipUiModule> ShipUiModule => InternShipUiModule;

public void Accumulate(FromProcessMeasurement<Parse.IMemoryMeasurement> MemoryMeasurementAtTime)
{
if (null == MemoryMeasurementAtTime)
return;

var MemoryMeasurement = MemoryMeasurementAtTime?.Value;

var ShipUi = MemoryMeasurement?.ShipUi;
Expand All @@ -31,6 +36,9 @@ public void Accumulate(FromProcessMeasurement<Parse.IMemoryMeasurement> MemoryMe
InternShipUiModule.Add(new ShipUiModule(++EntityIdLast, ModuleInstantNotAssigned));
}

InternShipUiModule?.Where(Module => !(MemoryMeasurementAtTime?.End - Module?.LastInstant?.End < ModuleInvisibleDurationMax))?.ToArray()
?.ForEach(Module => InternShipUiModule.Remove(Module));

if (MemoryMeasurement?.IsDocked ?? false)
{
InternShipUiModule?.Clear();
Expand Down

0 comments on commit 6565499

Please sign in to comment.