aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml
blob: 017c346251da196a8109b3d1f7ec00138e87505d (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<Window x:Class="Tango.PPC.Publisher.UI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:common="clr-namespace:Tango.PPC.Common;assembly=Tango.PPC.Common"
        xmlns:examiner="clr-namespace:Tango.SQLExaminer;assembly=Tango.SQLExaminer"
        xmlns:web="clr-namespace:Tango.Web;assembly=Tango.Web"
        xmlns:local="clr-namespace:Tango.PPC.Publisher.UI"
        mc:Ignorable="d"
        Title="Tango PPC Publisher" Height="2000" Width="500" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}">

    <Window.Resources>
        <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
    </Window.Resources>

    <Window.Style>
        <Style TargetType="Window">
            <Setter Property="Cursor" Value="Arrow"></Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsBusy}" Value="True">
                    <Setter Property="Cursor" Value="Wait"></Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Window.Style>

    <Grid IsEnabled="{Binding IsFree}">
        <DockPanel Margin="10">
            <TextBlock DockPanel.Dock="Top" FontSize="22">Tango Publish Utility</TextBlock>
            <Grid DockPanel.Dock="Bottom" Margin="0 20 0 0">
                <StackPanel>
                    <StackPanel VerticalAlignment="Bottom">
                        <TextBlock Text="{Binding PublishArgs.Message}" Foreground="Gray"></TextBlock>
                        <ProgressBar Height="15" Margin="0 5 0 10" Maximum="{Binding PublishArgs.Total}" Value="{Binding PublishArgs.Progress}"></ProgressBar>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Height="40">
                        <Button Width="150" Command="{Binding CreateTupCommand}">CREATE TUP FILE</Button>
                        <Button Width="150" Command="{Binding PublishCommand}">PUBLISH</Button>
                    </StackPanel>
                </StackPanel>
            </Grid>

            <Grid>
                <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="0 0 10 0">
                    <StackPanel>

                        <DockPanel Margin="0 40 0 0">
                            <TextBlock VerticalAlignment="Center" Width="136" DockPanel.Dock="Left">Deployment Slot:</TextBlock>
                            <ComboBox x:Name="combo" ItemsSource="{Binding Source={x:Type web:DeploymentSlot},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding Options.Environment}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" Margin="5 0 0 0" />
                        </DockPanel>

                        <DockPanel Margin="0 20 0 0">
                            <TextBlock VerticalAlignment="Center" Width="136" DockPanel.Dock="Left">Build Configuration:</TextBlock>
                            <ComboBox Margin="20 0 0 0" SelectedItem="{Binding Options.BuildConfig}" SelectedIndex="0">
                                <sys:String>Release</sys:String>
                                <sys:String>Debug</sys:String>
                            </ComboBox>
                        </DockPanel>

                        <DockPanel Margin="0 20 0 0">
                            <TextBlock VerticalAlignment="Center" DockPanel.Dock="Left">Selected machine version:</TextBlock>
                            <ComboBox Margin="20 0 0 0" ItemsSource="{Binding MachineVersions}" SelectedItem="{Binding SelectedMachineVersion}" DisplayMemberPath="Name" />
                        </DockPanel>

                        <TextBlock Margin="0 20 0 0">
                        <TextBlock>
                            <Run>Remote Versions:</Run>
                            <Run Text="{Binding RemoteVersion}"></Run>,
                            <Run Text="{Binding RemoteFirmwareVersion}"></Run>
                        </TextBlock>
                    </TextBlock>

                        <TextBlock Margin="0 20 0 0">
                        <TextBlock>
                            <Run>Local Versions:</Run>
                            <Run Text="{Binding LocalVersion}"></Run>,
                            <Run Text="{Binding LocalFirmwareVersion}"></Run>
                        </TextBlock>
                    </TextBlock>

                        <TextBlock Margin="0 20 0 0">Examiner Provision Sequence Items</TextBlock>

                        <DataGrid Height="170" SelectionMode="Single" SelectionUnit="FullRow" HorizontalScrollBarVisibility="Disabled" AutoGenerateColumns="False" ItemsSource="{Binding ProvisionSequenceItemsView}" CanUserAddRows="True" CanUserReorderColumns="False" CanUserDeleteRows="True" CanUserSortColumns="False" AddingNewItem="DataGrid_AddingNewItem">
                            <DataGrid.Columns>
                                <DataGridTextColumn IsReadOnly="True" Width="100" Header="File Name" Binding="{Binding FileName}" />
                                <DataGridComboBoxColumn Width="75" Header="Type" ItemsSource="{Binding Source={x:Type examiner:ExaminerSequenceItemType},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValueBinding="{Binding Type}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" />
                                <DataGridComboBoxColumn Width="90" Header="Direction" ItemsSource="{Binding Source={x:Type examiner:ExaminerSequenceItemDirection},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValueBinding="{Binding Direction}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" />
                                <DataGridCheckBoxColumn Width="35" Header="S/N" Binding="{Binding RequiresSerialNumber}" />
                                <DataGridTextColumn Header="Name" Width="1*" Binding="{Binding Name}" />
                                <DataGridTextColumn Header="Index" Width="40" Binding="{Binding Index}" />
                            </DataGrid.Columns>
                        </DataGrid>

                        <TextBlock Margin="0 20 0 0">Examiner Update Sequence Items</TextBlock>

                        <DataGrid Height="170" SelectionMode="Single" SelectionUnit="FullRow" HorizontalScrollBarVisibility="Disabled" AutoGenerateColumns="False" ItemsSource="{Binding UpdateSequenceItemsView}" CanUserAddRows="True" CanUserReorderColumns="False" CanUserDeleteRows="True" CanUserSortColumns="False" AddingNewItem="DataGrid_AddingNewItem_1">
                            <DataGrid.Columns>
                                <DataGridTextColumn IsReadOnly="True" Width="100" Header="File Name" Binding="{Binding FileName}" />
                                <DataGridComboBoxColumn Width="75" Header="Type" ItemsSource="{Binding Source={x:Type examiner:ExaminerSequenceItemType},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValueBinding="{Binding Type}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" />
                                <DataGridComboBoxColumn Width="90" Header="Direction" ItemsSource="{Binding Source={x:Type examiner:ExaminerSequenceItemDirection},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValueBinding="{Binding Direction}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" />
                                <DataGridCheckBoxColumn Width="35" Header="S/N" Binding="{Binding RequiresSerialNumber}" />
                                <DataGridTextColumn Header="Name" Width="1*" Binding="{Binding Name}" />
                                <DataGridTextColumn Header="Index" Width="40" Binding="{Binding Index}" />
                            </DataGrid.Columns>
                        </DataGrid>

                        <TextBlock Margin="0 20 0 0">Firmware Upgrade Package</TextBlock>
                        <DockPanel Margin="0 5 0 0">
                            <Button DockPanel.Dock="Right" Margin="10 0 0 0" Command="{Binding FirmwareUpgradePackageBrowseCommand}">BROWSE</Button>
                            <TextBox IsReadOnly="True" Text="{Binding Options.TfpPath}"></TextBox>
                        </DockPanel>

                        <StackPanel Margin="0 20 0 0">
                            <TextBlock>Installer Project</TextBlock>
                            <TextBox Margin="0 5 0 0" Text="{Binding Options.InstallerProject,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                            <TextBlock Margin="0 10 0 0">Installer Output Folder</TextBlock>
                            <TextBox Margin="0 5 0 0" Text="{Binding Options.InstallerOutputFolder,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                        </StackPanel>

                        <StackPanel Margin="0 20 0 0">

                            <TextBlock>Comments</TextBlock>
                            <TextBox Margin="0 5 0 0" Text="{Binding Options.Comments}" Height="50" AcceptsReturn="True" TextWrapping="Wrap"></TextBox>

                            <TextBlock>Email</TextBlock>
                            <TextBox Margin="0 5 0 0" Text="{Binding Options.Email}"></TextBox>

                            <TextBlock Margin="0 10 0 0">Password</TextBlock>
                            <TextBox Margin="0 5 0 0" Text="{Binding Options.Password}"></TextBox>
                        </StackPanel>

                        <StackPanel Margin="0 20 0 0">
                            <CheckBox x:Name="chkCreateTag" IsChecked="{Binding Options.CreateTag}">Create Tag On Repository</CheckBox>
                            <TextBlock Margin="0 10 0 0">Personal Access Token</TextBlock>
                            <TextBox  IsEnabled="{Binding ElementName=chkCreateTag,Path=IsChecked}" Margin="0 5 0 0" Text="{Binding Options.PersonalAccessToken}"></TextBox>
                        </StackPanel>
                    </StackPanel>
                </ScrollViewer>
            </Grid>
        </DockPanel>
    </Grid>
</Window>
lass="o">= value; RaisePropertyChangedAuto(); } } /// <summary> /// Gets or sets the db adapter. /// </summary> [XmlIgnore] public ObservablesStaticCollections Adapter { get; set; } private String _id; /// <summary> /// Unique Item ID. /// </summary> public String ID { get { return _id; } set { _id = value; RaisePropertyChanged(nameof(ID)); } } private String _name; /// <summary> /// item Name. /// </summary> [XmlIgnore] public String Name { get { return _name; } set { _name = value; RaisePropertyChanged(nameof(Name)); } } private double _left; /// <summary> /// Item Left. /// </summary> public double Left { get { return _left; } set { _left = value; RaisePropertyChanged(nameof(Left)); } } private double _top; /// <summary> /// Item Top. /// </summary> public double Top { get { return _top; } set { _top = value; RaisePropertyChanged(nameof(Top)); } } private double _width; /// <summary> /// Item Width. /// </summary> public double Width { get { return _width; } set { _width = value; RaisePropertyChanged(nameof(Width)); } } private double _height; /// <summary> /// Item Height. /// </summary> public double Height { get { return _height; } set { _height = value; RaisePropertyChanged(nameof(Height)); } } private double _angle; /// <summary> /// Item Angle. /// </summary> public double Angle { get { return _angle; } set { _angle = value; RaisePropertyChanged(nameof(Angle)); } } private String _techName; /// <summary> /// Gets or sets the tech item name. /// </summary> [XmlIgnore] public String TechName { get { return _techName; } set { _techName = value; RaisePropertyChangedAuto(); } } /// <summary> /// Gets or sets the db tech item guid. /// </summary> public String ItemGuid { get; set; } private Color _color; /// <summary> /// Gets or sets the item color. /// </summary> [XmlIgnore] public Color Color { get { return _color; } set { _color = value; RaisePropertyChanged(nameof(Color)); _colorNumber = ColorHelper.ColorToInteger(value); } } private int _colorNumber; /// <summary> /// Gets or sets the color number (for XML serialization). /// </summary> public int ColorNumber { get { return _colorNumber; } set { _colorNumber = value; _color = ColorHelper.IntegerToColor(value); _color.A = 255; RaisePropertyChanged(nameof(Color)); } } /// <summary> /// Clones this instance. /// </summary> /// <returns></returns> public virtual TechItem Clone() { TechItem cloned = Activator.CreateInstance(this.GetType()) as TechItem; cloned.Left = Left; cloned.Top = Top; cloned.Width = Width; cloned.Height = Height; cloned.Angle = Angle; cloned.Color = Color; return cloned; } /// <summary> /// Gets the available tech items. /// </summary> /// <returns></returns> public static List<TechItem> GetAvailableTechItems() { List<TechItem> items = new List<TechItem>(); foreach (var type in typeof(TechItem).Assembly.GetTypes().Where(x => typeof(TechItem).IsAssignableFrom(x) && !x.IsAbstract).OrderBy(x => x.GetCustomAttribute<TechItemAttribute>().Index)) { items.Add(Activator.CreateInstance(type) as TechItem); } return items; } /// <summary> /// Sets the bounds. /// </summary> /// <param name="bounds">The bounds.</param> public void SetBounds(Rect bounds) { Left = bounds.Left; Top = bounds.Top; Width = bounds.Width; Height = bounds.Height; } /// <summary> /// Gets the bounds. /// </summary> /// <returns></returns> public Rect GetBounds() { return new Rect(Left, Top, Width, Height); } } }