From 09b1dd03e5d67453e673789fe0826e7a25d881ab Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 24 Sep 2020 22:28:15 +0300 Subject: Allow null user on jobs. Dropped use of any user on PPC. --- .../Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') 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 c41a9ef5d..164867afe 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 @@ -518,7 +518,7 @@ namespace Tango.PPC.Jobs.ViewModels job.ColorSpaceGuid = Adapter.ColorSpaces.FirstOrDefault(x => x.Code == vm.SelectedColorSpace.ToInt32()).Guid; job.ColorSpace = _colorSpaces.SingleOrDefault(x => x.Guid == job.ColorSpaceGuid); job.MachineGuid = MachineProvider.Machine.Guid; - job.UserGuid = AuthenticationProvider.CurrentUser.Guid; + job.UserGuid = null; job.RmlGuid = Settings.DefaultRmlGuid != null ? Settings.DefaultRmlGuid : _rmls.FirstOrDefault().Guid; job.WindingMethodGuid = Adapter.WindingMethods.FirstOrDefault().Guid; job.SpoolTypeGuid = Settings.DefaultSpoolTypeGuid != null ? Settings.DefaultSpoolTypeGuid : Adapter.SpoolTypes.FirstOrDefault().Guid; @@ -843,7 +843,7 @@ namespace Tango.PPC.Jobs.ViewModels try { JobFile jFile = JobFile.Parser.ParseFrom(File.ReadAllBytes(jobFile.Path)); - var job = await Job.FromJobFile(jFile, MachineProvider.Machine.Guid, AuthenticationProvider.CurrentUser.Guid); + var job = await Job.FromJobFile(jFile, MachineProvider.Machine.Guid, null); job.JobSource = JobSource.Local; jobContext.Jobs.Add(job); await jobContext.SaveChangesAsync(); -- cgit v1.3.1 From ffc9932efa42c9485b9d0d53ee0b0602690f1c46 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 11 Oct 2020 18:43:01 +0300 Subject: Some improvements to notification bar. --- .../Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs | 4 +++- .../Notifications/NotificationItems/MessageNotificationItemView.xaml | 2 +- Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') 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 7869e6990..daf27e62e 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 @@ -82,9 +82,11 @@ namespace Tango.PPC.Jobs.ViewModels /// The instance containing the event data. private void MachineOperator_PrintingFailed(object sender, PrintingFailedEventArgs e) { + String message = $"{e.Exception.FlattenMessage()}\nTap to view this job details."; + _last_failed_job_notification = NotificationProvider.PushNotification(new MessageNotificationItem( $"'{e.Job.Name}' failed at position {e.JobHandler.Status.ProgressMinusSettingUp.ToString("0.0")} out of {e.JobHandler.Status.TotalProgressMinusSettingUp.ToString("0.0")} meters.", - 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, () => + message, MessageNotificationItem.MessageNotificationItemTypes.Error, () => { NavigationManager.NavigateWithObject(e.Job); NavigationManager.ClearHistoryExcept(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml index a6df8876e..f48f52ab9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml @@ -8,7 +8,7 @@ xmlns:common="clr-namespace:Tango.PPC.Common.Converters" mc:Ignorable="d" x:Name="MessageNotificationItemControl" - d:DesignHeight="60" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:MessageNotificationItem, IsDesignTimeCreatable=False}" MinHeight="90" MaxHeight="150" Background="White"> + d:DesignHeight="60" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:MessageNotificationItem, IsDesignTimeCreatable=False}" MinHeight="90" Height="90" MaxHeight="150" Background="White"> 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 76e20a817..d428b1aba 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -258,8 +258,8 @@ - - + + -- cgit v1.3.1