From f779e2b6f0bb1dedc7644c64651b59e31ce62c00 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 25 Nov 2018 11:24:33 +0200 Subject: Some changes in PPC. --- .../Converters/JobTypeToImageConverter.cs | 37 +++++++++++++++++++++ .../Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml | 17 +++++----- .../Modules/Tango.PPC.Jobs/Images/Embroidery.png | Bin 0 -> 38479 bytes .../PPC/Modules/Tango.PPC.Jobs/Images/Knitting.png | Bin 0 -> 42273 bytes .../PPC/Modules/Tango.PPC.Jobs/Images/Sewing.png | Bin 0 -> 30800 bytes .../Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 12 ++++++- .../PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 2 +- .../Tango.PPC.Storage/ViewModels/MainViewVM.cs | 14 ++++++-- 8 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobTypeToImageConverter.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Embroidery.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Knitting.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Sewing.png (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobTypeToImageConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobTypeToImageConverter.cs new file mode 100644 index 000000000..aaa6a5bf2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobTypeToImageConverter.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.BL.Enumerations; +using Tango.SharedUI.Helpers; + +namespace Tango.PPC.Jobs.Converters +{ + public class JobTypeToImageConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + JobTypes jobType = (JobTypes)value; + + switch (jobType) + { + case JobTypes.Embroidery: + return ResourceHelper.GetImageFromResources("Images/Embroidery.png"); + case JobTypes.Sewing: + return ResourceHelper.GetImageFromResources("Images/Sewing.png"); + case JobTypes.Knitting: + return ResourceHelper.GetImageFromResources("Images/Knitting.png"); + } + + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml index 810fcaf41..814f73eb1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml @@ -5,14 +5,15 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.PPC.Jobs.Dialogs" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" - xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:converters="clr-namespace:Tango.PPC.Jobs.Converters" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="500" Height="400" d:DataContext="{d:DesignInstance Type=local:JobTypePickerViewVM, IsDesignTimeCreatable=False}"> + Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="600" Height="380" d:DataContext="{d:DesignInstance Type=local:JobTypePickerViewVM, IsDesignTimeCreatable=False}"> - + + @@ -20,17 +21,17 @@ - + - + - + @@ -38,11 +39,11 @@ - + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Embroidery.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Embroidery.png new file mode 100644 index 000000000..d71717835 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Embroidery.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Knitting.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Knitting.png new file mode 100644 index 000000000..06c345965 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Knitting.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Sewing.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Sewing.png new file mode 100644 index 000000000..51c468eea Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Sewing.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index d804f4f28..ad98f7511 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -149,6 +149,7 @@ + AdvancedColorCorrectionView.xaml @@ -338,10 +339,19 @@ + + + + + + + + + - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index 81f995eb7..ada22ce5a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -388,7 +388,7 @@ Thread type: - + Comment: diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs index cb48958dd..e62ebc932 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs @@ -52,17 +52,23 @@ namespace Tango.PPC.Storage.ViewModels StorageProvider.StorageDisconnected += StorageProvider_StorageDisconnected; } - public override void OnNavigatedTo() + public override async void OnNavigatedTo() { base.OnNavigatedTo(); _allow_exit = false; _selectedItem = null; - if (StorageProvider.Drive != null) + if (StorageProvider.IsConnected && StorageProvider.Drive != null) { CurrentPath = StorageProvider.Drive.RootDirectory.FullName; } + else + { + _allow_exit = true; + await NotificationProvider.ShowError("No storage device connected."); + await NavigationManager.NavigateBack(); + } } private async void Close() @@ -97,14 +103,16 @@ namespace Tango.PPC.Storage.ViewModels { if (IsVisible) { + await NotificationProvider.ShowError("Storage device disconnected."); await NavigationManager.NavigateBack(); + CurrentPath = null; } }); } public override Task OnNavigateBackRequest() { - if (CurrentPath == StorageProvider.Drive.RootDirectory.FullName || _allow_exit) + if (_allow_exit || CurrentPath == StorageProvider.Drive.RootDirectory.FullName) { return Task.FromResult(true); } -- cgit v1.3.1