diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-04-23 22:25:54 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-04-23 22:25:54 +0300 |
| commit | ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb (patch) | |
| tree | 293aee8b1751ce7fce542645722c0f1a96b73097 /Software/Visual_Studio/PPC | |
| parent | 52967e858bd52621208f6360e84f4c47ec435816 (diff) | |
| parent | 636ad730569dfef1a4ee04c8d716d510bcc47ee1 (diff) | |
| download | Tango-ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb.tar.gz Tango-ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb.zip | |
merge alarm handling from remote
Diffstat (limited to 'Software/Visual_Studio/PPC')
120 files changed, 3087 insertions, 1177 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/EventsViews/GeneralView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml index edec8cb55..8ba021afb 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml @@ -3,10 +3,29 @@ 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:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.PPC.Events.EventsViews" mc:Ignorable="d" - d:DesignHeight="450" d:DesignWidth="800"> - <Grid> - <Image Source="../Images/event_demo.png" RenderOptions.BitmapScalingMode="Fant" /> + d:DesignHeight="220" d:DesignWidth="750" d:DataContext="{d:DesignInstance Type=entities:MachinesEvent, IsDesignTimeCreatable=False}"> + <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <Image Stretch="None" Margin="20" DockPanel.Dock="Right" Source="../Images/machine_small.png" RenderOptions.BitmapScalingMode="Fant" /> + <DockPanel Margin="35 20 20 20"> + <TextBlock FontSize="{StaticResource TangoTitleFontSize}" FontWeight="SemiBold" DockPanel.Dock="Top" Text="{Binding EventType.Title,FallbackValue='Unknown Event'}"></TextBlock> + + <StackPanel Margin="0 30 0 0"> + <TextBlock TextWrapping="Wrap" FontWeight="SemiBold" Text="{Binding EventType.Description,FallbackValue='No Description'}"></TextBlock> + <Rectangle Margin="0 5 0 10" StrokeThickness="2" Stroke="{StaticResource TangoDividerBrush}" /> + + <ItemsControl ItemsSource="{Binding EventType.Guidance,Converter={StaticResource StringToLinesConverter}}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <TextBlock Margin="0 10 0 0" Text="{Binding}" TextWrapping="Wrap"></TextBlock> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </DockPanel> + </DockPanel> </Grid> </UserControl> 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/Images/machine_small.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/machine_small.png Binary files differnew file mode 100644 index 000000000..8b86bfe25 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/machine_small.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..e446e3812 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,6 +164,12 @@ <ItemGroup> <Resource Include="Images\event_demo.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\events.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\machine_small.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs index 9ee24ad38..49e0763d9 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs @@ -132,7 +132,7 @@ namespace Tango.PPC.Events.ViewModels var notificationItem = new MessageNotificationItem(); notificationItem.CanClose = false; notificationItem.Message = ev.EventType.Title; - notificationItem.ExpandedMessage = ev.Description; + notificationItem.ExpandedMessage = ev.EventType.Description; notificationItem.Pressed += async (_, __) => { SelectedEventsSource = EventsSource.CURRENT; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml index 3477a5349..af42a5576 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml @@ -83,7 +83,7 @@ <touch:LightTouchDataGridColumn Width="1*" Header="Title" SortMember="Name" HorizontalContentAlignment="Left"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Name,Mode=OneWay}"></TextBlock> + <TextBlock IsHitTestVisible="False" Text="{Binding EventType.Title,Mode=OneWay}"></TextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> @@ -168,7 +168,7 @@ <touch:LightTouchDataGridColumn Width="1*" Header="Title" SortMember="Name" HorizontalContentAlignment="Left"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Name,Mode=OneWay}"></TextBlock> + <TextBlock IsHitTestVisible="False" Text="{Binding EventType.Title,Mode=OneWay}"></TextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config index cca4bcfd8..cfbf4bb5c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config @@ -20,7 +20,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> @@ -28,27 +28,27 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> @@ -74,6 +74,18 @@ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/AppBarItems/JobProgressAppBarItemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/AppBarItems/JobProgressAppBarItemView.xaml index 5e193edbf..cdc28335d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/AppBarItems/JobProgressAppBarItemView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/AppBarItems/JobProgressAppBarItemView.xaml @@ -10,11 +10,11 @@ <touch:TouchButton Style="{StaticResource TangoFlatButton}" Command="{Binding PressedCommand}" Padding="0"> <StackPanel VerticalAlignment="Center"> <TextBlock Text="{Binding MachineProvider.MachineOperator.RunningJob.Name,FallbackValue='Job Name'}" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> - <ProgressBar Maximum="{Binding MachineProvider.MachineOperator.RunningJobStatus.TotalProgress}" Value="{Binding MachineProvider.MachineOperator.RunningJobStatus.Progress}" Margin="0 10 0 5" Background="{StaticResource TangoGrayBrush}" Height="5" Foreground="{StaticResource TangoPrimaryAccentBrush}" BorderThickness="0" /> + <ProgressBar Maximum="{Binding MachineProvider.MachineOperator.RunningJobStatus.TotalProgressMinusSettingUp}" Value="{Binding MachineProvider.MachineOperator.RunningJobStatus.ProgressMinusSettingUp}" Margin="0 10 0 5" Background="{StaticResource TangoGrayBrush}" Height="5" Foreground="{StaticResource TangoPrimaryAccentBrush}" BorderThickness="0" /> <DockPanel LastChildFill="False"> <TextBlock DockPanel.Dock="Left"> <Run>Completed</Run> - <Run Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.Progress,StringFormat=0}"></Run><Run>/</Run><Run Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.TotalProgress,StringFormat=0}"></Run><Run>m</Run> + <Run Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.ProgressMinusSettingUp,StringFormat=0}"></Run><Run>/</Run><Run Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.TotalProgressMinusSettingUp,StringFormat=0}"></Run><Run>m</Run> </TextBlock> <TextBlock DockPanel.Dock="Right"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml index e7a416623..fd0a63456 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml @@ -7,7 +7,7 @@ xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.PPC.Jobs.Controls" mc:Ignorable="d" - d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=entities:Job, IsDesignTimeCreatable=False}"> + d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=entities:Job, IsDesignTimeCreatable=False}" x:Name="control"> <Grid> <Grid.ColumnDefinitions> @@ -20,7 +20,7 @@ <RowDefinition Height="1*" /> </Grid.RowDefinitions> - <ItemsControl ClipToBounds="False" ItemsSource="{Binding EffectiveSegments}" Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DisplayMarkers,Converter={StaticResource BooleanToVisibilityConverter}}"> + <ItemsControl ClipToBounds="False" ItemsSource="{Binding EffectiveSegments,IsAsync=True}" Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DisplayMarkers,Converter={StaticResource BooleanToVisibilityConverter}}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> @@ -28,7 +28,7 @@ </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <Grid> + <Grid x:Name="grid"> <Grid.Width> <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Length"></Binding> @@ -42,13 +42,13 @@ <Style TargetType="TextBlock"> <Setter Property="Visibility" Value="Visible"></Setter> <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Grid},Path=ActualWidth,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=20}" Value="True"> + <DataTrigger Binding="{Binding ElementName=grid,Path=ActualWidth,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=20}" Value="True"> <Setter Property="Visibility" Value="Collapsed"></Setter> </DataTrigger> </Style.Triggers> </Style> </TextBlock.Style> - <Run Text="{Binding LengthWithFactor,Mode=OneWay,StringFormat=N0}"></Run><Run Text="m"></Run> + <Run Text="{Binding LengthWithFactor,Mode=OneWay,StringFormat=N0,IsAsync=True}"></Run><Run Text="m"></Run> </TextBlock> </Grid> </DataTemplate> @@ -67,7 +67,7 @@ </RectangleGeometry> </Border.Clip> <Grid> - <ItemsControl ClipToBounds="False" ItemsSource="{Binding EffectiveSegments}"> + <ItemsControl ClipToBounds="False" ItemsSource="{Binding EffectiveSegments,IsAsync=True}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> @@ -102,7 +102,7 @@ <MultiDataTrigger> <MultiDataTrigger.Conditions> <Condition Binding="{Binding JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}" /> - <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsActive}" Value="False" /> + <Condition Binding="{Binding ElementName=control,Path=IsActive}" Value="False" /> </MultiDataTrigger.Conditions> <Setter Property="Visibility" Value="Visible"></Setter> </MultiDataTrigger> 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/Converters/ColorSpaceToVisibilityConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToVisibilityConverter.cs new file mode 100644 index 000000000..f7e3bb282 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/ColorSpaceToVisibilityConverter.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; +using Tango.BL.Entities; + +namespace Tango.PPC.Jobs.Converters +{ + public class ColorSpaceToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + ColorSpace colorSpace = value as ColorSpace; + + if (colorSpace != null) + { + if (colorSpace.Space == BL.Enumerations.ColorSpaces.Twine || colorSpace.Space == BL.Enumerations.ColorSpaces.Coats) + { + return Visibility.Collapsed; + } + } + + return Visibility.Visible; + } + + 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..cecdf813c 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,53 @@ <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> + + <Grid> + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="70 0" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" /> - <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 Margin="-20 -40 -20 0"> + <touch:TouchStaticListBox VerticalAlignment="Center" 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> + </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/Messages/NavigatedToJobsModuleMessage.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Messages/NavigatedToJobsModuleMessage.cs new file mode 100644 index 000000000..3f2be3f89 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Messages/NavigatedToJobsModuleMessage.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Jobs.Messages +{ + public class NavigatedToJobsModuleMessage + { + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobSummeryNavigationObject.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobSummeryNavigationObject.cs new file mode 100644 index 000000000..912b42683 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobSummeryNavigationObject.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; + +namespace Tango.PPC.Jobs.NavigationObjects +{ + public class JobSummeryNavigationObject + { + public ObservablesContext Context { get; set; } + public Job Job { get; set; } + } +} 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..5b7e97c93 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,8 @@ <Compile Include="Controls\TwineCatalogViewer.xaml.cs"> <DependentUpon>TwineCatalogViewer.xaml</DependentUpon> </Compile> + <Compile Include="Converters\ColorSpaceToImageConverter.cs" /> + <Compile Include="Converters\ColorSpaceToVisibilityConverter.cs" /> <Compile Include="Converters\JobProgressToPositionConverter.cs" /> <Compile Include="Converters\JobsCategoryToVisibilityConverter.cs" /> <Compile Include="Converters\JobToPieImageConverter.cs" /> @@ -186,7 +188,9 @@ <Compile Include="JobsModule.cs" /> <Compile Include="JobsModuleSettings.cs" /> <Compile Include="Messages\JobSelectedMessage.cs" /> + <Compile Include="Messages\NavigatedToJobsModuleMessage.cs" /> <Compile Include="NavigationObjects\JobNavigationObject.cs" /> + <Compile Include="NavigationObjects\JobSummeryNavigationObject.cs" /> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> @@ -390,10 +394,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/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs index 264f41131..103a10b28 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs @@ -4,12 +4,14 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.Core.Commands; using Tango.Integration.Operation; using Tango.PPC.Common; using Tango.PPC.Common.Navigation; using Tango.PPC.Jobs.AppBarItems; using Tango.PPC.Jobs.AppButtons; using Tango.PPC.Jobs.Dialogs; +using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; namespace Tango.PPC.Jobs.ViewModels @@ -47,10 +49,24 @@ namespace Tango.PPC.Jobs.ViewModels #endregion + #region Commands + + /// <summary> + /// Gets or sets the go to job command. + /// </summary> + /// <value> + /// The go to job command. + /// </value> + public RelayCommand GoToJobCommand { get; set; } + + #endregion + public JobProgressViewVM() { _stop_job_btn = new StopPrintingButton(); _stop_job_btn.Pressed += _stop_job_btn_Pressed; + + GoToJobCommand = new RelayCommand(GoToJob); } private void _stop_job_btn_Pressed() @@ -61,6 +77,12 @@ namespace Tango.PPC.Jobs.ViewModels } } + private void GoToJob() + { + NavigationManager.NavigateWithObject<JobsModule, JobView, JobNavigationObject>(new JobNavigationObject() { Job = _handler.Job }); + NavigationManager.ClearHistoryExcept<JobsView>(); + } + #region Override Methods /// <summary> @@ -78,7 +100,7 @@ namespace Tango.PPC.Jobs.ViewModels { base.OnNavigatedFrom(); - if (MachineProvider.MachineOperator.IsPrinting) + if (MachineProvider.MachineOperator.IsPrinting && _handler != null && !_handler.IsCanceled) { NotificationProvider.PushAppBarItem<JobProgressAppBarItem>().Pressed += (_, __) => { @@ -119,6 +141,8 @@ namespace Tango.PPC.Jobs.ViewModels e.JobHandler.StatusChanged += JobHandler_StatusChanged; e.JobHandler.SpoolChangeRequired += JobHandler_SpoolChangeRequired; e.JobHandler.Stopped += JobHandler_Stopped; + + _stop_job_btn.Push(); } /// <summary> 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..1a980fc4a 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 @@ -9,7 +9,9 @@ using Tango.BL.Entities; using Tango.Core.Commands; using Tango.PPC.Common; using Tango.PPC.Common.Messages; +using Tango.PPC.Common.Navigation; using Tango.PPC.Jobs.Messages; +using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; namespace Tango.PPC.Jobs.ViewModels @@ -18,7 +20,7 @@ namespace Tango.PPC.Jobs.ViewModels /// Represents the job summary view model. /// </summary> /// <seealso cref="Tango.PPC.Common.PPCViewModel" /> - public class JobSummeryViewVM : PPCViewModel + public class JobSummeryViewVM : PPCViewModel, INavigationObjectReceiver<JobSummeryNavigationObject> { private ObservablesContext _context; @@ -32,6 +34,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> @@ -47,23 +61,11 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public JobSummeryViewVM() { - RegisterForMessage<JobSelectedMessage>(HandleJobSelectedMessage); - DyeCommand = new RelayCommand(StartJob); EditCommand = new RelayCommand(EditJob); } /// <summary> - /// Handles the job selected message. - /// </summary> - /// <param name="message">The message.</param> - private void HandleJobSelectedMessage(JobSelectedMessage message) - { - _context = message.Context; - Job = message.Job; - } - - /// <summary> /// Edits the job. /// </summary> private void EditJob() @@ -81,16 +83,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 PrintingManager.Print(Job, _context); + await NavigationManager.NavigateTo<JobsModule>(false, nameof(JobProgressView)); } catch (Exception ex) { @@ -106,5 +100,26 @@ namespace Tango.PPC.Jobs.ViewModels { } + + public async void OnNavigatedToWithObject(JobSummeryNavigationObject obj) + { + _context = obj.Context; + Job = obj.Job; + + Job = await new JobBuilder(_context).Set(Job.Guid) + .WithConfiguration() + .WithRML() + .WithUser() + .WithSegments() + .WithBrushStops() + .BuildAsync(); + + + try + { + EstimatedDuration = await Job.GetEstimatedDuration(); + } + catch { } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index f0cf87079..713dfce42 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -31,6 +31,9 @@ using Tango.Logging; using Tango.PPC.Common.Messages; using Tango.BL.Builders; using Tango.PPC.Jobs.AppButtons; +using Tango.Core.Threading; +using System.Diagnostics; +using System.Runtime.ExceptionServices; namespace Tango.PPC.Jobs.ViewModels { @@ -47,6 +50,7 @@ namespace Tango.PPC.Jobs.ViewModels private JobNavigationIntent _job_to_load_intent; private static Dictionary<String, List<FineTuneItem>> _jobs_fine_tune_items; private StartPrintingButton _start_printing_btn; + private ActionTimer _volumeConversionTimer; #region Properties @@ -319,6 +323,8 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public JobViewVM() { + _volumeConversionTimer = new ActionTimer(TimeSpan.FromMilliseconds(50)); + RegisterForMessage<JobSelectedMessage>(HandleJobSelectedMessage); FineTuneItems = new ObservableCollection<FineTuneItem>(); @@ -396,7 +402,8 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log($"Loading selected job '{_job_to_load.Name}'..."); - NotificationProvider.SetGlobalBusyMessage("Loading job details..."); + //NotificationProvider.SetGlobalBusyMessage("Loading job details..."); + IsFree = false; _can_navigate_back = false; @@ -425,6 +432,11 @@ namespace Tango.PPC.Jobs.ViewModels Customers = await _db.Customers.Where(x => x.OrganizationGuid == MachineProvider.Machine.OrganizationGuid).ToListAsync(); TwineCatalogItems = await _db.ColorCatalogs.Where(x => x.RmlGuid == Job.Rml.Guid && x.ColorSpace.Code == (int)BL.Enumerations.ColorSpaces.Twine).OrderBy(x => x.Name).ToListAsync(); + foreach (var segment in Job.Segments) + { + SetSegmentLiquidVolumesIfVolume(segment); + } + if (!_check_gamut_thread.IsAlive) { _check_gamut_thread.Start(); @@ -433,10 +445,6 @@ namespace Tango.PPC.Jobs.ViewModels SegmentsCollectionView = CollectionViewSource.GetDefaultView(Job.Segments); SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending)); - InvokeUIOnIdle(() => - { - NotificationProvider.ReleaseGlobalBusyMessage(); - }); _job_to_load = null; } @@ -471,10 +479,16 @@ namespace Tango.PPC.Jobs.ViewModels LogManager.Log(ex, $"Error loading job '{_job_to_load.Name}'"); await NotificationProvider.ShowError("An error occurred while trying to load the selected job."); } + finally + { + InvokeUIOnIdle(() => + { + IsFree = true; + //NotificationProvider.ReleaseGlobalBusyMessage(); + }); + } } - - /// <summary> /// Saves the job. /// </summary> @@ -545,18 +559,18 @@ namespace Tango.PPC.Jobs.ViewModels /// <summary> /// Starts the job. /// </summary> - private void StartJob() + private async void StartJob() { try { LogManager.Log("Start job command pressed. Starting job and navigating to job progress view..."); - PrintingManager.Print(Job, _db); - NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); + await PrintingManager.Print(Job, _db); + await NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); } catch (Exception ex) { LogManager.Log(ex, "Could not start the current job."); - NotificationProvider.ShowError($"Cannot start job.\n{ex.Message}."); + await NotificationProvider.ShowError($"Cannot start job.\n{ex.Message}."); } } @@ -598,7 +612,9 @@ namespace Tango.PPC.Jobs.ViewModels try { LogManager.Log("Adding new solid segment..."); - return Job.AddSolidSegment(MachineProvider.Machine.DefaultSegmentLength > 0 ? MachineProvider.Machine.DefaultSegmentLength : 10); + var s = Job.AddSolidSegment(MachineProvider.Machine.DefaultSegmentLength > 0 ? MachineProvider.Machine.DefaultSegmentLength : 10); + SetSegmentLiquidVolumesIfVolume(s); + return s; } catch (Exception ex) { @@ -616,7 +632,9 @@ namespace Tango.PPC.Jobs.ViewModels try { LogManager.Log("Adding new gradient segment..."); - return Job.AddGradientSegment(MachineProvider.Machine.DefaultSegmentLength > 0 ? MachineProvider.Machine.DefaultSegmentLength : 10); + var s = Job.AddGradientSegment(MachineProvider.Machine.DefaultSegmentLength > 0 ? MachineProvider.Machine.DefaultSegmentLength : 10); + SetSegmentLiquidVolumesIfVolume(s); + return s; } catch (Exception ex) { @@ -680,6 +698,18 @@ namespace Tango.PPC.Jobs.ViewModels } } + /// <summary> + /// Sets the segment liquid volumes. + /// </summary> + /// <param name="segment">The segment.</param> + private void SetSegmentLiquidVolumesIfVolume(Segment segment) + { + if (Job.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32()) + { + segment.BrushStops.ToList().ForEach(x => x.SetLiquidVolumes(Job.Machine.Configuration, Job.Rml, Job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault())); + } + } + #endregion #region Brush Stops Management @@ -692,6 +722,7 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log($"Adding new brush stop to segment {segment.SegmentIndex}."); segment.AddBrushStop(); + SetSegmentLiquidVolumesIfVolume(segment); } /// <summary> @@ -761,11 +792,36 @@ namespace Tango.PPC.Jobs.ViewModels /// <summary> /// Called when the brush stop field value has been changed (This called from the view!). /// </summary> - /// <param name="brushStop">The brush stop.</param> - public void OnBrushStopFieldValueChanged(BrushStop brushStop) + /// <param name="stop">The brush stop.</param> + [HandleProcessCorruptedStateExceptions] + public void OnBrushStopFieldValueChanged(BrushStop stop) { - brushStop.Corrected = false; - brushStop.OutOfGamutChecked = false; + if (stop != null) + { + stop.Corrected = false; + stop.OutOfGamutChecked = false; + + if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.Volume) + { + _volumeConversionTimer.ResetReplace(() => + { + try + { + var output = TangoColorConverter.GetSuggestions(stop); + + stop.Red = output.SingleCoordinates.Red; + stop.Green = output.SingleCoordinates.Green; + stop.Blue = output.SingleCoordinates.Blue; + stop.Corrected = true; + stop.IsOutOfGamut = false; + } + catch (Exception ex) + { + LogManager.Log(ex, "An error occurred while trying to get volume => RGB from conversion engine."); + } + }); + } + } } /// <summary> @@ -802,20 +858,20 @@ namespace Tango.PPC.Jobs.ViewModels /// <summary> /// Starts a sample dye. /// </summary> - private void StartSampleDye() + private async void StartSampleDye() { try { LogManager.Log("Sample dye command pressed..."); - PrintingManager.PrintSample(Job, _db); + await PrintingManager.PrintSample(Job, _db); - NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); + await NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); } catch (Exception ex) { LogManager.Log(ex, $"Error executing sample dye for job {Job.Name}."); - NotificationProvider.ShowError("An error occurred while trying to execute the sample dye."); + await NotificationProvider.ShowError("An error occurred while trying to execute the sample dye."); } } @@ -940,7 +996,7 @@ namespace Tango.PPC.Jobs.ViewModels /// <summary> /// Starts the fine tuning. /// </summary> - private void StartFineTuning() + private async void StartFineTuning() { try { @@ -948,14 +1004,14 @@ namespace Tango.PPC.Jobs.ViewModels _jobs_fine_tune_items[Job.Guid] = FineTuneItems.ToList(); - PrintingManager.PrintFineTuning(Job, _db, FineTuneItems); + await PrintingManager.PrintFineTuning(Job, _db, FineTuneItems); - NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); + await NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); } catch (Exception ex) { LogManager.Log(ex, "Error executing fine tuning job."); - NotificationProvider.ShowError("An error occurred while trying to start the fine tuning job."); + await NotificationProvider.ShowError("An error occurred while trying to start the fine tuning job."); } } 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..bd6f95d44 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 @@ -225,6 +225,7 @@ namespace Tango.PPC.Jobs.ViewModels RegisterForMessage<JobRemovedMessage>(HandleJobRemovedMessage); RegisterForMessage<JobSavedMessage>(HandleJobSavedMessage); + RegisterForMessage<NavigatedToJobsModuleMessage>((x) => Filter = null); } #endregion @@ -271,15 +272,20 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log($"Job '{job.Name}' selected."); - if (!directlyToEdit) + RaiseMessage(new JobSelectedMessage() { Job = job, Context = _db }); + + if (!directlyToEdit && MachineProvider.MachineOperator.Status == Integration.Operation.MachineStatuses.ReadyToDye) { - await NavigationManager.NavigateTo<JobsModule>(nameof(JobSummeryView)); + await NavigationManager.NavigateWithObject<JobsModule, JobSummeryView, JobSummeryNavigationObject>(new JobSummeryNavigationObject() + { + Context = _db, + Job = job, + }); } else { await NavigationManager.NavigateTo<JobsModule>(nameof(JobView)); } - RaiseMessage(new JobSelectedMessage() { Job = job, Context = _db }); } /// <summary> @@ -306,7 +312,7 @@ namespace Tango.PPC.Jobs.ViewModels Jobs = jobs; DraftJobsCollectionView = new ListCollectionView(Jobs); DraftJobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); - DraftJobsCollectionView.Filter = new Predicate<object>(x => + DraftJobsCollectionView.Filter = new Predicate<object>(x => { var job = x as Job; @@ -323,7 +329,7 @@ namespace Tango.PPC.Jobs.ViewModels HistoryJobsCollectionView = new ListCollectionView(Jobs); HistoryJobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); - HistoryJobsCollectionView.Filter = new Predicate<object>(x => + HistoryJobsCollectionView.Filter = new Predicate<object>(x => { var job = x as Job; @@ -372,7 +378,7 @@ namespace Tango.PPC.Jobs.ViewModels JobCreationViewVM vm = new JobCreationViewVM( machine.SupportedJobTypes.Count > 0 ? machine.SupportedJobTypes : Enum.GetValues(typeof(JobTypes)).Cast<JobTypes>().ToList(), - machine.SupportedColorSpaces.Count > 0 ? machine.SupportedColorSpaces : Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x.IsUserSpace()).ToList() + machine.SupportedColorSpaces.Count > 0 ? machine.SupportedColorSpaces : Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x.IsUserSpace() || (ApplicationManager.IsInTechnicianMode && x == ColorSpaces.Volume)).ToList() ); var settings = SettingsManager.Default.GetOrCreate<JobsModuleSettings>(); @@ -419,13 +425,14 @@ namespace Tango.PPC.Jobs.ViewModels job.CreationDate = DateTime.UtcNow; job.JobStatus = JobStatuses.Draft; job.JobType = vm.SelectedJobType; + job.EnableLubrication = true; job.ColorSpaceGuid = Adapter.ColorSpaces.FirstOrDefault(x => x.Code == vm.SelectedColorSpace.ToInt32()).Guid; job.MachineGuid = MachineProvider.Machine.Guid; job.UserGuid = AuthenticationProvider.CurrentUser.Guid; job.RmlGuid = machine.DefaultRml != null ? machine.DefaultRmlGuid : Adapter.Rmls.FirstOrDefault().Guid; job.WindingMethodGuid = Adapter.WindingMethods.FirstOrDefault().Guid; job.SpoolTypeGuid = machine.DefaultSpoolType != null ? machine.DefaultSpoolTypeGuid : Adapter.SpoolTypes.FirstOrDefault().Guid; - + if (Jobs.Count > 0) { job.JobIndex = Jobs.Max(x => x.JobIndex) + 1; @@ -529,13 +536,16 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> private void OnFilterChanged() { - if (SelectedCategory == JobsCategory.Draft) - { - DraftJobsCollectionView.Refresh(); - } - else if (SelectedCategory == JobsCategory.History) + if (DraftJobsCollectionView != null && HistoryJobsCollectionView != null) { - HistoryJobsCollectionView.Refresh(); + if (SelectedCategory == JobsCategory.Draft) + { + DraftJobsCollectionView.Refresh(); + } + else if (SelectedCategory == JobsCategory.History) + { + HistoryJobsCollectionView.Refresh(); + } } } @@ -590,13 +600,21 @@ namespace Tango.PPC.Jobs.ViewModels StorageProvider.RegisterFileHandler(ExplorerFileDefinition.Job.Extension, HandleJobFileLoaded); } + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + Filter = null; + } + #endregion #region Job Export private async void ExportJob() { - var selected_job = SelectedJobs.First(); + var selected_job = SelectedJobs.FirstOrDefault(); + if (selected_job == null) return; + ClearSelection(); var result = await NavigationManager. diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs index 5b4a3e403..ed1e28f55 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs @@ -3,12 +3,15 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Builders; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Integration.Operation; using Tango.PPC.Common; using Tango.PPC.Common.Notifications; using Tango.PPC.Common.Notifications.NotificationItems; +using Tango.PPC.Jobs.Messages; using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; @@ -20,6 +23,8 @@ namespace Tango.PPC.Jobs.ViewModels /// <seealso cref="Tango.PPC.Common.PPCViewModel" /> public class MainViewVM : PPCViewModel { + private NotificationItem _last_failed_job_notification; + /// <summary> /// Called when the application has been started. /// </summary> @@ -27,6 +32,44 @@ namespace Tango.PPC.Jobs.ViewModels { MachineProvider.MachineOperator.PrintingCompleted += MachineOperator_PrintingCompleted; MachineProvider.MachineOperator.PrintingFailed += MachineOperator_PrintingFailed; + MachineProvider.MachineOperator.ResumingJob += MachineOperator_ResumingJob; + } + + private async void MachineOperator_ResumingJob(object sender, ResumingJobEventArgs e) + { + LogManager.Log($"Trying to resume job '{e.JobGuid}'..."); + + try + { + var job = await new JobBuilder(ObservablesContext.CreateDefault()).Set(e.JobGuid) + .WithConfiguration() + .WithRML() + .WithUser() + .WithSegments() + .WithBrushStops() + .BuildAsync(); + + e.Approve(job); + + InvokeUI(() => + { + NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); + + if (_last_failed_job_notification != null) + { + _last_failed_job_notification.Close(); + _last_failed_job_notification = null; + } + }); + } + catch (Exception ex) + { + LogManager.Log(ex, "An error occurred while trying to resume the job."); + InvokeUI(() => + { + NotificationProvider.ShowError("An error occurred while trying to resume a job in progress."); + }); + } } /// <summary> @@ -36,7 +79,7 @@ namespace Tango.PPC.Jobs.ViewModels /// <param name="e">The <see cref="Integration.Operation.PrintingFailedEventArgs"/> instance containing the event data.</param> private void MachineOperator_PrintingFailed(object sender, PrintingFailedEventArgs e) { - NotificationProvider.PushNotification(new MessageNotificationItem( + _last_failed_job_notification = NotificationProvider.PushNotification(new MessageNotificationItem( String.Format("'{0}' failed.", e.Job.Name), String.Format("The job '{1}' has failed due to unexpected error.{0}{2}{0}{0}Tap to view this job details.", Environment.NewLine, e.Job.Name, e.Exception), MessageNotificationItem.MessageNotificationItemTypes.Error, () => { @@ -79,5 +122,11 @@ namespace Tango.PPC.Jobs.ViewModels })); } } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + RaiseMessage<NavigatedToJobsModuleMessage>(); + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml index 0227e24f5..037fac09c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml @@ -203,14 +203,14 @@ <Grid> <controls:RunningJobViewer Height="30" Width="600" DisplayMarkers="False" IsActive="True" Job="{Binding Job}" RunningJobStatus="{Binding RunningJobStatus}" /> - <TextBlock Margin="0 0 -40 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Right"> + <TextBlock Margin="0 0 -50 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Right"> <Run Text="x"></Run><Run Text="{Binding RunningJobStatus.RemainingUnits}"></Run> </TextBlock> </Grid> </StackPanel> </Grid> - <touch:TouchButton Margin="0 100 0 0" Style="{StaticResource TangoLinkButton}" Height="60" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding RunningJobStatus.IsCompleted,Converter={StaticResource BooleanToVisibilityConverter}}"> + <touch:TouchButton Margin="0 100 0 0" Command="{Binding GoToJobCommand}" Style="{StaticResource TangoLinkButton}" Height="60" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding RunningJobStatus.IsCompleted,Converter={StaticResource BooleanToVisibilityConverter}}"> Go to job </touch:TouchButton> </StackPanel> 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/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index b6dcad145..75c4e9578 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 @@ -12,13 +12,21 @@ xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:localConverters="clr-namespace:Tango.PPC.Jobs.Converters" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:localControls="clr-namespace:Tango.PPC.Jobs.Controls" xmlns:local="clr-namespace:Tango.PPC.Jobs.Views" mc:Ignorable="d" - d:DesignHeight="2000" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:JobViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.JobViewVM}"> + d:DesignHeight="2000" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:JobViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.JobViewVM}" x:Name="view"> <UserControl.Resources> + + <localConverters:ColorSpaceToVisibilityConverter x:Key="ColorSpaceToVisibilityConverter" /> + <BitmapImage x:Key="Image_Out_Of_Gamut" UriSource="../Images/JobView/error.png" /> + <BitmapImage x:Key="Image_Replace_Color" UriSource="../Images/JobView/replace-color.png" /> + <BitmapImage x:Key="Image_Color_Picker" UriSource="../Images/JobView/color-picker.png" /> + + <Style TargetType="FrameworkElement" x:Key="Level1Container"> <Setter Property="Margin" Value="20 15 60 15"></Setter> </Style> @@ -29,6 +37,42 @@ <Setter Property="Margin" Value="80 40 60 0"></Setter> </Style> + <DataTemplate x:Key="Volume_Template" DataType="{x:Type entities:BrushStop}"> + <Grid> + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" Margin="0 0 -90 0"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Border> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IdsPack.IdsPackFormula.Name}" Value="Lubricant"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding IdsPack.IdsPackFormula.Name}" Value="Cleaner"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <touch:TouchNumericTextBox DisplayWatermarkHint="True" Width="50" Watermark="{Binding IdsPack.LiquidType.Name,IsAsync=True}" Margin="2 0" ValueChanged="OnLiquidVolumeFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Volume}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="100" JoggingFactor="0.5" StringFormat="0.00" /> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <Canvas VerticalAlignment="Bottom" Visibility="{Binding IsLiquidVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <controls:FastTextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Liquid volumes are out of range."></controls:FastTextBlock> + </Canvas> + </Grid> + </DataTemplate> + <DataTemplate x:Key="RGB_Template" DataType="{x:Type entities:BrushStop}"> <UniformGrid Rows="1" Columns="3"> <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Red}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" /> @@ -57,7 +101,7 @@ <DataTemplate x:Key="TWINE_Template" DataType="{x:Type entities:BrushStop}"> <DockPanel> <touch:TouchIconButton Margin="0 0 -40 0" CornerRadius="50" Width="32" Height="32" Padding="5" RippleBrush="{StaticResource TangoRippleDarkBrush}" DockPanel.Dock="Right" Icon="Palette" Foreground="{StaticResource TangoPrimaryAccentBrush}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.OpenTwineCatalogCommand}" CommandParameter="{Binding}"></touch:TouchIconButton> - <touch:TouchAutoComplete Margin="2 0" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TwineCatalogItems}" Watermark="Color Code" PopupHeight="250" DisplayMemberPath="Name" AutoCompleteProvider="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TwineCatalogAutoCompleteProvider}" SelectedItem="{Binding ColorCatalog,Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" keyboard:KeyboardView.Container="{Binding ElementName=Container}"> + <touch:TouchAutoComplete Margin="2 0" ItemsSource="{Binding ElementName=view,Path=DataContext.TwineCatalogItems}" Watermark="Color Code" PopupHeight="250" DisplayMemberPath="Name" AutoCompleteProvider="{Binding ElementName=view,Path=DataContext.TwineCatalogAutoCompleteProvider}" SelectedItem="{Binding ColorCatalog,Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" keyboard:KeyboardView.Container="{Binding ElementName=Container}"> <touch:TouchAutoComplete.ItemTemplate> <DataTemplate> <DockPanel Margin="2"> @@ -80,7 +124,7 @@ <StackPanel Orientation="Horizontal"> <Border Width="48" Height="48" CornerRadius="5" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}"> <Border.Background> - <SolidColorBrush Color="{Binding Color}"></SolidColorBrush> + <SolidColorBrush Color="{Binding Color,IsAsync=True}"></SolidColorBrush> </Border.Background> </Border> @@ -90,35 +134,42 @@ </StackPanel> <DockPanel LastChildFill="False" Margin="0 20 0 0"> - <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Color code:</TextBlock> + <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Color code:</controls:FastTextBlock> <ContentControl Focusable="False" Margin="20 0 0 0" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="300" Content="{Binding}"> <ContentControl.Style> <Style TargetType="ContentControl"> - <Setter Property="ContentTemplate" Value="{x:Null}"></Setter> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate/> + </Setter.Value> + </Setter> <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="RGB"> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="RGB"> <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="CMYK"> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="CMYK"> <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="LAB"> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="LAB"> <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="Twine"> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Twine"> <Setter Property="ContentTemplate" Value="{StaticResource TWINE_Template}" /> </DataTrigger> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Volume"> + <Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" /> + </DataTrigger> </Style.Triggers> </Style> </ContentControl.Style> </ContentControl> </DockPanel> - <Canvas Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> - <TextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></TextBlock> + <Canvas Visibility="{Binding IsOutOfGamut,IsAsync=True,Converter={StaticResource BooleanToVisibilityConverter}}"> + <controls:FastTextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></controls:FastTextBlock> </Canvas> - <DockPanel LastChildFill="False" Margin="0 20 0 0" IsEnabled="{Binding IsMiddle}"> + <DockPanel LastChildFill="False" Margin="0 20 0 0" IsEnabled="{Binding IsMiddle,IsAsync=True}"> <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Position (m):</TextBlock> <Grid Margin="20 0 0 0" Width="300" DockPanel.Dock="Right"> <Grid.ColumnDefinitions> @@ -126,21 +177,24 @@ <ColumnDefinition Width="2*" /> </Grid.ColumnDefinitions> - <touch:TouchNumericTextBox Value="{Binding OffsetMeters}" HasDecimalPoint="True" StringFormat="0.0" Maximum="{Binding Segment.Length}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox> + <touch:TouchNumericTextBox Value="{Binding OffsetMeters}" HasDecimalPoint="True" StringFormat="0.0" Maximum="{Binding Segment.Length,IsAsync=True}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox> <!--<touch:TouchSlider Grid.Column="1" Height="30" Margin="10 0 0 -23" Maximum="{Binding Segment.Length}" Value="{Binding OffsetMeters}" />--> </Grid> </DockPanel> </StackPanel> <StackPanel Orientation="Horizontal" Margin="0 0 -130 0" HorizontalAlignment="Right" VerticalAlignment="Top"> - <touch:TouchImageButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding}" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}" Width="50" Height="50" Padding="10" Image="../Images/JobView/replace-color.png" CornerRadius="30"></touch:TouchImageButton> - <touch:TouchIconButton Margin="0 0 50 0" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveBrushStopCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> + <touch:TouchImageButton Command="{Binding ElementName=view,Path=DataContext.ReplaceBrushStopCommand,IsAsync=True}" CommandParameter="{Binding}" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" Width="50" Height="50" Padding="10" Image="{StaticResource Image_Replace_Color}" CornerRadius="30"></touch:TouchImageButton> + <touch:TouchIconButton Margin="0 0 50 0" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding ElementName=view,Path=DataContext.RemoveBrushStopCommand,IsAsync=True}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> </StackPanel> </Grid> </DataTemplate> <DataTemplate x:Key="Segment_Template" DataType="{x:Type entities:Segment}"> <Border Margin="0 0 0 15" RenderOptions.EdgeMode="Unspecified" CornerRadius="8" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}"> + <Border.CacheMode> + <BitmapCache RenderAtScale="1" SnapsToDevicePixels="True" /> + </Border.CacheMode> <!--<Border.Effect> <DropShadowEffect Opacity="0.5" Color="{StaticResource TangoDropShadowColor}" BlurRadius="10" ShadowDepth="15" /> </Border.Effect>--> @@ -149,7 +203,7 @@ <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <Grid Background="Transparent" dragAndDrop:DragAndDropService.DropCommand="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SegmentDroppedCommand}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.Droppable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding ElementName=DraggingSurface}"> + <Grid Background="Transparent" dragAndDrop:DragAndDropService.DropCommand="{Binding ElementName=view,Path=DataContext.SegmentDroppedCommand}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.Droppable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding ElementName=DraggingSurface}"> <Grid.Style> <Style TargetType="Grid"> <Setter Property="Opacity" Value="1"></Setter> @@ -165,7 +219,7 @@ <Style TargetType="DockPanel"> <Setter Property="Height" Value="163"></Setter> <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked}" Value="True"> + <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked,IsAsync=True}" Value="True"> <Setter Property="Height" Value="74"></Setter> </DataTrigger> </Style.Triggers> @@ -175,15 +229,15 @@ <Border.Style> <Style TargetType="Border"> <Setter Property="CornerRadius" Value="8 0 0 8"></Setter> - <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,IsAsync=True}"></Setter> <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked}" Value="True"> - <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='*2'}"></Setter> + <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked,IsAsync=True}" Value="True"> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='*2',IsAsync=True}"></Setter> </DataTrigger> <MultiDataTrigger> <MultiDataTrigger.Conditions> - <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True"></Condition> - <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True"></Condition> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"></Condition> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True"></Condition> </MultiDataTrigger.Conditions> <Setter Property="CornerRadius" Value="8 0 0 0"></Setter> </MultiDataTrigger> @@ -195,48 +249,57 @@ <Grid> <DockPanel Margin="30 0" VerticalAlignment="Center"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> - <Canvas Visibility="{Binding HasOutOfGamutBrushStop,Converter={StaticResource BooleanToVisibilityConverter}}"> - <Image Canvas.Left="-25" Canvas.Top="1" Source="../Images/JobView/error.png" Width="19" Height="19" /> + <Canvas Visibility="{Binding HasOutOfGamutBrushStop,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}"> + <Image Canvas.Left="-25" Canvas.Top="1" Source="{StaticResource Image_Out_Of_Gamut}" Width="19" Height="19" /> </Canvas> <TextBlock FontSize="{StaticResource TangoTitleFontSize}"> <Run>Segment #</Run> - <Run Text="{Binding SegmentIndex,Mode=OneWay}"></Run> + <Run Text="{Binding SegmentIndex,Mode=OneWay,IsAsync=True}"></Run> </TextBlock> </StackPanel> - <StackPanel Margin="0 30 0 0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="300" Visibility="{Binding ElementName=toggle_large_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}"> + <StackPanel Margin="0 30 0 0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="300" Visibility="{Binding ElementName=toggle_large_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}"> <DockPanel LastChildFill="False"> <DockPanel.Style> <Style TargetType="DockPanel"> <Setter Property="Visibility" Value="Visible"></Setter> <Style.Triggers> - <DataTrigger Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True"> + <DataTrigger Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"> <Setter Property="Visibility" Value="Collapsed"></Setter> </DataTrigger> </Style.Triggers> </Style> </DockPanel.Style> - <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Color code:"></TextBlock> + <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Color code:"></controls:FastTextBlock> - <Grid DockPanel.Dock="Right" DataContext="{Binding BrushStops[0]}"> + <Grid DockPanel.Dock="Right" DataContext="{Binding BrushStops[0],IsAsync=True}"> <StackPanel> <ContentControl Focusable="False" FocusVisualStyle="{x:Null}" d:DataContext="{d:DesignInstance Type=entities:BrushStop, IsDesignTimeCreatable=False}" Content="{Binding}" Width="180"> <ContentControl.Style> <Style TargetType="ContentControl"> - <Setter Property="ContentTemplate" Value="{x:Null}"></Setter> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + + </DataTemplate> + </Setter.Value> + </Setter> <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="RGB"> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="RGB"> <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="CMYK"> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="CMYK"> <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="LAB"> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="LAB"> <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="Twine"> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Twine"> <Setter Property="ContentTemplate" Value="{StaticResource TWINE_Template}" /> </DataTrigger> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Volume"> + <Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" /> + </DataTrigger> </Style.Triggers> </Style> </ContentControl.Style> @@ -251,27 +314,27 @@ <Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> - <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="False" /> - <Condition Binding="{Binding BrushStops[0].IsOutOfGamut}" Value="True" /> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="False" /> + <Condition Binding="{Binding BrushStops[0].IsOutOfGamut,IsAsync=True}" Value="True" /> </MultiDataTrigger.Conditions> <Setter Property="Visibility" Value="Visible"></Setter> </MultiDataTrigger> </Style.Triggers> </Style> </Canvas.Style> - <TextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></TextBlock> + <controls:FastTextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></controls:FastTextBlock> </Canvas> <DockPanel LastChildFill="False" Margin="0 20 0 0"> - <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Length (m):"></TextBlock> + <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Length (m):"></controls:FastTextBlock> <touch:TouchNumericTextBox Width="180" DockPanel.Dock="Right" Value="{Binding Length}" StringFormat="0.0" AutoCalculateJogStep="False" HasDecimalPoint="True" Minimum="1" Maximum="100000" KeyboardContainer="{Binding ElementName=Container}" /> </DockPanel> </StackPanel> </DockPanel> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 10 10 0"> - <TextBlock Visibility="{Binding ElementName=toggle_small_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding Length,StringFormat={}{0:N1} m}"> - <TextBlock.Style> - <Style TargetType="TextBlock"> + <controls:FastTextBlock Visibility="{Binding ElementName=toggle_small_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding Length,StringFormat={}{0:N1} m}"> + <controls:FastTextBlock.Style> + <Style TargetType="controls:FastTextBlock"> <Setter Property="Margin" Value="0 16 20 0"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=toggleEdit,Path=IsChecked}" Value="True"> @@ -279,19 +342,19 @@ </DataTrigger> </Style.Triggers> </Style> - </TextBlock.Style> - </TextBlock> + </controls:FastTextBlock.Style> + </controls:FastTextBlock> - <touch:TouchImageButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding BrushStops[0]}" Width="50" Height="50" Padding="10" Image="../Images/JobView/replace-color.png" CornerRadius="30"> + <touch:TouchImageButton Command="{Binding ElementName=view,Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding BrushStops[0]}" Width="50" Height="50" Padding="10" Image="{StaticResource Image_Replace_Color}" CornerRadius="30"> <touch:TouchImageButton.Style> <Style TargetType="{x:Type touch:TouchImageButton}" BasedOn="{StaticResource {x:Type touch:TouchImageButton}}"> <Setter Property="Visibility" Value="Collapsed"></Setter> <Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> - <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True" /> - <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="False" /> - <Condition Binding="{Binding BrushStops[0].IsOutOfGamut}" Value="True" /> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True" /> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="False" /> + <Condition Binding="{Binding BrushStops[0].IsOutOfGamut,IsAsync=True}" Value="True" /> </MultiDataTrigger.Conditions> <Setter Property="Visibility" Value="Visible"></Setter> </MultiDataTrigger> @@ -300,9 +363,9 @@ </touch:TouchImageButton.Style> </touch:TouchImageButton> - <StackPanel Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Orientation="Horizontal"> + <StackPanel Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" Orientation="Horizontal"> - <touch:TouchIconButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveSegmentCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> + <touch:TouchIconButton Command="{Binding ElementName=view,Path=DataContext.RemoveSegmentCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> <dragAndDrop:DragThumb Background="Transparent" IsHitTestVisible="True"> <touch:TouchIconButton IsHitTestVisible="False" EnableDropShadow="False" Icon="BarsSolid" Padding="15" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> @@ -320,8 +383,8 @@ <Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> - <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True"></Condition> - <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True"></Condition> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"></Condition> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True"></Condition> </MultiDataTrigger.Conditions> <Setter Property="Visibility" Value="Visible"></Setter> @@ -335,14 +398,14 @@ </ItemsControl> - <touch:TouchButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.AddBrushStopCommand}" CommandParameter="{Binding}" Background="Transparent" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontWeight="Normal" Foreground="{StaticResource TangoPrimaryAccentBrush}" HorizontalAlignment="Left" EnableDropShadow="False" Margin="50 30 0 60"> + <touch:TouchButton Command="{Binding ElementName=view,Path=DataContext.AddBrushStopCommand}" CommandParameter="{Binding}" Background="Transparent" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontWeight="Normal" Foreground="{StaticResource TangoPrimaryAccentBrush}" HorizontalAlignment="Left" EnableDropShadow="False" Margin="50 30 0 60"> <StackPanel Orientation="Horizontal"> <Grid Width="49" Height="49"> <Rectangle Stroke="{StaticResource TangoPrimaryAccentBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="5" RadiusY="5"></Rectangle> <fa:ImageAwesome Icon="Plus" Width="16" Height="16" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> </Grid> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">ADD COLOR</TextBlock> + <controls:FastTextBlock VerticalAlignment="Center" Margin="20 0 0 0">ADD COLOR</controls:FastTextBlock> </StackPanel> </touch:TouchButton> </StackPanel> @@ -352,247 +415,253 @@ </DataTemplate> </UserControl.Resources> - <Grid Background="{StaticResource TangoMidBackgroundBrush}"> + <Grid Background="{StaticResource TangoMidBackgroundBrush}" SnapsToDevicePixels="False"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> - <Grid Grid.Row="1"> - <Grid.RowDefinitions> - <RowDefinition Height="1*"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> + <touch:TouchLoadingPanel Grid.Row="1" IsLoading="{Binding IsBusy}"> <Grid> - <Grid x:Name="Container" keyboard:KeyboardView.ContainerOffset="40" Grid.RowSpan="2"> - <touch:LightTouchScrollViewer x:Name="scrollViewer" Scrolling="scrollViewer_Scrolling"> - <StackPanel Margin="10 60 10 0"> - <StackPanel> - <touch:TouchExpander Padding="20 15" IsExpanded="{Binding IsJobDetailsExpanded}"> - <touch:TouchExpander.Header> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> - <Image Source="../Images/JobView/job-details.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Details</TextBlock> - <TextBlock FontWeight="Medium" Margin="50 0 0 0" VerticalAlignment="Center"> + <Grid.CacheMode> + <BitmapCache RenderAtScale="1" SnapsToDevicePixels="False" /> + </Grid.CacheMode> + + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Grid> + <Grid x:Name="Container" keyboard:KeyboardView.ContainerOffset="40" Grid.RowSpan="2"> + <touch:LightTouchScrollViewer x:Name="scrollViewer" Scrolling="scrollViewer_Scrolling"> + <StackPanel Margin="10 60 10 0"> + <StackPanel> + <touch:TouchExpander Padding="20 15" IsExpanded="{Binding IsJobDetailsExpanded}"> + <touch:TouchExpander.Header> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> + <Image Source="../Images/JobView/job-details.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Details</TextBlock> + + <TextBlock FontWeight="Medium" Margin="50 0 0 0" VerticalAlignment="Center"> <Run Text="{Binding Job.Rml.Name}"></Run><Run>,</Run> <Run Text="{Binding Job.ColorSpace.Name}"></Run> - </TextBlock> - </StackPanel> - </touch:TouchExpander.Header> + </TextBlock> + </StackPanel> + </touch:TouchExpander.Header> - <StackPanel Margin="60 30 60 20" TextElement.FontWeight="Medium"> - <controls:TableGrid RowHeight="50"> + <StackPanel Margin="60 30 60 20" TextElement.FontWeight="Medium"> + <controls:TableGrid RowHeight="50"> - <TextBlock>Job name:</TextBlock> - <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" FocusSelectionMode="SelectAll" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> + <TextBlock>Job name:</TextBlock> + <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" FocusSelectionMode="SelectAll" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> - <TextBlock>Customer:</TextBlock> - <touch:TouchAutoComplete ForceItemSelection="False" Text="{Binding CustomersFilter}" ItemsSource="{Binding Customers}" SelectedItem="{Binding Job.Customer}" DisplayMemberPath="Name" AutoCompleteProvider="{Binding CustomersAutoCompleteProvider}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> + <TextBlock>Customer:</TextBlock> + <touch:TouchAutoComplete ForceItemSelection="False" 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" /> + <TextBlock>Thread type:</TextBlock> + <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" keyboard:KeyboardView.Container="{Binding ElementName=Container}" keyboard:KeyboardView.Mode="AlphaNumeric"> + <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" keyboard:KeyboardView.Container="{Binding ElementName=Container}" keyboard:KeyboardView.Mode="AlphaNumeric"> - </TextBox> - </controls:TableGrid> + </TextBox> + </controls:TableGrid> - <Grid HorizontalAlignment="Center" Margin="0 20 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> + <Grid HorizontalAlignment="Center" Margin="0 20 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> - <TextBlock HorizontalAlignment="Left"> + <TextBlock HorizontalAlignment="Left"> <Run Text="Job status:"></Run> <Run Text="{Binding Job.JobStatus}"></Run> - </TextBlock> + </TextBlock> - <Rectangle Margin="20 0" Grid.Column="1" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" /> + <Rectangle Margin="20 0" Grid.Column="1" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" /> - <TextBlock Grid.Column="2" HorizontalAlignment="Center"> + <TextBlock Grid.Column="2" HorizontalAlignment="Center"> <Run Text="Last updated:"></Run> <Run Text="{Binding Job.LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=Never}"></Run> - </TextBlock> + </TextBlock> - <Rectangle Margin="20 0" Grid.Column="3" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" /> + <Rectangle Margin="20 0" Grid.Column="3" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" /> - <TextBlock Grid.Column="4" HorizontalAlignment="Right"> + <TextBlock Grid.Column="4" HorizontalAlignment="Right"> <Run Text="Last dye:"></Run> <Run Text="{Binding Job.LastRun,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=Never}"></Run> - </TextBlock> - </Grid> - </StackPanel> - </touch:TouchExpander> - - <Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> - <Grid> - <StackPanel> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> - <Image Source="../Images/JobView/color-length.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color & Length</TextBlock> - </StackPanel> + </TextBlock> + </Grid> + </StackPanel> + </touch:TouchExpander> + <Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> + <Grid> <StackPanel> - <StackPanel.Style> - <Style TargetType="StackPanel" BasedOn="{StaticResource Level2Container}"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </StackPanel.Style> - <UniformGrid Columns="2" Rows="1"> - <DockPanel Margin="0 0 10 0"> - <TextBlock Text="Number of units:" VerticalAlignment="Center"></TextBlock> - <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfUnits}" Minimum="1" Maximum="10000" JoggingFactor="0.01" /> - </DockPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <Image Source="../Images/JobView/color-length.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color & Length</TextBlock> + </StackPanel> - <DockPanel Margin="10 0 0 0"> - <TextBlock Text="Number of heads:" VerticalAlignment="Center"></TextBlock> - <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfHeads}" Minimum="1" Maximum="1000" JoggingFactor="0.1" /> - </DockPanel> - </UniformGrid> - </StackPanel> + <StackPanel> + <StackPanel.Style> + <Style TargetType="StackPanel" BasedOn="{StaticResource Level2Container}"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </StackPanel.Style> + <UniformGrid Columns="2" Rows="1"> + <DockPanel Margin="0 0 10 0"> + <TextBlock Text="Number of units:" VerticalAlignment="Bottom"></TextBlock> + <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfUnits}" Minimum="1" Maximum="10000" JoggingFactor="0.01" /> + </DockPanel> - <!--<DockPanel Style="{StaticResource Level2Container}"> + <DockPanel Margin="10 0 0 0"> + <TextBlock Text="Number of heads:" VerticalAlignment="Bottom"></TextBlock> + <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfHeads}" Minimum="1" Maximum="1000" JoggingFactor="0.1" /> + </DockPanel> + </UniformGrid> + </StackPanel> + + <!--<DockPanel Style="{StaticResource Level2Container}"> <TextBlock Text="Color Catalog/Space:" VerticalAlignment="Center"></TextBlock> <touch:TouchComboBox Margin="20 0 0 0" ItemsSource="{Binding ColorSpaces}" SelectedItem="{Binding Job.ColorSpace}" DisplayMemberPath="Name" Title="Select Color Catalog/Space" /> </DockPanel>--> - <Border x:Name="borderDockFloat" Height="80"> - <DockPanel x:Name="dockEdit" LastChildFill="False" Style="{StaticResource Level2ContainerExtraMargin}" Height="40" Width="640"> - <StackPanel DockPanel.Dock="Left" Orientation="Horizontal"> - <touch:TouchToggleIconButton x:Name="toggle_small_list" IsChecked="{Binding ElementName=toggle_large_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ListSolid" CheckedIcon="ListSolid" Padding="8" CornerRadius="20" /> - <Rectangle HorizontalAlignment="Left" Stroke="{StaticResource TangoDividerBrush}" Margin="10 8" /> - <touch:TouchToggleIconButton x:Name="toggle_large_list" IsChecked="{Binding ElementName=toggle_small_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ThListSolid" CheckedIcon="ThListSolid" Padding="8" CornerRadius="20" /> - </StackPanel> + <Border x:Name="borderDockFloat" Height="80"> + <DockPanel x:Name="dockEdit" LastChildFill="False" Style="{StaticResource Level2ContainerExtraMargin}" Height="40" Width="640"> + <StackPanel DockPanel.Dock="Left" Orientation="Horizontal"> + <touch:TouchToggleIconButton x:Name="toggle_small_list" IsChecked="{Binding ElementName=toggle_large_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ListSolid" CheckedIcon="ListSolid" Padding="8" CornerRadius="20" /> + <Rectangle HorizontalAlignment="Left" Stroke="{StaticResource TangoDividerBrush}" Margin="10 8" /> + <touch:TouchToggleIconButton x:Name="toggle_large_list" IsChecked="{Binding ElementName=toggle_small_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ThListSolid" CheckedIcon="ThListSolid" Padding="8" CornerRadius="20" /> + </StackPanel> - <touch:TouchToggleIconButton x:Name="toggleEdit" DockPanel.Dock="Right" Icon="Pencil" CheckedIcon="Pencil" Padding="8" CornerRadius="20" /> - </DockPanel> - </Border> + <touch:TouchToggleIconButton x:Name="toggleEdit" DockPanel.Dock="Right" Icon="Pencil" CheckedIcon="Pencil" Padding="8" CornerRadius="20" /> + </DockPanel> + </Border> - <ItemsControl x:Name="listSegments" Style="{StaticResource Level2Container}" ItemsSource="{Binding SegmentsCollectionView}" ItemTemplate="{StaticResource Segment_Template}"></ItemsControl> + <ItemsControl x:Name="listSegments" Style="{StaticResource Level2Container}" ItemsSource="{Binding SegmentsCollectionView}" ItemTemplate="{StaticResource Segment_Template}"></ItemsControl> - <StackPanel HorizontalAlignment="Right" Style="{StaticResource Level2Container}" Orientation="Horizontal"> - <touch:TouchButton Command="{Binding AddSolidSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="170" CornerRadius="20" Padding="0 10" Background="Transparent" BorderThickness="2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}"> - <StackPanel Orientation="Horizontal"> - <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" /> - <TextBlock Margin="10 0 0 0">SOLID SEGMENT</TextBlock> - </StackPanel> - </touch:TouchButton> - <touch:TouchButton Command="{Binding AddGradientSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" Margin="30 0 0 0" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Padding="0 10" Width="200" CornerRadius="20" Background="Transparent" BorderThickness="2"> - <touch:TouchButton.BorderBrush> - <LinearGradientBrush> - <GradientStop Offset="0" Color="{StaticResource TangoPrimaryAccentColor}" /> - <GradientStop Offset="1" Color="#57F157" /> - </LinearGradientBrush> - </touch:TouchButton.BorderBrush> + <StackPanel HorizontalAlignment="Right" Style="{StaticResource Level2Container}" Orientation="Horizontal"> + <touch:TouchButton Command="{Binding AddSolidSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="170" CornerRadius="20" Padding="0 10" Background="Transparent" BorderThickness="2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}"> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" /> + <TextBlock Margin="10 0 0 0">SOLID SEGMENT</TextBlock> + </StackPanel> + </touch:TouchButton> + <touch:TouchButton Command="{Binding AddGradientSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" Margin="30 0 0 0" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Padding="0 10" Width="200" CornerRadius="20" Background="Transparent" BorderThickness="2"> + <touch:TouchButton.BorderBrush> + <LinearGradientBrush> + <GradientStop Offset="0" Color="{StaticResource TangoPrimaryAccentColor}" /> + <GradientStop Offset="1" Color="#57F157" /> + </LinearGradientBrush> + </touch:TouchButton.BorderBrush> - <StackPanel Orientation="Horizontal"> - <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" /> - <TextBlock Margin="10 0 0 0">GRADIENT SEGMENT</TextBlock> - </StackPanel> - </touch:TouchButton> - </StackPanel> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" /> + <TextBlock Margin="10 0 0 0">GRADIENT SEGMENT</TextBlock> + </StackPanel> + </touch:TouchButton> + </StackPanel> - <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> - <DockPanel LastChildFill="False"> - <touch:TouchCheckBox DockPanel.Dock="Left" HorizontalAlignment="Left" IsChecked="{Binding Job.EnableInterSegment}">Include white gap between segments</touch:TouchCheckBox> - <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0"> - <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}" VerticalAlignment="Bottom"> + <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> + <DockPanel LastChildFill="False"> + <touch:TouchCheckBox DockPanel.Dock="Left" HorizontalAlignment="Left" IsChecked="{Binding Job.EnableInterSegment}">Include white gap between segments</touch:TouchCheckBox> + <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 -20 5 0"> + <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}" VerticalAlignment="Bottom"> <Run Text="Length (m):"></Run> - </TextBlock> + </TextBlock> - <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Minimum="1" Maximum="1000" Value="{Binding Job.InterSegmentLength}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> + <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Minimum="1" Maximum="1000" Value="{Binding Job.InterSegmentLength}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> - <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" VerticalAlignment="Bottom" /> - </StackPanel> - </DockPanel> - </StackPanel> + <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" VerticalAlignment="Bottom" /> + </StackPanel> + </DockPanel> + </StackPanel> - <Rectangle Stroke="{StaticResource TangoDividerBrush}" Margin="0 30 0 0" /> + <Rectangle Stroke="{StaticResource TangoDividerBrush}" Margin="0 30 0 0" /> - <StackPanel x:Name="stackOutput" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> - <Image Source="../Images/JobView/output.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Output</TextBlock> - </StackPanel> + <StackPanel x:Name="stackOutput" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <Image Source="../Images/JobView/output.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Output</TextBlock> + </StackPanel> - <!--<DockPanel Style="{StaticResource Level2Container}"> + <!--<DockPanel Style="{StaticResource Level2Container}"> <TextBlock Text="Output spool (m):" VerticalAlignment="Center"></TextBlock> <touch:TouchComboBox ItemsSource="{Binding SpoolTypes}" SelectedItem="{Binding Job.SpoolType}" Margin="40 0 0 0" DisplayMemberPath="Name" Title="Select Output Spool" /> </DockPanel>--> - <DockPanel Style="{StaticResource Level2Container}"> - <TextBlock Text="Segments per spool:" VerticalAlignment="Center"></TextBlock> - <touch:TouchToggleSlider Margin="30 0 0 0" BorderThickness="2" Height="38" Width="83" HorizontalAlignment="Left" UncheckedContent="One" CheckedContent="All" IsChecked="{Binding Job.IsAllSegmentsPerSpool}" /> - </DockPanel> - </StackPanel> - </Grid> - </Border> + <DockPanel Style="{StaticResource Level2Container}"> + <TextBlock Text="Segments per spool:" VerticalAlignment="Center"></TextBlock> + <touch:TouchToggleSlider Margin="30 0 0 0" BorderThickness="2" Height="38" Width="83" HorizontalAlignment="Left" UncheckedContent="One" CheckedContent="All" IsChecked="{Binding Job.IsAllSegmentsPerSpool}" /> + </DockPanel> + </StackPanel> + </Grid> + </Border> - <Border Style="{StaticResource TangoTouchBorder}" Margin="0 20 0 0" Padding="0 0 0 50"> - <StackPanel> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> - <Image Source="../Images/JobView/job-summary.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Summary</TextBlock> - </StackPanel> + <Border Style="{StaticResource TangoTouchBorder}" Margin="0 20 0 0" Padding="0 0 0 50"> + <StackPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <Image Source="../Images/JobView/job-summary.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Summary</TextBlock> + </StackPanel> - <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> - <Grid> - <localControls:JobSummeryViewer DataContext="{Binding Job}" /> - </Grid> + <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> + <Grid> + <localControls:JobSummeryViewer DataContext="{Binding Job,IsAsync=True}" /> + </Grid> - <DockPanel Margin="0 30 0 0" LastChildFill="False"> + <DockPanel Margin="0 30 0 0" LastChildFill="False"> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" VerticalAlignment="Center"> - <TextBlock> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" VerticalAlignment="Center"> + <TextBlock> <Run Text="Job length (m):"></Run> <Run Text="{Binding Job.Length,Mode=OneWay}"></Run> - </TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> - <TextBlock.Style> - <Style TargetType="TextBlock"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.LengthPercentageFactor,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=0}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </TextBlock.Style> + </TextBlock> + <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.LengthPercentageFactor,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=0}" Value="True"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> <Run>(</Run><Run Text="{Binding Job.Length,Mode=OneWay}"></Run><Run>+</Run><Run Text="{Binding Job.LengthPercentageFactor,Mode=OneWay}"></Run><Run>%</Run><Run>)</Run> - </TextBlock> - </StackPanel> + </TextBlock> + </StackPanel> - <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0"> - <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}" VerticalAlignment="Bottom"> + <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 -20 5 0"> + <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}" VerticalAlignment="Bottom"> <Run Text="Factor: +"></Run> - </TextBlock> + </TextBlock> - <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Maximum="100" Minimum="0" Value="{Binding Job.LengthPercentageFactor}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> + <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Maximum="100" Minimum="0" Value="{Binding Job.LengthPercentageFactor}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> - <TextBlock VerticalAlignment="Bottom" Foreground="{StaticResource TangoGrayTextBrush}">%</TextBlock> + <TextBlock VerticalAlignment="Bottom" Foreground="{StaticResource TangoGrayTextBrush}">%</TextBlock> - <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" VerticalAlignment="Bottom" /> - </StackPanel> - </DockPanel> + <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" VerticalAlignment="Bottom" /> + </StackPanel> + </DockPanel> + </StackPanel> </StackPanel> - </StackPanel> - </Border> + </Border> - <StackPanel HorizontalAlignment="Center" Margin="20 40 0 40" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Additional Tools</TextBlock> - </StackPanel> + <StackPanel HorizontalAlignment="Center" Margin="20 40 0 40" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Additional Tools</TextBlock> + </StackPanel> - <!--<Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> + <!--<Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> <StackPanel> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> <Image Source="../Images/JobView/additional-tools.png" Width="39" /> @@ -614,286 +683,199 @@ </StackPanel> </Border>--> - <touch:TouchExpander x:Name="expander_sample_dye" Margin="0 0 0 0" Padding="20 15"> - <touch:TouchExpander.Header> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> - <Image Source="../Images/JobView/sample-dye.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Sample Dye</TextBlock> - </StackPanel> - </touch:TouchExpander.Header> + <touch:TouchExpander x:Name="expander_sample_dye" Margin="0 0 0 0" Padding="20 15"> + <touch:TouchExpander.Header> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> + <Image Source="../Images/JobView/sample-dye.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Sample Dye</TextBlock> + </StackPanel> + </touch:TouchExpander.Header> - <StackPanel> - <StackPanel Margin="60 20 0 0"> - <ContentControl> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel> - <ContentControl Content="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext}"> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> - <StackPanel> - <TextBlock> + <StackPanel> + <StackPanel Margin="60 20 0 0"> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <ContentControl Content="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext}"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <StackPanel> + <TextBlock> <Run>Dye 1 or more units in order to get approval.</Run> <LineBreak/> <Run>Once approved, you can dye the entire job.</Run> - </TextBlock> + </TextBlock> - <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> - <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">How many sample units?</TextBlock> + <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">How many sample units?</TextBlock> - <DockPanel Margin="50 0 0 0"> - <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> - <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> - <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + <DockPanel Margin="50 0 0 0"> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + </DockPanel> </DockPanel> - </DockPanel> - </StackPanel> - </DataTemplate> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Sewing}"> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> - <StackPanel> - <TextBlock> + </StackPanel> + </DataTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Sewing}"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <StackPanel> + <TextBlock> <Run>Dye several meters per segment in order to get approval.</Run> <LineBreak/> <Run>Once approved, you can dye the entire job.</Run> - </TextBlock> + </TextBlock> - <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> - <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">Meters per segment</TextBlock> + <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">Meters per segment</TextBlock> - <DockPanel Margin="50 0 0 0"> - <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> - <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> - <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + <DockPanel Margin="50 0 0 0"> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + </DockPanel> </DockPanel> - </DockPanel> - </StackPanel> - </DataTemplate> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> + </StackPanel> + </DataTemplate> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> - <touch:TouchButton Margin="0 50 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartSampleDyeCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}"> - START - </touch:TouchButton> - </StackPanel> - </Setter.Value> - </Setter> + <touch:TouchButton Margin="0 50 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartSampleDyeCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}"> + START + </touch:TouchButton> + </StackPanel> + </Setter.Value> + </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel> - <TextBlock>How to continue?</TextBlock> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <TextBlock>How to continue?</TextBlock> - <UniformGrid Columns="2" Width="420" HorizontalAlignment="Left" Margin="0 40 0 20"> - <StackPanel HorizontalAlignment="Left"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveSampleCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Check"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">DONE</TextBlock> - </StackPanel> - </touch:TouchButton> + <UniformGrid Columns="2" Width="420" HorizontalAlignment="Left" Margin="0 40 0 20"> + <StackPanel HorizontalAlignment="Left"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveSampleCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Check"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">DONE</TextBlock> + </StackPanel> + </touch:TouchButton> - <TextBlock Margin="0 15 0 0" TextAlignment="Center">The sample is approved</TextBlock> - </StackPanel> + <TextBlock Margin="0 15 0 0" TextAlignment="Center">The sample is approved</TextBlock> + </StackPanel> - <StackPanel HorizontalAlignment="Right"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatSampleDyeCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> - </StackPanel> - </touch:TouchButton> + <StackPanel HorizontalAlignment="Right"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatSampleDyeCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> + </StackPanel> + </touch:TouchButton> - <TextBlock Margin="0 15 0 0" TextAlignment="Center">Dye more samples</TextBlock> - </StackPanel> - </UniformGrid> + <TextBlock Margin="0 15 0 0" TextAlignment="Center">Dye more samples</TextBlock> + </StackPanel> + </UniformGrid> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> - <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.Approved}"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Margin="0 40 80 40"> - <DockPanel LastChildFill="False"> - <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> + <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.Approved}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Margin="0 40 80 40"> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> <Run>Sample Approved:</Run> <Run Text="{Binding Job.SampleDyeApproveDate,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=''}"></Run> - </TextBlock> - <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding AnotherSampleCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Plus"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">ANOTHER SAMPLE</TextBlock> - </StackPanel> - </touch:TouchButton> - </DockPanel> - </StackPanel> - </Setter.Value> - </Setter> + </TextBlock> + <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding AnotherSampleCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Plus"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">ANOTHER SAMPLE</TextBlock> + </StackPanel> + </touch:TouchButton> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </StackPanel> + + <StackPanel Margin="0 0 0 15"> + <StackPanel.Style> + <Style TargetType="StackPanel"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> + <Setter Property="Visibility" Value="Visible"></Setter> </DataTrigger> </Style.Triggers> </Style> - </ContentControl.Style> - </ContentControl> - </StackPanel> - - <StackPanel Margin="0 0 0 15"> - <StackPanel.Style> - <Style TargetType="StackPanel"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </StackPanel.Style> - <Rectangle HorizontalAlignment="Stretch" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" Margin="-20 30"></Rectangle> + </StackPanel.Style> + <Rectangle HorizontalAlignment="Stretch" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" Margin="-20 30"></Rectangle> - <StackPanel Orientation="Horizontal" Margin="60 0 0 0"> - <touch:TouchIcon Icon="AlertCircleOutline" Width="32" Height="32" StrokeThickness="0.1" Foreground="{StaticResource TangoGrayBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center"> + <StackPanel Orientation="Horizontal" Margin="60 0 0 0"> + <touch:TouchIcon Icon="AlertCircleOutline" Width="32" Height="32" StrokeThickness="0.1" Foreground="{StaticResource TangoGrayBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center"> You can use the color fine tuning tool to adjust the colors. - </TextBlock> + </TextBlock> + </StackPanel> </StackPanel> </StackPanel> - </StackPanel> - </touch:TouchExpander> - - <touch:TouchExpander x:Name="expander_fine_tuning" Margin="0 20 0 120" Padding="20 15" IsExpanded="{Binding IsFineTuneExpanded,Mode=TwoWay}"> - <touch:TouchExpander.Header> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> - <Image Source="../Images/JobView/color-fine-tuning.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color Fine Tuning</TextBlock> - </StackPanel> - </touch:TouchExpander.Header> - - <StackPanel Margin="60 20 0 0"> - - <ContentControl> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel> - <TextBlock>Select the colors you want to fine tune.</TextBlock> + </touch:TouchExpander> - <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0"> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Defined Colors</TextBlock> + <touch:TouchExpander x:Name="expander_fine_tuning" Margin="0 20 0 120" Padding="20 15" IsExpanded="{Binding IsFineTuneExpanded,Mode=TwoWay}" Visibility="{Binding Job.ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter}}"> + <touch:TouchExpander.Header> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> + <Image Source="../Images/JobView/color-fine-tuning.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color Fine Tuning</TextBlock> + </StackPanel> + </touch:TouchExpander.Header> - <ItemsControl Margin="0 40 0 0" ItemsSource="{Binding FineTuneItems}"> - <ItemsControl.ItemTemplate> - <DataTemplate> - <DockPanel> - <touch:TouchCheckBox DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" Margin="0 0 20 0" /> - <touch:TouchImageButton DockPanel.Dock="Right" Image="../Images/JobView/color-picker.png" Width="80" Height="80" Padding="15" CornerRadius="100" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.InvokeFineTuningPaletteCommand}" CommandParameter="{Binding}"></touch:TouchImageButton> - <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}" IsEnabled="False"> - <touch:TouchFlatListBox.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid> - </ItemsPanelTemplate> - </touch:TouchFlatListBox.ItemsPanel> - <touch:TouchFlatListBox.ItemTemplate> - <DataTemplate> - <Ellipse Width="70" Height="70" Fill="{Binding Brush}" Margin="30 0"> - <Ellipse.Style> - <Style TargetType="Ellipse"> - <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> - <Setter Property="RenderTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="1" /> - </Setter.Value> - </Setter> - <Setter Property="Effect"> - <Setter.Value> - <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Ellipse.Style> - </Ellipse> - </DataTemplate> - </touch:TouchFlatListBox.ItemTemplate> - </touch:TouchFlatListBox> - </DockPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> + <StackPanel Margin="60 20 0 0"> - <DockPanel LastChildFill="False" Margin="0 80 0 0"> - <touch:TouchButton Command="{Binding ResetFineTuningCommand}" DockPanel.Dock="Left" Padding="40 10" Margin="-30 0 0 0" Style="{StaticResource TangoFlatButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">Reset</touch:TouchButton> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <TextBlock>Select the colors you want to fine tune.</TextBlock> - <touch:TouchButton Margin="0 0 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartFineTuningCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}"> - START - </touch:TouchButton> - </DockPanel> - </StackPanel> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.PendingApproval}"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Margin="0 20 0 0"> - <StackPanel Orientation="Horizontal"> - <Grid> - <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> - <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">1</TextBlock> - </Grid> - <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">Select the best variation for each color:</TextBlock> - </StackPanel> + <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0"> + <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Defined Colors</TextBlock> - <ItemsControl Margin="65 40 120 0" ItemsSource="{Binding ApprovalFineTuneItems}" AlternationCount="1000"> + <ItemsControl Margin="0 40 0 0" ItemsSource="{Binding FineTuneItems}"> <ItemsControl.ItemTemplate> <DataTemplate> <DockPanel> - <TextBlock Margin="0 0 20 0" VerticalAlignment="Center"> - <Run>Color</Run> - <Run>#</Run><Run Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(ItemsControl.AlternationIndex),Mode=OneWay,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}"></Run> - </TextBlock> - <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}"> + <touch:TouchCheckBox DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" Margin="0 0 20 0" /> + <touch:TouchImageButton DockPanel.Dock="Right" Image="{StaticResource Image_Color_Picker}" Width="80" Height="80" Padding="15" CornerRadius="100" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.InvokeFineTuningPaletteCommand}" CommandParameter="{Binding}"></touch:TouchImageButton> + <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}" IsEnabled="False"> <touch:TouchFlatListBox.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid> @@ -947,107 +929,197 @@ </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> + </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 40 0 0"> - <Grid> - <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> - <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">2</TextBlock> - </Grid> - <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">How to continue</TextBlock> - </StackPanel> + <DockPanel LastChildFill="False" Margin="0 80 0 0"> + <touch:TouchButton Command="{Binding ResetFineTuningCommand}" DockPanel.Dock="Left" Padding="40 10" Margin="-30 0 0 0" Style="{StaticResource TangoFlatButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">Reset</touch:TouchButton> - <UniformGrid Columns="2" Width="530" HorizontalAlignment="Left" Margin="0 40 0 20"> - <StackPanel HorizontalAlignment="Left"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveFineTuningCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Check"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">DONE</TextBlock> - </StackPanel> - </touch:TouchButton> - - <TextBlock Margin="0 15 0 0" TextAlignment="Center">All colors are approved</TextBlock> + <touch:TouchButton Margin="0 0 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartFineTuningCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}"> + START + </touch:TouchButton> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.PendingApproval}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Margin="0 20 0 0"> + <StackPanel Orientation="Horizontal"> + <Grid> + <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">1</TextBlock> + </Grid> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">Select the best variation for each color:</TextBlock> </StackPanel> - <StackPanel HorizontalAlignment="Right"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatFineTuningCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> - </StackPanel> - </touch:TouchButton> + <ItemsControl Margin="65 40 120 0" ItemsSource="{Binding ApprovalFineTuneItems}" AlternationCount="1000"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel> + <TextBlock Margin="0 0 20 0" VerticalAlignment="Center"> + <Run>Color</Run> + <Run>#</Run><Run Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(ItemsControl.AlternationIndex),Mode=OneWay,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}"></Run> + </TextBlock> + <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}"> + <touch:TouchFlatListBox.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid> + </ItemsPanelTemplate> + </touch:TouchFlatListBox.ItemsPanel> + <touch:TouchFlatListBox.ItemTemplate> + <DataTemplate> + <Ellipse Width="70" Height="70" Fill="{Binding Brush}" Margin="30 0"> + <Ellipse.Style> + <Style TargetType="Ellipse"> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Setter Property="Effect"> + <Setter.Value> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Ellipse.Style> + </Ellipse> + </DataTemplate> + </touch:TouchFlatListBox.ItemTemplate> + </touch:TouchFlatListBox> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> - <TextBlock Margin="0 15 0 0" TextAlignment="Left" TextWrapping="Wrap" Width="170">Some color need more fine tuning</TextBlock> + <StackPanel Orientation="Horizontal" Margin="0 40 0 0"> + <Grid> + <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">2</TextBlock> + </Grid> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">How to continue</TextBlock> </StackPanel> - </UniformGrid> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.Approved}"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Margin="0 40 80 40"> - <DockPanel LastChildFill="False"> - <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> + <UniformGrid Columns="2" Width="530" HorizontalAlignment="Left" Margin="0 40 0 20"> + <StackPanel HorizontalAlignment="Left"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Check"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">DONE</TextBlock> + </StackPanel> + </touch:TouchButton> + + <TextBlock Margin="0 15 0 0" TextAlignment="Center">All colors are approved</TextBlock> + </StackPanel> + + <StackPanel HorizontalAlignment="Right"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> + </StackPanel> + </touch:TouchButton> + + <TextBlock Margin="0 15 0 0" TextAlignment="Left" TextWrapping="Wrap" Width="170">Some color need more fine tuning</TextBlock> + </StackPanel> + </UniformGrid> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + + <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.Approved}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Margin="0 40 80 40"> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> <Run>Colors Approved:</Run> <Run Text="{Binding Job.FineTuningApproveDate,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=''}"></Run> - </TextBlock> - <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding RepeatFineTuningCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Plus"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">REPEAT FINE TUNING</TextBlock> - </StackPanel> - </touch:TouchButton> - </DockPanel> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> - </StackPanel> - </touch:TouchExpander> + </TextBlock> + <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding RepeatFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Plus"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">REPEAT FINE TUNING</TextBlock> + </StackPanel> + </touch:TouchButton> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </StackPanel> + </touch:TouchExpander> + </StackPanel> </StackPanel> - </StackPanel> - </touch:LightTouchScrollViewer> - </Grid> - - <Border VerticalAlignment="Top" x:Name="borderEditDock" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" Padding="0 0 0 10"> - <Border.Effect> - <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" BlurRadius="20" /> - </Border.Effect> - </Border> - </Grid> + </touch:LightTouchScrollViewer> + </Grid> - <Grid Grid.Row="1"> - <Grid IsHitTestVisible="False"> - <Grid.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="#AEFFFFFF" /> - <GradientStop Offset="1" Color="{StaticResource TangoPrimaryBackgroundColor}" /> - </LinearGradientBrush> - </Grid.Background> - <Rectangle Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" /> + <Border VerticalAlignment="Top" x:Name="borderEditDock" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" Padding="0 0 0 10"> + <!--<Border.Effect> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" BlurRadius="20" /> + </Border.Effect>--> + </Border> </Grid> - <!--<Border Padding="20 20"> + + <Grid Grid.Row="1"> + <Grid IsHitTestVisible="False"> + <Grid.Background> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Offset="0" Color="#AEFFFFFF" /> + <GradientStop Offset="1" Color="{StaticResource TangoPrimaryBackgroundColor}" /> + </LinearGradientBrush> + </Grid.Background> + <Rectangle Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" /> + </Grid> + <!--<Border Padding="20 20"> <Grid> <DockPanel> <touch:TouchButton IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" DelayCommand="{Binding DyeCommand}" DelayCommandDuration="00:00:0.3"> DYE </touch:TouchButton> - --><!--Add this in case you want to display job summery on bottom panel--> - <!--<localControls:JobSummeryViewer DataContext="{Binding Job}" Height="35" Margin="0 -20 30 0" />--><!-- + --> + <!--Add this in case you want to display job summery on bottom panel--> + <!--<localControls:JobSummeryViewer DataContext="{Binding Job}" Height="35" Margin="0 -20 30 0" />--> + <!-- </DockPanel> </Grid> </Border>--> - </Grid> + </Grid> - <dragAndDrop:DraggingSurface x:Name="DraggingSurface" /> - </Grid> + <dragAndDrop:DraggingSurface x:Name="DraggingSurface" /> + </Grid> + </touch:TouchLoadingPanel> <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}"> <Border.Effect> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs index 6a6e770a7..3cd6e1bce 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs @@ -13,6 +13,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.BL; using Tango.BL.Entities; using Tango.Core.DI; using Tango.PPC.Jobs.ViewContracts; @@ -111,5 +112,15 @@ namespace Tango.PPC.Jobs.Views borderDockFloat.Child = dockEdit; borderEditDock.Visibility = Visibility.Collapsed; } + + private void OnLiquidVolumeFieldValueChanged(object sender, Touch.Controls.DoubleValueChangedEventArgs e) + { + var liquidVolume = (sender as FrameworkElement).DataContext as LiquidVolume; + + if (liquidVolume != null) + { + _vm.OnBrushStopFieldValueChanged(liquidVolume.BrushStop); + } + } } } 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..475437cf3 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,40 @@ <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="IsHitTestVisible" Value="False"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <TranslateTransform X="100" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsMultiSelecting}" Value="True"> + <Setter Property="IsHitTestVisible" Value="True"></Setter> + <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 +117,34 @@ <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="IsHitTestVisible" Value="True"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> <Style.Triggers> <DataTrigger Binding="{Binding IsMultiSelecting}" Value="True"> + <Setter Property="IsHitTestVisible" Value="False"></Setter> <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 +153,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}"> @@ -240,8 +283,8 @@ </touch:LightTouchDataGrid> </touch:TouchLoadingPanel> - <touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}"> - <touch:LightTouchDataGrid AnimateSorting="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='History'}" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10"> + <touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='History'}"> + <touch:LightTouchDataGrid AnimateSorting="False" EnableDragAndDrop="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10"> <touch:LightTouchDataGrid.Columns> <touch:LightTouchDataGridColumn Width="50"> <touch:LightTouchDataGridColumn.Header> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config index bce416708..ec465920b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config @@ -20,7 +20,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> @@ -28,31 +28,31 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> @@ -78,6 +78,14 @@ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.png Binary files differdeleted file mode 100644 index 3f8318f70..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModelLocator.cs deleted file mode 100644 index d86a0d2ab..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModelLocator.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.DI; -using Tango.PPC.Logging.ViewModels; - -namespace Tango.PPC.Logging -{ - public static class ViewModelLocator - { - /// <summary> - /// Initializes a new instance of the ViewModelLocator class. - /// </summary> - static ViewModelLocator() - { - TangoIOC.Default.Register<MainViewVM>(); - } - - /// <summary> - /// Gets the main view VM. - /// </summary> - public static MainViewVM MainViewVM - { - get - { - return TangoIOC.Default.GetInstance<MainViewVM>(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml deleted file mode 100644 index fb4dd5d04..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml +++ /dev/null @@ -1,45 +0,0 @@ -<UserControl x:Class="Tango.PPC.Logging.Views.MainView" - 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:sys="clr-namespace:System;assembly=mscorlib" - xmlns:vm="clr-namespace:Tango.PPC.Logging.ViewModels" - xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:global="clr-namespace:Tango.PPC.Logging" - xmlns:local="clr-namespace:Tango.PPC.Logging.Views" - mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> - <Grid Background="{StaticResource TangoMidBackgroundBrush}"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - - <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}"> - <Border.Effect> - <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" /> - </Border.Effect> - <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Logs</TextBlock> - </Border> - - <Grid Grid.Row="1"> - - <DockPanel> - <DockPanel DockPanel.Dock="Top"> - <touch:TouchNavigationLinks Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}"> - <sys:String>Application</sys:String> - <sys:String>Embedded</sys:String> - </touch:TouchNavigationLinks> - - <touch:TouchDatePicker SelectedDate="12/15/2018" Height="40" /> - </DockPanel> - - <Grid> - - </Grid> - </DockPanel> - - </Grid> - </Grid> -</UserControl> 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..b413fee0d 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 @@ -86,6 +86,27 @@ namespace Tango.PPC.MachineSettings.ViewModels set { _enableRemoteAssistance = value; RaisePropertyChangedAuto(); OnEnableRemoteAssistanceChanged(); } } + private bool _enableLockScreen; + public bool EnableLockScreen + { + get { return _enableLockScreen; } + set { _enableLockScreen = value; RaisePropertyChangedAuto(); } + } + + private int _lockScreenTimeoutMinutes; + public int LockScreenTimeoutMinutes + { + get { return _lockScreenTimeoutMinutes; } + set { _lockScreenTimeoutMinutes = value; RaisePropertyChangedAuto(); } + } + + private String _lockScreenPassword; + public String LockScreenPassword + { + get { return _lockScreenPassword; } + set { _lockScreenPassword = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -119,12 +140,15 @@ 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; Settings.EnableExternalBridge = EnableExternalBridge; Settings.ExternalBridgePassword = ExternalBridgePassword; + Settings.EnableLockScreen = EnableLockScreen; + Settings.LockScreenTimeout = TimeSpan.FromMinutes(LockScreenTimeoutMinutes); + Settings.LockScreenPassword = LockScreenPassword; Settings.Save(); await MachineProvider.SaveMachine(); @@ -166,6 +190,9 @@ namespace Tango.PPC.MachineSettings.ViewModels _enableRemoteAssistance = RemoteAssistanceProvider.IsEnabled; RaisePropertyChanged(nameof(EnableRemoteAssistance)); + EnableLockScreen = Settings.EnableLockScreen; + LockScreenTimeoutMinutes = (int)Settings.LockScreenTimeout.TotalMinutes; + LockScreenPassword = Settings.LockScreenPassword; SelectedJobTypes = new SelectedObjectCollection<JobTypes>(Enum.GetValues(typeof(JobTypes)).Cast<JobTypes>().ToObservableCollection(), Machine.SupportedJobTypes.ToObservableCollection()); SelectedColorSpaces = new SelectedObjectCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x.IsUserSpace()).ToObservableCollection(), Machine.SupportedColorSpaces.ToObservableCollection()); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index 8ba06eb43..dd5f89bb2 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -11,7 +11,7 @@ xmlns:global="clr-namespace:Tango.PPC.MachineSettings" xmlns:local="clr-namespace:Tango.PPC.MachineSettings.Views" mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="2500" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> <Grid Background="{StaticResource TangoMidBackgroundBrush}"> <Grid.RowDefinitions> @@ -48,95 +48,152 @@ <TextBlock VerticalAlignment="Center">Enable Hot Spot</TextBlock> <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Margin="0 0 110 0" Width="90" IsChecked="{Binding EnableHotSpot}"></touch:TouchToggleSlider> - + <TextBlock VerticalAlignment="Bottom">Hot Spot Password</TextBlock> <touch:TouchTextBox IsPassword="True" Watermark="•••••••" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Text="{Binding HotSpotPassword}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchTextBox> </controls:TableGrid> + + <DockPanel Margin="10 -40 0 0"> + <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> + Enabling a hot-spot will create a wireless network dedicated to this machine. + </TextBlock> + </DockPanel> </StackPanel> </touch:TouchExpander> <!--EXTERNAL BRIDGE--> <touch:TouchExpander Margin="0 20 0 0" Header="External Bridge" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> - <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> - <TextBlock VerticalAlignment="Center">Enable External Bridge Service</TextBlock> - <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Margin="0 0 110 0" Width="90" IsChecked="{Binding EnableExternalBridge}"></touch:TouchToggleSlider> + <StackPanel> + <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> + <TextBlock VerticalAlignment="Center">Enable External Bridge Service</TextBlock> + <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Margin="0 0 110 0" Width="90" IsChecked="{Binding EnableExternalBridge}"></touch:TouchToggleSlider> - <TextBlock VerticalAlignment="Bottom">External Bridge Password</TextBlock> - <touch:TouchTextBox IsPassword="True" Watermark="•••••••" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Text="{Binding ExternalBridgePassword}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchTextBox> - </controls:TableGrid> + <TextBlock VerticalAlignment="Bottom">External Bridge Password</TextBlock> + <touch:TouchTextBox IsPassword="True" Watermark="•••••••" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Text="{Binding ExternalBridgePassword}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchTextBox> + </controls:TableGrid> + + <DockPanel Margin="10 -50 0 0"> + <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> + Enabling the external bridge service allows external Twine applications to interact with this machine over the local network. + </TextBlock> + </DockPanel> + </StackPanel> </touch:TouchExpander> <!--JOBS--> <touch:TouchExpander Margin="0 20 0 0" Header="JOBS" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> - <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> - <TextBlock VerticalAlignment="Center">Supported Job Types</TextBlock> - <ItemsControl ItemsSource="{Binding SelectedJobTypes}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <WrapPanel IsItemsHost="True" Orientation="Horizontal" /> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <touch:TouchToggleButton IsChecked="{Binding IsSelected}" Content="{Binding Data}" CornerRadius="5" CheckedContent="{Binding Data}" Padding="10" Margin="5"> - <touch:TouchToggleButton.Style> - <Style TargetType="touch:TouchToggleButton"> - <Setter Property="Background" Value="{StaticResource TangoGrayBrush}"></Setter> - <Style.Triggers> - <Trigger Property="IsChecked" Value="True"> - <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> - </Trigger> - </Style.Triggers> - </Style> - </touch:TouchToggleButton.Style> - </touch:TouchToggleButton> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> + <StackPanel> + <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> + <TextBlock VerticalAlignment="Center">Supported Job Types</TextBlock> + <ItemsControl ItemsSource="{Binding SelectedJobTypes}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel IsItemsHost="True" Orientation="Horizontal" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <touch:TouchToggleButton IsChecked="{Binding IsSelected}" Content="{Binding Data}" CornerRadius="5" CheckedContent="{Binding Data}" Padding="10" Margin="5"> + <touch:TouchToggleButton.Style> + <Style TargetType="touch:TouchToggleButton"> + <Setter Property="Background" Value="{StaticResource TangoGrayBrush}"></Setter> + <Style.Triggers> + <Trigger Property="IsChecked" Value="True"> + <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </touch:TouchToggleButton.Style> + </touch:TouchToggleButton> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> - <TextBlock VerticalAlignment="Center">Supported Color Spaces/Catalogs</TextBlock> - <ItemsControl ItemsSource="{Binding SelectedColorSpaces}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <WrapPanel IsItemsHost="True" Orientation="Horizontal" /> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <touch:TouchToggleButton IsChecked="{Binding IsSelected}" Content="{Binding Data}" CornerRadius="5" CheckedContent="{Binding Data}" Padding="10" Margin="5"> - <touch:TouchToggleButton.Style> - <Style TargetType="touch:TouchToggleButton"> - <Setter Property="Background" Value="{StaticResource TangoGrayBrush}"></Setter> - <Style.Triggers> - <Trigger Property="IsChecked" Value="True"> - <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> - </Trigger> - </Style.Triggers> - </Style> - </touch:TouchToggleButton.Style> - </touch:TouchToggleButton> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> + <TextBlock VerticalAlignment="Center">Supported Color Spaces/Catalogs</TextBlock> + <ItemsControl ItemsSource="{Binding SelectedColorSpaces}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel IsItemsHost="True" Orientation="Horizontal" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <touch:TouchToggleButton IsChecked="{Binding IsSelected}" Content="{Binding Data}" CornerRadius="5" CheckedContent="{Binding Data}" Padding="10" Margin="5"> + <touch:TouchToggleButton.Style> + <Style TargetType="touch:TouchToggleButton"> + <Setter Property="Background" Value="{StaticResource TangoGrayBrush}"></Setter> + <Style.Triggers> + <Trigger Property="IsChecked" Value="True"> + <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </touch:TouchToggleButton.Style> + </touch:TouchToggleButton> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> - <TextBlock VerticalAlignment="Bottom">Default Thread Type</TextBlock> - <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding Machine.DefaultRml}" DisplayMemberPath="Name" ValuePath="Guid"></touch:TouchComboBox> + <TextBlock VerticalAlignment="Bottom">Default Thread Type</TextBlock> + <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding Machine.DefaultRml}" DisplayMemberPath="Name" ValuePath="Guid"></touch:TouchComboBox> - <!--<TextBlock VerticalAlignment="Bottom">Default Spool</TextBlock> + <!--<TextBlock VerticalAlignment="Bottom">Default Spool</TextBlock> <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.SpoolTypes}" SelectedItem="{Binding Machine.DefaultSpoolType}" DisplayMemberPath="Name"></touch:TouchComboBox>--> - <TextBlock VerticalAlignment="Bottom">Default Segment Length</TextBlock> - <touch:TouchNumericTextBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Minimum="1" Maximum="1000" Value="{Binding Machine.DefaultSegmentLength}" HasDecimalPoint="True" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox> + <TextBlock VerticalAlignment="Bottom">Default Segment Length</TextBlock> + <touch:TouchNumericTextBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Minimum="1" Maximum="1000" Value="{Binding Machine.DefaultSegmentLength}" HasDecimalPoint="True" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox> - </controls:TableGrid> + </controls:TableGrid> + + <DockPanel Margin="10 -50 0 0"> + <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> + Job settings allows you to set the default configuration for new jobs. + </TextBlock> + </DockPanel> + </StackPanel> </touch:TouchExpander> <!--REMOTE ASSISTANCE--> <touch:TouchExpander Margin="0 20 0 0" Header="Remote Assistance" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> - <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> - <TextBlock VerticalAlignment="Center">Enable Remote Assistance</TextBlock> - <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Margin="0 0 110 0" Width="90" IsChecked="{Binding EnableRemoteAssistance}"></touch:TouchToggleSlider> - </controls:TableGrid> + <StackPanel> + <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> + <TextBlock VerticalAlignment="Center">Enable Remote Assistance</TextBlock> + <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Margin="0 0 110 0" Width="90" IsChecked="{Binding EnableRemoteAssistance}"></touch:TouchToggleSlider> + </controls:TableGrid> + + <DockPanel Margin="10 -50 0 0"> + <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> + Enable remote assistance for Twine's technicians. + </TextBlock> + </DockPanel> + </StackPanel> + </touch:TouchExpander> + + <!--LOCK SCREEN--> + <touch:TouchExpander Margin="0 20 0 0" Header="Lock Screen" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> + <StackPanel> + <controls:TableGrid Margin="10" RowHeight="60" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> + <TextBlock VerticalAlignment="Center">Enable Lock Screen</TextBlock> + <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Margin="0 0 110 0" Width="90" IsChecked="{Binding EnableLockScreen}"></touch:TouchToggleSlider> + + <TextBlock VerticalAlignment="Bottom">Lock Screen Timeout (m)</TextBlock> + <touch:TouchNumericTextBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Minimum="1" Maximum="60" Value="{Binding LockScreenTimeoutMinutes}" HasDecimalPoint="False" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox> + + <TextBlock VerticalAlignment="Bottom">Lock Screen Password</TextBlock> + <touch:TouchTextBox IsPassword="True" Watermark="•••••••" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Text="{Binding LockScreenPassword}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchTextBox> + </controls:TableGrid> + + <DockPanel Margin="10 -50 0 0"> + <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> + Enable the lock screen to protect the panel from unauthorized access. + </TextBlock> + </DockPanel> + </StackPanel> </touch:TouchExpander> </StackPanel> </touch:LightTouchScrollViewer> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config index bce416708..ec465920b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config @@ -20,7 +20,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> @@ -28,31 +28,31 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> @@ -78,6 +78,14 @@ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> 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/Modules/Tango.PPC.Storage/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/app.config index 8d7f1b8a7..0e9bb1d40 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/app.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/app.config @@ -16,7 +16,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> @@ -24,27 +24,27 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> @@ -74,6 +74,18 @@ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/App.xaml index 66ea48976..a696ceef9 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/App.xaml @@ -1,4 +1,4 @@ -<Application x:Class="Tango.PPC.Logging.App" +<Application x:Class="Tango.PPC.Technician.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Application.Resources> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/logging.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/logging.png Binary files differnew file mode 100644 index 000000000..580bcb046 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/logging.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/system.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/system.png Binary files differnew file mode 100644 index 000000000..48c8ce83d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/system.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/technician_module.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/technician_module.png Binary files differnew file mode 100644 index 000000000..2c5cc1fbc --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/technician_module.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/AssemblyInfo.cs index a834fd095..97a615572 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/AssemblyInfo.cs @@ -7,7 +7,7 @@ using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Tango PPC Logging Module")] +[assembly: AssemblyTitle("Tango PPC Technician Module")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: ThemeInfo( diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Resources.Designer.cs index 6cbf8164a..26e366738 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.Designer.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Resources.Designer.cs @@ -8,7 +8,8 @@ // </auto-generated> //------------------------------------------------------------------------------ -namespace Tango.PPC.Logging.Properties { +namespace Tango.PPC.Technician.Properties { + using System; /// <summary> @@ -18,7 +19,7 @@ namespace Tango.PPC.Logging.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -37,8 +38,8 @@ namespace Tango.PPC.Logging.Properties { [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { - if ((resourceMan == null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PPC.Logging.Properties.Resources", typeof(Resources).Assembly); + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PPC.Technician.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Resources.resx index af7dbebba..af7dbebba 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.resx +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Resources.resx diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.Designer.cs index ab102e0eb..dfc1a086b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.Designer.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // </auto-generated> //------------------------------------------------------------------------------ -namespace Tango.PPC.Logging.Properties -{ +namespace Tango.PPC.Technician.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - public static Settings Default - { - get - { + public static Settings Default { + get { return defaultInstance; } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.settings index 033d7a5e9..033d7a5e9 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.settings +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.settings diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Tango.PPC.Logging.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj index 51e41dba8..5b34c38a1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Tango.PPC.Logging.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj @@ -6,8 +6,8 @@ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{D2EE865B-B006-487A-9487-60A663636AC3}</ProjectGuid> <OutputType>library</OutputType> - <RootNamespace>Tango.PPC.Logging</RootNamespace> - <AssemblyName>Tango.PPC.Logging</AssemblyName> + <RootNamespace>Tango.PPC.Technician</RootNamespace> + <AssemblyName>Tango.PPC.Technician</AssemblyName> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> @@ -57,7 +57,7 @@ <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> - <Compile Include="LoggingModule.cs" /> + <Compile Include="TechnicianModule.cs" /> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> @@ -72,7 +72,15 @@ <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> <Compile Include="ViewModelLocator.cs" /> + <Compile Include="ViewModels\CatalogViewVM.cs" /> + <Compile Include="ViewModels\LoggingViewVM.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> + <Compile Include="Views\CatalogView.xaml.cs"> + <DependentUpon>CatalogView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\LoggingView.xaml.cs"> + <DependentUpon>LoggingView.xaml</DependentUpon> + </Compile> <Compile Include="Views\MainView.xaml.cs"> <DependentUpon>MainView.xaml</DependentUpon> </Compile> @@ -96,6 +104,10 @@ <Project>{A34EE0F0-649D-41C8-8489-B6F1CC6924EE}</Project> <Name>Tango.Core</Name> </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj"> + <Project>{BC932DBD-7CDB-488C-99E4-F02CF441F55E}</Project> + <Name>Tango.Logging</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.SharedUI\Tango.SharedUI.csproj"> <Project>{8491D07B-C1F6-4B62-A412-41B9FD2D6538}</Project> <Name>Tango.SharedUI</Name> @@ -110,17 +122,31 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <Resource Include="Images\logging_module.png" /> - </ItemGroup> - <ItemGroup> <Page Include="App.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Views\CatalogView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\LoggingView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\MainView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> </ItemGroup> + <ItemGroup> + <Resource Include="Images\technician_module.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\logging.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\system.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/LoggingModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/TechnicianModule.cs index 78c597e81..07ef8cabf 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/LoggingModule.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/TechnicianModule.cs @@ -6,21 +6,21 @@ using System.Threading.Tasks; using System.Windows.Media.Imaging; using Tango.BL.Enumerations; using Tango.PPC.Common; -using Tango.PPC.Logging.Views; +using Tango.PPC.Technician.Views; using Tango.SharedUI.Helpers; -namespace Tango.PPC.Logging +namespace Tango.PPC.Technician { [PPCModule(5)] - public class LoggingModule : PPCModuleBase + public class TechnicianModule : PPCModuleBase { - public override string Name => "Logging"; - public override string Description => "PPC logging module."; - public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/logging_module.png"); + public override string Name => "Technician"; + public override string Description => "PPC technician module."; + public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/technician_module.png"); public override Type MainViewType => typeof(MainView); public override Permissions Permission => Permissions.RunPPC; - public LoggingModule() + public TechnicianModule() { IsVisibleInMenu = false; } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs new file mode 100644 index 000000000..3c6f874e0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.PPC.Technician.ViewModels; + +namespace Tango.PPC.Technician +{ + public static class ViewModelLocator + { + /// <summary> + /// Initializes a new instance of the ViewModelLocator class. + /// </summary> + static ViewModelLocator() + { + TangoIOC.Default.Register<MainViewVM>(); + TangoIOC.Default.Register<LoggingViewVM>(); + TangoIOC.Default.Register<CatalogViewVM>(); + } + + /// <summary> + /// Gets the main view VM. + /// </summary> + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance<MainViewVM>(); + } + } + + /// <summary> + /// Gets the logging view VM. + /// </summary> + public static LoggingViewVM LoggingViewVM + { + get + { + return TangoIOC.Default.GetInstance<LoggingViewVM>(); + } + } + + /// <summary> + /// Gets the logging view VM. + /// </summary> + public static CatalogViewVM CatalogViewVM + { + get + { + return TangoIOC.Default.GetInstance<CatalogViewVM>(); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/CatalogViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/CatalogViewVM.cs new file mode 100644 index 000000000..97bae6f5b --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/CatalogViewVM.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.PPC.Common; + +namespace Tango.PPC.Technician.ViewModels +{ + public class CatalogViewVM : PPCViewModel + { + /// <summary> + /// Gets or sets the navigation command. + /// </summary> + public RelayCommand<String> NavigationCommand { get; set; } + + /// <summary> + /// Initializes a new instance of the <see cref="CatalogViewVM"/> class. + /// </summary> + public CatalogViewVM() + { + NavigationCommand = new RelayCommand<string>(NavigateToView); + } + + public override void OnApplicationStarted() + { + + } + + /// <summary> + /// Navigates to the specified view name. + /// </summary> + /// <param name="view">The view.</param> + private void NavigateToView(string view) + { + NavigationManager.NavigateTo<TechnicianModule>(view); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs new file mode 100644 index 000000000..1f63fcd55 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.Core; +using Tango.Core.Commands; +using Tango.Logging; +using Tango.PPC.Common; + +namespace Tango.PPC.Technician.ViewModels +{ + public class LoggingViewVM : PPCViewModel + { + private List<LogItemBase> paused_logs; + + public SynchronizedObservableCollection<LogItemBase> ApplicationLogs { get; set; } + + public SynchronizedObservableCollection<LogItemBase> EmbeddedLogs { get; set; } + + private ICollectionView _applicationLogsViewSource; + public ICollectionView ApplicationLogsViewSource + { + get { return _applicationLogsViewSource; } + set { _applicationLogsViewSource = value; RaisePropertyChangedAuto(); } + } + + private String _filter; + public String Filter + { + get { return _filter; } + set + { + _filter = value; + RaisePropertyChangedAuto(); + ApplicationLogsViewSource.Refresh(); + } + } + + private bool _isPaused; + public bool IsPaused + { + get { return _isPaused; } + set { _isPaused = value; RaisePropertyChangedAuto(); OnIsPausedChanged(); } + } + + public RelayCommand ClearCommand { get; set; } + + public LoggingViewVM() + { + ApplicationLogs = new SynchronizedObservableCollection<LogItemBase>(); + EmbeddedLogs = new SynchronizedObservableCollection<LogItemBase>(); + ApplicationLogsViewSource = CollectionViewSource.GetDefaultView(ApplicationLogs); + paused_logs = new List<LogItemBase>(); + LogManager.NewLog += LogManager_NewLog; + ClearCommand = new RelayCommand(ClearLogs); + + Filter = "error"; + + ApplicationLogsViewSource.Filter = (x) => + { + LogItemBase log = x as LogItemBase; + return String.IsNullOrWhiteSpace(Filter) || log.Category.ToString().ToLower().Contains(Filter.ToLower()) || log.Message.ToLower().Contains(Filter.ToLower()); + }; + } + + private void OnIsPausedChanged() + { + foreach (var log in paused_logs) + { + LogManager_NewLog(this, log); + } + + paused_logs.Clear(); + } + + private void LogManager_NewLog(object sender, LogItemBase log) + { + if (!IsPaused) + { + ApplicationLogs.Insert(0, log); + + var now = DateTime.Now; + + try + { + foreach (var l in ApplicationLogs.ToList()) + { + if (l.TimeStamp.Date < DateTime.Now.Date) + { + ApplicationLogs.Remove(l); + } + } + } + catch + { + //I don't know if this will cause an exception but I'm tired. + } + } + else + { + paused_logs.Add(log); + } + } + + private void ClearLogs() + { + ApplicationLogs.Clear(); + paused_logs.Clear(); + } + + public override void OnApplicationStarted() + { + + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs index 736bff5a2..d63a89f3b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs @@ -4,8 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.PPC.Common; +using Tango.PPC.Technician.Views; -namespace Tango.PPC.Logging.ViewModels +namespace Tango.PPC.Technician.ViewModels { public class MainViewVM : PPCViewModel { @@ -13,5 +14,11 @@ namespace Tango.PPC.Logging.ViewModels { } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + NavigationManager.NavigateTo<TechnicianModule>(nameof(CatalogView)); + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml new file mode 100644 index 000000000..79d753474 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml @@ -0,0 +1,51 @@ +<UserControl x:Class="Tango.PPC.Technician.Views.CatalogView" + 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:sys="clr-namespace:System;assembly=mscorlib" + xmlns:vm="clr-namespace:Tango.PPC.Technician.ViewModels" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:global="clr-namespace:Tango.PPC.Technician" + xmlns:local="clr-namespace:Tango.PPC.Technician.Views" + mc:Ignorable="d" + d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:CatalogViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.CatalogViewVM}"> + <Grid Background="{StaticResource TangoMidBackgroundBrush}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}"> + <Border.Effect> + <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" /> + </Border.Effect> + <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Technician Mode</TextBlock> + </Border> + + <Grid Grid.Row="1" VerticalAlignment="Top" Margin="20"> + <UniformGrid Columns="2"> + <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="LoggingView" Width="250" Height="250" Style="{StaticResource TangoHollowButton}" Padding="20"> + <DockPanel> + <TextBlock Margin="0 10 0 0" DockPanel.Dock="Bottom" HorizontalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Logging</TextBlock> + <Image Width="128" Source="../Images/logging.png" /> + </DockPanel> + </touch:TouchButton> + + <touch:TouchButton Width="250" Height="250" Style="{StaticResource TangoHollowButton}" Padding="20"> + <DockPanel> + <TextBlock Margin="0 10 0 0" DockPanel.Dock="Bottom" HorizontalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">System</TextBlock> + <Image Width="128" Source="../Images/system.png" /> + </DockPanel> + </touch:TouchButton> + + <touch:TouchButton Margin="0 60 0 0" Width="250" Height="250" Style="{StaticResource TangoHollowButton}" Padding="20"> + <DockPanel> + <TextBlock Margin="0 10 0 0" DockPanel.Dock="Bottom" HorizontalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Coming soon...</TextBlock> + <!--<Image Width="128" Source="../Images/system.png" />--> + </DockPanel> + </touch:TouchButton> + </UniformGrid> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml.cs new file mode 100644 index 000000000..d5e0398fb --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.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.PPC.Technician.Views +{ + /// <summary> + /// Interaction logic for CatalogView.xaml + /// </summary> + public partial class CatalogView : UserControl + { + public CatalogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml new file mode 100644 index 000000000..a1cdaf987 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml @@ -0,0 +1,132 @@ +<UserControl x:Class="Tango.PPC.Technician.Views.LoggingView" + 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:local="clr-namespace:Tango.PPC.Technician.Views" + xmlns:sys="clr-namespace:System;assembly=mscorlib" + xmlns:vm="clr-namespace:Tango.PPC.Technician.ViewModels" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:global="clr-namespace:Tango.PPC.Technician" + mc:Ignorable="d" + d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LoggingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoggingViewVM}"> + + <Grid Background="{StaticResource TangoMidBackgroundBrush}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}"> + <Border.Effect> + <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" /> + </Border.Effect> + <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Logging</TextBlock> + </Border> + + <Grid Grid.Row="1"> + + <DockPanel> + <DockPanel DockPanel.Dock="Top"> + <StackPanel Orientation="Horizontal"> + <touch:TouchNavigationLinks Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}"> + <sys:String>Application</sys:String> + <sys:String>Embedded</sys:String> + </touch:TouchNavigationLinks> + + <StackPanel Orientation="Horizontal" Margin="20 3 0 0"> + <touch:TouchToggleIconButton Icon="Pause" Width="32" Height="32" Padding="7" CheckedIcon="Play" IsChecked="{Binding IsPaused}"></touch:TouchToggleIconButton> + <touch:TouchIconButton Margin="10 0 0 0" Icon="TrashAltRegular" Foreground="{StaticResource TangoDarkForegroundBrush}" Width="32" Height="32" Padding="7" Command="{Binding ClearCommand}"></touch:TouchIconButton> + + <StackPanel Orientation="Horizontal" Margin="20 0 0 0"> + <touch:TouchIcon Icon="Magnify" Foreground="{StaticResource TangoGrayBrush}" Width="16" Height="16" /> + <touch:TouchTextBox Width="200" VerticalAlignment="Center" Margin="5 -10 0 0" Text="{Binding Filter}"></touch:TouchTextBox> + </StackPanel> + </StackPanel> + </StackPanel> + <touch:TouchDatePicker Visibility="Collapsed" SelectedDate="12/15/2018" Height="40" /> + </DockPanel> + + <Grid Margin="20"> + <ListBox VirtualizingPanel.ScrollUnit="Pixel" VirtualizingPanel.IsVirtualizing="True" Style="{StaticResource BlankListBox}" ItemsSource="{Binding ApplicationLogsViewSource}" SelectionMode="Single"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <VirtualizingStackPanel /> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource BlankListBoxItem}"> + <Setter Property="Height" Value="125"></Setter> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="Height" Value="Auto"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </ListBox.ItemContainerStyle> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid> + <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" Margin="5" Padding="5" CornerRadius="5" IsHitTestVisible="False"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="BorderBrush" Value="{StaticResource TangoLightBorderBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Category}" Value="Warning"> + <Setter Property="BorderBrush" Value="{StaticResource TangoWarningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Category}" Value="Error"> + <Setter Property="BorderBrush" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Category}" Value="Critical"> + <Setter Property="BorderBrush" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <StackPanel> + <TextBlock> + <Run>Time:</Run> + <Run Text="{Binding TimeStamp,Converter={StaticResource DateTimeUTCToStringConverter},Mode=OneWay,ConverterParameter='hh\\:mm\\:ss.ff'}" FontWeight="SemiBold"></Run> + </TextBlock> + <TextBlock Margin="0 2 0 0"> + <Run>File:</Run> + <Run Text="{Binding RelativeCallerFile,Mode=OneWay}" FontWeight="SemiBold"></Run> + </TextBlock> + <TextBlock Margin="0 2 0 0"> + <Run>Method:</Run> + <Run Text="{Binding CallerMethodName,Mode=OneWay}" FontWeight="SemiBold"></Run> + </TextBlock> + <TextBlock Margin="0 2 0 0"> + <Run>Line:</Run> + <Run Text="{Binding CallerLineNumber,Mode=OneWay}" FontWeight="SemiBold"></Run> + </TextBlock> + <TextBlock Margin="0 2 0 0" TextTrimming="WordEllipsis" TextWrapping="Wrap"> + <Run>Message:</Run> + <Run Text="{Binding Message,Mode=OneWay}" FontWeight="SemiBold"></Run> + </TextBlock> + </StackPanel> + </Border> + + <touch:TouchIcon HorizontalAlignment="Right" VerticalAlignment="Top" Margin="15" Width="16" Height="16"> + <touch:TouchIcon.Style> + <Style TargetType="touch:TouchIcon" BasedOn="{StaticResource {x:Type touch:TouchIcon}}"> + <Setter Property="Icon" Value="ChevronDown"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,IsAsync=True}" Value="True"> + <Setter Property="Icon" Value="ChevronUp"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </touch:TouchIcon.Style> + </touch:TouchIcon> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Grid> + </DockPanel> + + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml.cs new file mode 100644 index 000000000..9c12f7f13 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.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.PPC.Technician.Views +{ + /// <summary> + /// Interaction logic for LoggingView.xaml + /// </summary> + public partial class LoggingView : UserControl + { + public LoggingView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml new file mode 100644 index 000000000..66e16588b --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml @@ -0,0 +1,20 @@ +<UserControl x:Class="Tango.PPC.Technician.Views.MainView" + 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:sys="clr-namespace:System;assembly=mscorlib" + xmlns:vm="clr-namespace:Tango.PPC.Technician.ViewModels" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:global="clr-namespace:Tango.PPC.Technician" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.PPC.Technician.Views" + mc:Ignorable="d" + d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + <Grid Background="{StaticResource TangoMidBackgroundBrush}"> + <controls:NavigationControl TransitionAlwaysFades="True" TransitionType="Zoom" TransitionDuration="00:00:0.2"> + <local:CatalogView/> + <local:LoggingView/> + </controls:NavigationControl> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml.cs index eb448c67c..41eb08c0f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml.cs @@ -13,7 +13,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; -namespace Tango.PPC.Logging.Views +namespace Tango.PPC.Technician.Views { /// <summary> /// Interaction logic for MainView.xaml diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/app.config index f47375ba5..154562d23 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/app.config @@ -16,7 +16,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> @@ -24,27 +24,27 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> @@ -74,6 +74,18 @@ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/packages.config index b3daf0d6c..b3daf0d6c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/packages.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/packages.config diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs index 7769c74f6..5f58be48b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs @@ -56,6 +56,11 @@ namespace Tango.PPC.Common.Application bool IsShuttingDown { get; } /// <summary> + /// Gets a value indicating whether the application is in technician mode. + /// </summary> + bool IsInTechnicianMode { get; } + + /// <summary> /// Shutdown the application. /// </summary> void ShutDown(); @@ -73,7 +78,7 @@ namespace Tango.PPC.Common.Application /// <summary> /// Enteres the application technician mode. /// </summary> - void EnterTechnicianMode(); + void EnterTechnicianMode(bool displayNotification = true); /// <summary> /// Exits the application technician mode. @@ -89,5 +94,20 @@ namespace Tango.PPC.Common.Application /// Gets the application build date. /// </summary> String BuildDate { get; } + + /// <summary> + /// Gets or sets a value indicating whether the screen is currently locked. + /// </summary> + bool IsScreenLocked { get; set; } + + /// <summary> + /// Resets the screen lock timer. + /// </summary> + void ResetScreenLockTimer(); + + /// <summary> + /// Invokes a dialog for entering a password and releasing the screen lock. + /// </summary> + void ReleaseScreenLock(); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index 9a7e29bb7..61ddfdb2b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -79,6 +79,13 @@ namespace Tango.PPC.Common.Connection MachineOperator.UseKeepAlive = true; MachineOperator.EnableDiagnostics = false; MachineOperator.EnableEmbeddedDebugging = false; + + var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + + MachineOperator.JobUploadStrategy = settings.JobUploadStrategy; + + MachineOperator.GradientGenerationConfiguration.IsEnabled = settings.EnableGradientGeneration; + MachineOperator.GradientGenerationConfiguration.ResolutionCM = settings.GradientGenerationResolution; } private async void ConnectionThreadMethod() @@ -89,7 +96,7 @@ namespace Tango.PPC.Common.Connection { try { - LogManager.Log("Starting machine connection procedure..."); + LogManager.Log("Starting machine connection procedure...", LogCategory.Debug); var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); @@ -99,20 +106,28 @@ namespace Tango.PPC.Common.Connection { TimeSpan timeout = TimeSpan.FromSeconds(SettingsManager.Default.GetOrCreate<PPCSettings>().MachineScanningTimeoutSeconds); - LogManager.Log("Scanning for machine on available serial ports..."); + LogManager.Log("Scanning for machine on available serial ports...", LogCategory.Debug); Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(UsbSerialBaudRates.BR_115200); var response = await scanner.Scan(new ConnectRequest() { Password = "1234" }, timeout); - LogManager.Log("Machine discovered on port: " + response.Adapter.Address); - LogManager.Log("Device Information:"); - LogManager.Log(response.Response.DeviceInformation.ToJsonString()); + LogManager.Log("Machine discovered on port: " + response.Adapter.Address, LogCategory.Debug); + LogManager.Log("Device Information:", LogCategory.Debug); + LogManager.Log(response.Response.DeviceInformation.ToJsonString(), LogCategory.Debug); - LogManager.Log("Disconnecting machine operator..."); + LogManager.Log("Disconnecting machine operator...", LogCategory.Debug); await MachineOperator.Disconnect(); MachineOperator.Adapter = response.Adapter; MachineOperator.JobHandlingMode = JobHandlerModes.SettingUp; - LogManager.Log("Connecting machine operator..."); - await MachineOperator.Connect(); + LogManager.Log("Connecting machine operator...", LogCategory.Debug); + try + { + await MachineOperator.Connect(); + } + catch (Exception) + { + await response.Adapter.Disconnect(); + throw; + } await Task.Delay(1000); @@ -120,12 +135,20 @@ namespace Tango.PPC.Common.Connection } else { - LogManager.Log($"Connecting to machine on {settings.EmbeddedComPort}..."); + LogManager.Log($"Connecting to machine on {settings.EmbeddedComPort}...", LogCategory.Debug); UsbTransportAdapter adapter = new UsbTransportAdapter(settings.EmbeddedComPort, UsbSerialBaudRates.BR_115200); MachineOperator.Adapter = adapter; MachineOperator.JobHandlingMode = JobHandlerModes.SettingUp; - await MachineOperator.Connect(); + try + { + await MachineOperator.Connect(); + } + catch (Exception) + { + await adapter.Disconnect(); + throw; + } await Task.Delay(1000); await MachineOperator.UploadHardwareConfiguration(Machine.Configuration.HardwareVersion, Machine.Configuration); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connectivity/AvailableWiFiConnectionsControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connectivity/AvailableWiFiConnectionsControl.xaml index 80581551e..dac37ba10 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connectivity/AvailableWiFiConnectionsControl.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connectivity/AvailableWiFiConnectionsControl.xaml @@ -64,8 +64,8 @@ <Grid Margin="20" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}"> <Grid Height="80"> <touch:TouchCheckBox VerticalAlignment="Top" Margin="60 0 0 0" IsChecked="{Binding AutoConnect}" Visibility="{Binding IsConnected,Converter={StaticResource BooleanToVisibilityInverseConverter}}">Connect automatically</touch:TouchCheckBox> - <touch:TouchButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ConnectToWiFiCommand}" CommandParameter="{Binding}" Width="150" CornerRadius="17" Height="40" HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="{Binding IsConnected,Converter={StaticResource BooleanToVisibilityInverseConverter}}">Connect</touch:TouchButton> - <touch:TouchButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.DisconnectFromWiFiCommand}" CommandParameter="{Binding}" Width="150" CornerRadius="17" Height="40" HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="{Binding IsConnected,Converter={StaticResource BooleanToVisibilityConverter}}">Disconnect</touch:TouchButton> + <touch:TouchButton EnableDropShadow="False" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ConnectToWiFiCommand}" CommandParameter="{Binding}" Width="150" CornerRadius="17" Height="40" HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="{Binding IsConnected,Converter={StaticResource BooleanToVisibilityInverseConverter}}">Connect</touch:TouchButton> + <touch:TouchButton EnableDropShadow="False" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.DisconnectFromWiFiCommand}" CommandParameter="{Binding}" Width="150" CornerRadius="17" Height="40" HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="{Binding IsConnected,Converter={StaticResource BooleanToVisibilityConverter}}">Disconnect</touch:TouchButton> </Grid> <Grid Visibility="{Binding Connecting,Converter={StaticResource BooleanToVisibilityConverter}}" Background="{StaticResource TangoMidBackgroundBrush}"> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml index fe483420a..db6920c80 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.PPC.Common.Controls" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:catalog="clr-namespace:Tango.BL.Catalogs;assembly=Tango.BL" mc:Ignorable="d" @@ -16,12 +17,17 @@ <ColumnDefinition Width="0"/> </Grid.ColumnDefinitions> - <touch:TouchListBox ItemsSource="{Binding Groups}" x:Name="list" x:FieldModifier="public" DisableRipple="True" ScrollBarVisibility="Collapsed" SelectionMode="None"> - <touch:TouchListBox.ItemTemplate> + <ListBox Style="{StaticResource BlankListBox}" ItemsSource="{Binding Groups}" VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.ScrollUnit="Pixel" x:Name="list" x:FieldModifier="public" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Hidden"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <VirtualizingStackPanel /> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0 0 10 0"> - <TextBlock HorizontalAlignment="Center" Text="{Binding Name}" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> - <touch:TouchStaticListBox ItemsSource="{Binding Items}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SelectedItem,Mode=TwoWay}" Margin="0 20 0 40"> + <TextBlock HorizontalAlignment="Center" Text="{Binding Name,IsAsync=True}" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> + <touch:TouchStaticListBox ItemsSource="{Binding Items,IsAsync=True}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SelectedItem,Mode=TwoWay}" Margin="0 20 0 40"> <touch:TouchStaticListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel Orientation="Horizontal" /> @@ -45,8 +51,8 @@ <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.5" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.5" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.5" Duration="00:00:00" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.5" Duration="00:00:00" /> <!--<DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" />--> </Storyboard> </BeginStoryboard> @@ -54,8 +60,8 @@ <DataTrigger.ExitActions> <BeginStoryboard> <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:00" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:00" /> <!--<DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" />--> </Storyboard> </BeginStoryboard> @@ -66,17 +72,17 @@ </touch:TouchStaticListBox.ItemContainerStyle> <touch:TouchStaticListBox.ItemTemplate> <DataTemplate> - <StackPanel Margin="10"> + <StackPanel Margin="10" Width="70"> <Ellipse Width="60" Height="60" Fill="{Binding Brush}" /> - <TextBlock Margin="0 5 0 0" HorizontalAlignment="Center" Text="{Binding Name}"></TextBlock> + <controls:FastTextBlock Margin="0 5 0 0" HorizontalAlignment="Center" Text="{Binding Name,IsAsync=True}"></controls:FastTextBlock> </StackPanel> </DataTemplate> </touch:TouchStaticListBox.ItemTemplate> </touch:TouchStaticListBox> </StackPanel> </DataTemplate> - </touch:TouchListBox.ItemTemplate> - </touch:TouchListBox> + </ListBox.ItemTemplate> + </ListBox> <Grid Grid.Column="1"> <!--<Rectangle Stroke="{StaticResource TangoDividerBrush}" HorizontalAlignment="Left" />--> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs index d4b924f17..e23c629c5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs @@ -53,13 +53,13 @@ namespace Tango.PPC.Common.Controls { _catalog = DataContext as Catalog; - if (list.ScrollViewer != null && _catalog != null) - { - list.ScrollViewer.ScrollToTop(); - _preventChange = true; - slider.Value = _catalog.Groups.Count; - _preventChange = false; - } + //if (list.ScrollViewer != null && _catalog != null) + //{ + // list.ScrollViewer.ScrollToTop(); + // _preventChange = true; + // slider.Value = _catalog.Groups.Count; + // _preventChange = false; + //} }; } @@ -97,7 +97,7 @@ namespace Tango.PPC.Common.Controls { if (!_loaded) { - list.ScrollViewer.Scrolling += ScrollViewer_Scrolling; + //list.ScrollViewer.Scrolling += ScrollViewer_Scrolling; _preventChange = true; slider.Value = slider.Maximum; @@ -151,7 +151,7 @@ namespace Tango.PPC.Common.Controls /// </summary> public TouchListBox TouchListBox { - get { return list; } + get { return null; } } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs index d540e3fd3..25eb2df04 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs @@ -79,6 +79,7 @@ namespace Tango.PPC.Common.EventLogging _machineProvider.MachineOperator.RequestSent += Machine_RequestSent; _machineProvider.MachineOperator.RequestFailed += Machine_RequestFailed; _machineProvider.MachineOperator.ResponseReceived += Machine_ResponseReceived; + _machineProvider.MachineOperator.StateChanged += MachineOperator_StateChanged; } #endregion @@ -114,6 +115,20 @@ namespace Tango.PPC.Common.EventLogging #region Event Handlers /// <summary> + /// Handles the machine operator state changed event. + /// </summary> + /// <param name="sender">The sender.</param> + /// <param name="e">The e.</param> + private void MachineOperator_StateChanged(object sender, Transport.TransportComponentState e) + { + if (e == Transport.TransportComponentState.Connected) + { + _events = new ConcurrentQueue<MachinesEvent>(); + _currentEvents.Clear(); + } + } + + /// <summary> /// Handles the RequestSent event of the connected machine. /// </summary> /// <param name="sender">The sender.</param> @@ -212,7 +227,15 @@ namespace Tango.PPC.Common.EventLogging machineEvent.UserGuid = _authentication.CurrentUser.Guid; machineEvent.User = _authentication.CurrentUser; _events.Enqueue(machineEvent); - _currentEvents.Add(machineEvent); + + if (!_currentEvents.Exists(x => x.Type == machineEvent.Type)) + { + if (machineEvent.Group != EventTypeGroups.Application && machineEvent.Group != EventTypeGroups.Transport) + { + _currentEvents.Add(machineEvent); + } + } + EventReceived?.Invoke(this, machineEvent); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs index 4f035d814..835a7fc4a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs @@ -77,7 +77,7 @@ namespace Tango.PPC.Common.HotSpot { try { - CmdCommand command = new CmdCommand("netsh", $"wlan set hostednetwork mode=allow ssid='{"Tango-" + _machineProvider.Machine.SerialNumber}' key='{password}'"); + CmdCommand command = new CmdCommand("netsh", $"wlan set hostednetwork mode=allow ssid={"Tango-" + _machineProvider.Machine.SerialNumber} key={password}"); await command.Run(); command = new CmdCommand("netsh", "wlan start hosted network"); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 952944cf9..b64b624fe 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -75,13 +75,10 @@ namespace Tango.PPC.Common.MachineUpdate private Task Login(String serialNumber) { - return Task.Factory.StartNew(() => + return _client.Login(new LoginRequest() { - return _client.Login(new LoginRequest() - { - Mode = LoginMode.Machine, - SerialNumber = serialNumber, - }).Result; + Mode = LoginMode.Machine, + SerialNumber = serialNumber, }); } @@ -310,7 +307,7 @@ namespace Tango.PPC.Common.MachineUpdate LogManager.Log($"Connecting to machine service on {machineServiceAddress}..."); - Login(serialNumber).Wait(); + Login(serialNumber).GetAwaiter().GetResult(); LogManager.Log($"Checking if updates available..."); @@ -340,6 +337,8 @@ namespace Tango.PPC.Common.MachineUpdate { LogManager.Log("Starting database update..."); + UpdateProgress("Updating Database", "Initializing..."); + LogManager.Log("Looking for update scripts configuration on application path..."); String config_file = Path.Combine(PathHelper.GetStartupPath(), "Update Scripts", "config.xml"); @@ -355,6 +354,8 @@ namespace Tango.PPC.Common.MachineUpdate LogManager.Log($"Updating database '{update_response.DataSource.ToString()}' => '{localDataSource.ToString()}'..."); + UpdateProgress("Updating Database", "Initializing update sequence..."); + ExaminerSequenceConfiguration config_sequence = ExaminerSequenceConfiguration.FromFile(config_file); foreach (var item in config_sequence.Items.Where(x => x.Type == ExaminerSequenceItemType.Data).OrderBy(x => x.Index)) @@ -382,6 +383,8 @@ namespace Tango.PPC.Common.MachineUpdate try { + UpdateProgress("Updating Database", item.Name + "..."); + var result = process.Execute().Result; if (result.ExitCode != ExaminerProcessExitCode.Success) @@ -397,6 +400,7 @@ namespace Tango.PPC.Common.MachineUpdate } } + UpdateProgress("Updating Database", "Database synchronization completed successfully."); LogManager.Log("Update completed successfully."); }); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index 409dd1cfc..050f1615c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -5,6 +5,7 @@ using System.ServiceModel; using System.Text; using System.Threading.Tasks; using Tango.Logging; +using Tango.PMR.Printing; using Tango.Settings; using Tango.Web; @@ -77,6 +78,41 @@ namespace Tango.PPC.Common public bool EnableWatchDog { get; set; } /// <summary> + /// Gets or sets a value indicating whether to enable the technician mode when the application starts. + /// </summary> + public bool EnableTechnicianModeByDefault { get; set; } + + /// <summary> + /// Gets or sets the job upload strategy. + /// </summary> + public JobUploadStrategy JobUploadStrategy { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to enable gradient generation. + /// </summary> + public bool EnableGradientGeneration { get; set; } + + /// <summary> + /// Gets or sets the gradient generation resolution. + /// </summary> + public int GradientGenerationResolution { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to enable the application lock screen. + /// </summary> + public bool EnableLockScreen { get; set; } + + /// <summary> + /// Gets or sets the lock screen timeout. + /// </summary> + public TimeSpan LockScreenTimeout { get; set; } + + /// <summary> + /// Gets or sets the lock screen password. + /// </summary> + public String LockScreenPassword { get; set; } + + /// <summary> /// Gets the machine service address. /// </summary> /// <returns></returns> @@ -90,11 +126,16 @@ namespace Tango.PPC.Common /// </summary> public PPCSettings() { + JobUploadStrategy = JobUploadStrategy.JobDescriptionFile; + EnableGradientGeneration = true; + GradientGenerationResolution = 20; MachineScanningTimeoutSeconds = 20; LoggingCategories = new List<LogCategory>(); EmbeddedComPort = null; ExternalBridgePassword = "Aa123456"; HotSpotPassword = "Aa123456"; + LockScreenTimeout = TimeSpan.FromMinutes(10); + LockScreenPassword = "1111"; DeploymentSlot = DeploymentSlot.TEST; EnableWatchDog = true; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs index b9a0d8483..5e584f891 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs @@ -177,6 +177,15 @@ namespace Tango.PPC.Common } /// <summary> + /// Raises the specified message using the default <see cref="TangoMessenger"/>. + /// </summary> + /// <typeparam name="T"></typeparam> + protected void RaiseMessage<T>() where T : class + { + TangoMessenger.Default.Send<T>(Activator.CreateInstance<T>()); + } + + /// <summary> /// Registers a message handle for the specified message type T. /// </summary> /// <typeparam name="T"></typeparam> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/IPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/IPrintingManager.cs index 37a71c965..dc097a805 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/IPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/IPrintingManager.cs @@ -22,7 +22,7 @@ namespace Tango.PPC.Common.Printing /// <param name="job">The job.</param> /// <param name="context">The context.</param> /// <returns></returns> - JobHandler Print(Job job, ObservablesContext context); + Task<JobHandler> Print(Job job, ObservablesContext context); /// <summary> /// Creates a sample dye job from the specified job and prints it. @@ -31,7 +31,7 @@ namespace Tango.PPC.Common.Printing /// <param name="job">The job.</param> /// <param name="context">The context.</param> /// <returns></returns> - JobHandler PrintSample(Job job, ObservablesContext context); + Task<JobHandler> PrintSample(Job job, ObservablesContext context); /// <summary> /// Creates a fine tuning job from the specified job and fine tune items. @@ -41,6 +41,6 @@ namespace Tango.PPC.Common.Printing /// <param name="context">The context.</param> /// <param name="fineTuneItems">The fine tune items.</param> /// <returns></returns> - JobHandler PrintFineTuning(Job job, ObservablesContext context, IEnumerable<FineTuneItem> fineTuneItems); + Task<JobHandler> PrintFineTuning(Job job, ObservablesContext context, IEnumerable<FineTuneItem> fineTuneItems); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml index 05cd998e6..b5b9f9b23 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -14,6 +14,7 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchIconButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchListBox.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchNativeListBox.xaml" /> <!--PPC--> <ResourceDictionary Source="pack://application:,,,/Tango.PPC.Common;component/Resources/Colors.xaml"/> @@ -47,6 +48,7 @@ <converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" /> <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" /> <converters:IsNullToVisibilityConverter x:Key="IsNullToVisibilityConverter" /> + <converters:StringToLinesConverter x:Key="StringToLinesConverter" /> <Style TargetType="FrameworkElement"> <Setter Property="TextElement.FontFamily" Value="{StaticResource TangoFlexoFontFamily}"></Setter> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config b/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config index 24626938a..84ab8bb09 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config @@ -16,7 +16,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> @@ -24,27 +24,27 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> @@ -52,7 +52,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> @@ -78,6 +78,14 @@ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config index 4b93a7127..f1039847b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config @@ -25,7 +25,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> @@ -33,27 +33,27 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> @@ -61,7 +61,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> @@ -87,6 +87,14 @@ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> </configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config index 9a0087c43..61d4cf5bc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config @@ -12,6 +12,98 @@ + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> + </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml new file mode 100644 index 000000000..8a90b03a0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml @@ -0,0 +1,30 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.ScreenLockView" + 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:local="clr-namespace:Tango.PPC.UI.Dialogs" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="600" Height="250" d:DataContext="{d:DesignInstance Type=local:ScreenLockViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.InputBindings> + <KeyBinding Key="Return" Command="{Binding OKCommand}"></KeyBinding> + </UserControl.InputBindings> + <Grid Margin="10"> + <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">OK</touch:TouchButton> + </StackPanel> + <DockPanel> + <touch:TouchIcon Foreground="{StaticResource TangoErrorBrush}" Icon="Lock" VerticalAlignment="Top" Height="70"></touch:TouchIcon> + <StackPanel Margin="10 0 0 0"> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}">Screen Locked</TextBlock> + <TextBlock Margin="0 10 0 0" TextWrapping="Wrap">Please enter the password to unlock the screen.</TextBlock> + <touch:TouchTextBox x:Name="txtPassword" Margin="0 30 40 0" IsPassword="True" KeyboardAction="Go" Text="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs new file mode 100644 index 000000000..4a28984e6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs @@ -0,0 +1,36 @@ +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.PPC.UI.Dialogs +{ + /// <summary> + /// Interaction logic for TechnicianModeLoginView.xaml + /// </summary> + public partial class ScreenLockView : UserControl + { + public ScreenLockView() + { + InitializeComponent(); + + Loaded += ScreenLockView_Loaded; + } + + private async void ScreenLockView_Loaded(object sender, RoutedEventArgs e) + { + await Task.Delay(200); + txtPassword.Focus(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs new file mode 100644 index 000000000..e19117621 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class ScreenLockViewVM : DialogViewVM + { + private String _password; + public String Password + { + get { return _password; } + set { _password = value; RaisePropertyChangedAuto(); } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml new file mode 100644 index 000000000..24a5416ba --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml @@ -0,0 +1,31 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.TechnicianModeLoginView" + 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:local="clr-namespace:Tango.PPC.UI.Dialogs" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="600" Height="250" d:DataContext="{d:DesignInstance Type=local:TechnicianModeLoginViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.InputBindings> + <KeyBinding Key="Return" Command="{Binding OKCommand}"></KeyBinding> + </UserControl.InputBindings> + + <Grid Margin="10"> + <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">OK</touch:TouchButton> + </StackPanel> + <DockPanel> + <Image Source="/Images/technician-mode.png" Stretch="Uniform" VerticalAlignment="Top" Height="70"></Image> + <StackPanel Margin="10 0 0 0"> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}">Technician Mode</TextBlock> + <TextBlock Margin="0 10 0 0" TextWrapping="Wrap">Please enter the technician mode password.</TextBlock> + <touch:TouchTextBox x:Name="txtPassword" KeyboardAction="Go" Margin="0 30 40 0" IsPassword="True" Text="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs new file mode 100644 index 000000000..3a809b6f3 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs @@ -0,0 +1,36 @@ +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.PPC.UI.Dialogs +{ + /// <summary> + /// Interaction logic for TechnicianModeLoginView.xaml + /// </summary> + public partial class TechnicianModeLoginView : UserControl + { + public TechnicianModeLoginView() + { + InitializeComponent(); + + Loaded += TechnicianModeLoginView_Loaded; + } + + private async void TechnicianModeLoginView_Loaded(object sender, RoutedEventArgs e) + { + await Task.Delay(200); + txtPassword.Focus(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs new file mode 100644 index 000000000..2a46bcd96 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class TechnicianModeLoginViewVM : DialogViewVM + { + private String _password; + public String Password + { + get { return _password; } + set { _password = value; RaisePropertyChangedAuto(); } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif Binary files differnew file mode 100644 index 000000000..11cef3b10 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif Binary files differnew file mode 100644 index 000000000..058d9a34d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif Binary files differnew file mode 100644 index 000000000..9bf0d84f3 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif Binary files differnew file mode 100644 index 000000000..79256816a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif Binary files differnew file mode 100644 index 000000000..9ca81da39 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif Binary files differnew file mode 100644 index 000000000..f5962c36c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif Binary files differnew file mode 100644 index 000000000..d936476b6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif Binary files differnew file mode 100644 index 000000000..89491179d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif 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/machine-update.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-update.png Binary files differindex 3e49520dd..d8db51337 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-update.png +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-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/Images/technician-mode.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png Binary files differnew file mode 100644 index 000000000..7d98c6734 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs index 364ca8ee7..b90a1afff 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs @@ -11,7 +11,9 @@ using System.Windows.Data; using System.Windows.Documents; using System.Windows.Forms; using System.Windows.Input; +using System.Windows.Interop; using System.Windows.Media; +using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; @@ -32,6 +34,8 @@ namespace Tango.PPC.UI { Instance = this; + //Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline),new FrameworkPropertyMetadata { DefaultValue = 30 }); + InitializeComponent(); bool has_touch = false; @@ -77,6 +81,16 @@ namespace Tango.PPC.UI Closing += MainWindow_Closing; } + protected override void OnSourceInitialized(EventArgs e) + { + //var hwndSource = PresentationSource.FromVisual(this) as HwndSource; + + //if (hwndSource != null) + // hwndSource.CompositionTarget.RenderMode = RenderMode.SoftwareOnly; + + base.OnSourceInitialized(e); + } + private void LockAspectRatio() { this.Width = (this.Height * (800d / 1280d)) - 10; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs index d7dca484e..5062df1d6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -140,7 +140,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = TouchIconKind.AlertOctagon, + Icon = TouchIconKind.AlertCircleOutline, Title = "Error", Brush = Application.Current.Resources["TangoMessageBoxErrorBrush"] as Brush, }); @@ -156,7 +156,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = TouchIconKind.InfoCircleSolid, + Icon = TouchIconKind.AlertCircleOutline, Title = "Information", Brush = Application.Current.Resources["TangoMessageBoxInfoBrush"] as Brush, }); @@ -172,7 +172,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = TouchIconKind.Alert, + Icon = TouchIconKind.AlertCircleOutline, Title = "Warning", Brush = Application.Current.Resources["TangoMessageBoxWarningBrush"] as Brush, }); @@ -188,7 +188,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = TouchIconKind.QuestionCircleSolid, + Icon = TouchIconKind.QuestionCircleRegular, Title = "Confirm", HasCancel = true, Brush = Application.Current.Resources["TangoMessageBoxQuestionBrush"] as Brush, @@ -218,6 +218,8 @@ namespace Tango.PPC.UI.Notifications /// <returns></returns> private Task<bool> ShowMessageBox(MessageBoxVM vm) { + ReleaseGlobalBusyMessage(); + LogManager.Log($"Displaying MessagBox '{vm.Message}'."); TaskCompletionSource<bool> source = new TaskCompletionSource<bool>(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 788d2b178..1550e97e1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -28,6 +28,9 @@ using Tango.PPC.Common.EventLogging; using Tango.BL.Enumerations; using Tango.PPC.Common.Notifications; using Tango.PPC.Common.WatchDog; +using Tango.PPC.UI.Dialogs; +using Tango.Core.Threading; +using Tango.PPC.Common.Messages; namespace Tango.PPC.UI.PPCApplication { @@ -47,6 +50,7 @@ namespace Tango.PPC.UI.PPCApplication private INotificationProvider _notificationProvider; private WatchDogServer _watchdogServer; private ObservablesContext _machineContext; + private ActionTimer _screenLockTimer; /// <summary> /// Occurs when a system restart is required. @@ -89,6 +93,11 @@ namespace Tango.PPC.UI.PPCApplication public bool IsShuttingDown { get; private set; } /// <summary> + /// Gets a value indicating whether the application is in technician mode. + /// </summary> + public bool IsInTechnicianMode { get; private set; } + + /// <summary> /// Gets the application version. /// </summary> public Version Version @@ -110,6 +119,16 @@ namespace Tango.PPC.UI.PPCApplication } } + private bool _isScreenLocked; + /// <summary> + /// Gets or sets a value indicating whether the screen is currently locked. + /// </summary> + public bool IsScreenLocked + { + get { return _isScreenLocked; } + set { _isScreenLocked = value; RaisePropertyChangedAuto(); } + } + /// <summary> /// Initializes a new instance of the <see cref="DefaultPPCApplicationManager"/> class. /// </summary> @@ -300,6 +319,8 @@ namespace Tango.PPC.UI.PPCApplication /// </summary> private void FinalizeModuleInitialization() { + var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + LogManager.Log("Finalizing application initialization..."); LogManager.Log("Initializing Machine Provider..."); @@ -329,6 +350,31 @@ namespace Tango.PPC.UI.PPCApplication LogManager.Log($"Invoking {vm.GetType().Name}.OnApplicationReady..."); vm.OnApplicationReady(); } + + if (settings.EnableTechnicianModeByDefault) + { + EnterTechnicianMode(false); + } + + if (settings.EnableLockScreen) + { + _screenLockTimer = new ActionTimer(settings.LockScreenTimeout); + _screenLockTimer.ResetReplace(ScreenLockTimerAction); + } + + TangoMessenger.Default.Register<MachineSettingsSavedMessage>((msg) => + { + if (_screenLockTimer != null) + { + _screenLockTimer.Dispose(); + } + + if (settings.EnableLockScreen) + { + _screenLockTimer = new ActionTimer(settings.LockScreenTimeout); + _screenLockTimer.ResetReplace(ScreenLockTimerAction); + } + }); }); } @@ -412,10 +458,32 @@ namespace Tango.PPC.UI.PPCApplication /// <summary> /// Enteres the application technician mode. /// </summary> - public void EnterTechnicianMode() + public async void EnterTechnicianMode(bool displayNotification = true) { - _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); - _notificationProvider.ShowInfo("Technician mode is now enabled."); + if (displayNotification) + { + var vm = await _notificationProvider.ShowDialog<TechnicianModeLoginViewVM>(); + + if (vm.DialogResult) + { + if (vm.Password == "Aa123456") + { + IsInTechnicianMode = true; + _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); + await _notificationProvider.ShowInfo("Technician mode is now enabled."); + } + else + { + await _notificationProvider.ShowError("Invalid technician mode password."); + EnterTechnicianMode(); + } + } + } + else + { + IsInTechnicianMode = true; + _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); + } } /// <summary> @@ -423,8 +491,42 @@ namespace Tango.PPC.UI.PPCApplication /// </summary> public void ExitTechnicianMode() { + IsInTechnicianMode = false; _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianExited()); _notificationProvider.ShowInfo("Technician mode is now disabled."); } + + /// <summary> + /// Invokes a dialog for entering a password and releasing the screen lock. + /// </summary> + public async void ReleaseScreenLock() + { + if (IsScreenLocked) + { + var vm = await _notificationProvider.ShowDialog<ScreenLockViewVM>(); + + if (vm.DialogResult) + { + if (vm.Password == SettingsManager.Default.GetOrCreate<PPCSettings>().LockScreenPassword) + { + IsScreenLocked = false; + ResetScreenLockTimer(); + } + } + } + } + + public void ResetScreenLockTimer() + { + if (_screenLockTimer != null) + { + _screenLockTimer.ResetReplace(ScreenLockTimerAction); + } + } + + private void ScreenLockTimerAction() + { + IsScreenLocked = true; + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index d6770ed45..7d4aa154e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Tango.BL; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.Core; using Tango.Core.DI; using Tango.Integration.Operation; @@ -42,13 +43,23 @@ namespace Tango.PPC.UI.Printing /// <param name="job">The job.</param> /// <param name="context">The context.</param> /// <returns></returns> - public JobHandler Print(Job job, ObservablesContext context) + public async Task<JobHandler> Print(Job job, ObservablesContext context) { + JobHandler handler = null; + #if STUBPRINT - var handler = _machineProvider.MachineOperator.PrintStub(job); + handler = await _machineProvider.MachineOperator.PrintStub(job); #else - var handler = _machineProvider.MachineOperator.Print(job); + + if (job.ColorSpace.Code != ColorSpaces.Volume.ToInt32()) + { + handler = await _machineProvider.MachineOperator.Print(job); + } + else + { + handler = await _machineProvider.MachineOperator.Print(job, job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault()); + } #endif handler.Completed += async (x, e) => @@ -104,7 +115,7 @@ namespace Tango.PPC.UI.Printing /// <param name="job">The job.</param> /// <param name="context">The context.</param> /// <returns></returns> - public JobHandler PrintSample(Job job, ObservablesContext context) + public async Task<JobHandler> PrintSample(Job job, ObservablesContext context) { LogManager.Log("Cloning job..."); Job sampleDyeJob = job.Clone(); @@ -131,7 +142,7 @@ namespace Tango.PPC.UI.Printing LogManager.Log("Executing sample dye job..."); - var handler = _machineProvider.MachineOperator.Print(sampleDyeJob); + var handler = await _machineProvider.MachineOperator.Print(sampleDyeJob); handler.Completed += async (x, e) => { try @@ -157,7 +168,7 @@ namespace Tango.PPC.UI.Printing /// <param name="context">The context.</param> /// <param name="fineTuneItems">The fine tune items.</param> /// <returns></returns> - public JobHandler PrintFineTuning(Job job, ObservablesContext context, IEnumerable<FineTuneItem> fineTuneItems) + public async Task<JobHandler> PrintFineTuning(Job job, ObservablesContext context, IEnumerable<FineTuneItem> fineTuneItems) { LogManager.Log("Cloning job..."); Job fineTuneJob = job.Clone(); @@ -172,7 +183,7 @@ namespace Tango.PPC.UI.Printing var segment = fineTuneJob.AddSolidSegment(suggestion.Color); } - var handler = _machineProvider.MachineOperator.Print(fineTuneJob); + var handler = await _machineProvider.MachineOperator.Print(fineTuneJob); handler.Completed += async (x, e) => { try diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 9b8f8f4ae..a0db99ffb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.9.0")] 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..71fa82504 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 @@ -122,6 +122,14 @@ <Compile Include="Connectivity\WiFiAuthenticationViewVM.cs" /> <Compile Include="Converters\AppBarItemConverter.cs" /> <Compile Include="Converters\ItemBaseConverter.cs" /> + <Compile Include="Dialogs\ScreenLockView.xaml.cs"> + <DependentUpon>ScreenLockView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\TechnicianModeLoginView.xaml.cs"> + <DependentUpon>TechnicianModeLoginView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\ScreenLockViewVM.cs" /> + <Compile Include="Dialogs\TechnicianModeLoginViewVM.cs" /> <Compile Include="Dialogs\UpdateFromFileView.xaml.cs"> <DependentUpon>UpdateFromFileView.xaml</DependentUpon> </Compile> @@ -182,6 +190,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Dialogs\ScreenLockView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Dialogs\TechnicianModeLoginView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Dialogs\UpdateFromFileView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -274,6 +290,19 @@ </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" /> + <Resource Include="Images\technician-mode.png" /> + <Resource Include="Images\GlobalStatus\getting_ready_Anim.gif" /> + <Resource Include="Images\GlobalStatus\dyeing_Anim.gif" /> + <Resource Include="Images\GlobalStatus\error_Anim.gif" /> + <Resource Include="Images\GlobalStatus\machine_off_Anim.gif" /> + <Resource Include="Images\GlobalStatus\Ready_Anim.gif" /> + <Resource Include="Images\GlobalStatus\service_Anim.gif" /> + <Resource Include="Images\GlobalStatus\shutdown_icon_Anim.gif" /> + <Resource Include="Images\GlobalStatus\standby_Anim.gif" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> <None Include="packages.config" /> @@ -362,22 +391,18 @@ <Project>{096f16c8-6d06-4b5f-9496-b9d2df2d94a3}</Project> <Name>Tango.PPC.Jobs</Name> </ProjectReference> - <ProjectReference Include="..\Modules\Tango.PPC.Logging\Tango.PPC.Logging.csproj"> - <Project>{d2ee865b-b006-487a-9487-60a663636ac3}</Project> - <Name>Tango.PPC.Logging</Name> - </ProjectReference> <ProjectReference Include="..\Modules\Tango.PPC.MachineSettings\Tango.PPC.MachineSettings.csproj"> <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> </ProjectReference> + <ProjectReference Include="..\Modules\Tango.PPC.Technician\Tango.PPC.Technician.csproj"> + <Project>{d2ee865b-b006-487a-9487-60a663636ac3}</Project> + <Name>Tango.PPC.Technician</Name> + </ProjectReference> <ProjectReference Include="..\Tango.PPC.Common\Tango.PPC.Common.csproj"> <Project>{0be74eee-22cb-4dba-b896-793b9e1a3ac0}</Project> <Name>Tango.PPC.Common</Name> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs index a8faeea7b..80a95d1bf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs @@ -7,6 +7,7 @@ using Tango.BL.Entities; using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.ExternalBridge; +using Tango.PMR.Integration; using Tango.PPC.Common; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Common.Navigation; @@ -115,12 +116,15 @@ namespace Tango.PPC.UI.ViewModels /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void ExternalBridgeService_ClientDisconnected(object sender, EventArgs e) { - LogManager.Log("External bridge client disconnected. Navigating to home module..."); - - InvokeUI(() => + if (IsVisible) { - NavigationManager.NavigateTo(NavigationView.HomeModule); - }); + LogManager.Log("External bridge client disconnected. Navigating to home module..."); + + InvokeUI(() => + { + NavigationManager.NavigateTo(NavigationView.HomeModule); + }); + } } /// <summary> @@ -132,7 +136,7 @@ namespace Tango.PPC.UI.ViewModels { LogManager.Log($"External bridge connection request received.\n{e.ToJsonString()}"); - if (e.Request.Password == Settings.ExternalBridgePassword) + if (!e.Request.Intent.RequiresPassword() || e.Request.Password == Settings.ExternalBridgePassword) { e.Confirmed = true; @@ -145,11 +149,14 @@ namespace Tango.PPC.UI.ViewModels LogManager.Log($"External bridge connection user has been identified as {User.Contact.FullName}"); } - LogManager.Log("Navigating to external bridge view..."); - InvokeUI(() => + if (e.Request.Intent == ExternalBridgeLoginIntent.FullControl) { - NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false); - }); + LogManager.Log("Navigating to external bridge view..."); + InvokeUI(() => + { + NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false); + }); + } } else { 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..9e8a9fe34 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,16 @@ namespace Tango.PPC.UI.ViewModels /// </summary> public RelayCommand UpdateCommand { get; set; } + /// <summary> + /// Gets or sets the power command. + /// </summary> + public RelayCommand PowerCommand { get; set; } + + /// <summary> + /// Gets or sets the restart application command. + /// </summary> + public RelayCommand RestartApplicationCommand { get; set; } + #endregion #region Constructors @@ -106,12 +137,15 @@ 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); + RestartApplicationCommand = new RelayCommand(RestartApplication); } #endregion @@ -194,6 +228,17 @@ namespace Tango.PPC.UI.ViewModels } } + /// <summary> + /// Restarts the application. + /// </summary> + private async void RestartApplication() + { + if (await NotificationProvider.ShowQuestion("Are you sure you want to restart the application?")) + { + ApplicationManager.Restart(); + } + } + #endregion #region Override Methods @@ -217,6 +262,25 @@ namespace Tango.PPC.UI.ViewModels #endregion + #region Public Methods + + /// <summary> + /// Toggles the application technician mode. + /// </summary> + public void ToggleTechnicianMode() + { + if (!ApplicationManager.IsInTechnicianMode) + { + ApplicationManager.EnterTechnicianMode(); + } + else + { + ApplicationManager.ExitTechnicianMode(); + } + } + + #endregion + #region Event Handlers /// <summary> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs index b5b5f56bc..f265c5dbf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -33,6 +33,7 @@ namespace Tango.PPC.UI.ViewModels private MachineUpdateResult _update_result; private DbCompareResult _db_compare_result; + private bool _isChecking; #region Properties @@ -132,10 +133,21 @@ namespace Tango.PPC.UI.ViewModels { await NavigateTo(MachineUpdateView.UpdateCheckView); + if (_isChecking) return; + try { + _isChecking = true; IsDbUpdate = false; + await Task.Delay(2000); + if (!await ConnectivityProvider.CheckInternetConnection()) + { + _isChecking = false; + await NavigateTo(MachineUpdateView.UpdateCheckErrorView); + return; + } + var response = await MachineUpdateManager.CheckForUpdate(MachineProvider.Machine.SerialNumber); if (response.IsUpdateAvailable) @@ -164,6 +176,10 @@ namespace Tango.PPC.UI.ViewModels LogManager.Log(ex, "Error while trying to check for updates."); await NavigateTo(MachineUpdateView.UpdateFailedView); } + finally + { + _isChecking = false; + } } private async void Update() 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..56b4c2283 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,43 @@ </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}" /> + + <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" FontSize="{StaticResource TangoSmallFontSize}" Margin="40 20 20 50" VerticalAlignment="Bottom" HorizontalAlignment="Left"> + <Run>Machine S/N:</Run> + <Run FontStyle="Italic" Text="{Binding MachineProvider.Machine.SerialNumber,Mode=OneWay,IsAsync=True}"></Run> + </TextBlock> </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 +69,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 +88,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 +103,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 Command="{Binding RestartApplicationCommand}" 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,33 +213,36 @@ <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"> <StackPanel Orientation="Horizontal"> - <StackPanel VerticalAlignment="Center"> - <Image Width="33" HorizontalAlignment="Center"> - <Image.Style> - <Style TargetType="Image"> + <StackPanel x:Name="techPressElement" VerticalAlignment="Center" Background="Transparent"> + <touch:TouchGifAnimation Width="36" HorizontalAlignment="Center" EnableAnimation="True"> + <touch:TouchGifAnimation.Style> + <Style TargetType="touch:TouchGifAnimation"> <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Disconnected}"> - <Setter Property="Source" Value="/Images/GlobalStatus/machine-off.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/machine_off_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Standby}"> - <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/standby_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.ReadyToDye}"> - <Setter Property="Source" Value="/Images/GlobalStatus/ready-to-dye.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/Ready_Anim.gif"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.GettingReady}"> + <Setter Property="Source" Value="/Images/GlobalStatus/getting_ready_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Printing}"> - <Setter Property="Source" Value="/Images/GlobalStatus/dyeing.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/dyeing_Anim.gif"></Setter> </DataTrigger> </Style.Triggers> </Style> - </Image.Style> - </Image> + </touch:TouchGifAnimation.Style> + </touch:TouchGifAnimation> <TextBlock Margin="0 10 0 0" Text="{Binding MachineProvider.MachineOperator.Status,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> </StackPanel> @@ -179,7 +284,12 @@ <!--MODULES GOES HERE--> </controls:NavigationControl> </Grid> + </DockPanel> </touch:TouchSideMenu> + + <Grid PreviewMouseUp="Grid_PreviewMouseUp" IsHitTestVisible="True" Background="Transparent" Visibility="{Binding ApplicationManager.IsScreenLocked,Converter={StaticResource BooleanToVisibilityConverter}}"> + <touch:TouchIcon HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="40" Icon="Lock" Width="60" Height="60" Opacity="0.5" Foreground="{StaticResource TangoSuccessBrush}" /> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs index 50b9df550..883d3f893 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs @@ -14,9 +14,11 @@ using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using System.Windows.Threading; using Tango.Core.EventArguments; using Tango.Logging; using Tango.PPC.Common; +using Tango.PPC.UI.ViewModels; using Tango.PPC.UI.ViewsContracts; namespace Tango.PPC.UI.Views @@ -27,11 +29,65 @@ namespace Tango.PPC.UI.Views public partial class LayoutView : UserControl, ILayoutView { public static LayoutView Instance { get; private set; } + private LayoutViewVM _vm; + private DispatcherTimer _timer; public LayoutView() { InitializeComponent(); Instance = this; + Loaded += (_, __) => _vm = DataContext as LayoutViewVM; + techPressElement.RegisterForPreviewMouseOrTouchDown(OnMouseOrTouchDown); + techPressElement.RegisterForPreviewMouseOrTouchUp(OnMouseOrTouchUp); + _timer = new DispatcherTimer(); + _timer.Interval = TimeSpan.FromSeconds(10); + _timer.Tick += _timer_Tick; + + this.PreviewMouseUp += LayoutView_PreviewMouseUp; + } + + private void LayoutView_PreviewMouseUp(object sender, MouseButtonEventArgs e) + { + _vm.ApplicationManager.ResetScreenLockTimer(); + } + + private void _timer_Tick(object sender, EventArgs e) + { + _timer.Stop(); + _vm.ToggleTechnicianMode(); + } + + private void OnMouseOrTouchDown(object sender, MouseOrTouchEventArgs e) + { + //if (e.TouchDevice != null) + //{ + // techPressElement.CaptureTouch(e.TouchDevice); + //} + //else + //{ + // techPressElement.CaptureMouse(); + //} + + _timer.Start(); + } + + private void OnMouseOrTouchUp(object sender, MouseOrTouchEventArgs e) + { + //if (e.TouchDevice != null) + //{ + // techPressElement.ReleaseTouchCapture(e.TouchDevice); + //} + //else + //{ + // techPressElement.ReleaseMouseCapture(); + //} + + _timer.Stop(); + } + + private void Grid_PreviewMouseUp(object sender, MouseButtonEventArgs e) + { + _vm.ApplicationManager.ReleaseScreenLock(); } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml index 179d1dde3..dee4e9c7b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml @@ -27,13 +27,6 @@ <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Forgot password?</TextBlock> </StackPanel> - <StackPanel> - <controls:AsyncAdornerControl Height="130" Visibility="{Binding IsLoading,Converter={StaticResource BooleanToVisibilityConverter}}"> - <StackPanel VerticalAlignment="Center"> - <touch:TouchGifAnimation Source="/Images/preloader_rectangles.gif" EnableAnimation="{Binding IsLoading}" /> - </StackPanel> - </controls:AsyncAdornerControl> - </StackPanel> </StackPanel> </StackPanel> </Grid> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml index 0fb9d9e09..fba8a599d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml @@ -11,115 +11,127 @@ xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:MachineUpdateViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineUpdateViewVM}"> + d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:MachineUpdateViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineUpdateViewVM}"> <Grid> <DockPanel> - <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 10 0 0"> - <Image Source="/Images/machine-update.png" Stretch="None" /> + <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 20 0 0"> + <Image Source="/Images/machine-update.png" Stretch="Fill" Width="700" /> </StackPanel> <controls:NavigationControl x:Name="navigationControl" TransitionType="Slide" KeepElementsAttached="True" Margin="0 20 0 0" SelectedIndex="0"> <Grid controls:NavigationControl.NavigationName="UpdateCheckView"> - <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> - <touch:TouchBusyIndicator Width="250" Height="250" IsIndeterminate="{Binding IsVisible}" /> - <TextBlock DockPanel.Dock="Top" Margin="0 100" FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 0 30 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchBusyIndicator Width="250" Height="250" IsIndeterminate="{Binding IsVisible}" /> + <TextBlock DockPanel.Dock="Top" Margin="0 50 0 0" FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> Checking for updates, please wait... - </TextBlock> - </StackPanel> + </TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateAvailableView"> - <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0"> - <ContentControl> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock FontSize="{StaticResource TangoHeaderFontSize}"> + <DockPanel Margin="0 50 0 0"> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Width="300" CornerRadius="35" Command="{Binding UpdateCommand}">UPDATE</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 80 0 30" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center"> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}"> <Run>Version</Run> <Run Foreground="{StaticResource TangoPrimaryAccentBrush}" Text="{Binding LatestVersion}"></Run> <Run>is available</Run> - </TextBlock> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsDbUpdate}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock FontSize="{StaticResource TangoHeaderFontSize}"> + </TextBlock> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsDbUpdate}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock FontSize="{StaticResource TangoHeaderFontSize}"> Database update is available - </TextBlock> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> + </TextBlock> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> - <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Margin="0 40 0 0"> + <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Margin="0 40 0 0"> Updating your machine can improve the following: - </TextBlock> + </TextBlock> - <StackPanel Margin="0 40 0 0"> - <StackPanel Orientation="Horizontal" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Support for new media</TextBlock> - </StackPanel> + <StackPanel Margin="0 40 0 0"> + <StackPanel Orientation="Horizontal" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Support for new media</TextBlock> + </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Refined color conversion and calibration algorithms</TextBlock> - </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Refined color conversion and calibration algorithms</TextBlock> + </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Software fixes and improvements</TextBlock> - </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Software fixes and improvements</TextBlock> + </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> - <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Firmware upgrade</TextBlock> + <StackPanel Orientation="Horizontal" Margin="0 10 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchIcon Width="24" Height="24" Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">Firmware upgrade</TextBlock> + </StackPanel> </StackPanel> - </StackPanel> - <TextBlock Margin="0 60 0 0" FontSize="{StaticResource TangoTitleFontSize}"> + <TextBlock Margin="0 60 0 0" FontSize="{StaticResource TangoTitleFontSize}"> Tap 'UPDATE' to start updating now. - </TextBlock> - - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding UpdateCommand}">UPDATE</touch:TouchButton> - - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 80 0 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> - </StackPanel> + </TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpToDateView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> - <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Your machine is up to date!</TextBlock> - - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Margin="0 0 0 140" Width="300" CornerRadius="35" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Your machine is up to date!</TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateCheckErrorView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> - <TextBlock VerticalAlignment="Center" Width="600" TextWrapping="Wrap" TextAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to check for updates. Please check your internet connection and try again.</TextBlock> - - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">TRY AGAIN</touch:TouchButton> - - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 200 0 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">TRY AGAIN</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 80 0 30" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Width="600" TextWrapping="Wrap" TextAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to check for updates. Please check your internet connection and try again.</TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateProgressView"> <StackPanel> - <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Updating your machine</TextBlock> + <TextBlock HorizontalAlignment="Center" Margin="0 80 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Updating your machine</TextBlock> <TextBlock Margin="0 10 0 0" TextAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayBrush}">Do not turn off the machine</TextBlock> - + <StackPanel Margin="0 200 0 0"> <TextBlock Text="{Binding MachineUpdateManager.Status.Name,FallbackValue='Download Software Package'}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> <TextBlock HorizontalAlignment="Center" Text="{Binding MachineUpdateManager.Status.Message,FallbackValue='Connecting to machine service...'}" Margin="0 40 0 0"></TextBlock> @@ -129,37 +141,46 @@ </Grid> <Grid controls:NavigationControl.NavigationName="UpdateDbProgressView"> - <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> - <touch:TouchBusyIndicator Width="250" Height="250" IsIndeterminate="{Binding IsVisible}" /> - <TextBlock DockPanel.Dock="Top" Margin="0 100" FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> - Updating database... - </TextBlock> + <StackPanel> + <TextBlock HorizontalAlignment="Center" Margin="0 80 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Updating your machine</TextBlock> + <TextBlock Margin="0 10 0 0" TextAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayBrush}">Do not turn off the machine</TextBlock> + + <StackPanel Margin="0 200 0 0"> + <TextBlock Text="{Binding MachineUpdateManager.Status.Name,FallbackValue='Synchronizing database'}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> + <TextBlock HorizontalAlignment="Center" Text="{Binding MachineUpdateManager.Status.Message,FallbackValue='Retrieving data...'}" Margin="0 40 0 0"></TextBlock> + <touch:TouchProgressBar Margin="50 10" Height="10" IsIndeterminate="{Binding MachineUpdateManager.Status.IsIntermediate}" Maximum="{Binding MachineUpdateManager.Status.Total}" Value="{Binding MachineUpdateManager.Status.Progress,Mode=OneWay}" /> + </StackPanel> </StackPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateCompletedView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> - <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Update completed successfully !</TextBlock> - - <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding CompleteCommand}">RESTART</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Margin="0 0 0 130" Padding="20" Width="300" CornerRadius="35" Command="{Binding CompleteCommand}">RESTART</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Your machine is up to date!</TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateFailedView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="AlertOutline" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> - <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" FontSize="{StaticResource TangoTitleFontSize}">Update Failed</TextBlock> - <TextBlock HorizontalAlignment="Center" Margin="0 5 0 0" Foreground="{StaticResource TangoErrorBrush}" Text="{Binding FailedError,FallbackValue='Unexpected error'}"></TextBlock> - - <touch:TouchButton Margin="0 180 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">TRY AGAIN</touch:TouchButton> - - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 200 0 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">TRY AGAIN</touch:TouchButton> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 100 0 30" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="AlertOutline" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> + <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" FontSize="{StaticResource TangoTitleFontSize}">Update Failed</TextBlock> + <TextBlock HorizontalAlignment="Center" Margin="0 5 0 0" Foreground="{StaticResource TangoErrorBrush}" TextAlignment="Center" Text="{Binding FailedError,FallbackValue='Unexpected error'}"></TextBlock> + </StackPanel> + </DockPanel> </Grid> <Grid controls:NavigationControl.NavigationName="UpdateFromPackageView"> - <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0"> + <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0" VerticalAlignment="Top"> <touch:TouchBusyIndicator Width="250" Height="250" IsIndeterminate="{Binding IsVisible}" /> <TextBlock DockPanel.Dock="Top" Margin="0 100" FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> Updating your software @@ -168,12 +189,15 @@ </Grid> <Grid controls:NavigationControl.NavigationName="UpdateFailedFromPackageView"> - <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> - <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> - <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to update the machine.</TextBlock> - - <touch:TouchButton Style="{StaticResource TangoFlatButton}" Margin="0 200 0 0" Padding="20" Width="300" HorizontalContentAlignment="Center" CornerRadius="35" Command="{Binding ToApplicationCommand}">Back To Application</touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Bottom"> + <touch:TouchButton Padding="20" Width="300" Margin="0 0 0 130" CornerRadius="35" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> + </StackPanel> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0"> + <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to update the machine.</TextBlock> + </StackPanel> + </DockPanel> </Grid> </controls:NavigationControl> </DockPanel> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index e4c107049..604c79aeb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -28,7 +28,9 @@ ItemExpandedPropertyPath="IsExpanded" HasDialog="{Binding NotificationProvider.HasDialog}" CurrentDialog="{Binding NotificationProvider.CurrentDialog}" - NotificationBarVisibility="{Binding NotificationProvider.NotificationsVisible,Converter={StaticResource BooleanToVisibilityConverter}}"> + NotificationBarVisibility="{Binding NotificationProvider.NotificationsVisible,Converter={StaticResource BooleanToVisibilityConverter}}" + IsBusy="{Binding NotificationProvider.IsInGlobalBusyState}" + BusyMessage="{Binding NotificationProvider.GlobalBusyMessage}"> <touch:TouchPanel.NotificationTemplate> <DataTemplate> <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="0" Command="{Binding PressedCommand}" components:TransformationHelper.TransformWhenPressed="False"> @@ -59,7 +61,7 @@ </touch:TouchIcon.Style> </touch:TouchIcon> - <touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Icon="AccessPointNetwork" Visibility="{Binding ConnectivityProvider.IsHotspotActive,Converter={StaticResource BooleanToVisibilityConverter}}" /> + <touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Icon="AccessPointNetwork" Visibility="{Binding HotSpotProvider.IsEnabled,Converter={StaticResource BooleanToVisibilityConverter}}" /> <touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Icon="Bridge" Visibility="{Binding ExternalBridgeService.Enabled,Converter={StaticResource BooleanToVisibilityConverter}}" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config index b295bcfda..f51c20e54 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config @@ -15,7 +15,7 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> @@ -23,27 +23,27 @@ </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> @@ -73,6 +73,18 @@ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> </configuration>
\ No newline at end of file |
