diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-03-30 19:41:54 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-03-30 19:41:54 +0300 |
| commit | 3dcf3242705a7522617d4b5f7ca4d9b918e48ca5 (patch) | |
| tree | 29e6083fbe1f9778e14e9641bffcb7d4765e8b39 /Software/Visual_Studio | |
| parent | c61d12100372054de07f6201c27c7755c7be35e8 (diff) | |
| download | Tango-3dcf3242705a7522617d4b5f7ca4d9b918e48ca5.tar.gz Tango-3dcf3242705a7522617d4b5f7ca4d9b918e48ca5.zip | |
Eureka PPC. GoToJob, Notifications, LengthWothSpool.
Diffstat (limited to 'Software/Visual_Studio')
12 files changed, 290 insertions, 135 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index 02ed4d27d..da021858c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -68,7 +68,6 @@ namespace Tango.PPC.Jobs.ViewModels private string _current_job_string; private bool startingJob = false; private List<ColorCatalog> _catalogs; - private string _jsonJobModelLoaded; #region Properties @@ -88,7 +87,6 @@ namespace Tango.PPC.Jobs.ViewModels } private JobModel _jobModel; - public JobModel JobModel { get { return _jobModel; } @@ -99,6 +97,10 @@ namespace Tango.PPC.Jobs.ViewModels } } + public bool CanEdit + { + get { return !MachineProvider.MachineOperator.IsPrinting || MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid; } + } private ICollectionView _segmentsCollectionView; /// <summary> @@ -407,12 +409,12 @@ namespace Tango.PPC.Jobs.ViewModels #endregion - #region Job Management + #region Job Management - /// <summary> + /// <summary> /// Loads the job. /// </summary> - private async void LoadJob() + private async void LoadJob() { try { @@ -468,6 +470,8 @@ namespace Tango.PPC.Jobs.ViewModels .WithSegmentsGroups() .BuildAsync(); + RaisePropertyChanged(nameof(CanEdit)); + Job.NameChanged -= Job_NameChanged; Job.NameChanged += Job_NameChanged; @@ -477,8 +481,8 @@ namespace Tango.PPC.Jobs.ViewModels //await SetSpoolTension(Job.Rml); LogManager.Log("Loading RMLS..."); - //Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToList(); - Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToList(); + Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToList(); + //Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToList(); LogManager.Log("Loading Color Spaces..."); ColorSpaces = await _db.ColorSpaces.Where(x => x.Code != (int)BL.Enumerations.ColorSpaces.CMYK).ToListAsync(); LogManager.Log("Loading Spool Types..."); @@ -712,6 +716,8 @@ namespace Tango.PPC.Jobs.ViewModels await Save(); var handler = await PrintingManager.Print(Job, _db, new PrintingConfiguration() { }); + RaisePropertyChanged(nameof(CanEdit)); + if (!BuildProvider.IsEureka) { await NavigationManager.NavigateTo<JobsV2Module>(nameof(JobProgressView)); @@ -1255,6 +1261,12 @@ namespace Tango.PPC.Jobs.ViewModels base.OnApplicationStarted(); MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; + MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; + } + + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) + { + RaisePropertyChanged(nameof(CanEdit)); } private void MachineOperator_PrintingEnded(object sender, Integration.Operation.PrintingEventArgs e) @@ -1263,6 +1275,8 @@ namespace Tango.PPC.Jobs.ViewModels { _start_printing_btn.Push(); } + + RaisePropertyChanged(nameof(CanEdit)); } /// <summary> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index 7e042c82c..bbd05ae8e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -819,7 +819,7 @@ </UserControl.Resources> - <Grid Background="{StaticResource TangoMidBackgroundBrush}" SnapsToDevicePixels="False"> + <Grid Background="{StaticResource TangoMidBackgroundBrush}" SnapsToDevicePixels="False" IsEnabled="{Binding CanEdit}"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs index 32ba01ad2..d7e70b881 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs @@ -17,8 +17,8 @@ namespace Tango.PPC.UI.Converters { double length = System.Convert.ToDouble(values[0]); double coef = System.Convert.ToDouble(values[1]); - var weight = ((double)length * coef) / (1000 * 1000);//(kg) - + double spools = System.Convert.ToDouble(values[3]); + var weight = ((double)length * spools * coef) / (1000 * 1000);//(kg) return weight; } catch diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs new file mode 100644 index 000000000..48e9bce7b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs @@ -0,0 +1,33 @@ +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; + +namespace Tango.PPC.UI.Converters +{ + public class LengthWithSpoolsConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + double length = System.Convert.ToDouble(values[0]); + double spools = System.Convert.ToDouble(values[1]); + return length * spools; + } + catch + { + return 0d; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs index d0f6484ab..14f9db927 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs @@ -97,8 +97,8 @@ namespace Tango.PPC.UI.Modules } else { - LogManager.Log(String.Format("Loading module '{0}'...", nameof(JobsModule))); - AllModules.Add(new JobsModule()); + //LogManager.Log(String.Format("Loading module '{0}'...", nameof(JobsModule))); + //AllModules.Add(new JobsModule()); } //Preloaded @@ -142,7 +142,7 @@ namespace Tango.PPC.UI.Modules if (settings.UseJobsModuleV2) { - var legacyJobsModule = AllModules.SingleOrDefault(x => x.GetType() == typeof(JobsModule)); + var legacyJobsModule = AllModules.SingleOrDefault(x => x.GetType().Name == "JobsModule"); AllModules.Remove(legacyJobsModule); } else 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 88bbcc92e..7ed27a3ce 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 @@ -142,6 +142,7 @@ <Compile Include="Converters\AppBarItemConverter.cs" /> <Compile Include="Converters\ItemBaseConverter.cs" /> <Compile Include="Converters\LengthToWeightConverter.cs" /> + <Compile Include="Converters\LengthWithSpoolsConverter.cs" /> <Compile Include="Dialogs\BitResultsView.xaml.cs"> <DependentUpon>BitResultsView.xaml</DependentUpon> </Compile> @@ -666,10 +667,6 @@ <Project>{dbbd90f4-4135-475d-a8f8-6795d3a8f697}</Project> <Name>Tango.PPC.JobsV2</Name> </ProjectReference> - <ProjectReference Include="..\Modules\Tango.PPC.Jobs\Tango.PPC.Jobs.csproj"> - <Project>{096f16c8-6d06-4b5f-9496-b9d2df2d94a3}</Project> - <Name>Tango.PPC.Jobs</Name> - </ProjectReference> <ProjectReference Include="..\Modules\Tango.PPC.MachineSettings\Tango.PPC.MachineSettings.csproj"> <Project>{91b70e9b-66a7-4873-ae10-400e71cf404f}</Project> <Name>Tango.PPC.MachineSettings</Name> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs index f22d43b19..77b883150 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -187,8 +187,8 @@ namespace Tango.PPC.UI.ViewModels private void GoToJob() { - // NavigationManager.NavigateWithObject<JobsV2Module, JobEurekaView, JobNavigationObject>(new JobNavigationObject() { Job = _handler.Job }); - // NavigationManager.ClearHistoryExcept<JobsView>(); + NavigationManager.NavigateWithObject<JobsV2Module, JobEurekaView, JobNavigationObject>(new JobNavigationObject() { Job = _handler.Job }); + NavigationManager.ClearHistoryExcept<JobsView>(); } #region Public Methods 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 14b9b76e3..7caabf6a1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -566,7 +566,11 @@ namespace Tango.PPC.UI.ViewModels { _updateNotificationItem = null; }; - NotificationProvider.PushNotification(_updateNotificationItem); + + if (!BuildProvider.IsEureka) + { + NotificationProvider.PushNotification(_updateNotificationItem); + } }); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index 097245990..fe42576b4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -61,8 +61,8 @@ <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1" Visibility="{Binding IsVisibleInMenu,Converter={StaticResource BooleanToVisibilityConverter}}"> <touch:TouchButton Margin="0 0 0 0" Padding="10 15" 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="32" Height="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Name}" Foreground="{StaticResource TangoLightForegroundBrush}"></TextBlock> + <Image VerticalAlignment="Center" Source="{Binding Image}" Width="20" Height="20"></Image> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Name}" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Light"></TextBlock> </StackPanel> </touch:TouchButton> </Border> @@ -75,8 +75,8 @@ <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1"> <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="10 15" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="/Images/Menu/update.png" VerticalAlignment="Center" Width="32" Height="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}">Update</TextBlock> + <Image Source="/Images/Menu/update.png" VerticalAlignment="Center" Width="20" Height="20"></Image> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Light">Update</TextBlock> </StackPanel> </touch:TouchButton> </Border> @@ -192,8 +192,8 @@ </Border.Style> <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="10 0 0 25" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding PowerCommand}" Background="{StaticResource TangoMenuPanelDarkBrush}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="/Images/menu/power.png" VerticalAlignment="Center" Width="32" Height="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}">Power</TextBlock> + <Image Source="/Images/menu/power.png" VerticalAlignment="Center" Width="20" Height="20"></Image> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Light">Power</TextBlock> </StackPanel> </touch:TouchButton> </Border> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index f681a5112..bbb6127e5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -14,6 +14,7 @@ <UserControl.Resources> <locaConverters:LengthToWeightConverter x:Key="LengthToWeightConverter" /> + <locaConverters:LengthWithSpoolsConverter x:Key="LengthWithSpoolsConverter"/> <Style x:Key="LinkRoundButtonStyle" TargetType="{x:Type touch:TouchButton}"> <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> @@ -90,7 +91,7 @@ </Grid.RowDefinitions> <Grid Margin=" 0 0 0 20"> <DockPanel> - <touch:TouchButton DockPanel.Dock="Right" VerticalAlignment="Top" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}"> + <touch:TouchButton Command="{Binding GoToJobCommand}" DockPanel.Dock="Right" VerticalAlignment="Top" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}"> <StackPanel Orientation="Vertical"> <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Bottom">Go To Job</TextBlock> <Rectangle Height="3" Fill="{StaticResource TangoPrimaryAccentBrush}" VerticalAlignment="Bottom" Margin="0 2 0 0"></Rectangle> @@ -229,103 +230,118 @@ </touch:TouchRingProgress.Style> </touch:TouchRingProgress> - <touch:TouchBusyIndicator Width="360" Height="360" StrokeThickness="10" Maximum="100" Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityConverter}}"> - <touch:TouchBusyIndicator.Style> - <Style TargetType="touch:TouchBusyIndicator"> - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> - <Setter Property="Value" Value="0"></Setter> - <Setter Property="IsIndeterminate" Value="False"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RunningJobStatus.IsSettingUp}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> + <touch:TouchBusyIndicator Width="360" Height="360" StrokeThickness="10" Maximum="100" Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityConverter}}"> + <touch:TouchBusyIndicator.Style> + <Style TargetType="touch:TouchBusyIndicator"> + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> <Setter Property="Value" Value="0"></Setter> - <Setter Property="IsIndeterminate" Value="True"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding RunningJobStatus.IsCompleted}" Value="True"> <Setter Property="IsIndeterminate" Value="False"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding RunningJobStatus.IsCanceled}" Value="True"> - <Setter Property="Value" Value="99.9999999"></Setter> - <Setter Property="IsIndeterminate" Value="False"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding RunningJobStatus.IsFailed}" Value="True"> - <Setter Property="Value" Value="99.9999999"></Setter> - <Setter Property="IsIndeterminate" Value="False"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchBusyIndicator.Style> - </touch:TouchBusyIndicator> - - <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> + <Style.Triggers> + <DataTrigger Binding="{Binding RunningJobStatus.IsSettingUp}" Value="True"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Setter Property="Value" Value="0"></Setter> + <Setter Property="IsIndeterminate" Value="True"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding RunningJobStatus.IsCompleted}" Value="True"> + <Setter Property="IsIndeterminate" Value="False"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding RunningJobStatus.IsCanceled}" Value="True"> + <Setter Property="Value" Value="99.9999999"></Setter> + <Setter Property="IsIndeterminate" Value="False"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding RunningJobStatus.IsFailed}" Value="True"> + <Setter Property="Value" Value="99.9999999"></Setter> + <Setter Property="IsIndeterminate" Value="False"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </touch:TouchBusyIndicator.Style> + </touch:TouchBusyIndicator> - <StackPanel Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> - <Image Source="../Images/JobProgressView/drop.png" Stretch="None" /> - <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Completed</TextBlock> - </StackPanel> + <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> - <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}" Margin="0 10 0 0" HorizontalAlignment="Center"> - <Run Text="{Binding RunningJobStatus.ProgressMinusSettingUp,StringFormat=0,FallbackValue=0}"></Run><Run Text="/" /><Run Text="{Binding RunningJobStatus.TotalProgressMinusSettingUp,StringFormat=0,FallbackValue=0}"/> - <Run FontSize="16">m</Run> - </TextBlock> - </StackPanel> + <StackPanel Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> + <Image Source="../Images/JobProgressView/drop.png" Stretch="None" /> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Completed</TextBlock> + </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 10 0 0" HorizontalAlignment="Center"> + <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}"> + <TextBlock.Text> + <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0" TargetNullValue='-' FallbackValue='0' Mode="OneWay"> + <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> + <Binding Path="Job.Spools" Mode="OneWay"/> + </MultiBinding> + </TextBlock.Text> + </TextBlock> + <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}" Text="/"></TextBlock> + <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}"> + <TextBlock.Text> + <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0" TargetNullValue='-' FallbackValue='0' Mode="OneWay"> + <Binding Path="RunningJobStatus.TotalProgressMinusSettingUp" Mode="OneWay"/> + <Binding Path="Job.Spools" Mode="OneWay"/> + </MultiBinding> + </TextBlock.Text> + </TextBlock> + <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}" Text="m"></TextBlock> + </StackPanel> + </StackPanel> - <StackPanel Height="90" Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityConverter}}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> - <Image Source="../Images/JobProgressView/drop.png" Stretch="None" /> - <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Getting Ready...</TextBlock> - </StackPanel> - </StackPanel> + <StackPanel Height="90" Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityConverter}}"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> + <Image Source="../Images/JobProgressView/drop.png" Stretch="None" /> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Getting Ready...</TextBlock> + </StackPanel> + </StackPanel> - <Rectangle Margin="0 10 0 0" Width="250" Stroke="{StaticResource TangoDividerBrush}" /> + <Rectangle Margin="0 10 0 0" Width="250" Stroke="{StaticResource TangoDividerBrush}" /> - <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 Left</TextBlock> - </StackPanel> + <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 Left</TextBlock> + </StackPanel> - <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}" Margin="0 10 0 0" HorizontalAlignment="Center"> + <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}" Margin="0 10 0 0" HorizontalAlignment="Center"> <Run Text="{Binding RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToTwoDigitsTimeConverter},FallbackValue=5}"></Run> <Run FontSize="16" Text="{Binding RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToLabelConverter},FallbackValue=min}"></Run> - </TextBlock> + </TextBlock> + </StackPanel> + </Grid> + + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> + <touch:TouchButton Content="Abort" Margin="0 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding AbortCommand}" IsEnabled="true" BorderThickness="1" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" EnableDropShadow="False"> + <touch:TouchButton.Style > + <Style TargetType="touch:TouchButton" > + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + <Setter Property="Background" Value="Transparent"/> + <Style.Triggers> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </touch:TouchButton.Style> + </touch:TouchButton> + <touch:TouchButton Content="Stop" Margin="20 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding StopCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" EnableDropShadow="False"> + <touch:TouchButton.Style > + <Style TargetType="touch:TouchButton" > + <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter> + <Setter Property="Background" Value="{StaticResource TangoPrimaryAccentBrush}"/> + <Style.Triggers> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter> + <Setter Property="Background" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </touch:TouchButton.Style> + </touch:TouchButton> + </StackPanel> </StackPanel> </Grid> - - <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> - <touch:TouchButton Content="Abort" Margin="0 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding AbortCommand}" IsEnabled="true" BorderThickness="1" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" EnableDropShadow="False"> - <touch:TouchButton.Style > - <Style TargetType="touch:TouchButton" > - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> - <Setter Property="Background" Value="Transparent"/> - <Style.Triggers> - <Trigger Property="IsEnabled" Value="False"> - <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter> - <Setter Property="BorderBrush" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter> - </Trigger> - </Style.Triggers> - </Style> - </touch:TouchButton.Style> - </touch:TouchButton> - <touch:TouchButton Content="Stop" Margin="20 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding StopCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" EnableDropShadow="False"> - <touch:TouchButton.Style > - <Style TargetType="touch:TouchButton" > - <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter> - <Setter Property="Background" Value="{StaticResource TangoPrimaryAccentBrush}"/> - <Style.Triggers> - <Trigger Property="IsEnabled" Value="False"> - <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter> - <Setter Property="Background" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter> - </Trigger> - </Style.Triggers> - </Style> - </touch:TouchButton.Style> - </touch:TouchButton> - </StackPanel> - </StackPanel> - </Grid> </DockPanel> <StackPanel x:Name="Job_Progress" Grid.Row="2" Margin="0 25 0 0" Orientation="Vertical"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> @@ -347,8 +363,15 @@ <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <Image Source="../Images/Job Issues/job_length.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left"/> <StackPanel Orientation="Vertical" Margin="15 0 0 0"> - <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Job Length</TextBlock> - <TextBlock Text="{Binding RunningJobStatus.ProgressMinusSettingUp,StringFormat=0.##,FallbackValue=0}" FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></TextBlock> + <TextBlock x:Name="ProgressLength" VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Job Length</TextBlock> + <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> + <TextBlock.Text> + <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> + <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> + <Binding Path="Job.Spools" Mode="OneWay"/> + </MultiBinding> + </TextBlock.Text> + </TextBlock> </StackPanel> </StackPanel> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> @@ -357,9 +380,10 @@ <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Job Weight</TextBlock> <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="0.#####" TargetNullValue='-' FallbackValue='-'> - <Binding Path="RunningJobStatus.ProgressMinusSettingUp"/> - <Binding Path="Job.GramPerLength"/> + <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="0.#####" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> + <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> + <Binding Path="Job.GramPerLength" Mode="OneWay"/> + <Binding Path="Job.Spools" Mode="OneWay"/> </MultiBinding> </TextBlock.Text> </TextBlock> @@ -430,33 +454,33 @@ <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> </StackPanel> <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="Magenta" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">M</TextBlock> + <Border Width="50" Height="50" Background="LightCyan" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">LC</TextBlock> <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> </StackPanel> <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="Yellow" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">Y</TextBlock> + <Border Width="50" Height="50" Background="Magenta" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">M</TextBlock> <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> </StackPanel> <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="Black" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">K</TextBlock> + <Border Width="50" Height="50" Background="LightPink" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">LM</TextBlock> <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> </StackPanel> <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="White" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">-</TextBlock> + <Border Width="50" Height="50" Background="Yellow" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">Y</TextBlock> <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> </StackPanel> <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="White" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">-</TextBlock> + <Border Width="50" Height="50" Background="LightYellow" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">LY</TextBlock> <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> </StackPanel> <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="White" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">-</TextBlock> + <Border Width="50" Height="50" Background="Black" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">K</TextBlock> <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> </StackPanel> </UniformGrid> @@ -470,6 +494,87 @@ </Grid> </Grid> - </Grid> + </Grid> + <Grid VerticalAlignment="Bottom" Grid.ColumnSpan="2" Margin="10 0 0 0"> + <touch:TouchExpander x:Name="Notifications" Style="{StaticResource TouchRoundedExpander}" IsTabStop="False" KeyboardNavigation.TabNavigation ="None" BorderThickness="0" IsExpanded="false" CornerRadius="20 20 0 0" > + <touch:TouchExpander.Header> + <DockPanel > + <touch:TouchButton Margin="0 0 20 0" Content="Clear All" DockPanel.Dock="Right" Width="120" Height="38" HorizontalAlignment="Right" VerticalAlignment="Center" EnableDropShadow="False" Background="Transparent" BorderThickness="1" CornerRadius="19" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" Foreground="{StaticResource TangoPrimaryAccentBrush}" > + + </touch:TouchButton> + <StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center" > + <!--<Image Source="../Images/JobView/job-summary.png" Width="39" />--> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" >Notifications</TextBlock> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" FontWeight="Normal" Visibility="{Binding NotificationProvider.HasNotificationItems, Converter={StaticResource BooleanToVisibilityConverter}}"> + <Run Text="(" ></Run> + <Run Text="7(TEST)"></Run> + <Run Text=" new Events)" ></Run> + </TextBlock> + </StackPanel> + </DockPanel> + </touch:TouchExpander.Header> + <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> + <ItemsControl ClipToBounds="False" ItemsSource="{Binding NotificationProvider.NotificationItems}" > + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Border BorderThickness="1" Margin="-1 0 0 0" BorderBrush="{StaticResource TangoDividerBrush}" Width="935"> + <DockPanel HorizontalAlignment="Stretch" > + <Grid DockPanel.Dock="Right" Width="40" HorizontalAlignment="Right" VerticalAlignment="Stretch" Visibility="{Binding CanClose,Converter={StaticResource BooleanToVisibilityConverter}}"> + <Grid Margin="0 0 20 0" HorizontalAlignment="Right" VerticalAlignment="Center" Width="14" Height="14"> + <touch:TouchIcon Icon="Close" Foreground="Black" /> + </Grid> + <touch:TouchButton Opacity="0" Background="Transparent" Style="{StaticResource TangoFlatButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}" Padding="5" /> + </Grid> + <touch:TouchIcon Margin="24 12 15 12" DockPanel.Dock="Left" Height="32"> + <touch:TouchIcon.Style> + <Style TargetType="touch:TouchIcon"> + <Setter Property="Icon" Value="Information"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding MessageType}" Value="Info"> + <Setter Property="Icon" Value="InformationOutline"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"/> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Success"> + <Setter Property="Icon" Value="Check"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"/> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Warning"> + <Setter Property="Icon" Value="AlertCircleOutline"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"/> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Error"> + <Setter Property="Icon" Value="AlertCircleOutline"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"/> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Critical"> + <Setter Property="Icon" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"/> + </DataTrigger> + </Style.Triggers> + </Style> + </touch:TouchIcon.Style> + </touch:TouchIcon> + + <StackPanel Margin="20 3 40 3" VerticalAlignment="Center"> + <TextBlock Text="{Binding Message}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Foreground="Black" VerticalAlignment="Center" ></TextBlock> + + <TextBlock Margin="0 5 0 0" Foreground="{StaticResource TangoDarkForegroundBrush}" Text="{Binding ExpandedMessage}" FontSize="{StaticResource TangoSmallFontSize}" TextWrapping="Wrap" VerticalAlignment="Center" > + + </TextBlock> + + </StackPanel> + </DockPanel> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Grid> + </touch:TouchExpander> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index bfcd19cb1..f4bde2599 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -405,7 +405,7 @@ namespace Tango.BL.Entities [NotMapped] [JsonIgnore] - public double GramPerLength { get; private set;} + public double GramPerLength { get; set;} #endregion diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index c5841a8b5..92fc9cc1c 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2884,12 +2884,12 @@ namespace Tango.Integration.Operation await fileUploadHandler.Cancel(); fileUploadHandler = null; LogManager.Log("Job upload canceled."); - OnPrintingAborted(handler, jobForJobRun); - handler.RaiseCanceled(); if (Status != MachineStatuses.Disconnected) { UpdateStatus(MachineStatuses.ReadyToDye); } + OnPrintingAborted(handler, jobForJobRun); + handler.RaiseCanceled(); } else { @@ -2899,12 +2899,14 @@ namespace Tango.Integration.Operation } SaveLastJobLiquidQuantities(clonedJob, originalJob.Machine.Configuration, processParameters, handler); - OnPrintingAborted(handler, jobForJobRun); - handler.RaiseCanceled(); + if (Status != MachineStatuses.Disconnected) { UpdateStatus(MachineStatuses.ReadyToDye); } + + OnPrintingAborted(handler, jobForJobRun); + handler.RaiseCanceled(); } } } |
