From cd8bec354b018a03ed3960ed4f76970d4cbff2ef Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 16 May 2023 16:12:09 +0300 Subject: Bugs + added Display Job Outline button in Tech. mode Related Work Items: #8407 --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') 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 a47b68a4f..828047ccf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -187,6 +187,26 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewModel OverviewModel { get; set; } + private bool _isDisplayJobOutline; + /// + /// Gets or sets a value indicating whether to display the job outline. + /// + public bool IsDisplayJobOutline + { + get { return _isDisplayJobOutline; } + set { _isDisplayJobOutline = value; RaisePropertyChangedAuto(); } + } + + private JobTicket _jobOutlineTicket; + /// + /// Gets or sets the job outline ticket. + /// + public JobTicket JobOutlineTicket + { + get { return _jobOutlineTicket; } + set { _jobOutlineTicket = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -209,6 +229,10 @@ namespace Tango.PPC.UI.ViewModels public RelayCommand ClearAllNotificationsCommand { get; set; } + public RelayCommand DisplayJobOutlineCommand { get; set; } + + public RelayCommand HideJobOutlineCommand { get; set; } + #endregion public MachineStatusViewVM() @@ -221,6 +245,8 @@ namespace Tango.PPC.UI.ViewModels JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); + DisplayJobOutlineCommand = new RelayCommand(DisplayJobOutline); + HideJobOutlineCommand = new RelayCommand(HideJobOutline); IsJobStatusViewEnable = true; IsEnabledStopButton = false; @@ -267,6 +293,57 @@ namespace Tango.PPC.UI.ViewModels model.MidTankRefillPumpActive = item.MidTankRefillPumpActive; model.RemainingTimeoutError = TimeSpan.FromSeconds(item.TimerRemainingSeconds); } + //TEST + //if (model != null) + //{ + // var Li = model.IDSPack.LiquidType.Type; + // var Mid = model.IDSPack.MidTankType.Type; + // model.Level = 0.0; + //model.JerricanPresent = false; + //model.FillingTimeoutError = false; + //model.MidTankEmpty = true; + //model.MidTankRefillPumpActive = false; + //model.RemainingTimeoutError = TimeSpan.FromSeconds(300); + + //if (item.Index == 1) + //{ + // model.Level = 1.0; + //} + //if (item.Index == 2) + //{ + // model.Level = 2.0; + //} + //if (item.Index == 3) + //{ + // model.Level = 3.0; + //} + //if (item.Index == 4)//TI + //{ + // model.Level = 7.0; + //} + //if (item.Index == 5)//LC + //{ + // model.Level = 7.0; + //} + //if (item.Index == 6)//LM + //{ + // model.Level = 3.5; + //} + //if (item.Index == 7)//LY + //{ + // model.Level = 2.5; + //} + // if (item.Index == 8)//Lub + // { + // model.Level = 1.5; + // } + // if (item.Index ==9) + // { + // model.Level = 4.99; + // } + + //} + ////////////////////////////// } } } @@ -454,6 +531,20 @@ namespace Tango.PPC.UI.ViewModels RaisePropertyChanged(nameof(BlackOutput)); } + private void HideJobOutline() + { + IsDisplayJobOutline = false; + } + + private void DisplayJobOutline() + { + if(_handler != null && _handler.JobTicket != null) + { + JobOutlineTicket = _handler.JobTicket; + IsDisplayJobOutline = true; + } + } + #endregion } } -- cgit v1.3.1 From 11aff2c52535254745dd521322b2b7f46ae16123 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 17 May 2023 15:54:30 +0300 Subject: PPC. Added General Information dialog. Changes in System Technion for Eureka. --- .../ViewModels/SystemViewVM.cs | 28 ++++ .../Tango.PPC.Technician/Views/SystemView.xaml | 186 ++++++++++++++++++++- .../Dialogs/GeneralInformationView.xaml | 122 ++++++++++++++ .../Dialogs/GeneralInformationView.xaml.cs | 28 ++++ .../Dialogs/GeneralInformationViewVM.cs | 76 +++++++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 8 + .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 12 ++ .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 12 +- 8 files changed, 465 insertions(+), 7 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs index 452907366..e3f695514 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs @@ -15,6 +15,7 @@ using Tango.PPC.Common.OS; using Tango.Settings; using System.Data.Entity; using Tango.PPC.Common.UWF; +using Tango.BL.Entities; namespace Tango.PPC.Technician.ViewModels { @@ -74,6 +75,14 @@ namespace Tango.PPC.Technician.ViewModels set { _totalDyeMeters = value; RaisePropertyChangedAuto(); } } + public Site CurrentSite { get; set; } + + public String SiteName + { + get { return CurrentSite == null? "" : CurrentSite.Name; } + } + + public RelayCommand ResetDeviceCommand { get; set; } public RelayCommand RestartCommand { get; set; } @@ -181,6 +190,8 @@ namespace Tango.PPC.Technician.ViewModels _statsTimer.Interval = 2000; _statsTimer.Elapsed += _statsTimer_Elapsed; _statsTimer.Start(); + + InitSite(); } private void _statsTimer_Elapsed(object sender, ElapsedEventArgs e) @@ -299,5 +310,22 @@ namespace Tango.PPC.Technician.ViewModels TotalDyeMeters = "error!"; } } + + public async void InitSite() + { + if (CurrentSite == null) + { + var machine = MachineProvider.Machine; + if (machine != null && !String.IsNullOrEmpty(machine.SiteGuid)) + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var site = (await db.Sites.Where(x => x.Guid == machine.SiteGuid).ToListAsync()).FirstOrDefault(); + CurrentSite = site; + RaisePropertyChanged( nameof(SiteName)); + } + } + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml index fc0f734ff..8ef29bb7e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml @@ -110,7 +110,7 @@ - + @@ -174,7 +174,7 @@ - + FPGA 1: @@ -303,6 +303,188 @@ + + + + Total Dye Meters: + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + Environment: + + + + + + + + + + + + + + Application Version: + + + + + + + + + + + + + + Site: + + + + + + + + + + + + + + Machine S/N: + + + + + + + + + + + + + + Firmware Version: + + + + + + + + + + + + + + CPU: + + + + + + + + % + + + + + + + + + RAM: + + + + + + + + + + + + + + Up Time: + + + + + + + + + + + + + + IP Address: + + + + + + + + + + + + + + Total Dye Time: + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml new file mode 100644 index 000000000..b4bc717cc --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml @@ -0,0 +1,122 @@ + + + + + + CLOSE + + + + + General Information + + + + + +
+ + + + + + + + + + + + + + + + + Environment: + + + + + + + + + + + + + + Application Version: + + + + + + + + + + + + + + Site: + + + + + + + + + + + + + + Machine S/N: + + + + + + + + + + + + + + Firmware Version: + + + + + + + + + + + +
+
+
+ + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml.cs new file mode 100644 index 000000000..3e01d9b93 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.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.UI.Dialogs +{ + /// + /// Interaction logic for GeneralInformationView.xaml + /// + public partial class GeneralInformationView : UserControl + { + public GeneralInformationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs new file mode 100644 index 000000000..c680f4b90 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs @@ -0,0 +1,76 @@ +using System; +using System.Data.Entity; +using System.Linq; +using Tango.BL; +using Tango.BL.Entities; +using Tango.Core.DI; +using Tango.Integration.Operation; +using Tango.PMR.Diagnostics; +using Tango.PPC.Common; +using Tango.PPC.Common.Application; +using Tango.PPC.Common.Connection; +using Tango.PPC.Common.Notifications; +using Tango.Settings; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class GeneralInformationViewVM : DialogViewVM + { + [TangoInject] + public IMachineProvider MachineProvider { get; set; } + + [TangoInject] + public IPPCApplicationManager ApplicationManager { get; set; } + + private PPCSettings _settings; + /// + /// Gets the main PPC settings. + /// + public PPCSettings Settings + { + get + { + if (_settings == null) + { + _settings = SettingsManager.Default.GetOrCreate(); + } + + return _settings; + } + private set { _settings = value; } + } + + public Site CurrentSite { get; set; } + + public String SiteName + { + get { return CurrentSite == null ? "" : CurrentSite.Name; } + } + + public GeneralInformationViewVM( IMachineProvider provider, IPPCApplicationManager appManager) + { + MachineProvider = provider; + ApplicationManager = appManager; + InitSite(); + } + + public async void InitSite() + { + if (CurrentSite == null) + { + var machine = MachineProvider.Machine; + if (machine != null && !String.IsNullOrEmpty(machine.SiteGuid)) + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var site = (await db.Sites.Where(x => x.Guid == machine.SiteGuid).ToListAsync()).FirstOrDefault(); + CurrentSite = site; + RaisePropertyChanged(nameof(SiteName)); + } + } + } + } + } +} + 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 12d0486bd..e02dba00e 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 @@ -182,6 +182,10 @@ CartridgeValidationView.xaml + + GeneralInformationView.xaml + + InsufficientLiquidQuantityView.xaml @@ -350,6 +354,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer 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 95eb22d7a..f40a89f42 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -293,6 +293,10 @@ namespace Tango.PPC.UI.ViewModels /// Gets or sets the stand by command. /// public RelayCommand StandByCommand { get; set; } + /// + /// Gets or sets the open general information dialog command. + /// + public RelayCommand OpenGeneralinformationCommand { get; set; } #endregion @@ -317,6 +321,7 @@ namespace Tango.PPC.UI.ViewModels PowerOffCommand = new RelayCommand(PowerOffMachine, () => MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected); ResetCommand = new RelayCommand(ResetMachine, () => MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected); StandByCommand = new RelayCommand(StandBy, () => MachineProvider.MachineOperator.CanPrint); + OpenGeneralinformationCommand = new RelayCommand(OpenGeneralinformationDlg); _date_timer = new DispatcherTimer(); _date_timer.Interval = TimeSpan.FromSeconds(1); @@ -527,6 +532,13 @@ namespace Tango.PPC.UI.ViewModels IsMenuOpened = false; } + private async void OpenGeneralinformationDlg() + { + GeneralInformationViewVM vm = new GeneralInformationViewVM(MachineProvider, ApplicationManager); + vm = await NotificationProvider.ShowDialog(vm); + + } + #endregion #region Override Methods 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 a72dc2d1d..84d1108f2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -47,11 +47,13 @@ --> - - - - - + + + + + + +