From bc94c84ee20ea01618241e8a4d32c2a77b4084cc Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 23 May 2023 16:49:49 +0300 Subject: Added data processing of BtsrsInError, DancersInError, WindersInError in GUI. --- .../PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') 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 828047ccf..1182ba50e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -206,7 +206,9 @@ namespace Tango.PPC.UI.ViewModels get { return _jobOutlineTicket; } set { _jobOutlineTicket = value; RaisePropertyChangedAuto(); } } - + + public MachineOverviewErrorStates MachineErrorStates { get; set; } + #endregion #region Commands @@ -254,6 +256,7 @@ namespace Tango.PPC.UI.ViewModels IsWeghtView = false; OverviewModel = new MachineOverviewModel(); + MachineErrorStates = new MachineOverviewErrorStates(); } public override void OnApplicationReady() @@ -275,6 +278,7 @@ namespace Tango.PPC.UI.ViewModels private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) { UpdateMidTankLevels(status); + UpdateMachineStatusErrors(status); } private void UpdateMidTankLevels(MachineStatus status) { @@ -348,6 +352,16 @@ namespace Tango.PPC.UI.ViewModels } } + private void UpdateMachineStatusErrors(MachineStatus status) + { + var windersInError = status.WindersInError.ToList();// to test + MachineErrorStates.UpdateWinders(windersInError); + var dansersInError = status.DancersInError.ToList(); + MachineErrorStates.UpdateDancers(dansersInError); + var btsrsInErrors = status.BtsrsInError.ToList(); + MachineErrorStates.UpdateBTSRs(btsrsInErrors); + } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) { //foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink)) -- cgit v1.3.1 From c3b117cb5612295c80e1ed3da1cc10a582d5cb9f Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 29 May 2023 15:57:53 +0300 Subject: PPC. Bug error GoTOJob when job is null. Related Work Items: #8486 --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 8 ++++++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 26 ++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') 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 1182ba50e..68c0f1867 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -45,6 +45,7 @@ namespace Tango.PPC.UI.ViewModels if (_job == null) IsDyeingProcess = false; RaisePropertyChangedAuto(); + InvalidateRelayCommands(); } } @@ -243,7 +244,7 @@ namespace Tango.PPC.UI.ViewModels StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); - GoToJobCommand = new RelayCommand(GoToJob); + GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob()); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); @@ -467,6 +468,11 @@ namespace Tango.PPC.UI.ViewModels #region Methods + private bool IsEnableGoToJob() + { + return Job != null && _handler != null; + } + private void GoToJob() { 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 8baaf0067..731693a06 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -335,8 +335,30 @@ - Go To Job - + + + + + + + + + + -- cgit v1.3.1 From 3e46bf434c6f8ba56fe812205fd1ea20a1f9d347 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 5 Jun 2023 15:11:17 +0300 Subject: Present Lubricant Ink with divider, sort the Ink level indicators. Related Work Items: #8528 --- .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 2 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 29 +++++- .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 10 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 114 ++++++++++++++++++--- 4 files changed, 129 insertions(+), 26 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') 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 613200c02..c31c8036d 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 @@ -258,7 +258,7 @@ x.MidTankType.HasLevelMeasure || x.MidTankType.Type == MidTankTypes.LubricantMidTank).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() + MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure ).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { Max = x.MidTankType.LiterCapacity, IDSPack = x, - }).OrderBy(y => y.IDSPack.LiquidType.PreferredIndex).ToList(); + }).OrderBy(y => y.IDSPack.LiquidType.Type).ToList(); + var LubLevel = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.Type == MidTankTypes.LubricantMidTank).FirstOrDefault(); + + MidTankLubLevel = new JerricanLevelModel(); + if(LubLevel != null) + { + MidTankLubLevel.Max = LubLevel.MidTankType.LiterCapacity; + MidTankLubLevel.IDSPack = LubLevel; + }; MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; @@ -287,7 +302,15 @@ namespace Tango.PPC.UI.ViewModels { foreach (var item in status.IDSPacksLevels) { - var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + JerricanLevelModel model = null; + if (item.Index == 8)//lub + { + model = MidTankLubLevel; + + } + else { + model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + } if (model != null) { 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 84d1108f2..049f2268d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -61,7 +61,7 @@ Foreground="{StaticResource TangoLightForegroundBrush}" Background="{StaticResource TangoMidAccentBrush}" CornerRadius="18" Margin="0 8 0 8"> - + - Back + Back @@ -85,7 +85,7 @@ - + + + + + + + + + + + + + + + + + + 30 + 88 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -236,11 +315,11 @@ - - - - - + + + + + @@ -904,7 +983,7 @@ - + @@ -1089,7 +1168,7 @@ Waste - + @@ -1107,9 +1186,10 @@ - - + + + + @@ -1120,8 +1200,8 @@ - - + + -- cgit v1.3.1 From 54624e4a90a240ad702995e1ed551901768e131f Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 6 Jun 2023 14:56:59 +0300 Subject: Open Notifications bar when an error happens Related Work Items: #8534 --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 27 +++++++++++++++++++++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 12 ++++++---- .../Tango.Touch/Controls/TouchExpander.cs | 7 +++++- 3 files changed, 39 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') 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 52199fcca..2563cb331 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -217,6 +217,17 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewErrorStates MachineErrorStates { get; set; } + private bool _isExpandedNotificatios; + + public bool IsExpandedNotifications + { + get { return _isExpandedNotificatios; } + set { + _isExpandedNotificatios = value; + RaisePropertyChangedAuto();} + } + + #endregion #region Commands @@ -265,11 +276,14 @@ namespace Tango.PPC.UI.ViewModels OverviewModel = new MachineOverviewModel(); MachineErrorStates = new MachineOverviewErrorStates(); + + IsExpandedNotifications = false; } public override void OnApplicationReady() { base.OnApplicationReady(); + EventLogger.EventReceived += EventLogger_EventReceived; MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure ).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { @@ -291,7 +305,18 @@ namespace Tango.PPC.UI.ViewModels #region Events - private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) + private void EventLogger_EventReceived(object sender, MachinesEvent ev) + { + InvokeUI(() => + { + if (ev.Category == EventTypeCategories.Error || ev.Category == EventTypeCategories.Critical) + { + IsExpandedNotifications = true; + } + }); + } + + private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) { UpdateMidTankLevels(status); UpdateMachineStatusErrors(status); 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 1cdc39973..536682bf9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -1201,7 +1201,7 @@ - + @@ -1244,13 +1244,13 @@ - + - + @@ -1281,10 +1281,12 @@ - + + - + + diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchExpander.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchExpander.cs index b85be6c49..80974bd4a 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchExpander.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchExpander.cs @@ -39,7 +39,12 @@ namespace Tango.Touch.Controls set { SetValue(IsExpandedProperty, value); } } public static readonly DependencyProperty IsExpandedProperty = - DependencyProperty.Register("IsExpanded", typeof(bool), typeof(TouchExpander), new PropertyMetadata(false)); + DependencyProperty.Register("IsExpanded", typeof(bool), typeof(TouchExpander), new FrameworkPropertyMetadata + { + DefaultValue = false, + BindsTwoWayByDefault = true, + DefaultUpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged + }); static TouchExpander() { -- cgit v1.3.1 From a5de87ea9863c6e7053e09ed1c2eabf58285af48 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 20 Jun 2023 16:40:58 +0300 Subject: PPC. Added Real Time Graph --- Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml | 1 + .../StatisticTabToVisibilityConverter.cs | 28 ++++ .../PPC/Tango.PPC.UI/Graphs/GraphHelper.cs | 36 +++++ .../PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs | 149 +++++++++++++++++++++ .../PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml | 106 +++++++++++++++ .../Tango.PPC.UI/Images/Overview Icons/motor.png | Bin 0 -> 1023 bytes .../Tango.PPC.UI/Images/Overview Icons/pr_data.png | Bin 0 -> 1054 bytes .../Images/Overview Icons/pressure.png | Bin 0 -> 1156 bytes .../Images/Overview Icons/temperature.png | Bin 0 -> 1065 bytes .../PPC/Tango.PPC.UI/Images/screw.png | Bin 0 -> 937 bytes .../PPC/Tango.PPC.UI/Resources/Graphs.xaml | 8 ++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 26 +++- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 112 ++++++++++++++++ .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 64 +++++++++ .../Tango.PPC.UI/Views/MachineStatusView.xaml.cs | 10 ++ .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Tango.Touch/Controls/TouchNavigationLinks.cs | 22 ++- .../Tango.Touch/Controls/TouchNavigationLinks.xaml | 5 +- .../Tango.Touch/Resources/Colors.xaml | 28 ++++ 19 files changed, 589 insertions(+), 8 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml index bdcf675e3..38a5b91b2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml @@ -20,6 +20,7 @@ + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs new file mode 100644 index 000000000..06c75a999 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs @@ -0,0 +1,28 @@ +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 static Tango.PPC.UI.ViewModels.MachineStatusViewVM; + +namespace Tango.PPC.UI.Converters +{ + public class StatisticTabToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + StatisticTab selected = (StatisticTab)Enum.Parse(typeof(StatisticTab), parameter.ToString()); + StatisticTab statTab = (StatisticTab)value; + + return statTab.Equals(selected) ? Visibility.Visible : Visibility.Hidden; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs new file mode 100644 index 000000000..d06ed042a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Media; + +namespace Tango.PPC.UI.Graphs +{ + public static class GraphHelper + { + public enum GraphColor + { + White, + Red, + Yellow, + Green, + Orange + } + + public static Color GetGraphColor(GraphColor graphColor) + { + return (Color)Application.Current.Resources[$"Tango_RealTimeGraph_{graphColor.ToString()}"]; + } + + public static Brush GetGraphBrush(GraphColor graphColor) + { + return new SolidColorBrush(GetGraphColor(graphColor)); + } + + public static Color GetGraphStrokeColor() + { + return (Color)Application.Current.Resources["Tango_RealTimeGraph_ForegroundColor"]; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs new file mode 100644 index 000000000..303b18892 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs @@ -0,0 +1,149 @@ +using RealTimeGraphX; +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; + +namespace Tango.PPC.UI.Graphs +{ + public class RealTimeGraph : Control + { + /// + /// Gets or sets the graph controller. + /// + public IGraphController Controller + { + get { return (IGraphController)GetValue(ControllerProperty); } + set { SetValue(ControllerProperty, value); } + } + public static readonly DependencyProperty ControllerProperty = + DependencyProperty.Register("Controller", typeof(IGraphController), typeof(RealTimeGraph), new PropertyMetadata(null)); + + + /// + /// Gets or sets the string format of the y-axis. + /// + public String StringFormat + { + get { return (String)GetValue(StringFormatProperty); } + set { SetValue(StringFormatProperty, value); } + } + public static readonly DependencyProperty StringFormatProperty = + DependencyProperty.Register("StringFormat", typeof(String), typeof(RealTimeGraph), new PropertyMetadata("0.0")); + + + /// + /// Gets or sets the display name. + /// + public String DisplayName + { + get { return (String)GetValue(DisplayNameProperty); } + set { SetValue(DisplayNameProperty, value); } + } + public static readonly DependencyProperty DisplayNameProperty = + DependencyProperty.Register("DisplayName", typeof(String), typeof(RealTimeGraph), new PropertyMetadata(null)); + + + /// + /// Gets or sets the display units. + /// + public String DisplayUnits + { + get { return (String)GetValue(DisplayUnitsProperty); } + set { SetValue(DisplayUnitsProperty, value); } + } + public static readonly DependencyProperty DisplayUnitsProperty = + DependencyProperty.Register("DisplayUnits", typeof(String), typeof(RealTimeGraph), new PropertyMetadata(null)); + + /// + /// Gets or sets the graph label visibility. + /// + public Visibility GraphLabelVisibility + { + get { return (Visibility)GetValue(GraphLabelVisibilityProperty); } + set { SetValue(GraphLabelVisibilityProperty, value); } + } + public static readonly DependencyProperty GraphLabelVisibilityProperty = + DependencyProperty.Register("GraphLabelVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + + /// + /// Gets or sets the vertical ticks. + /// + public int VerticalTicks + { + get { return (int)GetValue(VerticalTicksProperty); } + set { SetValue(VerticalTicksProperty, value); } + } + public static readonly DependencyProperty VerticalTicksProperty = + DependencyProperty.Register("VerticalTicks", typeof(int), typeof(RealTimeGraph), new PropertyMetadata(10)); + + + /// + /// Gets or sets the horizontal ticks. + /// + public int HorizontalTicks + { + get { return (int)GetValue(HorizontalTicksProperty); } + set { SetValue(HorizontalTicksProperty, value); } + } + public static readonly DependencyProperty HorizontalTicksProperty = + DependencyProperty.Register("HorizontalTicks", typeof(int), typeof(RealTimeGraph), new PropertyMetadata(10)); + + public Brush GridLinesBrush + { + get { return (Brush)GetValue(GridLinesBrushProperty); } + set { SetValue(GridLinesBrushProperty, value); } + } + public static readonly DependencyProperty GridLinesBrushProperty = + DependencyProperty.Register("GridLinesBrush", typeof(Brush), typeof(RealTimeGraph), new PropertyMetadata(null)); + + public Visibility HorizontalAxisVisibility + { + get { return (Visibility)GetValue(HorizontalAxisVisibilityProperty); } + set { SetValue(HorizontalAxisVisibilityProperty, value); } + } + public static readonly DependencyProperty HorizontalAxisVisibilityProperty = + DependencyProperty.Register("HorizontalAxisVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + public Visibility VerticalAxisVisibility + { + get { return (Visibility)GetValue(VerticalAxisVisibilityProperty); } + set { SetValue(VerticalAxisVisibilityProperty, value); } + } + public static readonly DependencyProperty VerticalAxisVisibilityProperty = + DependencyProperty.Register("VerticalAxisVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + public Visibility CurrentValueVisibility + { + get { return (Visibility)GetValue(CurrentValueVisibilityProperty); } + set { SetValue(CurrentValueVisibilityProperty, value); } + } + public static readonly DependencyProperty CurrentValueVisibilityProperty = + DependencyProperty.Register("CurrentValueVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Collapsed)); + + public double CurrentValueFontSize + { + get { return (double)GetValue(CurrentValueFontSizeProperty); } + set { SetValue(CurrentValueFontSizeProperty, value); } + } + public static readonly DependencyProperty CurrentValueFontSizeProperty = + DependencyProperty.Register("CurrentValueFontSize", typeof(double), typeof(RealTimeGraph), new PropertyMetadata(25.0)); + + public Thickness CurrentValueMargin + { + get { return (Thickness)GetValue(CurrentValueMarginProperty); } + set { SetValue(CurrentValueMarginProperty, value); } + } + public static readonly DependencyProperty CurrentValueMarginProperty = + DependencyProperty.Register("CurrentValueMargin", typeof(Thickness), typeof(RealTimeGraph), new PropertyMetadata(new Thickness(20))); + + /// + /// Initializes the class. + /// + static RealTimeGraph() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(RealTimeGraph), new FrameworkPropertyMetadata(typeof(RealTimeGraph))); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml new file mode 100644 index 000000000..8844f9627 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml @@ -0,0 +1,106 @@ + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png new file mode 100644 index 000000000..8401a8e30 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png new file mode 100644 index 000000000..ebd02a99b Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png new file mode 100644 index 000000000..12ade5d92 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png new file mode 100644 index 000000000..de9b042c4 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png new file mode 100644 index 000000000..46a8134fe Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml new file mode 100644 index 000000000..67047cf1f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file 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 a3ec9667f..e2d447be5 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 @@ -176,6 +176,7 @@ + BitResultsView.xaml @@ -236,6 +237,8 @@ + + @@ -409,6 +412,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -433,6 +440,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -627,6 +638,11 @@ + + + + + @@ -648,6 +664,14 @@ + + {6b9774f7-960d-438e-ad81-c6b9be328d50} + RealTimeGraphX.WPF + + + {f13a489c-80ee-4cd0-bdd4-92d959215646} + RealTimeGraphX + {d129789c-3096-4d0b-8dd7-fe24a4df4b21} Tango.AnimatedGif @@ -964,7 +988,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) - + 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 2563cb331..103084e11 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -20,11 +20,27 @@ using System.Timers; using System.Windows.Threading; using System.Diagnostics; using Tango.PMR.Printing; +using System.ComponentModel; +using RealTimeGraphX.WPF; +using RealTimeGraphX.DataPoints; +using Tango.PPC.UI.Graphs; namespace Tango.PPC.UI.ViewModels { public class MachineStatusViewVM : PPCViewModel { + public enum StatisticTab + { + [Description("Production Data")] + Productiondata = 0, + [Description("Temperature")] + Temperature = 1, + [Description("Pressure")] + Pressure = 2, + [Description("Motor")] + Motor = 3 + } + #region Properties [TangoInject] @@ -227,6 +243,70 @@ namespace Tango.PPC.UI.ViewModels RaisePropertyChangedAuto();} } + private int _selectedStatisticTabIndex; + /// + /// Gets or sets the index of the selected category. + /// + public int SelectedStatisticTabIndex + { + get { return _selectedStatisticTabIndex; } + set + { + if (_selectedStatisticTabIndex != value) + { + _selectedStatisticTabIndex = value; + RaisePropertyChangedAuto(); + switch (_selectedStatisticTabIndex) + { + case 0: + { + SelectedStatisticTab = StatisticTab.Productiondata; + break; + } + case 1: + { + SelectedStatisticTab = StatisticTab.Temperature; + break; + } + case 2: + { + SelectedStatisticTab = StatisticTab.Pressure; + break; + } + case 3: + { + SelectedStatisticTab = StatisticTab.Motor; + break; + } + } + } + } + } + + private StatisticTab _selectedStatisticTab; + /// + /// Gets or sets the selected category. + /// + /// + public StatisticTab SelectedStatisticTab + { + get + { + return _selectedStatisticTab; + } + set + { + if (_selectedStatisticTab != value) + { + _selectedStatisticTab = value; + RaisePropertyChangedAuto(); + } + _selectedStatisticTabIndex = _selectedStatisticTab.ToInt32(); + RaisePropertyChanged(nameof(SelectedStatisticTabIndex)); + } + } + + public WpfGraphController JobController { get; set; } #endregion @@ -278,6 +358,9 @@ namespace Tango.PPC.UI.ViewModels MachineErrorStates = new MachineOverviewErrorStates(); IsExpandedNotifications = false; + SelectedStatisticTabIndex = 0; + + JobController = CreateController(CreateSeries("Total", GraphHelper.GraphColor.Green)); } public override void OnApplicationReady() @@ -613,6 +696,35 @@ namespace Tango.PPC.UI.ViewModels } } + private WpfGraphController CreateController(params WpfGraphDataSeries[] seriesCollection) + { + var controller = new WpfGraphController(); + + foreach (var series in seriesCollection) + { + controller.DataSeriesCollection.Add(series); + } + + controller.Range.AutoY = true; + controller.Range.MaximumY = 100; + controller.Range.MinimumY = 0; + controller.Range.MaximumX = new DateTime(0).AddMinutes(30); + + controller.RefreshRate = TimeSpan.FromMilliseconds(300000);//5 min + + return controller; + } + + private WpfGraphDataSeries CreateSeries(String name, GraphHelper.GraphColor fill) + { + WpfGraphDataSeries series = new WpfGraphDataSeries(); + series.Name = name; + series.Fill = GraphHelper.GetGraphBrush(fill); + series.StrokeThickness = 1; + series.Stroke = GraphHelper.GetGraphStrokeColor(); + return series; + } + #endregion } } 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 1445337ad..9e766fffc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -12,6 +12,7 @@ xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters" xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:models="clr-namespace:Tango.PPC.UI.Models" + xmlns:graphs="clr-namespace:Tango.PPC.UI.Graphs" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="932" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}"> @@ -25,6 +26,7 @@ + + @@ -1203,6 +1209,64 @@ + + + + + + + + + + + + Production Data + + + + Temperature + + + + Pressure + + + + Motor + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs index 2ee98bc2b..e49e062b7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs @@ -57,5 +57,15 @@ namespace Tango.PPC.UI.Views { _timer.Stop(); } + + private void NavigationSTLinks_PreviewTouchDown(object sender, TouchEventArgs e) + { + e.Handled = true; + } + + private void NavigationSTLinks_PreviewMouseDown(object sender, MouseButtonEventArgs e) + { + e.Handled = true; + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs index 3a0d3de9e..5fb4496e0 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs @@ -24,7 +24,18 @@ namespace Tango.Touch.Controls private const string PART_Rectangle = "PART_Rectangle"; private Line _line; private Object _lastSelectedItem; + + public int LineThickness + { + get { return (int)GetValue(LineThicknessProperty); } + set { SetValue(LineThicknessProperty, value); } + } + + // Using a DependencyProperty as the backing store for LineThickness. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LineThicknessProperty = + DependencyProperty.Register("LineThickness", typeof(int), typeof(TouchNavigationLinks), new PropertyMetadata(3)); + static TouchNavigationLinks() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchNavigationLinks), new FrameworkPropertyMetadata(typeof(TouchNavigationLinks))); @@ -48,12 +59,14 @@ namespace Tango.Touch.Controls private void MoveLineToSelectedItem() { - if (SelectedItem != null) + if (SelectedItem != null ) { + if(SelectedItem is UIElement && ((UIElement)SelectedItem).IsEnabled == false) + return; var container = ItemContainerGenerator.ContainerFromItem(SelectedItem) as FrameworkElement; - + ContentPresenter presenter = container.FindChild().FindChild(); - + if (presenter != null) { Point relativePoint = presenter.TransformToAncestor(this).Transform(new Point(0, 0)); @@ -87,8 +100,9 @@ namespace Tango.Touch.Controls _line.BeginAnimation(Line.X2Property, aniX2); } } + _lastSelectedItem = SelectedItem; } - + _lastSelectedItem = SelectedItem; } } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml index 599dfdf7c..2b8b4ff03 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml @@ -37,10 +37,11 @@ + - + @@ -77,7 +78,7 @@ - + diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml index 283e69b45..1dc2090aa 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml @@ -60,6 +60,17 @@ #55FFFFFF #000131 + #18FFFFFF + #B6FF6F6F + #BBFFB84B + #B958C13B + #BBFA9252 + + #7C98B3 + #202020 + #505050 + #303030 + @@ -128,4 +139,21 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.3.1