aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadViewVM.cs
blob: 896175400e61d455045a6e3cf8b9732480f9a1e8 (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
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.Core.DI;
using Tango.FSE.Common;
using Tango.FSE.Common.Build;
using Tango.FSE.Common.Connection;
using Tango.PPC.Shared.Statistics;

namespace Tango.FSE.UI.Dialogs
{
    public class JobUploadViewVM : FSEDialogViewVM
    {
        public class LiquidVolume
        {
            public LiquidType LiquidType { get; set; }
            public double Volume { get; set; }
        }

        private String _name;
        public String Name
        {
            get { return _name; }
            set { _name = value; InvalidateRelayCommands(); }
        }

        public List<ThreadFilterData> Rmls { get; set; }

        public ThreadFilterData SelectedRML { get; set; }

        public List<LiquidVolume> Volumes { get; set; }

        public int Length { get; set; }

        public JobUploadViewVM(IMachineProvider machineProvider)
        {
            Rmls = new List<ThreadFilterData>();

            Volumes = machineProvider.Machine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.LiquidType.PreferredIndex).Where(x => x.LiquidType.AvailableForStandardUser).Select(x => new LiquidVolume()
            {
                LiquidType = x.LiquidType
            }).ToList();

            OKText = "UPLOAD";
            CancelText = "CANCEL";
        }

        protected override bool CanOK()
        {
            return base.CanOK() && Name.IsNotNullOrEmpty();
        }
    }
}