From 00a491d93733d4625ad329b2ba8237f445364b3f Mon Sep 17 00:00:00 2001 From: Mirta Date: Wed, 30 Dec 2020 16:39:52 +0200 Subject: merge --- .../Dialogs/FirmwareUpgradeFromFileView.xaml | 28 -- .../Dialogs/FirmwareUpgradeFromFileView.xaml.cs | 28 -- .../Dialogs/FirmwareUpgradeFromFileViewVM.cs | 15 -- .../Dialogs/InsufficientLiquidQuantityView.xaml | 62 +---- .../Dialogs/InsufficientLiquidQuantityView.xaml.cs | 6 +- .../PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml | 32 --- .../PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs | 34 --- .../PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs | 128 --------- .../SafetyLevelOperationsConfirmationView.xaml | 52 ---- .../SafetyLevelOperationsConfirmationView.xaml.cs | 28 -- .../SafetyLevelOperationsConfirmationViewVM.cs | 82 ------ .../PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml | 225 ---------------- .../Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs | 28 -- .../PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs | 245 ------------------ .../Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml | 170 ------------ .../Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs | 28 -- .../Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs | 287 --------------------- .../Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml | 21 +- .../Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs | 8 +- 19 files changed, 24 insertions(+), 1483 deletions(-) delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml deleted file mode 100644 index 66bd0392d..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CANCEL - UPGRADE - - - - Tango Firmware Upgrade - The selected file contains a firmware upgrade package. Press 'UPGRADE' to start updating your system. - - - Firmware: - - - - - - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs deleted file mode 100644 index e7e1eb86c..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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 UpdateFromFileView.xaml - /// - public partial class FirmwareUpgradeFromFileView : UserControl - { - public FirmwareUpgradeFromFileView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs deleted file mode 100644 index 9a7322565..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PPC.Common.Publish; -using Tango.SharedUI; - -namespace Tango.PPC.UI.Dialogs -{ - public class FirmwareUpgradeFromFileViewVM : DialogViewVM - { - public String Version { get; set; } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml index ad1c2ece3..f3c471954 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" mc:Ignorable="d" Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="700" Height="800" d:DataContext="{d:DesignInstance Type=local:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> @@ -20,59 +20,28 @@ The job cannot be completed. - + - + - - - - - - - - - - - - - + + + - + - + + - - + - - - - - - - - - - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs index e0f02e4af..9ec1eec0e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs @@ -33,7 +33,7 @@ namespace Tango.PPC.UI.Dialogs Grid parent = border.Parent as Grid; IDSPackLevel packLevel = border.DataContext as IDSPackLevel; - border.Width = Math.Max(((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth, 0); + border.Height = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; } private void Limit_Loaded(object sender, RoutedEventArgs e) @@ -42,8 +42,8 @@ namespace Tango.PPC.UI.Dialogs Grid parent = rect.Parent as Grid; IDSPackLevel packLevel = rect.DataContext as IDSPackLevel; - var left = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth; - rect.Margin = new Thickness(left, 0, 0, 0); + var top = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + rect.Margin = new Thickness(0, 0, 0, top); if (packLevel.IsValid) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml deleted file mode 100644 index 081778434..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Continue getting ready for: - - - - - - - Minimal temperature - - - CONTINUE - - - auto select in - - sec - - - - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs deleted file mode 100644 index a9767276a..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -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 PowerUpView.xaml - /// - public partial class PowerUpView : UserControl - { - public PowerUpView() - { - InitializeComponent(); - } - - protected override void OnPreviewMouseUp(MouseButtonEventArgs e) - { - base.OnPreviewMouseUp(e); - (DataContext as PowerUpViewVM).IsTimeoutEnabled = false; - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs deleted file mode 100644 index ec4b3bb2b..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Timers; -using Tango.BL.Entities; -using Tango.PPC.Common; -using Tango.Settings; -using Tango.SharedUI; - -namespace Tango.PPC.UI.Dialogs -{ - public class PowerUpViewVM : DialogViewVM - { - private Timer _timer; - - private List _rmls; - public List Rmls - { - get { return _rmls; } - set { _rmls = value; RaisePropertyChangedAuto(); } - } - - private Rml _selectedRml; - public Rml SelectedRml - { - get { return _selectedRml; } - set { _selectedRml = value; RaisePropertyChangedAuto(); } - } - - private bool _isSelectedRml; - public bool IsSelectedRml - { - get { return _isSelectedRml; } - set - { - _isSelectedRml = value; - RaisePropertyChangedAuto(); - - if (_isSelectedRml) - { - IsMinimalTemperature = false; - } - } - } - - private bool _isMinimalTemperature; - public bool IsMinimalTemperature - { - get { return _isMinimalTemperature; } - set - { - _isMinimalTemperature = value; - RaisePropertyChangedAuto(); - - if (_isMinimalTemperature) - { - IsSelectedRml = false; - } - } - } - - private int _remainingSeconds; - public int RemainingSeconds - { - get { return _remainingSeconds; } - set { _remainingSeconds = value; RaisePropertyChangedAuto(); } - } - - private bool _isTimeoutEnabled; - public bool IsTimeoutEnabled - { - get { return _isTimeoutEnabled; } - set - { - _isTimeoutEnabled = value; RaisePropertyChangedAuto(); - - if (!_isTimeoutEnabled) - { - _timer.Stop(); - } - } - } - - public PowerUpViewVM() - { - RemainingSeconds = (int)SettingsManager.Default.GetOrCreate().PowerUpScreenTimeout.TotalSeconds; - CanClose = true; - IsMinimalTemperature = true; - IsTimeoutEnabled = true; - _timer = new Timer(); - _timer.Interval = TimeSpan.FromSeconds(1).TotalMilliseconds; - _timer.Elapsed += _timer_Elapsed; - } - - private void _timer_Elapsed(object sender, ElapsedEventArgs e) - { - RemainingSeconds--; - - if (RemainingSeconds == 0) - { - InvokeUI(() => - { - Accept(); - }); - } - } - - protected override void Cancel() - { - _timer.Stop(); - base.Cancel(); - } - - protected override void Accept() - { - _timer.Stop(); - base.Accept(); - } - - public override void OnShow() - { - base.OnShow(); - _timer.Start(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml deleted file mode 100644 index e96b39a63..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - DECLINE - - - - - - - APPROVE - - - - Safety Level Access Request - - A remote client is requesting a safety level connection to this machine. - - Once approved, the remote user will be able to perform any mechanical operation remotely. - - - - - Request Information - - Address: - - - Host Name: - - - App ID: - - - User: - - - - - - - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs deleted file mode 100644 index ef689f1de..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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 SafetyLevelOperationsConfirmationView.xaml - /// - public partial class SafetyLevelOperationsConfirmationView : UserControl - { - public SafetyLevelOperationsConfirmationView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs deleted file mode 100644 index f8027b4c2..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Threading; -using Tango.Integration.ExternalBridge; -using Tango.PMR.Integration; -using Tango.SharedUI; - -namespace Tango.PPC.UI.Dialogs -{ - public class SafetyLevelOperationsConfirmationViewVM : DialogViewVM - { - private DispatcherTimer _timer; - - private int _maxSeconds; - public int MaxSeconds - { - get { return _maxSeconds; } - set { _maxSeconds = value; RaisePropertyChangedAuto(); } - } - - private int _secondsRemaining; - public int SecondsRemaining - { - get { return _secondsRemaining; } - set { _secondsRemaining = value; RaisePropertyChangedAuto(); } - } - - private ExternalBridgeClientConnectedEventArgs _connection; - /// - /// Gets or sets the last client connection event arguments. - /// - public ExternalBridgeClientConnectedEventArgs Connection - { - get { return _connection; } - set { _connection = value; RaisePropertyChangedAuto(); } - } - - public SafetyLevelOperationsConfirmationViewVM(ExternalBridgeClientConnectedEventArgs connection) - { - Connection = connection; - - MaxSeconds = 30; - SecondsRemaining = 30; - - _timer = new DispatcherTimer(DispatcherPriority.Background, Application.Current.Dispatcher); - _timer.Interval = TimeSpan.FromMilliseconds(800); - _timer.Tick += _timer_Tick; - } - - public override void OnShow() - { - base.OnShow(); - _timer.Start(); - } - - protected override void Accept() - { - _timer.Stop(); - base.Accept(); - } - - protected override void Cancel() - { - _timer.Stop(); - base.Cancel(); - } - - private void _timer_Tick(object sender, EventArgs e) - { - SecondsRemaining--; - - if (SecondsRemaining == 0) - { - Cancel(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml deleted file mode 100644 index f17860d42..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - Thread Break Wizard - - - - - - - - - - Back - - - - - - - - - - - - Found But Can't Fix - Found and Fixed - Can't Find It - - - - Please check guiding units on both sides of the system and fix/tie the thread if possible. - - - - - - - - - - - - - - Found and Fixed - Can't Fix - - - if the thread is out of is route or tangle on one of the components you can go to the maintenance screen and open the component to solve the problem - - - - - Open the covers and check the feeder and puller and fix/tie if possible. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Removed Successfully - Can't Remove - - - - - HOT SURFACE! - - - Recommended to cool down and/or to wear safety gloves - - - - - - Open the dryer, cut the thread and remove any residue. - - - - - - - - - - - - - - - - - - - Open The Thread Loading Wizard - - - You will be able to open the thread loading wizard once the dryer door is closed - - - - - Close the dryer door - - - - - - - - - - - - - - - - - - Close - - - - - Please Contact Twine Customer Care - - - - - support@twine-s.com - - - - - - - - - - - - Verifying thread movement - - - - - working... - - - - - - - - - - - Close - - - - - Issue Resolved - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs deleted file mode 100644 index c105a9a15..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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 ThreadBreakWizard.xaml - /// - public partial class ThreadBreakView : UserControl - { - public ThreadBreakView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs deleted file mode 100644 index e737f3b12..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs +++ /dev/null @@ -1,245 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.Commands; -using Tango.Core.DI; -using Tango.Logging; -using Tango.PPC.Common.Connection; -using Tango.PPC.Common.Notifications; -using Tango.SharedUI; - -namespace Tango.PPC.UI.Dialogs -{ - public class ThreadBreakViewVM : DialogViewVM - { - public enum ThreadBreakWizardResult - { - None, - StartThreadLoading - } - - public enum WizardStage - { - Welcome, - GuidingUnits, - FeedingUnits, - Jogging, - TheDryer, - DryerClose, - Fixed, - ContactSupport, - } - - [TangoInject] - private IMachineProvider MachineProvider { get; set; } - - [TangoInject] - private INotificationProvider NotificationProvider { get; set; } - - public ThreadBreakWizardResult Result { get; set; } - - private WizardStage _stage; - public WizardStage Stage - { - get { return _stage; } - set { _stage = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - private bool _isArcHead; - public bool IsArcHead - { - get { return _isArcHead; } - set { _isArcHead = value; RaisePropertyChangedAuto(); } - } - - public RelayCommand BackCommand { get; set; } - - //Guiding Units - public RelayCommand GuidingUnitsFoundCantFixCommand { get; set; } - public RelayCommand GuidingUnitsCantFindItCommand { get; set; } - public RelayCommand GuidingUnitsFoundAndFixedCommand { get; set; } - - //Feeding Units - public RelayCommand FeedingUnitsCantFixCommand { get; set; } - public RelayCommand FeedingUnitsFoundAndFixedCommand { get; set; } - - //The Dryer - public RelayCommand TheDryerCantRemoveCommand { get; set; } - public RelayCommand TheDryerRemovedSuccessfullyCommand { get; set; } - - //Dryer Close - public RelayCommand OpenThreadLoadingWizardCommand { get; set; } - - public ThreadBreakViewVM() - { - CanClose = true; - TangoIOC.Default.Inject(this); - - MachineProvider.MachineOperator.MachineEventsStateProvider.EventsChanged += MachineEventsStateProvider_EventsChanged; - MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected; - - IsArcHead = MachineProvider.Machine.MachineHeadType == BL.Enumerations.HeadTypes.Arc; - - BackCommand = new RelayCommand(GoBack, CanGoBack); - - //Guiding Units Commands - GuidingUnitsFoundCantFixCommand = new RelayCommand(GuidingUnitsFoundCantFix); - GuidingUnitsCantFindItCommand = new RelayCommand(GuidingUnitsCantFindIt); - GuidingUnitsFoundAndFixedCommand = new RelayCommand(GuidingUnitsFoundAndFixed); - - //Feeding Units Commands - FeedingUnitsCantFixCommand = new RelayCommand(FeedingUnitsCantFix); - FeedingUnitsFoundAndFixedCommand = new RelayCommand(FeedingUnitsFoundAndFixed); - - //The Dryer Commands - TheDryerRemovedSuccessfullyCommand = new RelayCommand(TheDryerRemovedSuccessfully); - TheDryerCantRemoveCommand = new RelayCommand(TheDryerCantRemove); - - OpenThreadLoadingWizardCommand = new RelayCommand(OpenThreadLoadingWizard, () => !MachineProvider.MachineOperator.MachineEventsStateProvider.Events.Any(x => x.Type == BL.Enumerations.EventTypes.DRYER_DOOR_OPEN)); - } - - private void MachineProvider_MachineDisconnected(object sender, EventArgs e) - { - InvokeUI(() => - { - Cancel(); - }); - } - - private void MachineEventsStateProvider_EventsChanged(object sender, IEnumerable e) - { - InvalidateRelayCommands(); - } - - #region Back - - private bool CanGoBack() - { - return Stage != WizardStage.GuidingUnits && - Stage != WizardStage.Jogging && - Stage != WizardStage.Fixed; - } - - private void GoBack() - { - switch (Stage) - { - case WizardStage.FeedingUnits: - Stage = WizardStage.GuidingUnits; - break; - case WizardStage.TheDryer: - Stage = WizardStage.GuidingUnits; - break; - case WizardStage.ContactSupport: - Stage = WizardStage.TheDryer; - break; - case WizardStage.DryerClose: - Stage = WizardStage.TheDryer; - break; - } - } - - #endregion - - #region Guiding Units Commands - - private async void GuidingUnitsFoundAndFixed() - { - Stage = WizardStage.Jogging; - - try - { - await MachineProvider.MachineOperator.AttemptThreadJogging(); - Stage = WizardStage.Fixed; - } - catch (Exception ex) - { - LogManager.Log(ex, LogCategory.Warning, "Error occurred while attempting to perform thread jogging."); - await NotificationProvider.ShowError($"Thread movement verification failed.\n{ex.FlattenMessage()}"); - Stage = WizardStage.FeedingUnits; - } - } - - private void GuidingUnitsCantFindIt() - { - Stage = WizardStage.FeedingUnits; - } - - private void GuidingUnitsFoundCantFix() - { - Stage = WizardStage.TheDryer; - } - - #endregion - - #region Feeding Units Commands - - private void FeedingUnitsCantFix() - { - Stage = WizardStage.TheDryer; - } - - private async void FeedingUnitsFoundAndFixed() - { - Stage = WizardStage.Jogging; - - try - { - await MachineProvider.MachineOperator.AttemptThreadJogging(); - Stage = WizardStage.Fixed; - } - catch (Exception ex) - { - LogManager.Log(ex, LogCategory.Warning, "Error occurred while attempting to perform thread jogging."); - await NotificationProvider.ShowError($"Thread movement verification failed.\n{ex.FlattenMessage()}"); - Stage = WizardStage.TheDryer; - } - } - - #endregion - - #region The Dryer Commands - - private void TheDryerCantRemove() - { - Stage = WizardStage.ContactSupport; - } - - private void TheDryerRemovedSuccessfully() - { - Stage = WizardStage.DryerClose; - } - - #endregion - - #region Dryer Close Commands - - private void OpenThreadLoadingWizard() - { - Result = ThreadBreakWizardResult.StartThreadLoading; - Accept(); - } - - #endregion - - protected override void Accept() - { - base.Accept(); - CleanUp(); - } - - protected override void Cancel() - { - base.Cancel(); - CleanUp(); - } - - private void CleanUp() - { - MachineProvider.MachineOperator.MachineEventsStateProvider.EventsChanged -= MachineEventsStateProvider_EventsChanged; - MachineProvider.MachineDisconnected -= MachineProvider_MachineDisconnected; - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml deleted file mode 100644 index e45065c61..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Thread Loading - - - - - - - - - Continue - - - - Welcome to the automatic thread loading wizard. - - - - Please ensure there are no thread residue in the system and press - continue - - - - - - - - - - - - - Continue - - - - - The system is now preparing... - - - - - - - - - - - - Continue - - - - - Please select the thread type you are going to load and press - continue - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Continue - - - - - The system is now loading the thread... - - - - - - - - - - - - - - Close - - - - Thread loading completed successfully! - - - - - - - - - - - Close - Retry - - - - Something went wrong, press 'retry' to try again - - - - - - - - - - - - Close - Retry - - - - Something went wrong, press 'retry' to try again - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs deleted file mode 100644 index d4c737bcc..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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 PowerUpView.xaml - /// - public partial class ThreadLoadingView : UserControl - { - public ThreadLoadingView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs deleted file mode 100644 index bb503e718..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs +++ /dev/null @@ -1,287 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL; -using Tango.BL.Builders; -using Tango.BL.Entities; -using Tango.Core.Commands; -using Tango.Core.DI; -using Tango.Integration.Operation; -using Tango.PMR.ThreadLoading; -using Tango.PPC.Common; -using Tango.PPC.Common.Connection; -using Tango.PPC.Common.Notifications; -using Tango.Settings; -using Tango.SharedUI; - -namespace Tango.PPC.UI.Dialogs -{ - public class ThreadLoadingViewVM : DialogViewVM - { - public enum ThreadLoadingStage - { - Welcome, - Preparing, - ReadyForLoading, - Finalizing, - Completed, - PreparationError, - FinalizationError, - } - - [TangoInject] - private IMachineProvider MachineProvider { get; set; } - - [TangoInject] - private INotificationProvider NotificationProvider { get; set; } - - private PPCSettings _settings; - - private StartThreadLoadingResponse _status; - public StartThreadLoadingResponse Status - { - get { return _status; } - set { _status = value; RaisePropertyChangedAuto(); } - } - - private List _rmls; - public List Rmls - { - get { return _rmls; } - set { _rmls = value; RaisePropertyChangedAuto(); } - } - - private Rml _selectedRml; - public Rml SelectedRml - { - get { return _selectedRml; } - set { _selectedRml = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - private ThreadLoadingStage _stage; - public ThreadLoadingStage Stage - { - get { return _stage; } - set { _stage = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - private bool _isArcHead; - public bool IsArcHead - { - get { return _isArcHead; } - set { _isArcHead = value; RaisePropertyChangedAuto(); } - } - - private String _error; - public String Error - { - get { return _error; } - set { _error = value; RaisePropertyChangedAuto(); } - } - - public RelayCommand ContinueCommand { get; set; } - public RelayCommand AbortCommand { get; set; } - - public ThreadLoadingViewVM(bool userInvoked = false) - { - CanClose = false; - - TangoIOC.Default.Inject(this); - _settings = SettingsManager.Default.GetOrCreate(); - - MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged; - MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected; - - IsArcHead = MachineProvider.Machine.MachineHeadType == BL.Enumerations.HeadTypes.Arc; - - ContinueCommand = new RelayCommand(Continue, CanContinue); - AbortCommand = new RelayCommand(Abort); - - AdaptToState(userInvoked); - } - - private void MachineProvider_MachineDisconnected(object sender, EventArgs e) - { - InvokeUI(() => - { - Cancel(); - }); - } - - private void AdaptToState(bool userInvoked = false) - { - var status = MachineProvider.MachineOperator.ThreadLoadingStatus; - - if (status != null) - { - if (status.State == ThreadLoadingState.Preparing) - { - Stage = ThreadLoadingStage.Preparing; - } - else if (status.State == ThreadLoadingState.ReadyForLoading) - { - Stage = ThreadLoadingStage.ReadyForLoading; - } - else if (status.State == ThreadLoadingState.Finalizing) - { - Stage = ThreadLoadingStage.Finalizing; - } - else if (status.State == ThreadLoadingState.PreparationError) - { - OnPreparationError(status.ErrorReason); - } - else if (status.State == ThreadLoadingState.FinalizationError) - { - OnFinalizationError(status.ErrorReason); - } - else if (status.State == ThreadLoadingState.Completed) - { - if (userInvoked) - { - Stage = ThreadLoadingStage.Welcome; - } - else - { - Stage = ThreadLoadingStage.Completed; - } - } - } - } - - private void MachineOperator_ThreadLoadingStatusChanged(object sender, StartThreadLoadingResponse e) - { - Status = e; - AdaptToState(); - } - - private void Continue() - { - if (Stage == ThreadLoadingStage.Welcome) - { - Stage = ThreadLoadingStage.Preparing; - StartPreparing(); - } - else if (Stage == ThreadLoadingStage.ReadyForLoading) - { - ContinueThreadLoading(); - } - else if (Stage == ThreadLoadingStage.Completed) - { - Accept(); - } - else if (Stage == ThreadLoadingStage.PreparationError) - { - Stage = ThreadLoadingStage.Preparing; - StartPreparing(); - } - else if (Stage == ThreadLoadingStage.FinalizationError) - { - ContinueThreadLoading(); - } - } - - private async void StartPreparing() - { - try - { - await MachineProvider.MachineOperator.StartThreadLoading(); - } - catch (Exception ex) - { - OnPreparationError(ex.Message); - } - } - - private async void ContinueThreadLoading() - { - try - { - Stage = ThreadLoadingStage.Finalizing; - await MachineProvider.MachineOperator.ContinueThreadLoading(SelectedRml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault()); - } - catch (Exception ex) - { - OnFinalizationError(ex.Message); - } - } - - private bool CanContinue() - { - bool canContinue = false; - - if (Stage != ThreadLoadingStage.Preparing && Stage != ThreadLoadingStage.Finalizing) - { - canContinue = true; - } - - if (Stage == ThreadLoadingStage.ReadyForLoading && SelectedRml == null) - { - canContinue = false; - } - - return canContinue; - } - - private void OnPreparationError(String error) - { - Error = error; - Stage = ThreadLoadingStage.PreparationError; - } - - private void OnFinalizationError(String error) - { - Error = error; - Stage = ThreadLoadingStage.FinalizationError; - } - - private void Abort() - { - Cancel(); - } - - public async override void OnShow() - { - base.OnShow(); - - LogManager.Log("Loading site RMLS..."); - - List rmls = new List(); - - using (ObservablesContext db = ObservablesContext.CreateDefault()) - { - rmls = await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).WithActiveParametersGroup().BuildListAsync(); - } - - var selectedRml = rmls.SingleOrDefault(x => x.Guid == _settings.LoadedRmlGuid); - - Rmls = rmls; - SelectedRml = selectedRml != null ? selectedRml : rmls.FirstOrDefault(); - } - - protected override void Cancel() - { - CleanUp(); - base.Cancel(); - } - - protected override void Accept() - { - CleanUp(); - base.Accept(); - } - - private void CleanUp() - { - MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged; - MachineProvider.MachineDisconnected -= MachineProvider_MachineDisconnected; - - if (SelectedRml != null) - { - _settings.LoadedRmlGuid = SelectedRml.Guid; - _settings.Save(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml index 6f70b954d..231f5dabb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml @@ -6,24 +6,21 @@ xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:UpdateFromFileViewVM, IsDesignTimeCreatable=False}"> + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="550" Height="450" d:DataContext="{d:DesignInstance Type=local:UpdateFromFileViewVM, IsDesignTimeCreatable=False}"> - - CANCEL - UPDATE - + + CANCEL + UPDATE + - Tango Update Package + UPDATE PACKAGE The selected file contains a software update package. Press 'UPDATE' to start updating your system. - - Application: - - - Firmware: - + + Version + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs index a38b0431a..b9e876809 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs @@ -3,18 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.PPC.Common.Publish; using Tango.SharedUI; namespace Tango.PPC.UI.Dialogs { public class UpdateFromFileViewVM : DialogViewVM { - public PublishInfo PublishInfo { get; set; } - - public String FirmwareVersion - { - get { return PublishInfo.GetFirmwareVersion(); } - } + public String Version { get; set; } } } -- cgit v1.3.1