From baf96c13dbdb1510cb86221f8e12396af7251f59 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 14 May 2023 19:56:51 +0300 Subject: Eureka Installer. --- Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC') 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 642a5b02f..1a21989bc 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("2.0.2.0")] +[assembly: AssemblyVersion("2.0.3.0")] -- cgit v1.3.1 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 --- .../Modules/Tango.PPC.JobsV2/Models/JobModel.cs | 2 +- .../PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs | 327 ++++ .../MidTankLevelToElementRectConverter.cs | 2 +- .../Tango.PPC.UI/Models/MachineOverviewModel.cs | 30 +- .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 1 + .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 91 ++ .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 4 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 1659 ++++++++++---------- 8 files changed, 1280 insertions(+), 836 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs index 00dcf6f8b..8267fd3aa 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs @@ -390,7 +390,7 @@ namespace Tango.PPC.Jobs.Models int coeff = (int)(value + NumberSpools - 1) / NumberSpools; _copies = coeff * NumberSpools; } - NumberOfUnits = (int)value / NumberSpools; + NumberOfUnits = (int)_copies / NumberSpools; RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs new file mode 100644 index 000000000..a22afe3ea --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Shapes; +using Tango.PMR.Printing; +using Tango.Touch.Controls; + +namespace Tango.PPC.UI.Controls +{ + public class JobOutlineControl : Control + { + + #region Members + + private Size _sizeControl = new Size(0, 0); + ScrollViewer _parentScrollViewer = null; + public struct LevelOffset + { + public const double level_0 = 0.0; + public const double level_1 = 10.0; + public const double level_2 = 20.0; + public const double level_3 = 37.0; + public const double level_4 = 50.0; + public const double level_5 = 60.0; + public const double level_6 = 77.0; + public const double level_7 = 90.0; + public const double level_8 = 100.0; + } + private double _verticalOffset = 0; + private double _viewportHeight = 0; + private const double HEADER_FONT_HEIGHT = 35; + private const double TITLE_FONT_HEIGHT = 22; + private const double SUB_TITLE_FONT_HEIGHT = 19; + private const double NORMAL_FONT_HEIGHT = 17; + private const double WIDTH = 330; + + #endregion members + + public JobOutlineControl() : base() + { + DataContextChanged += JobOutlineControl_DataContextChanged; + Width = WIDTH; + } + + private void JobOutlineControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (DataContext == null) + { + return; + } + + if (_parentScrollViewer != null) + { + _parentScrollViewer.ScrollToTop(); + } + + InvalidateVisual(); + } + + #region events + + private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e) + { + if (e.VerticalChange == 0.0) + return; + + _verticalOffset = _parentScrollViewer.VerticalOffset; + _viewportHeight = _parentScrollViewer.ViewportHeight; + InvalidateVisual(); + } + #endregion events + + #region render + protected override void OnRender(DrawingContext drawingContext) + { + base.OnRender(drawingContext); + + if (!(DataContext is JobTicket job)) return; + if (_parentScrollViewer == null) + { + _parentScrollViewer = this.FindAncestor(); + _parentScrollViewer.ScrollChanged -= ScrollViewer_ScrollChanged; + _parentScrollViewer.ScrollChanged += ScrollViewer_ScrollChanged; + } + else if (_viewportHeight == 0) + { + _viewportHeight = _parentScrollViewer.ActualHeight; + } + _sizeControl = new Size(); + _sizeControl.Height += 10; + DrawHeaderText(drawingContext, "JOB OUTLINE", 30, LevelOffset.level_0); + _sizeControl.Height += HEADER_FONT_HEIGHT; + + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "BASIC", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + var basicProps = GetNameValueList(job); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Pencil); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + //JobTicket.Spool + if (job.Spool != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "SPOOL", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.Spool); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Pencil); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.ProcessParameters + if (job.ProcessParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "PROCESS PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.ProcessParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.ThreadParameters + if (job.ThreadParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "THREAD PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.ThreadParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.HeadCleaningParameters + if (job.HeadCleaningParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "HEAD CLEANING PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.HeadCleaningParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.BtsrParameters + if (job.BtsrParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "BTSR PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.BtsrParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.Segments + if (job.Segments != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "SEGMENTS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 10.0; + int index = 0; + foreach (JobSegment seg in job.Segments) + { + DrawHeaderText(drawingContext, string.Format("#{0} SEGMENT", ++index), 14, LevelOffset.level_1); + _sizeControl.Height += SUB_TITLE_FONT_HEIGHT; + basicProps = GetNameValueList(seg); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_2, TouchIconKind.Pencil); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + //BrushStops + DrawHeaderText(drawingContext, "BRUSH STOPS", 12, LevelOffset.level_3); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + int indexBrush = 0; + foreach (JobBrushStop brushstop in seg.BrushStops) + { + _sizeControl.Height += 5.0; + DrawHeaderText(drawingContext, string.Format("#{0} STOP", ++indexBrush), 11, LevelOffset.level_4); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + var brushStops = GetNameValueList(brushstop); + foreach (var brushstopprop in brushStops) + { + DrawNameValueText(drawingContext, brushstopprop, LevelOffset.level_5, TouchIconKind.Pencil); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + DrawHeaderText(drawingContext, "DISPENSERS", 12, LevelOffset.level_6); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + _sizeControl.Height += 5.0; + int indexDispenser = 0; + foreach (JobDispenser disp in brushstop.Dispensers) + { + DrawHeaderText(drawingContext, string.Format("#{0} DISPENSER", ++indexDispenser), 11, LevelOffset.level_6); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + var dispProperties = GetNameValueList(disp); + foreach (var dispprop in dispProperties) + { + DrawNameValueText(drawingContext, dispprop, LevelOffset.level_7, TouchIconKind.ArrowRightBoldCircle); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + } + } + } + + if (Height != _sizeControl.Height) + { + Height = _sizeControl.Height; + } + } + public IEnumerable> GetNameValueList(object value) + { + if (value != null) + { + var properties = value.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => (!x.PropertyType.IsClass && !typeof(IEnumerable).IsAssignableFrom(x.PropertyType)) || x.PropertyType == typeof(String)).ToList(); + return properties.Select(x => new Tuple(x.Name, x.GetValue(value).ToString())); + } + else + { + return null; + } + } + #endregion render + + #region drawing + protected void DrawNameValueText(DrawingContext drawingContext, Tuple text, double levelOfOffset, TouchIconKind? icon) + { + if (IsInViewPort()) + { + FormattedText formattedName = new FormattedText(text.Item1 + ": ", System.Globalization.CultureInfo.InvariantCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(this.FontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal), + 12, Foreground); + DrawIconTextIfVisible(drawingContext, levelOfOffset, formattedName, icon); + double widthOfNameText = formattedName.WidthIncludingTrailingWhitespace + 17 + levelOfOffset;//17 pix for draw icon before text + + FormattedText formattedValue = new FormattedText(text.Item2, System.Globalization.CultureInfo.InvariantCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(this.FontFamily, FontStyles.Normal, FontWeights.SemiBold, FontStretches.Normal), + 12, Foreground); + DrawIconTextIfVisible(drawingContext, widthOfNameText, formattedValue); + _sizeControl.Width = Math.Max(_sizeControl.Width, (widthOfNameText + formattedValue.WidthIncludingTrailingWhitespace)); + } + } + + private bool IsInViewPort() + { + return (_sizeControl.Height >= _verticalOffset && _sizeControl.Height <= (_verticalOffset + _viewportHeight + 5)); + } + + protected void DrawHeaderText(DrawingContext drawingContext, string text, int fontSize, double levelOfOffset) + { + if (IsInViewPort()) + { + FormattedText formattedtext = new FormattedText(text, System.Globalization.CultureInfo.InvariantCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(this.FontFamily, FontStyles.Normal, FontWeights.SemiBold, FontStretches.Normal), + fontSize, Foreground); + DrawIconTextIfVisible(drawingContext, levelOfOffset, formattedtext); + _sizeControl.Width = Math.Max(_sizeControl.Width, (formattedtext.Width + levelOfOffset)); + } + } + + private void DrawIconTextIfVisible(DrawingContext drawingContext, double levelOfOffset, FormattedText formattedText, TouchIconKind? icon = null) + { + if (icon is TouchIconKind) + { + DrawIcon(drawingContext, (TouchIconKind)icon, new Point(levelOfOffset, _sizeControl.Height)); + levelOfOffset += 17; + } + drawingContext.DrawText(formattedText, new Point(levelOfOffset, _sizeControl.Height)); + } + private void DrawIcon(DrawingContext drawingContext, TouchIconKind kind, Point point) + { + GeometryGroup group = GetGeometryByIcon(kind); + SetGeometryPosition(group, point); + drawingContext.DrawGeometry(Foreground, new Pen(Brushes.White, 1), group); + + } + private GeometryGroup GetGeometryByIcon(TouchIconKind kind) + { + Geometry geometry = Geometry.Parse(TouchIcon.Icons[kind]); + GeometryGroup group = new GeometryGroup(); + group.Children.Add(geometry); + + TransformGroup tg = new TransformGroup(); + tg.Children.Add(new ScaleTransform() + { + ScaleX = 10d / geometry.Bounds.Width, + ScaleY = 10d / geometry.Bounds.Height, + }); + tg.Children.Add(new TranslateTransform() { }); + + group.Transform = tg; + return group; + } + private void SetGeometryPosition(GeometryGroup group, Point point) + { + TransformGroup tg = group.Transform as TransformGroup; + (tg.Children[1] as TranslateTransform).X = point.X; + (tg.Children[1] as TranslateTransform).Y = point.Y + 1; + } + #endregion drawing + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs index 2f0e73e2f..93576a8fb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs @@ -20,7 +20,7 @@ namespace Tango.PPC.UI.Converters double maxLiters = (double)values[3]; double midTankLevel = Math.Min((double)values[2], maxLiters); - var offset = (midTankLevel / maxLiters) * actualHeight; + var offset = actualHeight - (midTankLevel / maxLiters) * actualHeight; return new System.Windows.Rect(1, offset, actualWidth, actualHeight); } catch diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs index d5d8407b7..bd34122c6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs @@ -14,6 +14,8 @@ namespace Tango.PPC.UI.Models { public class MachineOverviewModel : ExtendedObject { + public static double DryerAirMaxValue = 120.0; + public MachineOverviewItem DryerZone3 { get; set; } public MachineOverviewItem DryerAir { get; set; } public MachineOverviewItem Tunnel { get; set; } @@ -42,7 +44,7 @@ namespace Tango.PPC.UI.Models { DryerZone3 = new MachineOverviewItem(); DryerAir = new MachineOverviewItem(); - DryerAir.MaxValue =140; + DryerAir.MaxValue = DryerAirMaxValue; Tunnel = new MachineOverviewItem(); PumpsPressure = new MachineOverviewItem(); PumpsPressure.MaxValue = 6; @@ -84,7 +86,9 @@ namespace Tango.PPC.UI.Models if (state != null) { - if (state.IsRampingUp) + if (state.IsRampingUp && + (state.SetPoint != 0 + && (state.CurrentValue <= (state.SetPoint - 10)))) { item.Status = "Heating Up"; item.Color = Colors.Orange; @@ -92,15 +96,7 @@ namespace Tango.PPC.UI.Models item.MaxValue = state.SetPoint; item.Value = state.CurrentValue; } - else if (state.CurrentValue > state.SetPoint) - { - item.Status = "Over-temperature"; - item.Color = Colors.Red; - item.DisplayValue = $"{state.CurrentValue} / {state.SetPoint}"; - item.MaxValue = state.SetPoint; - item.Value = state.CurrentValue; - } - else if (state.IsInSetPoint) + else if (state.SetPoint == 0 || (state.CurrentValue >= (state.SetPoint - 10) || state.CurrentValue <= (state.SetPoint + 10))) { item.Status = "Operational"; item.Color = Colors.Green; @@ -108,6 +104,14 @@ namespace Tango.PPC.UI.Models item.MaxValue = state.SetPoint; item.Value = state.CurrentValue; } + else if (!state.IsRampingUp && (state.CurrentValue < (state.SetPoint - 10) || state.CurrentValue > (state.SetPoint + 10))) + { + item.Status = "Over-temperature"; + item.Color = Colors.Red; + item.DisplayValue = $"{state.CurrentValue} / {state.SetPoint}"; + item.MaxValue = state.SetPoint; + item.Value = state.CurrentValue > state.SetPoint? state.SetPoint : state.CurrentValue; + } else { item.Color = Colors.Gray; @@ -119,13 +123,13 @@ namespace Tango.PPC.UI.Models private void UpdateDryerAirItem(double currentvalue) { - if (currentvalue < 140) + if (currentvalue < DryerAirMaxValue) { DryerAir.Status = "Heating Up"; DryerAir.Color = Colors.Orange; DryerAir.DisplayValue = $"{currentvalue}"; } - else if (currentvalue >= 140) + else if (currentvalue >= DryerAirMaxValue) { DryerAir.Status = "Operational"; DryerAir.Color = Colors.Green; 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 120001ea3..12d0486bd 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 @@ -158,6 +158,7 @@ WiFiAuthenticationView.xaml + MachineStatusControl.xaml 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 } } 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 acaf14f15..a72dc2d1d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -59,7 +59,7 @@ Foreground="{StaticResource TangoLightForegroundBrush}" Background="{StaticResource TangoMidAccentBrush}" CornerRadius="18" Margin="0 8 0 8"> - + - Back + Back 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 44be63ffe..d9b37ac85 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -214,7 +214,7 @@ - + - - - - - - Job Length + + + + + + + Job Length @@ -607,12 +614,12 @@ + - - - - - Job Weight + + + + Job Weight @@ -622,189 +629,189 @@ + - - - - - Copies + + + + Copies + - - - - - Time Left - - - + + + + Time Left + + + - - + + + - - + - - + + - - - - - - - - - - Input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Output - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C - - - - - LC - - - - - M - - - - - LM - - - - - Y - - - - - LY - + + + + + + + + + + Input - - - K - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Output - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C + + + + + LC + + + + + M + + + + + LM + + + + + Y + + + + + LY + + + + + K + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -814,21 +821,21 @@ - - - + + + + + - - - - + + - - + + @@ -847,328 +854,342 @@ - - - - - - - - Sensors - - - - - - - - - - - - - - - ºC - - Dryer Zone 3 - - - - - - - - - - - - - - - - - - Dryer Air - - - - - - - - - - - - - - - - - Tunnel + + + + + + + Sensors - - - - - - - - - - - - - + + + + + + + + + + + + + + ºC - - Pumps pressure - - - - - - - - - - - - - - + + Dryer Zone 3 + - - Lubricant - - - - - - - - - - - - - - - - Winder + + + + + + + + + + + + + + + Dryer Air - - - - - - - - - - - Dancer - - + + + + + + + + + + + + - - - - - - - - - - - - BTSR + + Tunnel - - - - - - - - - - - Feeder + + + + + + + + + + + + + + + Pumps pressure - - - - - - - - - - - Waste + + + + + + + + + + + + + + + + Lubricant - - - + + + + + + + + + + + + + + + + Winder + + + + + + + + + + + + + Dancer + + + + + + + + + + + + + + + BTSR + + + + + + + + + + + + + Feeder + + + + + + + + + + + Waste + + + + + - - - - - Ink Levels - - - - - - - - + + + + Ink Levels + + + + + + + + + - + + - - - - - + + + + + - - - - - - - - - - - Notifications - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + Notifications + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + Hide Job Outline + -- 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') 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 @@ --> - - - - - + + + + + + + Date: Wed, 17 May 2023 18:03:58 +0300 Subject: Bugs - delay progress in PPC, Overview error Related Work Items: #8408 --- .../Converters/LiquidTypeToBrushConverter.cs | 8 +------ .../Tango.Emulations/Emulators/MachineEmulator.cs | 25 +++++++++++++--------- .../Tango.FileSystem/FileSystemManager.cs | 2 +- .../Discovery/UdpDiscoveryService.cs | 3 ++- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LiquidTypeToBrushConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LiquidTypeToBrushConverter.cs index f9ced3719..75846431f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LiquidTypeToBrushConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LiquidTypeToBrushConverter.cs @@ -24,13 +24,7 @@ namespace Tango.PPC.UI.Converters } case BL.Enumerations.LiquidTypes.Cleaner: { - ImageBrush cleanerBrush = new ImageBrush() { Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute }; - BitmapSource bit_source = ResourceHelper.GetImageFromResources(@"Images/cl-full.png"); - var targetBitmap = new WriteableBitmap(new TransformedBitmap(bit_source, new ScaleTransform(0.3, 0.3))); - - cleanerBrush.ImageSource = targetBitmap; - cleanerBrush.Viewport = new System.Windows.Rect(0, 0, targetBitmap.Width, targetBitmap.Height); - return cleanerBrush; + return Application.Current.Resources["TangoCleanerBrush"] as Brush; } case BL.Enumerations.LiquidTypes.Yellow: return Application.Current.Resources["TangoYellowInkBrush"] as Brush; diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 8f8a04005..3543b8b3a 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -87,6 +87,7 @@ namespace Tango.Emulations.Emulators private int _jobAbortCounter; private bool _abortHeadCleaning; private String _machineStatusRequestToken; + private MachineType _machineType; #region Properties @@ -620,12 +621,12 @@ namespace Tango.Emulations.Emulators monitors.Dispenser7MotorFrequency.AddRange(dispenserFrequencies[6].Data); monitors.Dispenser8MotorFrequency.AddRange(dispenserFrequencies[7].Data); - res.HeatersStates.Add(new HeaterState() - { - CurrentValue = 50, - IsInSetPoint = false, - SetPoint = 100 - }); + //res.HeatersStates.Add(new HeaterState() + //{ + // CurrentValue = 50, + // IsInSetPoint = false, + // SetPoint = 100 + //}); res.DigitalInterfaceStates.AddRange(_digitalOutputPinsStates.Concat(_digitalInputPinsStates)); res.ComponentsStates.AddRange(_componentsStates); @@ -801,10 +802,12 @@ namespace Tango.Emulations.Emulators Stopwatch watch = new Stopwatch(); Dictionary dispenserindexToPacklevel = new Dictionary(); + double dryerLength = _machineType == MachineType.Ts1800 ? (job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS) : job.ProcessParameters.DryerBufferLength; + for (int i = 0; i < units; i++) { - while (progress < unit_length + (i == units - 1 ? (job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS) : 0) && !_cancelJob) + while (progress < unit_length + (i == units - 1 ? dryerLength : 0) && !_cancelJob) { var status = new PMR.Printing.JobStatus(); status.Progress = progress; @@ -835,7 +838,7 @@ namespace Tango.Emulations.Emulators } } - progress += Math.Min((centimeter_per_second / 1000d), (unit_length + (i == units - 1 ? (job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS) : 0)) - progress); + progress += Math.Min((centimeter_per_second / 1000d), (unit_length + (i == units - 1 ? dryerLength : 0)) - progress); double currentPosition = 0; double nextStopPosition = unit_length; @@ -935,7 +938,7 @@ namespace Tango.Emulations.Emulators { Status = new PMR.Printing.JobStatus() { - Progress = unit_length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS, + Progress = unit_length + dryerLength, } }, request.Container.Token, new TransportResponseConfig() { Completed = !_cancelJob }); @@ -961,7 +964,7 @@ namespace Tango.Emulations.Emulators { Status = new PMR.Printing.JobStatus() { - Progress = unit_length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS, + Progress = unit_length + dryerLength, } }, _current_job_resume_token, new TransportResponseConfig() { Completed = !_cancelJob }); @@ -1268,6 +1271,8 @@ namespace Tango.Emulations.Emulators }, request.Container.Token, new TransportResponseConfig() { ErrorCode = request.Message.Password == "1234" ? ErrorCode.None : ErrorCode.UnauthorizedConnection }); + _machineType = request.Message.MachineType; + _connectionTime = DateTime.Now; _isAfterReset = false; diff --git a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs index dc8efa7dd..9c112ae75 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs @@ -19,7 +19,7 @@ namespace Tango.FileSystem folder.Path = "This PC"; folder.IsRoot = true; folder.Type = FileSystemItemType.Folder; - folder.Items = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Fixed || x.DriveType == DriveType.Removable || x.DriveType == DriveType.Network).Select(x => new FileSystemItemDTO() + folder.Items = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Fixed || x.DriveType == DriveType.Removable || x.DriveType == DriveType.Network).Where(x => x.IsReady).Select(x => new FileSystemItemDTO() { Path = x.RootDirectory.FullName, DriveType = x.DriveType, diff --git a/Software/Visual_Studio/Tango.Transport/Discovery/UdpDiscoveryService.cs b/Software/Visual_Studio/Tango.Transport/Discovery/UdpDiscoveryService.cs index 3e714325b..f593a6ea6 100644 --- a/Software/Visual_Studio/Tango.Transport/Discovery/UdpDiscoveryService.cs +++ b/Software/Visual_Studio/Tango.Transport/Discovery/UdpDiscoveryService.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using System.Timers; using Tango.Core; using Tango.Core.ExtensionMethods; +using Tango.Logging; using Tango.PMR.Discovery; using Tango.PMR.Integration; using Tango.Transport.Helpers; @@ -190,7 +191,7 @@ namespace Tango.Transport.Discovery } catch (Exception ex) { - LogManager.Log(ex, "Error multicasting discovery packet."); + LogManager.Log(ex, LogCategory.Debug, "Error multicasting discovery packet."); } } } -- cgit v1.3.1 From adc3cb7ad1fd46a2417c5a0ff1725aa67d04a503 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 18 May 2023 10:48:24 +0300 Subject: Installers --- .../Eureka Installer.aip | 15 ++++++++++++--- .../Advanced Installer Projects/FSE Installer.aip | 6 +++--- .../Machine Studio Installer.aip | 6 +++--- .../Help/proc-doc.chm | Bin 368013 -> 368011 bytes .../FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- 8 files changed, 22 insertions(+), 13 deletions(-) (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/Advanced Installer Projects/Eureka Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Eureka Installer.aip index 0593e501f..c1ff02c34 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Eureka Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Eureka Installer.aip @@ -15,10 +15,10 @@ - + - + @@ -47,8 +47,11 @@ + + + @@ -468,6 +471,9 @@ + + + @@ -476,7 +482,7 @@ - + @@ -747,6 +753,9 @@ + + + diff --git a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip index 5442fc1bc..a18abd6ac 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip @@ -29,10 +29,10 @@ - + - + @@ -1201,7 +1201,7 @@ - + diff --git a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip index 53e1c79b1..6cae10041 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip @@ -16,10 +16,10 @@ - + - + @@ -845,7 +845,7 @@ - + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm index 62f67be57..32466caf1 100644 Binary files a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs index afe4677be..cd4408202 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.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 FSE")] -[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyVersion("2.0.1.0")] diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index e1e952af9..0bbe0ae7a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("5.7.0.0")] +[assembly: AssemblyVersion("5.8.0.0")] [assembly: ComVisible(false)] \ No newline at end of file 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 1a21989bc..4940201f0 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("2.0.3.0")] +[assembly: AssemblyVersion("2.0.4.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index efc5f8179..d72e75011 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. --> - + -- cgit v1.3.1 From ead5472228247e3a3f3da2ba213815ee4d8e2e26 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 18 May 2023 12:02:21 +0300 Subject: Bugs in Overview: Copies in Progress run (*4) and if job completed - length ( was 0). --- .../Converters/ProgressLengthSpoolConverter.cs | 2 +- .../Converters/ProgressUnitSpoolConverter.cs | 40 ++++++++++++++++++++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 3 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 9 ++++- 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs index 3be7a8818..377d02d81 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs @@ -37,7 +37,7 @@ namespace Tango.PPC.UI.Converters var currentProgressBy4Spools = (double)currentProgresslength * 4 ; int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools; - var progressCurrent = coeff == 0 ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress + var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress if (forOneSpool) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs new file mode 100644 index 000000000..054ccd3df --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.PPC.UI.Converters +{ + public class ProgressUnitSpoolConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (values.Count() == 1)//may be added count of spools + { + int CurrentUnit = System.Convert.ToInt16(values[0]); + CurrentUnit +=1; + var totalBy4Spools = (double)CurrentUnit * 4;// spools ; + + return totalBy4Spools.ToString(); + + } + + return "-"; + } + catch + { + return "-"; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 e02dba00e..51600b0e8 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 @@ -174,6 +174,7 @@ + BitResultsView.xaml @@ -961,7 +962,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) - + 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 d9b37ac85..666fffe72 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -24,6 +24,7 @@ + - + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml.cs index 4a970ffda..459728264 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/RunningJobViewer.xaml.cs @@ -55,6 +55,14 @@ namespace Tango.FSE.Common.Controls public static readonly DependencyProperty JobProperty = DependencyProperty.Register("Job", typeof(Job), typeof(RunningJobViewer), new PropertyMetadata(null)); + public bool IsEureka + { + get { return (bool)GetValue(IsEurekaProperty); } + set { SetValue(IsEurekaProperty, value); } + } + public static readonly DependencyProperty IsEurekaProperty = + DependencyProperty.Register("IsEureka", typeof(bool), typeof(RunningJobViewer), new PropertyMetadata(false)); + /// /// Gets or sets the running job status. /// diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ProgressLengthSpoolConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ProgressLengthSpoolConverter.cs new file mode 100644 index 000000000..10c20c171 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/ProgressLengthSpoolConverter.cs @@ -0,0 +1,61 @@ +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.FSE.Common.Converters +{ + public class ProgressLengthSpoolConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (values.Count() == 2) + { + double length = System.Convert.ToDouble(values[0]); + bool isEureka = System.Convert.ToBoolean(values[1]); + int jobSpools = 1; + if (isEureka) + jobSpools = 4; + var totalBy4Spools = (double)length * jobSpools;// spools 4; + return totalBy4Spools; + + } + if (values.Count() == 3) + { + double length = System.Convert.ToDouble(values[0]); + var segment = values[1] as Segment; + bool isEureka = System.Convert.ToBoolean(values[1]); + int jobSpools = 1; + if (isEureka) + jobSpools = 4; + double currentProgresslength = System.Convert.ToDouble(values[2]); + + var totalBySpools = (double)length * jobSpools; + var currentProgressBySpools = (double)currentProgresslength * jobSpools; + + int coeff = (int)currentProgressBySpools / (int)totalBySpools; + var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBySpools : currentProgressBySpools % (coeff * totalBySpools);//show for progress + + return progressCurrent; + } + return "-"; + } + catch + { + return "-"; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 82d62ff14..8ef3551d5 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -220,6 +220,7 @@ + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobProgressRingTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobProgressRingTileView.xaml index 62e7c4798..c021b0a15 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobProgressRingTileView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobProgressRingTileView.xaml @@ -9,6 +9,6 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:RemoteJobProgressRingTile, IsDesignTimeCreatable=False}"> - + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs index 650818c22..453a0892e 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Media; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.FSE.Common; using Tango.Integration.Operation; using Tango.PPC.Shared.Jobs; @@ -42,6 +43,15 @@ namespace Tango.FSE.UI.Tiles.RemoteJob set { _isRunning = value; RaisePropertyChangedAuto(); } } + private bool _isEureka; + + public bool IsEureka + { + get { return _isEureka; } + set { _isEureka = value; RaisePropertyChangedAuto(); } + } + + public RemoteJobTile() { Name = "Remote Job"; @@ -113,6 +123,7 @@ namespace Tango.FSE.UI.Tiles.RemoteJob Handler.StatusChanged += Handler_StatusChanged; Job = e.JobHandler.Job; IsRunning = true; + IsEureka = MachineProvider.MachineOperator.MachineType == MachineTypes.Eureka; } private void Handler_StatusChanged(object sender, RunningJobStatus status) diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTileView.xaml index ee05314ce..1323c9298 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTileView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTileView.xaml @@ -10,7 +10,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml index b4bc717cc..8ae0f4354 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationView.xaml @@ -111,7 +111,61 @@ - + + + + Up Time: + + + + + + + + + + + + + IP Address: + + + + + + + + + + + + + + Total Dye Time: + + + + + + + + + + + + + + Total Dye Meters: + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs index c680f4b90..7f810b2f3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/GeneralInformationViewVM.cs @@ -12,6 +12,18 @@ using Tango.PPC.Common.Connection; using Tango.PPC.Common.Notifications; using Tango.Settings; using Tango.SharedUI; +using Tango.PPC.Common.UWF; +using Tango.Core.Commands; +using Tango.PPC.Common.OS; +using System.Collections.Generic; +using System.Diagnostics; +using System.Management; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading.Tasks; +using System.Timers; + namespace Tango.PPC.UI.Dialogs { @@ -48,11 +60,43 @@ namespace Tango.PPC.UI.Dialogs get { return CurrentSite == null ? "" : CurrentSite.Name; } } + private String _ipAddress; + public String IPAddress + { + get { return _ipAddress; } + set { _ipAddress = value; RaisePropertyChangedAuto(); } + } + + private String _totalDyeTime; + public String TotalDyeTime + { + get { return _totalDyeTime; } + set { _totalDyeTime = value; RaisePropertyChangedAuto(); } + } + + private String _totalDyeMeters; + public String TotalDyeMeters + { + get { return _totalDyeMeters; } + set { _totalDyeMeters = value; RaisePropertyChangedAuto(); } + } + + private TimeSpan _upTime; + public TimeSpan UpTime + { + get { return _upTime; } + set { _upTime = value; RaisePropertyChangedAuto(); } + } + public GeneralInformationViewVM( IMachineProvider provider, IPPCApplicationManager appManager) { MachineProvider = provider; ApplicationManager = appManager; InitSite(); + + IPAddress = GetIpv4Address(); + InitTotalDyeProp(); + UpTime = DateTime.Now - ApplicationManager.StartUpDate; } public async void InitSite() @@ -71,6 +115,48 @@ namespace Tango.PPC.UI.Dialogs } } } + + public String GetIpv4Address() + { + try + { + var host = Dns.GetHostEntry(Dns.GetHostName()); + foreach (var ip in host.AddressList) + { + if (ip.AddressFamily == AddressFamily.InterNetwork) + { + return ip.ToString(); + } + } + return "N/A"; + } + catch (Exception ex) + { + return "N/A"; + } + } + + public async void InitTotalDyeProp() + { + try + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var jobRuns = await db.JobRuns.Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).ToListAsync(); + + TotalDyeTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToStringUnlimitedHours(); + + int meters = (int)jobRuns.Select(x => x.EndPosition).Sum(); + TotalDyeMeters = $"{meters.ToString("N0")} meters"; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error loading machine counters."); + TotalDyeTime = "error!"; + TotalDyeMeters = "error!"; + } + } } } 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. --> - + -- cgit v1.3.1