Compiler wired to show CPU status again

This commit is contained in:
Justin Swanson 2019-11-20 23:17:40 -06:00
parent 587395e98b
commit e77f933ce9

View File

@ -1,4 +1,6 @@
using Microsoft.WindowsAPICodePack.Dialogs;
using DynamicData;
using DynamicData.Binding;
using Microsoft.WindowsAPICodePack.Dialogs;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;
using System;
@ -101,6 +103,19 @@ namespace Wabbajack
.Select(compilation => compilation != null)
.ObserveOnGuiThread()
.ToProperty(this, nameof(this.Compiling));
// Compile progress updates and populate ObservableCollection
var subscription = this.WhenAny(x => x.Compiler.ActiveCompilation)
.SelectMany(c => c?.QueueStatus ?? Observable.Empty<CPUStatus>())
.ObserveOn(RxApp.TaskpoolScheduler)
.ToObservableChangeSet(x => x.ID)
.Batch(TimeSpan.FromMilliseconds(250), RxApp.TaskpoolScheduler)
.EnsureUniqueChanges()
.ObserveOn(RxApp.MainThreadScheduler)
.Sort(SortExpressionComparer<CPUStatus>.Ascending(s => s.ID), SortOptimisations.ComparesImmutableValuesOnly)
.Bind(this.MWVM.StatusList)
.Subscribe()
.DisposeWith(this.CompositeDisposable);
}
}
}