aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs
blob: 9f99b147f3fd57c23b9f0b2f400c7504e06b1aa7 (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Enumerations;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Build;

namespace Tango.PPC.UI.Build
{
    public class DefaultBuildProvider : IBuildProvider
    {
        public BuildType BuildType { get; internal set; }

        public bool IsEureka
        {
            get { return BuildType == BuildType.Eureka; }
        }

        public bool IsX1
        {
            get { return BuildType == BuildType.Eureka && MachineType == MachineTypes.X1; }
        }

        public string BuildName => MachineType.ToDescription();

        public MachineTypes MachineType { get; private set; }

        public DefaultBuildProvider()
        {
            MachineType = MachineTypes.TS1800;

            if (App.StartupArgs != null && App.StartupArgs.Contains("eureka_build"))
            {
                BuildType = BuildType.Eureka;
            }
            else if (App.StartupArgs != null && App.StartupArgs.Contains("eureka_x1_build"))
            {
                BuildType = BuildType.Eureka;
                MachineType = MachineTypes.X1;
            }
#if Eureka
            BuildType = BuildType.Eureka;
            MachineType = MachineTypes.Eureka;
#endif

#if X1
            MachineType = MachineTypes.X1;
#endif
        }
    }
}