diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-05 14:53:49 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-05 14:53:49 +0200 |
| commit | 499f4facfe296d984a44e9ce0b6e1eb23ba8d644 (patch) | |
| tree | bf554330362404128c36321a4fce3fd927caea82 /Software/Visual_Studio | |
| parent | b292fb7ff234a973670ebf9e54b9e111a90f3639 (diff) | |
| download | Tango-499f4facfe296d984a44e9ce0b6e1eb23ba8d644.tar.gz Tango-499f4facfe296d984a44e9ce0b6e1eb23ba8d644.zip | |
Improvements and bug fixes on PPC.
Diffstat (limited to 'Software/Visual_Studio')
38 files changed, 491 insertions, 133 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsModule.cs index e1e5c93ec..0ad826546 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsModule.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsModule.cs @@ -47,7 +47,7 @@ namespace Tango.PPC.Events { get { - return ResourceHelper.GetImageFromResources("Images/events-module.png"); + return ResourceHelper.GetImageFromResources("Images/events.png"); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/events.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/events.png Binary files differnew file mode 100644 index 000000000..53a767f8e --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/events.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj index fa7583e85..815223834 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj @@ -164,10 +164,13 @@ <ItemGroup> <Resource Include="Images\event_demo.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\events.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/Converters/ColorSpaceToImageConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToImageConverter.cs new file mode 100644 index 000000000..a74a87d28 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToImageConverter.cs @@ -0,0 +1,41 @@ +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 ColorSpaceToImageConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null) + { + ColorSpaces colorSpace = (ColorSpaces)value; + + switch (colorSpace) + { + case ColorSpaces.RGB: + return ResourceHelper.GetImageFromResources("Images/NewJob/rgb.png"); + case ColorSpaces.LAB: + return ResourceHelper.GetImageFromResources("Images/NewJob/lab.png"); + case ColorSpaces.Twine: + return ResourceHelper.GetImageFromResources("Images/NewJob/twine.png"); + default: + return ResourceHelper.GetImageFromResources("Images/NewJob/coats.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/JobCreationView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobCreationView.xaml index 1f48474aa..0e4f6e38c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobCreationView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobCreationView.xaml @@ -9,26 +9,29 @@ 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}" d:DesignHeight="555" d:DesignWidth="560" Width="550" Height="750" d:DataContext="{d:DesignInstance Type=local:JobCreationViewVM, IsDesignTimeCreatable=False}"> + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:JobCreationViewVM, IsDesignTimeCreatable=False}"> <UserControl.Resources> <converters:JobTypeToImageConverter x:Key="JobTypeToImageConverter" /> + <converters:ColorSpaceToImageConverter x:Key="ColorSpaceToImageConverter" /> </UserControl.Resources> <Grid Margin="20"> <DockPanel> - <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal"> - <touch:TouchButton Command="{Binding CloseCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton> - <touch:TouchButton Command="{Binding OKCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">CREATE</touch:TouchButton> + <Grid DockPanel.Dock="Bottom"> + <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton> + <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CREATE</touch:TouchButton> + </Grid> + + <StackPanel DockPanel.Dock="Top"> + <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" FontSize="{StaticResource TangoHeaderFontSize}">New Job</TextBlock> + <TextBlock Margin="0 30 100 0" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="{StaticResource TangoTitleFontSize}">Please select the job application and color space/catalog and press 'create'.</TextBlock> </StackPanel> - <StackPanel> - <touch:TouchIcon HorizontalAlignment="Center" Icon="PlusCircle" Foreground="{StaticResource TangoSuccessBrush}" Height="80" /> - <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">NEW JOB</TextBlock> - <TextBlock Margin="20 20" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">Please select the job application and color space/catalog and press 'CREATE'.</TextBlock> - <touch:TouchStaticListBox Margin="20" ItemsSource="{Binding SupportedJobTypes}" SelectedItem="{Binding SelectedJobType,Mode=TwoWay}"> + <UniformGrid Rows="2" Margin="0 40 0 0" VerticalAlignment="Center" TextElement.FontWeight="Normal"> + <touch:TouchStaticListBox Margin="20" VerticalAlignment="Center" Width="480" ItemsSource="{Binding SupportedJobTypes}" SelectedItem="{Binding SelectedJobType,Mode=TwoWay}"> <touch:TouchStaticListBox.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Rows="1" /> @@ -36,10 +39,16 @@ </touch:TouchStaticListBox.ItemsPanel> <touch:TouchStaticListBox.ItemContainerStyle> <Style TargetType="touch:TouchStaticListBoxItem"> - <Setter Property="Opacity" Value="0.5"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="CornerRadius" Value="5"></Setter> + <Setter Property="Padding" Value="0 10"></Setter> + <Setter Property="Margin" Value="25"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Width" Value="110"></Setter> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> - <Setter Property="Opacity" Value="1"></Setter> + <Setter Property="BorderThickness" Value="2"></Setter> </Trigger> </Style.Triggers> </Style> @@ -48,37 +57,50 @@ <DataTemplate> <StackPanel Orientation="Vertical" HorizontalAlignment="Center"> <Image Stretch="Fill" Width="60" RenderOptions.BitmapScalingMode="Fant" Height="60" Source="{Binding Converter={StaticResource JobTypeToImageConverter}}"></Image> - <TextBlock HorizontalAlignment="Center" Margin="0 5 0 0" Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}" FontSize="{StaticResource TangoButtonFontSize}"></TextBlock> + <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}" ></TextBlock> </StackPanel> </DataTemplate> </touch:TouchStaticListBox.ItemTemplate> </touch:TouchStaticListBox> - - <touch:TouchStaticListBox Margin="20 100 20 20" ItemsSource="{Binding SupportedColorSpaces}" SelectedItem="{Binding SelectedColorSpace,Mode=TwoWay}"> - <touch:TouchStaticListBox.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Rows="1" /> - </ItemsPanelTemplate> - </touch:TouchStaticListBox.ItemsPanel> - <touch:TouchStaticListBox.ItemContainerStyle> - <Style TargetType="touch:TouchStaticListBoxItem"> - <Setter Property="Opacity" Value="0.5"></Setter> - <Style.Triggers> - <Trigger Property="IsSelected" Value="True"> - <Setter Property="Opacity" Value="1"></Setter> - </Trigger> - </Style.Triggers> - </Style> - </touch:TouchStaticListBox.ItemContainerStyle> - <touch:TouchStaticListBox.ItemTemplate> - <DataTemplate> - <Border BorderBrush="{StaticResource TangoLightBorderBrush}" BorderThickness="1" Padding="20" Margin="5" Background="Transparent"> - <TextBlock HorizontalAlignment="Center" Text="{Binding}" FontSize="{StaticResource TangoDefaultFontSize}"></TextBlock> - </Border> - </DataTemplate> - </touch:TouchStaticListBox.ItemTemplate> - </touch:TouchStaticListBox> - </StackPanel> + + <Grid> + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="70 0" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" /> + <touch:TouchStaticListBox Margin="0 -40 0 0" VerticalAlignment="Center" Width="440" ItemsSource="{Binding SupportedColorSpaces}" SelectedItem="{Binding SelectedColorSpace,Mode=TwoWay}"> + <touch:TouchStaticListBox.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Rows="1" /> + </ItemsPanelTemplate> + </touch:TouchStaticListBox.ItemsPanel> + <touch:TouchStaticListBox.ItemContainerStyle> + <Style TargetType="touch:TouchStaticListBoxItem"> + <Setter Property="BorderBrush" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="CornerRadius" Value="5"></Setter> + <Setter Property="Padding" Value="0 10"></Setter> + <Setter Property="Margin" Value="10"></Setter> + <Setter Property="Width" Value="90"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="BorderThickness" Value="2"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </touch:TouchStaticListBox.ItemContainerStyle> + <touch:TouchStaticListBox.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical" HorizontalAlignment="Center"> + <Image Stretch="Fill" Width="32" Height="32" RenderOptions.BitmapScalingMode="Fant" Source="{Binding Converter={StaticResource ColorSpaceToImageConverter}}"></Image> + <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" Text="{Binding}"></TextBlock> + </StackPanel> + </DataTemplate> + </touch:TouchStaticListBox.ItemTemplate> + </touch:TouchStaticListBox> + </Grid> + </UniformGrid> </DockPanel> </Grid> </UserControl> + + +
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/coats.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/coats.png Binary files differnew file mode 100644 index 000000000..d6cd3ecf2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/coats.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/lab.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/lab.png Binary files differnew file mode 100644 index 000000000..607afd980 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/lab.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/rgb.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/rgb.png Binary files differnew file mode 100644 index 000000000..dfdf32c8d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/rgb.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/twine.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/twine.png Binary files differnew file mode 100644 index 000000000..b1d3da8c5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/NewJob/twine.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/jobs.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/jobs.png Binary files differnew file mode 100644 index 000000000..eb668ad03 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/jobs.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/length.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/length.png Binary files differnew file mode 100644 index 000000000..bad870dcb --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/length.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModule.cs index f15aad70c..b9e121f86 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModule.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModule.cs @@ -47,7 +47,7 @@ namespace Tango.PPC.Jobs { get { - return ResourceHelper.GetImageFromResources("Images/jobs-module.png"); + return ResourceHelper.GetImageFromResources("Images/jobs.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 34c4861ab..25d4507f6 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 @@ -155,6 +155,7 @@ <Compile Include="Controls\TwineCatalogViewer.xaml.cs"> <DependentUpon>TwineCatalogViewer.xaml</DependentUpon> </Compile> + <Compile Include="Converters\ColorSpaceToImageConverter.cs" /> <Compile Include="Converters\JobProgressToPositionConverter.cs" /> <Compile Include="Converters\JobsCategoryToVisibilityConverter.cs" /> <Compile Include="Converters\JobToPieImageConverter.cs" /> @@ -390,10 +391,22 @@ <Resource Include="Images\color_approved_small_gray.png" /> <Resource Include="Images\sample_approved_small_gray.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\NewJob\coats.png" /> + <Resource Include="Images\NewJob\lab.png" /> + <Resource Include="Images\NewJob\rgb.png" /> + <Resource Include="Images\NewJob\twine.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\length.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\jobs.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs index 46c6d7ffd..01d83d0d0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs @@ -32,6 +32,18 @@ namespace Tango.PPC.Jobs.ViewModels set { _job = value; RaisePropertyChangedAuto(); } } + private TimeSpan _estimatedDuration; + /// <summary> + /// Gets or sets the duration of the estimated. + /// </summary> + + public TimeSpan EstimatedDuration + { + get { return _estimatedDuration; } + set { _estimatedDuration = value; RaisePropertyChangedAuto(); } + } + + /// <summary> /// Gets or sets the dye command. /// </summary> @@ -57,10 +69,20 @@ namespace Tango.PPC.Jobs.ViewModels /// Handles the job selected message. /// </summary> /// <param name="message">The message.</param> - private void HandleJobSelectedMessage(JobSelectedMessage message) + private async void HandleJobSelectedMessage(JobSelectedMessage message) { _context = message.Context; Job = message.Job; + + Job = await new JobBuilder(_context).Set(Job.Guid) + .WithConfiguration() + .WithRML() + .WithUser() + .WithSegments() + .WithBrushStops() + .BuildAsync(); + + EstimatedDuration = await Job.GetEstimatedDuration(); } /// <summary> @@ -81,16 +103,8 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log("Start job command pressed. Starting job and navigating to job progress view..."); - Job = await new JobBuilder(_context).Set(Job.Guid) - .WithConfiguration() - .WithRML() - .WithUser() - .WithSegments() - .WithBrushStops() - .BuildAsync(); - PrintingManager.Print(Job, _context); - await NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); + await NavigationManager.NavigateTo<JobsModule>(false, nameof(JobProgressView)); } catch (Exception ex) { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index d29323412..c87d3585b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -271,7 +271,7 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log($"Job '{job.Name}' selected."); - if (!directlyToEdit) + if (!directlyToEdit && MachineProvider.MachineOperator.Status == Integration.Operation.MachineStatuses.ReadyToDye) { await NavigationManager.NavigateTo<JobsModule>(nameof(JobSummeryView)); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml index 27c3cb93a..ac2d5b3be 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml @@ -26,39 +26,76 @@ </Border> <Grid Grid.Row="1"> - <DockPanel> - <Grid DockPanel.Dock="Bottom" Height="350"> - <StackPanel Margin="50 0 50 0"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 60 0 0"> - <touch:TouchButton FontSize="{StaticResource TangoExpanderHeaderFontSize}" Command="{Binding EditCommand}" BorderThickness="2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" RippleBrush="{StaticResource TangoRippleDarkBrush}" Background="Transparent" EnableDropShadow="False" Height="80" Padding="0" Width="270" Foreground="{StaticResource TangoPrimaryAccentBrush}" CornerRadius="40" BlurRadius="20" HorizontalAlignment="Right"> - <StackPanel Orientation="Horizontal"> - <fa:ImageAwesome Icon="Pencil" Width="24" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">EDIT</TextBlock> - </StackPanel> - </touch:TouchButton> - <touch:TouchButton IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Margin="20 0 0 0" Height="80" Padding="0" Width="270" CornerRadius="40" BlurRadius="20" HorizontalAlignment="Right" DelayCommand="{Binding DyeCommand}" DelayCommandDuration="00:00:0.3"> - <StackPanel Orientation="Horizontal"> - <TextBlock VerticalAlignment="Center">DYE</TextBlock> - <touch:TouchIcon Margin="20 0 0 0" Icon="ChevronRight" Width="14" /> - </StackPanel> - </touch:TouchButton> - </StackPanel> - </StackPanel> - </Grid> + <Border Padding="50"> + <DockPanel> + <Grid DockPanel.Dock="Bottom"> + <StackPanel> + <Grid> + <touch:TouchButton HorizontalAlignment="Left" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Command="{Binding EditCommand}" BorderThickness="2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" RippleBrush="{StaticResource TangoRippleDarkBrush}" Background="Transparent" EnableDropShadow="False" Height="80" Padding="0" Width="270" Foreground="{StaticResource TangoPrimaryAccentBrush}" CornerRadius="40" BlurRadius="20"> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome Icon="Pencil" Width="24" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">EDIT</TextBlock> + </StackPanel> + </touch:TouchButton> + <touch:TouchButton IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Margin="20 0 0 0" Height="80" Padding="0" Width="270" CornerRadius="40" BlurRadius="20" HorizontalAlignment="Right" DelayCommand="{Binding DyeCommand}" DelayCommandDuration="00:00:0.3"> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center">DYE</TextBlock> + <touch:TouchIcon Margin="20 0 0 0" Icon="ChevronRight" Width="14" /> + </StackPanel> + </touch:TouchButton> + </Grid> + </StackPanel> + </Grid> - <Grid> - <StackPanel VerticalAlignment="Center" Margin="50 0"> - <Image Source="../Images/pantone.png" Width="256" /> - <TextBlock FontSize="{StaticResource TangoHeaderFontSize}" Margin="0 30 0 0"> - <Run>'</Run><Run Text="{Binding Job.Name,FallbackValue='Name'}"></Run><Run>'</Run> - <Run>is ready!</Run> - </TextBlock> - <TextBlock Margin="40 10 0 0" FontSize="{StaticResource TangoTitleFontSize}">Tap 'DYE' to start the dying process...</TextBlock> - </StackPanel> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="60*"/> + <RowDefinition Height="400*"/> + <RowDefinition Height="300*"/> + </Grid.RowDefinitions> - <controls:JobSummeryViewer Height="50" DataContext="{Binding Job}" VerticalAlignment="Bottom" Margin="20 0" /> - </Grid> - </DockPanel> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}" Text="{Binding Job.Name}" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock> + + <Grid Grid.Row="1" Width="360" Height="360"> + <touch:TouchBusyIndicator Opacity="0.6" IsIndeterminate="False" Foreground="{StaticResource TangoGrayBrush}" StrokeThickness="10" Minimum="0" Maximum="100" Value="99.999" Width="Auto" Height="Auto"> + + </touch:TouchBusyIndicator> + + <UniformGrid Rows="2"> + <Grid> + <StackPanel VerticalAlignment="Center"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 15 0 0"> + <Image Source="../Images/length.png" Stretch="None" /> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Length</TextBlock> + </StackPanel> + + <TextBlock FontSize="40" Margin="0 10 0 0" HorizontalAlignment="Center"> + <Run Text="{Binding Job.LengthIncludingNumberOfUnits,Mode=OneWay,StringFormat=0,FallbackValue=0}"/> + <Run FontSize="16">m</Run> + </TextBlock> + </StackPanel> + </Grid> + <Grid> + <Rectangle Margin="40 0" Stroke="{StaticResource TangoDividerBrush}" VerticalAlignment="Top" /> + <StackPanel VerticalAlignment="Center" Margin="0 -40 0 0"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 15 0 0"> + <Image Source="../Images/JobProgressView/clock.png" Stretch="None" /> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Time</TextBlock> + </StackPanel> + + <TextBlock FontSize="40" Margin="0 10 0 0" HorizontalAlignment="Center"> + <Run Text="{Binding EstimatedDuration,Mode=OneWay,Converter={StaticResource TimeSpanToTwoDigitsTimeConverter},FallbackValue=5}"></Run> + <Run FontSize="16" Text="{Binding EstimatedDuration,Mode=OneWay,Converter={StaticResource TimeSpanToLabelConverter},FallbackValue=min}"></Run> + </TextBlock> + </StackPanel> + </Grid> + </UniformGrid> + </Grid> + + <controls:JobSummeryViewer Height="50" DataContext="{Binding Job}" VerticalAlignment="Center" Margin="20 0" Grid.Row="2" /> + </Grid> + </DockPanel> + </Border> </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml index 01d0c86a2..ace1d38af 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml @@ -54,8 +54,38 @@ <RowDefinition Height="1*"/> </Grid.RowDefinitions> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -28 30 0"> - <StackPanel Orientation="Horizontal" Height="58" Visibility="{Binding ElementName=dataGridJobs,Path=IsMultiSelecting,Converter={StaticResource BooleanToVisibilityConverter}}"> + <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -28 30 0"> + <StackPanel Orientation="Horizontal" Height="58" RenderTransformOrigin="0.5,0.5"> + <StackPanel.Style> + <Style TargetType="StackPanel"> + <Setter Property="Opacity" Value="0"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <TranslateTransform X="100" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsMultiSelecting}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.X" To="0" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.X" To="100" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </StackPanel.Style> <touch:TouchIconButton Command="{Binding ClearSelectionCommand}" Visibility="{Binding IsMultiSelecting,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 0 30 0" Padding="20" Icon="Undo"> <touch:TouchIconButton.Style> <Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource TangoRoundTouchIconButton}"> @@ -85,23 +115,32 @@ <touch:TouchIconButton Command="{Binding CloneJobsCommand}" Margin="0 0 30 0" Padding="20" Icon="CopyRegular" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton> <touch:TouchIconButton Command="{Binding DeleteJobsCommand}" Padding="20" Icon="TrashAltRegular" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton> </StackPanel> - <touch:TouchIconButton Command="{Binding AddJobCommand}" Visibility="{Binding IsMultiSelecting,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="0 -15 0 0" Padding="20" Height="80" Icon="Plus"> + <touch:TouchIconButton Command="{Binding AddJobCommand}" RenderTransformOrigin="0.5,0.5" Margin="0 -15 0 0" Padding="20" Height="80" Icon="Plus" HorizontalAlignment="Right"> <touch:TouchIconButton.Style> <Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource TangoRoundTouchIconButton}"> - <Setter Property="IconAngle" Value="0"></Setter> + <Setter Property="Opacity" Value="1"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> <Style.Triggers> <DataTrigger Binding="{Binding IsMultiSelecting}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="IconAngle" To="360" Duration="00:00:00"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0.5" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0.5" Duration="00:00:0.2"></DoubleAnimation> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> <DataTrigger.ExitActions> <BeginStoryboard> <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="IconAngle" To="0" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation> </Storyboard> </BeginStoryboard> </DataTrigger.ExitActions> @@ -110,7 +149,7 @@ </Style> </touch:TouchIconButton.Style> </touch:TouchIconButton> - </StackPanel> + </Grid> <DockPanel> <touch:TouchNavigationLinks DockPanel.Dock="Left" x:Name="navigationLinks" SelectionChanged="TouchNavigationLinks_SelectionChanged" SelectedIndex="{Binding SelectedCategoryIndex,Mode=TwoWay}" IsEnabled="{Binding IsMultiSelecting,Converter={StaticResource BooleanInverseConverter}}" VerticalAlignment="Bottom" Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Images/settings.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Images/settings.png Binary files differnew file mode 100644 index 000000000..fa268e53a --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Images/settings.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/MachineSettingsModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/MachineSettingsModule.cs index 53321b799..477340357 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/MachineSettingsModule.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/MachineSettingsModule.cs @@ -47,7 +47,7 @@ namespace Tango.PPC.MachineSettings { get { - return ResourceHelper.GetImageFromResources("Images/settings-module.png"); + return ResourceHelper.GetImageFromResources("Images/settings.png"); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj index 2b89c1e9b..00cc18382 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj @@ -160,10 +160,13 @@ <ItemGroup> <Resource Include="Images\settings-module.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\settings.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index 246b86469..c858e982e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -119,7 +119,7 @@ namespace Tango.PPC.MachineSettings.ViewModels { Machine.SupportedJobTypes = SelectedJobTypes.SynchedSource.ToList(); Machine.SupportedColorSpaces = SelectedColorSpaces.SynchedSource.ToList(); - Machine.MapPrimitivesWithStringsNoNullsTo(MachineProvider.Machine); + Machine.MapPrimitivesWithStrings(MachineProvider.Machine); Settings.EnableHotSpot = EnableHotSpot; Settings.HotSpotPassword = HotSpotPassword; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Images/storage.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Images/storage.png Binary files differnew file mode 100644 index 000000000..619d9de34 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Images/storage.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/StorageModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/StorageModule.cs index 6133ebb3c..b3553e666 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/StorageModule.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/StorageModule.cs @@ -47,7 +47,7 @@ namespace Tango.PPC.Storage { get { - return ResourceHelper.GetImageFromResources("Images/storage-module.png"); + return ResourceHelper.GetImageFromResources("Images/storage.png"); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj index b25af0348..e541c472b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj @@ -137,5 +137,8 @@ <ItemGroup> <Resource Include="Images\storage-module.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\storage.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/power.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/power.png Binary files differnew file mode 100644 index 000000000..1f42d43a1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/power.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/update.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/update.png Binary files differnew file mode 100644 index 000000000..45f4608c9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/update.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-machine.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-machine.png Binary files differnew file mode 100644 index 000000000..5c8608b61 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-machine.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-tablet.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-tablet.png Binary files differnew file mode 100644 index 000000000..34191593c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power-tablet.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 1891139e9..1201c4ab0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -274,6 +274,10 @@ </EmbeddedResource> <None Include="app.manifest" /> <Resource Include="Images\machine.png" /> + <Resource Include="Images\power-machine.png" /> + <Resource Include="Images\power-tablet.png" /> + <Resource Include="Images\Menu\power.png" /> + <Resource Include="Images\Menu\update.png" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> <None Include="packages.config" /> @@ -370,10 +374,6 @@ <Project>{91b70e9b-66a7-4873-ae10-400e71cf404f}</Project> <Name>Tango.PPC.MachineSettings</Name> </ProjectReference> - <ProjectReference Include="..\Modules\Tango.PPC.Power\Tango.PPC.Power.csproj"> - <Project>{1d0f15b7-c1f3-4b9e-b0bc-a5b9e50c91d0}</Project> - <Name>Tango.PPC.Power</Name> - </ProjectReference> <ProjectReference Include="..\Modules\Tango.PPC.Storage\Tango.PPC.Storage.csproj"> <Project>{04febb02-f782-4b96-b47d-f6902afa43be}</Project> <Name>Tango.PPC.Storage</Name> @@ -509,7 +509,7 @@ del "$(TargetDir)firmware_package.tfp"</PostBuildEvent> </PropertyGroup> <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/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 52f0fb403..1c1eeca5e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -38,7 +38,15 @@ namespace Tango.PPC.UI.ViewModels public bool IsMenuOpened { get { return _isMenuOpened; } - set { _isMenuOpened = value; RaisePropertyChangedAuto(); } + set + { + _isMenuOpened = value; RaisePropertyChangedAuto(); + + if (!_isMenuOpened) + { + IsPowerOpened = false; + } + } } private bool _isNotificationsOpened; @@ -48,7 +56,20 @@ namespace Tango.PPC.UI.ViewModels public bool IsNotificationsOpened { get { return _isNotificationsOpened; } - set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); } + set + { + _isNotificationsOpened = value; RaisePropertyChangedAuto(); + } + } + + private bool _isPowerOpened; + /// <summary> + /// Gets or sets a value indicating whether the power area is opened. + /// </summary> + public bool IsPowerOpened + { + get { return _isPowerOpened; } + set { _isPowerOpened = value; RaisePropertyChangedAuto(); } } #endregion @@ -90,6 +111,10 @@ namespace Tango.PPC.UI.ViewModels /// </summary> public RelayCommand UpdateCommand { get; set; } + /// <summary> + /// Gets or sets the power command. + /// </summary> + public RelayCommand PowerCommand { get; set; } #endregion #region Constructors @@ -106,12 +131,14 @@ namespace Tango.PPC.UI.ViewModels StopPrintingCommand = new RelayCommand(StopPrinting); SignOutCommand = new RelayCommand(SignOut); - UpdateCommand = new RelayCommand(() => + UpdateCommand = new RelayCommand(() => { NavigationManager.NavigateTo(NavigationView.MachineUpdateView); TangoIOC.Default.GetInstance<MachineUpdateViewVM>().CheckForUpdates(); IsMenuOpened = false; }); + + PowerCommand = new RelayCommand(() => IsPowerOpened = true); } #endregion diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 2743e5126..5d4428989 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -23,38 +23,38 @@ </UserControl.Resources> <Grid> - <touch:TouchSideMenu x:Name="menu" IsOpened="{Binding IsMenuOpened,Mode=TwoWay}" Grid.Row="1"> + <touch:TouchSideMenu x:Name="menu" IsOpened="{Binding IsMenuOpened,Mode=TwoWay}" Grid.Row="1" > <touch:TouchSideMenu.MenuContent> - <Border Width="400" x:Name="border" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDarkForegroundBrush}" TextElement.Foreground="{StaticResource TangoDarkForegroundBrush}"> + <Border TextElement.FontSize="{StaticResource TangoMenuItemFontSize}" TextElement.FontFamily="{StaticResource TangoFlexoFontFamily}" Width="450" x:Name="border" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDarkForegroundBrush}" TextElement.Foreground="{StaticResource TangoDarkForegroundBrush}"> <DockPanel LastChildFill="False" Background="{StaticResource TangoPrimaryBackgroundBrush}"> <StackPanel MinWidth="300" DockPanel.Dock="Top"> - <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1"> + <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1" Height="320"> <Grid> - <Image Source="/Images/logo.png" Stretch="Uniform" Margin="20 50 50 50"></Image> - <touch:TouchToggleButton Style="{StaticResource TangoTouchToggleButtonHamburger}" + <Image Source="/Images/logo.png" Stretch="Uniform" HorizontalAlignment="Left" Margin="40 0 0 0" Width="320"></Image> + <touch:TouchToggleButton Width="70" Height="70" Padding="15" Style="{StaticResource TangoTouchToggleButtonHamburger}" VerticalAlignment="Top" - HorizontalAlignment="Right" Margin="16" - IsChecked="{Binding ElementName=menu,Path=IsOpened}" /> + HorizontalAlignment="Right" + IsChecked="{Binding ElementName=menu,Path=IsOpened}" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> </Grid> </Border> - <StackPanel Margin="0 5 0 0"> - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding HomeCommand}" FontSize="{StaticResource TangoHeaderFontSize}"> + <!--<StackPanel Margin="0 5 0 0"> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding HomeCommand}" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="Normal"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="/Images/home.png" VerticalAlignment="Center" Width="48" Height="48"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">Home</TextBlock> + <Image Source="/Images/home.png" VerticalAlignment="Center" Width="32" Height="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}">Home</TextBlock> </StackPanel> </touch:TouchButton> - </StackPanel> + </StackPanel>--> <ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}"> <ItemsControl.ItemTemplate> <DataTemplate> <Border Visibility="{Binding DockToBottom,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> - <Border BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0 1 0 0" Visibility="{Binding IsVisibleInMenu,Converter={StaticResource BooleanToVisibilityConverter}}"> - <touch:TouchButton Margin="0 0 0 0" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Style="{StaticResource TangoFlatButton}" FontSize="{StaticResource TangoHeaderFontSize}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ModuleNavigationCommand}" CommandParameter="{Binding Name}"> + <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1" Visibility="{Binding IsVisibleInMenu,Converter={StaticResource BooleanToVisibilityConverter}}"> + <touch:TouchButton Margin="0 0 0 0" Padding="40 25" Foreground="{StaticResource TangoDarkForegroundBrush}" Style="{StaticResource TangoFlatButton}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ModuleNavigationCommand}" CommandParameter="{Binding Name}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image VerticalAlignment="Center" Source="{Binding Image}" Width="48" Height="48"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Name}"></TextBlock> + <Image VerticalAlignment="Center" Source="{Binding Image}" Width="32" Height="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="40 0 0 0" Text="{Binding Name}" Foreground="{StaticResource TangoPrimaryAccentBrush}"></TextBlock> </StackPanel> </touch:TouchButton> </Border> @@ -64,20 +64,18 @@ </ItemsControl> <StackPanel Margin="0 5 0 0"> - - <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 1 0 0"> - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}" FontSize="{StaticResource TangoHeaderFontSize}"> + <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1"> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="40 25" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="/Images/right-arrow-64.png" VerticalAlignment="Center" Width="48" Height="48"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">Update</TextBlock> + <Image Source="/Images/Menu/update.png" VerticalAlignment="Center" Width="32" Height="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="40 0 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}">Update</TextBlock> </StackPanel> </touch:TouchButton> </Border> </StackPanel> </StackPanel> - <StackPanel DockPanel.Dock="Bottom"> - <Separator Margin="0 10 0 0" Background="{StaticResource TangoDividerBrush}" /> + <Grid DockPanel.Dock="Bottom"> <!--<touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Command="{Binding SignOutCommand}" FontSize="{StaticResource TangoHeaderFontSize}" Foreground="{StaticResource TangoDarkForegroundBrush}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <touch:TouchIcon VerticalAlignment="Center" Angle="180" Icon="Logout" Width="32" Height="32"></touch:TouchIcon> @@ -85,7 +83,7 @@ </StackPanel> </touch:TouchButton>--> - <ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}"> + <!--<ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}"> <ItemsControl.ItemTemplate> <DataTemplate> <Border Visibility="{Binding DockToBottom,Converter={StaticResource BooleanToVisibilityConverter}}"> @@ -100,8 +98,107 @@ </Border> </DataTemplate> </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> + </ItemsControl>--> + + + <Border Background="{StaticResource TangoPowerMenuOpenedBackgroundBrush}" Height="350" Padding="20" RenderTransformOrigin="0.5,1" VerticalAlignment="Bottom"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsPowerOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="188*"/> + <ColumnDefinition Width="261*"/> + </Grid.ColumnDefinitions> + + <Image Source="/Images/power-machine.png" Margin="30" /> + + <UniformGrid Grid.Column="1" Rows="2"> + <touch:TouchButton HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}">Turn Off</touch:TouchButton> + <touch:TouchButton HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}">Stand By</touch:TouchButton> + </UniformGrid> + </Grid> + + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="25 0" Opacity="0.3" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" /> + + <Grid Grid.Row="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="188*"/> + <ColumnDefinition Width="261*"/> + </Grid.ColumnDefinitions> + <Image Source="/Images/power-tablet.png" Margin="30" /> + + <touch:TouchButton Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}" FontSize="{StaticResource TangoTitleFontSize}">Restart</touch:TouchButton> + </Grid> + </Grid> + </Border> + + <Border Background="{StaticResource TangoMidBackgroundBrush}" RenderTransformOrigin="0.5,1" VerticalAlignment="Bottom"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsPowerOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="40 25" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding PowerCommand}"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> + <Image Source="/Images/menu/power.png" VerticalAlignment="Center" Width="32" Height="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="40 0 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}">Power</TextBlock> + </StackPanel> + </touch:TouchButton> + </Border> + </Grid> </DockPanel> </Border> </touch:TouchSideMenu.MenuContent> @@ -111,7 +208,7 @@ <DockPanel> <Border BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}"> <touch:TouchHamburgerButton Width="100" Height="100" Padding="15" Command="{Binding MenuOrBackCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" IsBack="{Binding NavigationManager.CanNavigateBack}"> - + </touch:TouchHamburgerButton> </Border> <Grid DockPanel.Dock="Right" Margin="0 0 20 0"> diff --git a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs index e94dd851b..d44859413 100644 --- a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs +++ b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs @@ -184,7 +184,7 @@ namespace Tango.BL.ColorConversion min_standard = standard_stops.Select(x => GetSuggestions(x)).Select(x => x.SingleCoordinates).Min(x => x.ProcessParametersTableIndex); } - if (color_catalog_stops.Count() > 0) + if (color_catalog_stops.Where(x => x.ColorCatalog != null).Count() > 0) { min_catalog = color_catalog_stops.Where(x => x.ColorCatalog != null).Min(x => x.ColorCatalog.ProcessParametersTableIndex); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 77f151fbc..d28f00613 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -464,6 +464,19 @@ namespace Tango.BL.Entities } /// <summary> + /// Gets the duration estimation for this job. + /// </summary> + /// <returns></returns> + public Task<TimeSpan> GetEstimatedDuration() + { + return Task.Factory.StartNew<TimeSpan>(() => + { + var process = GetRecommendedProcessParameters().Result; + return GetEstimatedDuration(process); + }); + } + + /// <summary> /// Translates the job progress to time. /// </summary> /// <param name="progress">The progress.</param> @@ -497,6 +510,22 @@ namespace Tango.BL.Entities }; } + public Task<ProcessParametersTable> GetRecommendedProcessParameters() + { + return Task.Factory.StartNew<ProcessParametersTable>(() => + { + try + { + int index = ColorConversion.TangoColorConverter.GetLeastCommonProcessParametersTableIndex(Segments.SelectMany(x => x.BrushStops)); + return Rml.GetActiveProcessGroup().ProcessParametersTables[index]; + } + catch (Exception ex) + { + throw new InvalidOperationException("Could not calculate the recommended process parameters for the job.", ex); + } + }); + } + public Task<JobFile> ToJobFile() { return Task.Factory.StartNew<JobFile>(() => diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index f79fb6c5b..fd8f3d2d1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -50,5 +50,10 @@ namespace Tango.BL.Entities return Color.FromRgb((byte)rgb.R, (byte)rgb.G, (byte)rgb.B); } } + + public ProcessParametersTablesGroup GetActiveProcessGroup() + { + return ProcessParametersTablesGroups.FirstOrDefault(x => x.Active); + } } } diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs index 0ce3e8369..ce907b57b 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs @@ -97,6 +97,26 @@ public static class ObjectExtensions } /// <summary> + /// Maps the object properties values to the destination object including strings and without assigning null string values from the source. + /// </summary> + /// <param name="source">The source.</param> + /// <param name="destination">The destination.</param> + public static void MapPrimitivesWithStrings(this object source, object destination) + { + foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive || x.PropertyType == typeof(String))) + { + var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); + + if (desProp != null && (desProp.PropertyType.IsPrimitive || desProp.PropertyType == typeof(String)) && desProp.SetMethod != null) + { + var value = prop.GetValue(source); + + desProp.SetValue(destination, value); + } + } + } + + /// <summary> /// Maps the object properties values to the destination object. /// </summary> /// <param name="source">The source.</param> diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml index 409006201..1a77b76be 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml @@ -14,7 +14,7 @@ <Color x:Key="TangoDarkForegroundColor">#3b3e4a</Color> <Color x:Key="TangoLightForegroundColor">#FFFFFF</Color> - <Color x:Key="TangoDividerColor">#c8cbd4</Color> + <Color x:Key="TangoDividerColor">#E7E8E9</Color> <Color x:Key="TangoLightBorderColor">#dbe0e8</Color> <Color x:Key="TangoDisabledBackgroundColor">#B8B8B8</Color> @@ -54,6 +54,8 @@ <Color x:Key="TangoComboBoxPopupTitleBackgroundColor">#DDE7FD</Color> + <Color x:Key="TangoPowerMenuOpenedBackgroundColor">#4E5470</Color> + <!--Brushes--> <SolidColorBrush x:Key="TangoPrimaryBackgroundBrush" Color="{StaticResource TangoPrimaryBackgroundColor}"></SolidColorBrush> <SolidColorBrush x:Key="TangoMidBackgroundBrush" Color="{StaticResource TangoMidBackgroundColor}"></SolidColorBrush> @@ -116,4 +118,6 @@ <SolidColorBrush x:Key="TangoKeyboardKeyLightTextBrush">#F1F1F1</SolidColorBrush> <SolidColorBrush x:Key="TangoComboBoxPopupTitleBackgroundBrush" Color="{StaticResource TangoComboBoxPopupTitleBackgroundColor}"></SolidColorBrush> + + <SolidColorBrush x:Key="TangoPowerMenuOpenedBackgroundBrush" Color="{StaticResource TangoPowerMenuOpenedBackgroundColor}"></SolidColorBrush> </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml index b81e247de..387977e0a 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml @@ -22,4 +22,5 @@ <sys:Double x:Key="TangoComboBoxTitleFontSize">26</sys:Double> <sys:Double x:Key="TangoComboBoxItemFontSize">18</sys:Double> + <sys:Double x:Key="TangoMenuItemFontSize">27</sys:Double> </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchToggleButton.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchToggleButton.xaml index 02450ee95..edf25c256 100644 --- a/Software/Visual_Studio/Tango.Touch/Styles/TouchToggleButton.xaml +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchToggleButton.xaml @@ -18,7 +18,7 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type controls:TouchToggleButton}"> - <Border Background="{TemplateBinding Property=Background}"> + <Border Background="{TemplateBinding Property=Background}" Padding="{TemplateBinding Padding}"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState Name="Normal"/> |
