aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj8
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineUpdatesViewVM.cs60
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs29
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/TupViewVM.cs129
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml3
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml7
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdateDetailsDialog.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdatesView.xaml25
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/TupView.xaml60
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/TupView.xaml.cs28
10 files changed, 334 insertions, 21 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj
index 6225bd7ad..69cc75461 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj
@@ -93,6 +93,7 @@
<Compile Include="ViewModels\MachineUpdatesViewVM.cs" />
<Compile Include="ViewModels\MachineVersionDialogVM.cs" />
<Compile Include="ViewModels\MainViewVM.cs" />
+ <Compile Include="ViewModels\TupViewVM.cs" />
<Compile Include="Views\ColorCalibrationView.xaml.cs">
<DependentUpon>ColorCalibrationView.xaml</DependentUpon>
</Compile>
@@ -130,6 +131,9 @@
<Compile Include="Views\MachineUpdatesView.xaml.cs">
<DependentUpon>MachineUpdatesView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\TupView.xaml.cs">
+ <DependentUpon>TupView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\SpoolsView.xaml.cs">
<DependentUpon>SpoolsView.xaml</DependentUpon>
</Compile>
@@ -185,6 +189,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\TupView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\SpoolsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineUpdatesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineUpdatesViewVM.cs
index 7ff64c505..e1e9ee561 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineUpdatesViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineUpdatesViewVM.cs
@@ -8,6 +8,7 @@ using System.Windows.Data;
using Tango.BL;
using Tango.BL.Builders;
using Tango.BL.Entities;
+using Tango.Core.Commands;
using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.MachineDesigner.Views;
using Tango.SharedUI;
@@ -17,6 +18,8 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
public class MachineUpdatesViewVM : ViewModel
{
private INotificationProvider _notification;
+ private ObservablesContext _context;
+ private const int MAX_UPDATE_ITEMS = 100;
#region Properties
@@ -70,6 +73,19 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
set { _displayDatabaseUpdates = value; RaisePropertyChangedAuto(); OnFilterChanged(); }
}
+ private bool _displaySynchronizations;
+ public bool DisplaySynchronizations
+ {
+ get { return _displaySynchronizations; }
+ set { _displaySynchronizations = value; RaisePropertyChangedAuto(); OnFilterChanged(); }
+ }
+
+ #endregion
+
+ #region Commands
+
+ public RelayCommand RefreshCommand { get; set; }
+
#endregion
#region Constructors
@@ -79,6 +95,9 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
DisplayApplicationUpdates = true;
DisplayMachineSetups = true;
DisplayDatabaseUpdates = true;
+ DisplaySynchronizations = true;
+
+ RefreshCommand = new RelayCommand(Refresh, () => IsFree);
}
public MachineUpdatesViewVM(INotificationProvider notificationProvider) : this()
@@ -92,17 +111,36 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
public async Task Init(Machine machine, ObservablesContext context)
{
- Machine = machine;
- Updates = (await new TangoUpdatesCollectionBuilder(context).Set(x => x.MachineGuid == machine.Guid).BuildAsync()).OrderByDescending(x => x.StartDate).ToList();
- UpdatesView = CollectionViewSource.GetDefaultView(Updates);
- UpdatesView.Filter = UpdatesFilter;
- OnFilterChanged();
+ try
+ {
+ _context = context;
+ Machine = machine;
+ Updates = (await new TangoUpdatesCollectionBuilder(context).Set(x => x.MachineGuid == machine.Guid).Query(x => x.OrderByDescending(y => y.StartDate).Take(MAX_UPDATE_ITEMS)).BuildAsync()).ToList();
+ UpdatesView = CollectionViewSource.GetDefaultView(Updates);
+ UpdatesView.Filter = UpdatesFilter;
+ OnFilterChanged();
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error loading machine updates.");
+ _notification.ShowError($"An error occurred while loading the history of machine updates.\n{ex.FlattenMessage()}");
+ }
}
#endregion
#region Private Methods
+ private async void Refresh()
+ {
+ IsFree = false;
+ using (_notification.PushTaskItem("Refreshing machine updates..."))
+ {
+ await Init(Machine, _context);
+ }
+ IsFree = true;
+ }
+
private void OnFilterChanged()
{
if (UpdatesView != null)
@@ -119,6 +157,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
if (!DisplayMachineSetups && update.IsSetup) return false;
if (!DisplayApplicationUpdates && update.IsUpdate) return false;
if (!DisplayDatabaseUpdates && update.IsDataBase) return false;
+ if (!DisplaySynchronizations && update.IsSynchronization) return false;
return true;
}
else
@@ -129,12 +168,11 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
private void OnSelectedUpdateChanged()
{
- if (SelectedUpdate == null) return;
-
- var selectedUpdate = SelectedUpdate;
- SelectedUpdate = null;
-
- _notification.ShowModalDialog<MachineUpdateDetailsDialogVM, MachineUpdateDetailsDialog>(new MachineUpdateDetailsDialogVM() { Update = selectedUpdate }, (vm) => { }, () => { });
+ if (SelectedUpdate != null && SelectedUpdate.ApplicationVersion != "Fake")
+ {
+ _notification.ShowModalDialog<MachineUpdateDetailsDialogVM, MachineUpdateDetailsDialog>(new MachineUpdateDetailsDialogVM() { Update = SelectedUpdate }, (vm) => { }, () => { });
+ SelectedUpdate = new TangoUpdate() { ApplicationVersion = "Fake"};
+ }
}
#endregion
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs
index 820950290..fd31cd950 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs
@@ -115,6 +115,21 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
set { _selectedSpool = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
+ private Site _selectedSite;
+ public Site SelectedSite
+ {
+ get { return _selectedSite; }
+ set { _selectedSite = value; RaisePropertyChangedAuto(); }
+ }
+
+ private List<Site> _sites;
+ public List<Site> Sites
+ {
+ get { return _sites; }
+ set { _sites = value; RaisePropertyChangedAuto(); }
+ }
+
+
private ColorCalibrationViewVM _colorCalibrationViewVM;
public ColorCalibrationViewVM ColorCalibrationViewVM
{
@@ -140,6 +155,12 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
set { _machineUpdatesViewVM = value; RaisePropertyChangedAuto(); }
}
+ private TupViewVM _tupViewVM;
+ public TupViewVM TupViewVM
+ {
+ get { return _tupViewVM; }
+ set { _tupViewVM = value; RaisePropertyChangedAuto(); }
+ }
#endregion
@@ -233,6 +254,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
ResetDeviceRegistrationCommand = new RelayCommand(ResetDeviceRegistration);
MachineUpdatesViewVM = new MachineUpdatesViewVM(_notification);
+ TupViewVM = new TupViewVM(_notification);
}
#endregion
@@ -467,6 +489,10 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
}
}
+ Sites = await ActiveMachineAdapter.Context.Sites.ToListAsync();
+ Sites.Insert(0, new Site() { Name = "NONE", ID = -1 });
+ SelectedSite = Sites.SingleOrDefault(x => x.Guid == ActiveMachine.SiteGuid);
+
ColorCalibrationViewVM = new ColorCalibrationViewVM(_notification, ActiveMachine, _activeMachineAdapter.Context)
{
Rmls = ActiveMachineAdapter.Rmls,
@@ -478,7 +504,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
HardwareConfigurationViewVM.Init(ActiveMachine.Configuration);
await MachineUpdatesViewVM.Init(ActiveMachine, ActiveMachineAdapter.Context);
-
+ TupViewVM.Init(ActiveMachine);
ActiveMachine.Configuration.HardwareVersionChanged += Configuration_HardwareVersionChanged;
@@ -643,6 +669,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
ActiveMachine.ConfigurationGuid = ActiveMachine.Configuration.Guid;
ActiveMachine.LastUpdated = DateTime.UtcNow;
ActiveMachine.ProductionDate = DateTime.UtcNow;
+ ActiveMachine.SiteGuid = SelectedSite == null ? null : (SelectedSite.ID == -1 ? null : SelectedSite.Guid);
ColorCalibrationViewVM.Save();
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/TupViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/TupViewVM.cs
new file mode 100644
index 000000000..5d1703dc3
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/TupViewVM.cs
@@ -0,0 +1,129 @@
+using Microsoft.Win32;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL.Entities;
+using Tango.Core.Commands;
+using Tango.MachineStudio.Common.Notifications;
+using Tango.MachineStudio.Common.Tup;
+using Tango.SharedUI;
+
+namespace Tango.MachineStudio.MachineDesigner.ViewModels
+{
+ public class TupViewVM : ViewModel
+ {
+ private INotificationProvider _notification;
+
+ private String _latestVersion;
+ public String LatestVersion
+ {
+ get { return _latestVersion; }
+ set { _latestVersion = value; RaisePropertyChangedAuto(); }
+ }
+
+ private Machine _machine;
+ public Machine Machine
+ {
+ get { return _machine; }
+ set { _machine = value; RaisePropertyChangedAuto(); }
+ }
+
+ private String _filePath;
+ public String FilePath
+ {
+ get { return _filePath; }
+ set { _filePath = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
+ }
+
+ private TupFileBuilderProgressEventArgs _progress;
+ public TupFileBuilderProgressEventArgs Progress
+ {
+ get { return _progress; }
+ set { _progress = value; RaisePropertyChangedAuto(); }
+ }
+
+ public RelayCommand CreateTupFileCommand { get; set; }
+
+ public RelayCommand SelectFileCommand { get; set; }
+
+ public TupViewVM()
+ {
+
+ }
+
+ public TupViewVM(INotificationProvider notification) : this()
+ {
+ _notification = notification;
+ CreateTupFileCommand = new RelayCommand(CreateTupFile, () => FilePath != null && IsFree);
+ SelectFileCommand = new RelayCommand(SelectFile);
+ }
+
+ public void Init(Machine machine)
+ {
+ Machine = machine;
+ DisplayLatestPPCVersion();
+ }
+
+ private async void DisplayLatestPPCVersion()
+ {
+ TupFileBuilder builder = new TupFileBuilder();
+
+ try
+ {
+ LatestVersion = await builder.GetLatestPPCVersion(Machine.SerialNumber);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error retrieving latest PPC version.");
+ await Task.Delay(5000);
+ DisplayLatestPPCVersion();
+ }
+ }
+
+ private void SelectFile()
+ {
+ SaveFileDialog dlg = new SaveFileDialog();
+ dlg.Title = "Select package location";
+ dlg.Filter = "Tango Update Package Files|*.tup";
+ dlg.DefaultExt = ".tup";
+ dlg.FileName = LatestVersion == null ? $"{Machine.SerialNumber}_Update_{DateTime.Now.Date.ToFileName()}.tup" : $"{Machine.SerialNumber}_Update_{DateTime.Now.Date.ToFileName()}_v{LatestVersion}.tup";
+
+ if (dlg.ShowDialog().Value)
+ {
+ FilePath = dlg.FileName;
+ }
+ }
+
+ private async void CreateTupFile()
+ {
+ try
+ {
+ LogManager.Log($"Generating TUP file to '{FilePath}'...");
+
+ IsFree = false;
+ TupFileBuilder builder = new TupFileBuilder();
+ builder.Progress += Builder_Progress;
+ await builder.Build(Machine.SerialNumber, FilePath);
+
+ LogManager.Log("TUP file generated successfully.");
+ _notification.ShowInfo("Tango update package created successfuly.");
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error generating tup file.");
+ _notification.ShowError($"An error occurred while generating the .tup file.\n{ex.FlattenMessage()}");
+ }
+ finally
+ {
+ IsFree = true;
+ }
+ }
+
+ private void Builder_Progress(object sender, TupFileBuilderProgressEventArgs e)
+ {
+ Progress = e;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml
index 666a4ee4a..bcca83ca5 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml
@@ -64,6 +64,9 @@
<TabItem Header="UPDATES">
<local:MachineUpdatesView/>
</TabItem>
+ <TabItem Header="TUP">
+ <local:TupView/>
+ </TabItem>
</TabControl>
</Grid>
</DockPanel>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
index b6c1ba974..4631ac068 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
@@ -48,6 +48,9 @@
<TextBlock FontWeight="SemiBold">Organization</TextBlock>
<ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.Organizations}" SelectedItem="{Binding ActiveMachine.Organization}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox>
+ <TextBlock FontWeight="SemiBold">Site</TextBlock>
+ <ComboBox Background="Transparent" ItemsSource="{Binding Sites}" SelectedItem="{Binding SelectedSite}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox>
+
<TextBlock FontWeight="SemiBold">OS Key</TextBlock>
<TextBox Text="{Binding ActiveMachine.OsKey}"></TextBox>
@@ -59,8 +62,8 @@
<TextBlock FontWeight="SemiBold">Auto Login</TextBlock>
<ToggleButton HorizontalAlignment="Left" IsChecked="{Binding ActiveMachine.AutoLogin}"></ToggleButton>
- <TextBlock FontWeight="SemiBold">Auto Check For Updates</TextBlock>
- <ToggleButton HorizontalAlignment="Left" IsChecked="{Binding ActiveMachine.AutoCheckForUpdates}"></ToggleButton>
+ <!--<TextBlock FontWeight="SemiBold">Auto Check For Updates</TextBlock>
+ <ToggleButton HorizontalAlignment="Left" IsChecked="{Binding ActiveMachine.AutoCheckForUpdates}"></ToggleButton>-->
<TextBlock FontWeight="SemiBold">Setup Activation</TextBlock>
<ToggleButton HorizontalAlignment="Left" IsChecked="{Binding ActiveMachine.SetupActivation}"></ToggleButton>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdateDetailsDialog.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdateDetailsDialog.xaml
index 9d60d36f8..1e7b03fed 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdateDetailsDialog.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdateDetailsDialog.xaml
@@ -40,6 +40,12 @@
<DataTrigger Binding="{Binding IsDataBase}" Value="True">
<Setter Property="Kind" Value="Database"></Setter>
</DataTrigger>
+ <DataTrigger Binding="{Binding IsSynchronization}" Value="True">
+ <Setter Property="Kind" Value="Sync"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding IsOfflineUpdate}" Value="True">
+ <Setter Property="Kind" Value="Sd"></Setter>
+ </DataTrigger>
<DataTrigger Binding="{Binding IsStarted}" Value="True">
<Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter>
</DataTrigger>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdatesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdatesView.xaml
index d9ea2cb44..65a5a569f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdatesView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineUpdatesView.xaml
@@ -18,9 +18,9 @@
<converters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter" />
<converters:StringToOneLineConverter x:Key="StringToOneLineConverter" />
</UserControl.Resources>
-
+
<Grid Margin="20" DataContext="{Binding MachineUpdatesViewVM}">
- <DockPanel>
+ <DockPanel IsEnabled="{Binding IsFree}">
<Grid DockPanel.Dock="Bottom">
</Grid>
@@ -34,11 +34,16 @@
<local:MachineView Margin="30 80 0 0" DataContext="{Binding Machine}" IsHitTestVisible="False" VerticalAlignment="Top" Height="241" />
<DockPanel Grid.Column="1" Margin="50 100 50 50">
- <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Height="50">
- <CheckBox IsChecked="{Binding DisplayMachineSetups}">Machine Setups</CheckBox>
- <CheckBox IsChecked="{Binding DisplayApplicationUpdates}" Margin="30 0">Software Updates</CheckBox>
- <CheckBox IsChecked="{Binding DisplayDatabaseUpdates}">Database Updates</CheckBox>
- </StackPanel>
+ <Grid DockPanel.Dock="Bottom" Height="50">
+ <StackPanel Orientation="Horizontal">
+ <CheckBox IsChecked="{Binding DisplayMachineSetups}">Machine Setups</CheckBox>
+ <CheckBox IsChecked="{Binding DisplayApplicationUpdates}" Margin="30 0">Software Updates</CheckBox>
+ <CheckBox IsChecked="{Binding DisplayDatabaseUpdates}">Database Updates</CheckBox>
+ <CheckBox IsChecked="{Binding DisplaySynchronizations}" Margin="30 0 0 0">Synchronizations</CheckBox>
+ </StackPanel>
+
+ <Button Command="{Binding RefreshCommand}" HorizontalAlignment="Right" Width="150" Style="{StaticResource MaterialDesignFlatButton}">REFRESH</Button>
+ </Grid>
<Grid>
<DataGrid Margin="0 0 0 10" SelectionUnit="FullRow" BorderBrush="{StaticResource borderBrush }" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True" ItemsSource="{Binding Updates}" SelectedItem="{Binding SelectedUpdate}">
<DataGrid.CellStyle>
@@ -66,6 +71,12 @@
<DataTrigger Binding="{Binding IsDataBase}" Value="True">
<Setter Property="Kind" Value="Database"></Setter>
</DataTrigger>
+ <DataTrigger Binding="{Binding IsSynchronization}" Value="True">
+ <Setter Property="Kind" Value="Sync"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding IsOfflineUpdate}" Value="True">
+ <Setter Property="Kind" Value="Sd"></Setter>
+ </DataTrigger>
<DataTrigger Binding="{Binding IsStarted}" Value="True">
<Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter>
</DataTrigger>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/TupView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/TupView.xaml
new file mode 100644
index 000000000..895a26ca0
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/TupView.xaml
@@ -0,0 +1,60 @@
+<UserControl x:Class="Tango.MachineStudio.MachineDesigner.Views.TupView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:vm="clr-namespace:Tango.MachineStudio.MachineDesigner.ViewModels"
+ xmlns:global="clr-namespace:Tango.MachineStudio.MachineDesigner"
+ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views"
+ mc:Ignorable="d"
+ d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" Background="Transparent">
+
+ <Grid Margin="20" DataContext="{Binding TupViewVM}">
+ <DockPanel IsEnabled="{Binding IsFree}">
+ <Grid DockPanel.Dock="Bottom">
+
+ </Grid>
+
+ <Grid Margin="0 20">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="38*"/>
+ <ColumnDefinition Width="117*"/>
+ </Grid.ColumnDefinitions>
+
+ <local:MachineView Margin="30 80 0 0" DataContext="{Binding Machine}" IsHitTestVisible="False" VerticalAlignment="Top" Height="241" />
+
+ <DockPanel Grid.Column="1" Margin="50 100 300 100">
+ <TextBlock DockPanel.Dock="Top">
+ <Run>Create a complete update package (.tup) in order to update this machine offline using a removable storage device.</Run>
+ <LineBreak/>
+ <Run>The latest PPC version is </Run>
+ <Run Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" Text="{Binding LatestVersion,FallbackValue='loading...',TargetNullValue='loading...'}"></Run>
+ </TextBlock>
+ <Grid Margin="0 20 0 0">
+ <Border Background="{StaticResource Transparent200}" CornerRadius="5" Padding="60" BorderThickness="1" BorderBrush="Silver">
+ <DockPanel>
+ <DockPanel DockPanel.Dock="Top" Height="40">
+ <Button Command="{Binding SelectFileCommand}" DockPanel.Dock="Right" BorderBrush="Silver" BorderThickness="1" Padding="0" Height="Auto" Width="40" Margin="5 0 0 0" Style="{StaticResource MaterialDesignFlatButton}">
+ <material:PackIcon Kind="Folder" />
+ </Button>
+ <TextBox materialDesign:HintAssist.Hint="Select package location" BorderBrush="Silver" BorderThickness="1" Text="{Binding FilePath}" IsReadOnly="True" VerticalContentAlignment="Center" Padding="10 0 0 0"></TextBox>
+ </DockPanel>
+ <StackPanel DockPanel.Dock="Bottom">
+ <TextBlock HorizontalAlignment="Center" Text="{Binding Progress.Message,FallbackValue='Ready',TargetNullValue='Ready'}"></TextBlock>
+ <ProgressBar Margin="0 10 0 0" Height="15" IsIndeterminate="{Binding Progress.IsIntermediate}" Value="{Binding Progress.Progress}" Maximum="{Binding Progress.Total}"></ProgressBar>
+ </StackPanel>
+ <Grid>
+ <Button Command="{Binding CreateTupFileCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="20 10" Height="60" Width="300">GENERATE UPDATE PACKAGE</Button>
+ </Grid>
+ </DockPanel>
+ </Border>
+ </Grid>
+ </DockPanel>
+ </Grid>
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/TupView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/TupView.xaml.cs
new file mode 100644
index 000000000..fe01296d8
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/TupView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.MachineStudio.MachineDesigner.Views
+{
+ /// <summary>
+ /// Interaction logic for SpoolsView.xaml
+ /// </summary>
+ public partial class TupView : UserControl
+ {
+ public TupView()
+ {
+ InitializeComponent();
+ }
+ }
+}