aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StatsModel.cs
blob: 773bea60b3b8d10d31c667d6613afd5544efa271 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using LiveCharts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Enumerations;
using Tango.Core;

namespace Tango.FSE.Statistics.Models
{
    public class StatsModel : ExtendedObject
    {
        public int TotalRuns { get; set; }
        public int TotalDyeingLength { get; set; }
        public int AverageDyeingLength { get; set; }
        public TimeSpan TotalDyeingTime { get; set; }
        public TimeSpan AverageDyeingTime { get; set; }
        public Func<ChartPoint, string> StatusCounts { get; set; } = (point) => { return point.Y.ToString(); };
        public Func<ChartPoint, string> QuantityCounts { get; set; } = (point) => { return (Convert.ToUInt64(point.Y) / 1000000000d).ToString("0.00"); };
        public double CompletedRuns { get; set; }
        public double FailedRuns { get; set; }
        public double AbortedRuns { get; set; }

        private List<LiquidQuantityModel> _liquidQuantities;
        public List<LiquidQuantityModel> LiquidQuantities
        {
            get { return _liquidQuantities; }
            set { _liquidQuantities = value; RaisePropertyChangedAuto(); }
        }

        public StatsModel()
        {
            LiquidQuantities = new List<LiquidQuantityModel>()
            {
                new LiquidQuantityModel() { LiquidType = LiquidTypes.Cyan, Quantity = 1 },
                new LiquidQuantityModel() { LiquidType = LiquidTypes.Magenta, Quantity = 1 },
                new LiquidQuantityModel() { LiquidType = LiquidTypes.Yellow, Quantity = 1 },
                new LiquidQuantityModel() { LiquidType = LiquidTypes.Black, Quantity = 1 },
                new LiquidQuantityModel() { LiquidType = LiquidTypes.LightCyan, Quantity = 1 },
                new LiquidQuantityModel() { LiquidType = LiquidTypes.LightMagenta, Quantity = 1 },
                new LiquidQuantityModel() { LiquidType = LiquidTypes.LightYellow, Quantity = 1 },
                new LiquidQuantityModel() { LiquidType = LiquidTypes.TransparentInk, Quantity = 1 },
                new LiquidQuantityModel() { LiquidType = LiquidTypes.Lubricant, Quantity = 1 },
            };

            FailedRuns = 1;
            CompletedRuns = 1;
            AbortedRuns = 1;
        }
    }
}