2019-12-15 19:20:27 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2020-01-10 04:27:59 +00:00
|
|
|
|
using ReactiveUI.Fody.Helpers;
|
2019-12-15 19:20:27 +00:00
|
|
|
|
using Wabbajack.Common;
|
2020-01-10 04:27:59 +00:00
|
|
|
|
using Wabbajack.Lib;
|
2019-12-15 19:20:27 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack
|
|
|
|
|
{
|
2020-01-10 04:27:59 +00:00
|
|
|
|
public class CPUDisplayVM : ViewModel
|
2019-12-15 19:20:27 +00:00
|
|
|
|
{
|
2020-01-10 04:27:59 +00:00
|
|
|
|
[Reactive]
|
|
|
|
|
public int ID { get; set; }
|
|
|
|
|
[Reactive]
|
2019-12-15 19:20:27 +00:00
|
|
|
|
public DateTime StartTime { get; set; }
|
2020-01-10 04:27:59 +00:00
|
|
|
|
[Reactive]
|
|
|
|
|
public bool IsWorking { get; set; }
|
|
|
|
|
[Reactive]
|
|
|
|
|
public string Msg { get; set; }
|
|
|
|
|
[Reactive]
|
2020-02-08 04:35:08 +00:00
|
|
|
|
public Percent ProgressPercent { get; set; }
|
2020-01-10 04:27:59 +00:00
|
|
|
|
|
|
|
|
|
public CPUDisplayVM()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CPUDisplayVM(CPUStatus cpu)
|
|
|
|
|
{
|
|
|
|
|
AbsorbStatus(cpu);
|
|
|
|
|
}
|
2019-12-15 19:20:27 +00:00
|
|
|
|
|
|
|
|
|
public void AbsorbStatus(CPUStatus cpu)
|
|
|
|
|
{
|
2020-01-10 04:27:59 +00:00
|
|
|
|
bool starting = cpu.IsWorking && !IsWorking;
|
2019-12-15 19:20:27 +00:00
|
|
|
|
if (starting)
|
|
|
|
|
{
|
|
|
|
|
StartTime = DateTime.Now;
|
|
|
|
|
}
|
2020-01-10 04:27:59 +00:00
|
|
|
|
|
|
|
|
|
ID = cpu.ID;
|
|
|
|
|
Msg = cpu.Msg;
|
|
|
|
|
ProgressPercent = cpu.ProgressPercent;
|
|
|
|
|
IsWorking = cpu.IsWorking;
|
2019-12-15 19:20:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|