diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-25 11:24:33 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-25 11:24:33 +0200 |
| commit | f779e2b6f0bb1dedc7644c64651b59e31ce62c00 (patch) | |
| tree | 8071e764f45d08225b0c8ab3d50b0fb02bdb05f9 /Software/Visual_Studio/PPC/Modules | |
| parent | dff24e56a8906b8c9b355cf407f25f4b793beafe (diff) | |
| download | Tango-f779e2b6f0bb1dedc7644c64651b59e31ce62c00.tar.gz Tango-f779e2b6f0bb1dedc7644c64651b59e31ce62c00.zip | |
Some changes in PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobTypeToImageConverter.cs | 37 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml | 17 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Embroidery.png | bin | 0 -> 38479 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Knitting.png | bin | 0 -> 42273 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Sewing.png | bin | 0 -> 30800 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 12 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 2 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs | 14 |
8 files changed, 69 insertions, 13 deletions
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}"> <UserControl.Resources> - <converters:EnumToXamlVectorConverter x:Key="EnumToXamlVectorConverter" /> + <converters:JobTypeToImageConverter x:Key="JobTypeToImageConverter" /> + </UserControl.Resources> <Grid> @@ -20,17 +21,17 @@ <Grid.RowDefinitions> <RowDefinition Height="40"/> <RowDefinition Height="1*"/> - <RowDefinition Height="60"/> + <RowDefinition Height="0"/> </Grid.RowDefinitions> - <TextBlock VerticalAlignment="Center" Text="Select Job Type" FontSize="{StaticResource TangoMessageBoxTitleFontSize}"></TextBlock> + <TextBlock VerticalAlignment="Center" Text="Select Job Application" FontSize="{StaticResource TangoMessageBoxTitleFontSize}"></TextBlock> <touch:TouchNativeListBox RippleFactor="10" Grid.Row="1" Margin="0 15 0 0" ItemsSource="{Binding SupportedJobTypes}" SelectedItem="{Binding SelectedJobType,Mode=OneWayToSource}" SelectedIndex="-1"> <ListBox.ItemTemplate> <DataTemplate> <Border Padding="0 15"> <StackPanel Orientation="Horizontal"> - <Path Stretch="Fill" Fill="{StaticResource TangoDarkForegroundBrush}" Data="{Binding Converter={StaticResource EnumToXamlVectorConverter}}" Width="60" Height="60"></Path> + <Image Stretch="Fill" Width="60" RenderOptions.BitmapScalingMode="Fant" Height="60" Source="{Binding Converter={StaticResource JobTypeToImageConverter}}"></Image> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}" FontSize="{StaticResource TangoButtonFontSize}"></TextBlock> </StackPanel> </Border> @@ -38,11 +39,11 @@ </ListBox.ItemTemplate> </touch:TouchNativeListBox> - <Grid Grid.Row="3"> + <!--<Grid Grid.Row="3"> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> <touch:TouchButton Command="{Binding CloseCommand}" CornerRadius="25" Style="{StaticResource TangoHollowButton}" Width="170" Height="50" VerticalAlignment="Bottom">CLOSE</touch:TouchButton> </StackPanel> - </Grid> + </Grid>--> </Grid> </Grid> </UserControl> 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 Binary files differnew file mode 100644 index 000000000..d71717835 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Embroidery.png 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 Binary files differnew file mode 100644 index 000000000..06c345965 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Knitting.png 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 Binary files differnew file mode 100644 index 000000000..51c468eea --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Sewing.png 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 @@ <Compile Include="Converters\JobCollectionToCategoryCountConverter.cs" /> <Compile Include="Converters\JobProgressToPositionConverter.cs" /> <Compile Include="Converters\JobToPieImageConverter.cs" /> + <Compile Include="Converters\JobTypeToImageConverter.cs" /> <Compile Include="Dialogs\AdvancedColorCorrectionView.xaml.cs"> <DependentUpon>AdvancedColorCorrectionView.xaml</DependentUpon> </Compile> @@ -338,10 +339,19 @@ <ItemGroup> <Resource Include="Images\JobView\color-picker.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\Sewing.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\Embroidery.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\Knitting.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ 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 @@ <touch:TouchAutoComplete Text="{Binding CustomersFilter}" ItemsSource="{Binding Customers}" SelectedItem="{Binding Job.Customer}" DisplayMemberPath="Name" AutoCompleteProvider="{Binding CustomersAutoCompleteProvider}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> <TextBlock>Thread type:</TextBlock> - <touch:TouchComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding Job.Rml}" DisplayMemberPath="Name" Title="Select Thread Type" /> + <touch:TouchComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding Job.Rml}" DisplayMemberPath="Name" Title="Select Thread" /> <TextBlock>Comment:</TextBlock> <TextBox Margin="20 0 0 -42" Text="{Binding Job.Description}" FocusVisualStyle="{x:Null}" BorderBrush="{StaticResource TangoDividerBrush}" Foreground="{StaticResource TangoDarkForegroundBrush}" AcceptsReturn="True" TextWrapping="Wrap" Height="60" Padding="5"> 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<bool> OnNavigateBackRequest() { - if (CurrentPath == StorageProvider.Drive.RootDirectory.FullName || _allow_exit) + if (_allow_exit || CurrentPath == StorageProvider.Drive.RootDirectory.FullName) { return Task.FromResult(true); } |
