From b7f4088f257c3c9c816f680c97a652f6f73de940 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 18 Feb 2020 14:31:24 +0200 Subject: Several bug fixes on PPC. --- .../Dialogs/AdvancedColorCorrectionView.xaml | 25 ++++++++++++++++++++++ .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 21 ++++++++---------- .../PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 1 - .../PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs | 2 ++ 4 files changed, 36 insertions(+), 13 deletions(-) (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml index defd65d6e..abe2fab7d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml @@ -42,10 +42,35 @@ + + + , , + + + + + , + , + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index f07c20aa9..c394bbfa1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -760,15 +760,8 @@ namespace Tango.PPC.Jobs.ViewModels { draggedSegment.SegmentIndex = droppedSegment.SegmentIndex + 1; } - - int index = 1; - - foreach (var segment in Job.Segments.OrderBy(x => x.SegmentIndex)) - { - segment.SegmentIndex = index++; - } - - SegmentsCollectionView.Refresh(); + + ArrangeSegmentsIndices(); } /// @@ -831,10 +824,14 @@ namespace Tango.PPC.Jobs.ViewModels private void ArrangeSegmentsIndices() { - for (int i = 0; i < Job.Segments.Count; i++) + int index = 1; + + foreach (var segment in Job.Segments.OrderBy(x => x.SegmentIndex)) { - Job.Segments[i].SegmentIndex = i + 1; + segment.SegmentIndex = index++; } + + SegmentsCollectionView.Refresh(); } #endregion @@ -982,7 +979,7 @@ namespace Tango.PPC.Jobs.ViewModels [HandleProcessCorruptedStateExceptions] public void OnBrushStopFieldValueChanged(BrushStop stop) { - if (stop != null) + if (stop != null && stop.ColorSpace != null) { stop.Corrected = false; stop.OutOfGamutChecked = false; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index c04c13ea1..557576d22 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -631,7 +631,6 @@ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs index f926a0f4c..e280d5f9d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs @@ -96,12 +96,14 @@ namespace Tango.PPC.UI.ViewModels LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView..."); await AuthenticationProvider.Login(user.Email, user.Password, false); + await Task.Delay(1000); IsLoading = false; } else { LogManager.Log("Application started. Navigating to LoginView..."); await NavigationManager.NavigateTo(NavigationView.LoginView); + await Task.Delay(1000); IsLoading = false; } } -- cgit v1.3.1 From 00b7de2653058bd9657217075eae834f6a1a4ec5 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 18 Feb 2020 16:26:46 +0200 Subject: Implemented PPC thread loading from preparation.. --- .../Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml | 22 ++++++++---- .../Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs | 27 +++++++++++++-- .../PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs | 38 ++++++++++++++++++--- .../Software Release Notes (4.1, 1.1).docx | Bin 0 -> 9504602 bytes .../Release Notes/Transparent Colors.docx | Bin 0 -> 214687 bytes .../Software Release Notes (4.1, 1.1).docx | Bin 9706563 -> 0 bytes .../Tango.Emulations/Emulators/MachineEmulator.cs | 14 ++++++-- .../Tango.Integration/Operation/MachineOperator.cs | 1 + .../Tango.Touch/Controls/TouchPanel.xaml | 2 +- 9 files changed, 87 insertions(+), 17 deletions(-) create mode 100644 Software/Visual_Studio/Resources/Release Notes/Software Release Notes (4.1, 1.1).docx create mode 100644 Software/Visual_Studio/Resources/Release Notes/Transparent Colors.docx delete mode 100644 Software/Visual_Studio/Resources/Software Release Notes (4.1, 1.1).docx (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml index f6fc7704a..d6db3d124 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml @@ -14,16 +14,24 @@ Thread Loading - - + + + The machine is ready for thread loading. Please load the thread as instructed and press 'continue'. - - - CONTINUE + + + CONTINUE + + + + The machine is now loading the thread. please wait... + + + - + - The machine is now loading the thread. please wait... + The machine is now preparing for thread loading. please wait... diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs index 5e5370416..5c4d003a1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs @@ -40,6 +40,13 @@ namespace Tango.PPC.UI.Dialogs set { _isFinalizing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } } + private bool _isPreparing; + public bool IsPreparing + { + get { return _isPreparing; } + set { _isPreparing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + public List Rmls { get; set; } private Rml _selectedRml; @@ -51,15 +58,28 @@ namespace Tango.PPC.UI.Dialogs public RelayCommand ContinueCommand { get; set; } - public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs) + public ThreadLoadingViewVM(IMachineProvider machineProvider) { CanClose = true; - _confirmationArgs = confirmationArgs; + IsPreparing = true; ContinueCommand = new RelayCommand(ContinueThreadLoading, () => !IsFinalizing && SelectedRml != null); MachineProvider = machineProvider; MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged; MachineProvider.MachineOperator.ThreadLoadingCompleted += MachineOperator_ThreadLoadingCompleted; MachineProvider.MachineOperator.ThreadLoadingFailed += MachineOperator_ThreadLoadingFailed; + MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired; + } + + public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs) : this(machineProvider) + { + _confirmationArgs = confirmationArgs; + IsPreparing = false; + } + + private void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e) + { + _confirmationArgs = e; + IsPreparing = false; } private async void ContinueThreadLoading() @@ -125,7 +145,7 @@ namespace Tango.PPC.UI.Dialogs { Status = e; - if(Status.State == ThreadLoadingState.Finalizing) + if (Status.State == ThreadLoadingState.Finalizing) { IsFinalizing = true; } @@ -150,6 +170,7 @@ namespace Tango.PPC.UI.Dialogs MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged; MachineProvider.MachineOperator.ThreadLoadingCompleted -= MachineOperator_ThreadLoadingCompleted; MachineProvider.MachineOperator.ThreadLoadingFailed -= MachineOperator_ThreadLoadingFailed; + MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired -= MachineOperator_ThreadLoadingConfirmationRequired; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs index 5c518f60d..048234949 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs @@ -32,6 +32,7 @@ namespace Tango.PPC.UI.ViewModels { private DispatcherTimer _date_timer; private bool _isPowerUpDialogShown; + private bool _isThreadLoadingShown; private DateTime _currentDateTime; /// @@ -64,6 +65,7 @@ namespace Tango.PPC.UI.ViewModels base.OnApplicationReady(); MachineProvider.MachineOperator.CartridgeValidationRequestReceived += MachineOperator_CartridgeValidationRequestReceived; MachineProvider.MachineOperator.PowerUpStarted += MachineOperator_PowerUpStarted; + MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged; MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired; } @@ -187,12 +189,30 @@ namespace Tango.PPC.UI.ViewModels }); } - private async void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e) + private void MachineOperator_ThreadLoadingStatusChanged(object sender, PMR.ThreadLoading.StartThreadLoadingResponse e) { - LogManager.Log("Thread loading confirmation detected, showing thread loading screen..."); + if (e.State == PMR.ThreadLoading.ThreadLoadingState.Preparing) + { + DisplayThreadLoading(); + } + } + + private void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e) + { + DisplayThreadLoading(e); + } + + private async void DisplayThreadLoading(ThreadLoadingConfirmationRequiredEventArgs confirmationArgs = null) + { + if (_isThreadLoadingShown) return; + + _isThreadLoadingShown = true; + + LogManager.Log("Thread loading preparation/finalization detected, showing thread loading screen..."); if (!Settings.DisplayAutomaticThreadLoadingScreen) { + _isThreadLoadingShown = false; LogManager.Log("Thread loading screen disabled. skipping..."); return; } @@ -212,12 +232,21 @@ namespace Tango.PPC.UI.ViewModels var selectedRml = rmls.SingleOrDefault(x => x.Guid == Settings.LoadedRmlGuid); - vm = new ThreadLoadingViewVM(MachineProvider, e); + if (confirmationArgs == null) + { + vm = new ThreadLoadingViewVM(MachineProvider); + } + else + { + vm = new ThreadLoadingViewVM(MachineProvider, confirmationArgs); + } + vm.Rmls = rmls; vm.SelectedRml = selectedRml != null ? selectedRml : rmls.FirstOrDefault(); } catch (Exception ex) { + _isThreadLoadingShown = false; LogManager.Log(ex, "Error initializing thread loading screen."); return; } @@ -226,6 +255,8 @@ namespace Tango.PPC.UI.ViewModels { await NotificationProvider.ShowDialog(vm); + _isThreadLoadingShown = false; + LogManager.Log("Thread loading screen closed."); if (!vm.DialogResult) @@ -257,7 +288,6 @@ namespace Tango.PPC.UI.ViewModels } }); } - #endregion } } diff --git a/Software/Visual_Studio/Resources/Release Notes/Software Release Notes (4.1, 1.1).docx b/Software/Visual_Studio/Resources/Release Notes/Software Release Notes (4.1, 1.1).docx new file mode 100644 index 000000000..d6ebf5330 Binary files /dev/null and b/Software/Visual_Studio/Resources/Release Notes/Software Release Notes (4.1, 1.1).docx differ diff --git a/Software/Visual_Studio/Resources/Release Notes/Transparent Colors.docx b/Software/Visual_Studio/Resources/Release Notes/Transparent Colors.docx new file mode 100644 index 000000000..849600e3e Binary files /dev/null and b/Software/Visual_Studio/Resources/Release Notes/Transparent Colors.docx differ diff --git a/Software/Visual_Studio/Resources/Software Release Notes (4.1, 1.1).docx b/Software/Visual_Studio/Resources/Software Release Notes (4.1, 1.1).docx deleted file mode 100644 index 7e6ff1e00..000000000 Binary files a/Software/Visual_Studio/Resources/Software Release Notes (4.1, 1.1).docx and /dev/null differ diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index b901bd224..17a7fbe58 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -1543,7 +1543,17 @@ namespace Tango.Emulations.Emulators public async void StartThreadLoading() { - await Transporter.SendResponse(new StartThreadLoadingResponse() { State = ThreadLoadingState.ReadyForLoading }, _threadLoadingToken); + await Transporter.SendResponse(new StartThreadLoadingResponse() { State = ThreadLoadingState.Preparing }, _threadLoadingToken); + await Task.Delay(2000); + + if (_rnd.Next(0, 100) > 50) + { + await Transporter.SendResponse(new StartThreadLoadingResponse() { State = ThreadLoadingState.PreparationError, ErrorReason = "Emulator preparation random error." }, _threadLoadingToken); + } + else + { + await Transporter.SendResponse(new StartThreadLoadingResponse() { State = ThreadLoadingState.ReadyForLoading }, _threadLoadingToken); + } } public async void FinalizeThreadLoading() @@ -1557,7 +1567,7 @@ namespace Tango.Emulations.Emulators } else { - await Transporter.SendResponse(new StartThreadLoadingResponse() { State = ThreadLoadingState.FinalizationError, ErrorReason = "Emulator random error." }, _threadLoadingToken); + await Transporter.SendResponse(new StartThreadLoadingResponse() { State = ThreadLoadingState.FinalizationError, ErrorReason = "Emulator finalization random error." }, _threadLoadingToken); } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 80ba87ce1..5711882a3 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -949,6 +949,7 @@ namespace Tango.Integration.Operation ThreadLoadingCompleted?.Invoke(this, ThreadLoadingStatus); break; case ThreadLoadingState.FinalizationError: + case ThreadLoadingState.PreparationError: ThreadLoadingFailed?.Invoke(this, ThreadLoadingStatus); break; } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml index ffe3d19dd..8a5367234 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml @@ -66,7 +66,7 @@ - + -- cgit v1.3.1 From 96691cea7e86b1df3f6cd5b3f45ae614e5f09821 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 18 Feb 2020 21:06:18 +0200 Subject: FSE... --- .../PPC Installer-cache/cacheIndex.txt | Bin 52 -> 52 bytes .../Advanced Installer Projects/PPC Installer.aip | 6 +- .../FSE/Tango.FSE.Common/FSEViewModel.cs | 19 +++ .../Tango.FSE.Common/Images/twine_logo_colored.png | Bin 0 -> 27285 bytes .../FSE/Tango.FSE.Common/Resources/Fonts.xaml | 9 +- .../FSE/Tango.FSE.Common/Resources/Images.xaml | 1 + .../FSE/Tango.FSE.Common/Tango.FSE.Common.csproj | 3 + .../FSE/Tango.FSE.UI/Contracts/ILayoutView.cs | 14 ++ .../Connections/external-bridge-emulator.png | Bin 0 -> 6412 bytes .../Images/Connections/external-bridge-signalr.png | Bin 0 -> 5399 bytes .../Images/Connections/external-bridge-tcp.png | Bin 0 -> 5653 bytes .../Images/Connections/external-bridge-usb.png | Bin 0 -> 5669 bytes .../FSE/Tango.FSE.UI/Images/login_white.png | Bin 0 -> 3308 bytes .../Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml | 2 +- .../Tango.FSE.UI/Panes/MachineConnectionPane.xaml | 94 +++++++++++ .../Panes/MachineConnectionPane.xaml.cs | 38 +++++ .../Tango.FSE.UI/Panes/MachineConnectionPaneVM.cs | 108 ++++++++++++ .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 22 +++ .../FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs | 52 ++++++ .../FSE/Tango.FSE.UI/Views/LayoutView.xaml | 182 +++++++++++++++++++-- .../FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs | 31 +++- .../PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Visual_Studio/Tango.Core/ExtendedObject.cs | 2 +- .../ExternalBridge/ExternalBridgeScanner.cs | 18 +- 25 files changed, 574 insertions(+), 31 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/Images/twine_logo_colored.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Contracts/ILayoutView.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-emulator.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-signalr.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-tcp.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-usb.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/login_white.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPaneVM.cs (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt index a603ff06b..993ced97e 100644 Binary files a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt and b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip index ac9082375..d21e2ee6f 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip @@ -18,10 +18,10 @@ - + - + @@ -415,7 +415,7 @@ - + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs index d277d0bdb..a1c67ee44 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs @@ -1,8 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; +using System.Windows.Input; using Tango.BL; using Tango.Core.DI; using Tango.FSE.Common.Authentication; @@ -198,6 +200,23 @@ namespace Tango.FSE.Common { } + + protected override void RaisePropertyChanged(string propName) + { + base.RaisePropertyChanged(propName); + + if (propName == nameof(IsFree)) + { + if (IsFree) + { + Mouse.OverrideCursor = null; + } + else + { + Mouse.OverrideCursor = Cursors.AppStarting; + } + } + } } /// diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Images/twine_logo_colored.png b/Software/Visual_Studio/FSE/Tango.FSE.Common/Images/twine_logo_colored.png new file mode 100644 index 000000000..2204585dc Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.Common/Images/twine_logo_colored.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Fonts.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Fonts.xaml index e3ac57536..8bb175e3e 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Fonts.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Fonts.xaml @@ -5,7 +5,12 @@ ../Fonts/#digital-7 ../Fonts/#flexo - + + 14 + 12 + 10 + 16 + 18 16 - + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Images.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Images.xaml index f72ae5675..c46d10ce5 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Images.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Images.xaml @@ -6,5 +6,6 @@ + \ No newline at end of file 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 2b8f0db0b..20c39d161 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 @@ -207,6 +207,9 @@ + + + nswag run "$(SolutionDir)Web\Tango.MachineService.Gateway\Nswag\GatewayClient.nswag" /variables:assembly="$(SolutionDir)Web\Tango.MachineService.Gateway\bin\Tango.MachineService.Gateway.dll",output="$(ProjectDir)Gateway\GatewayClient.cs" diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Contracts/ILayoutView.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Contracts/ILayoutView.cs new file mode 100644 index 000000000..f6ba9f200 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Contracts/ILayoutView.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common; + +namespace Tango.FSE.UI.Contracts +{ + public interface ILayoutView : IFSEView + { + + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-emulator.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-emulator.png new file mode 100644 index 000000000..254fc819a Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-emulator.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-signalr.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-signalr.png new file mode 100644 index 000000000..bda45ffd2 Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-signalr.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-tcp.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-tcp.png new file mode 100644 index 000000000..04e47f539 Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-tcp.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-usb.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-usb.png new file mode 100644 index 000000000..07814e7de Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Connections/external-bridge-usb.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/login_white.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/login_white.png new file mode 100644 index 000000000..10a054147 Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/login_white.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml index 202476e90..059b2e277 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml @@ -13,7 +13,7 @@ TextElement.Foreground="{StaticResource FSE_PrimaryForegroundBrush}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" TextElement.FontWeight="Medium" - TextElement.FontSize="14" + TextElement.FontSize="{StaticResource FSE_DefaultFontSize}" TitleCharacterCasing="Normal" UseNoneWindowStyle="True" EnableDWMDropShadow="True" MinWidth="800" MinHeight="600" BorderThickness="1" BorderBrush="Gray" FontFamily="{StaticResource flexo}" WindowTitleBrush="{StaticResource PrimaryHueMidBrush}"> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml new file mode 100644 index 000000000..d309d3599 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + Port: + + + Device: + + + + + + + + + + + + + + + + + + + + S/N: + + + IP Address: + + + Organization: + + + + + + + + + + + + + + + + + + + + S/N: + + + Hub: + + + Organization: + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml.cs new file mode 100644 index 000000000..6e0a5e74f --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml.cs @@ -0,0 +1,38 @@ +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.FSE.UI.Panes +{ + /// + /// Interaction logic for MachineConnectionPane.xaml + /// + public partial class MachineConnectionPane : UserControl + { + public MachineConnectionPane() + { + InitializeComponent(); + } + + private void ListBox_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) + { + var vm = DataContext as MachineConnectionPaneVM; + if (vm != null) + { + vm.SelectedMachine = (sender as ListBox).SelectedItem as Integration.ExternalBridge.IExternalBridgeClient; + vm.ConnectToMachine(); + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPaneVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPaneVM.cs new file mode 100644 index 000000000..37cf9b70f --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPaneVM.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Integration.ExternalBridge; +using Tango.SharedUI; + +namespace Tango.FSE.UI.Panes +{ + public class MachineConnectionPaneVM : ViewModel + { + private ExternalBridgeScanner _scanner; + + public event EventHandler MachineSelected; + + public ObservableCollection UsbMachines { get; set; } + + public ObservableCollection TcpMachines { get; set; } + + public ObservableCollection SignalRMachines { get; set; } + + public RelayCommand ConnectToMachineCommand { get; set; } + + private IExternalBridgeClient _selectedMachine; + public IExternalBridgeClient SelectedMachine + { + get { return _selectedMachine; } + set { _selectedMachine = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public MachineConnectionPaneVM() + { + ConnectToMachineCommand = new RelayCommand(ConnectToMachine, () => SelectedMachine != null); + + UsbMachines = new ObservableCollection(); + TcpMachines = new ObservableCollection(); + SignalRMachines = new ObservableCollection(); + + _scanner = new ExternalBridgeScanner(); + _scanner.MachineDiscovered += _scanner_MachineDiscovered; + _scanner.MachineLost += _scanner_MachineLost; + } + + internal void ConnectToMachine() + { + if (SelectedMachine != null) + { + MachineSelected?.Invoke(this, SelectedMachine); + } + } + + private void _scanner_MachineLost(object sender, IExternalBridgeClient machine) + { + InvokeUI(() => + { + if (machine is ExternalBridgeUsbClient) + { + UsbMachines.Remove(machine as ExternalBridgeUsbClient); + } + else if (machine is ExternalBridgeTcpClient) + { + TcpMachines.Remove(machine as ExternalBridgeTcpClient); + } + else if (machine is ExternalBridgeSignalRClient) + { + SignalRMachines.Remove(machine as ExternalBridgeSignalRClient); + } + }); + } + + private void _scanner_MachineDiscovered(object sender, IExternalBridgeClient machine) + { + InvokeUI(() => + { + if (machine is ExternalBridgeUsbClient) + { + UsbMachines.Add(machine as ExternalBridgeUsbClient); + } + else if (machine is ExternalBridgeTcpClient) + { + TcpMachines.Add(machine as ExternalBridgeTcpClient); + } + else if (machine is ExternalBridgeSignalRClient) + { + SignalRMachines.Add(machine as ExternalBridgeSignalRClient); + } + }); + } + + public void Start() + { + TcpMachines.Clear(); + SignalRMachines.Clear(); + SelectedMachine = null; + + _scanner.Start(); + } + + public void Stop() + { + _scanner.Stop(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 825902774..2a242d226 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -84,6 +84,7 @@ Designer + @@ -92,6 +93,10 @@ + + MachineConnectionPane.xaml + + @@ -130,6 +135,10 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -191,6 +200,10 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {4206AC58-3B57-4699-8835-90BF6DB01A61} + Tango.Integration + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging @@ -230,6 +243,15 @@ + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs index 13d2baff0..6623f7aba 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs @@ -1,14 +1,66 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core.Commands; using Tango.FSE.Common; +using Tango.FSE.UI.Panes; +using Tango.Integration.ExternalBridge; namespace Tango.FSE.UI.ViewModels { public class LayoutViewVM : FSEViewModel { + private bool _isConnectionPaneOpened; + public bool IsConnectionPaneOpened + { + get { return _isConnectionPaneOpened; } + set { _isConnectionPaneOpened = value; RaisePropertyChangedAuto(); OnConnectionPaneToggleChanged(); } + } + + private MachineConnectionPaneVM _connectionPaneVM; + public MachineConnectionPaneVM ConnectionPaneVM + { + get { return _connectionPaneVM; } + set { _connectionPaneVM = value; RaisePropertyChangedAuto(); } + } + + private bool _isMenuOpened; + public bool IsMenuOpened + { + get { return _isMenuOpened; } + set { _isMenuOpened = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand ToggleConnectionPaneCommand { get; set; } + + public LayoutViewVM() + { + ToggleConnectionPaneCommand = new RelayCommand(() => IsConnectionPaneOpened = !IsConnectionPaneOpened); + ConnectionPaneVM = new MachineConnectionPaneVM(); + ConnectionPaneVM.MachineSelected += ConnectionPaneVM_MachineSelected; + } + + private void ConnectionPaneVM_MachineSelected(object sender, IExternalBridgeClient machine) + { + IsConnectionPaneOpened = false; + Debug.WriteLine($"Machine selected for connection: {machine.ToString()}"); + } + + private void OnConnectionPaneToggleChanged() + { + if (IsConnectionPaneOpened) + { + ConnectionPaneVM.Start(); + } + else + { + ConnectionPaneVM.Stop(); + } + } + public override void OnApplicationStarted() { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml index 3ea648ff1..4806ab006 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml @@ -4,21 +4,74 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:global="clr-namespace:Tango.FSE.UI" + xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:vm="clr-namespace:Tango.FSE.UI.ViewModels" xmlns:local="clr-namespace:Tango.FSE.UI.Views" + xmlns:panes="clr-namespace:Tango.FSE.UI.Panes" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" - d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LayoutViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LayoutViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:LayoutViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LayoutViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -26,33 +79,134 @@ - - - - + + + + + + + + + + + + + + + + + , + + + + + + + + + + + + + + + ... + + + + + + + + + + - - + + + + - + + + + + - + + + + + + + + + + + + + - + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs index fdafee3b1..2ec734c71 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs @@ -9,24 +9,31 @@ using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; +using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.FSE.UI.Contracts; +using Tango.FSE.UI.ViewModels; namespace Tango.FSE.UI.Views { /// /// Interaction logic for LayoutView.xaml /// - public partial class LayoutView : UserControl + public partial class LayoutView : UserControl, ILayoutView { public static LayoutView Instance { get; set; } + private LayoutViewVM _vm; + public LayoutView() { Instance = this; InitializeComponent(); + Loaded += (_, __) => _vm = DataContext as LayoutViewVM; + gridMask.Visibility = Visibility.Visible; gridMenu.MouseEnter += GridMenu_MouseEnter; gridMenu.MouseLeave += GridMenu_MouseLeave; @@ -34,16 +41,26 @@ namespace Tango.FSE.UI.Views private void GridMenu_MouseLeave(object sender, MouseEventArgs e) { - gridMenu.StartDoubleAnimation(Grid.WidthProperty, TimeSpan.FromSeconds(0.2), 70); - imgBack.StartDoubleAnimation(Image.OpacityProperty, TimeSpan.FromSeconds(0.2), 0.6); - gridMask.StartDoubleAnimation(Image.OpacityProperty, TimeSpan.FromSeconds(0.2), 0); + _vm.IsMenuOpened = false; + + StartPointAnimation(polyTopRight, new Point(70, 0)); + StartPointAnimation(polyBottomRight, new Point(70, 300)); } private void GridMenu_MouseEnter(object sender, MouseEventArgs e) { - gridMenu.StartDoubleAnimation(Grid.WidthProperty, TimeSpan.FromSeconds(0.2), 200); - imgBack.StartDoubleAnimation(Image.OpacityProperty, TimeSpan.FromSeconds(0.2), 0.2); - gridMask.StartDoubleAnimation(Image.OpacityProperty, TimeSpan.FromSeconds(0.2), 1); + _vm.IsMenuOpened = true; + + StartPointAnimation(polyTopRight, new Point(200, 0)); + StartPointAnimation(polyBottomRight, new Point(200, 400)); + } + + private void StartPointAnimation(LineSegment segment, Point to) + { + PointAnimation ani = new PointAnimation(); + ani.Duration = TimeSpan.FromSeconds(0.2); + ani.To = to; + segment.BeginAnimation(LineSegment.PointProperty, ani); } } } 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 cfe0a03a0..f5b3d427f 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("1.1.0.0")] +[assembly: AssemblyVersion("1.1.1.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. --> - + diff --git a/Software/Visual_Studio/Tango.Core/ExtendedObject.cs b/Software/Visual_Studio/Tango.Core/ExtendedObject.cs index acead4157..1875dcd2d 100644 --- a/Software/Visual_Studio/Tango.Core/ExtendedObject.cs +++ b/Software/Visual_Studio/Tango.Core/ExtendedObject.cs @@ -69,7 +69,7 @@ namespace Tango.Core /// Name of the property. protected virtual void RaisePropertyChangedAuto([CallerMemberName] string caller = null) { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(caller)); + RaisePropertyChanged(caller); } /// diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs index ff045a9e5..f158af53f 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs @@ -39,6 +39,10 @@ namespace Tango.Integration.ExternalBridge private HubConnection _connection; private IHubProxy _proxy; + public event EventHandler MachineDiscovered; + + public event EventHandler MachineLost; + private SynchronizedObservableCollection _availableMachines; /// /// Gets the available machines. @@ -97,6 +101,11 @@ namespace Tango.Integration.ExternalBridge AvailableMachines.Remove(machine); } + foreach (var machine in AvailableMachines.OfType().ToList()) + { + AvailableMachines.Remove(machine); + } + _tcpDiscoveryThread = new Thread(TcpDiscoveryThreadMethod); _tcpDiscoveryThread.IsBackground = true; _tcpDiscoveryThread.Start(); @@ -166,7 +175,9 @@ namespace Tango.Integration.ExternalBridge LogManager.Log("Found a new machine via USB " + device.Description); ThreadsHelper.InvokeUINow(() => { - AvailableMachines.Add(new ExternalBridgeUsbClient(device.Port, device.Description, _settings.EmbeddedSerialBaudRate)); + var machine = new ExternalBridgeUsbClient(device.Port, device.Description, _settings.EmbeddedSerialBaudRate); + AvailableMachines.Add(machine); + MachineDiscovered?.Invoke(this, machine); }); } } @@ -209,6 +220,7 @@ namespace Tango.Integration.ExternalBridge { LogManager.Log("Disconnected machine detected via TCP: " + disconnected_machine.SerialNumber); AvailableMachines.Remove(disconnected_machine); + MachineLost?.Invoke(this, disconnected_machine); } continue; @@ -223,6 +235,7 @@ namespace Tango.Integration.ExternalBridge ThreadsHelper.InvokeUINow(() => { AvailableMachines.Insert(1, newMachine); + MachineDiscovered?.Invoke(this, newMachine); }); } } @@ -246,6 +259,7 @@ namespace Tango.Integration.ExternalBridge foreach (var machine in AvailableMachines.OfType().ToList().Where(x => !machines.Exists(y => y.SerialNumber == x.SerialNumber))) { AvailableMachines.Remove(machine); + MachineLost?.Invoke(this, machine); } foreach (var machine in machines.Where(x => !AvailableMachines.OfType().ToList().Exists(y => y.SerialNumber == x.SerialNumber))) @@ -255,6 +269,7 @@ namespace Tango.Integration.ExternalBridge ThreadsHelper.InvokeUINow(() => { AvailableMachines.Insert(1, newMachine); + MachineDiscovered?.Invoke(this, newMachine); }); } } @@ -291,6 +306,7 @@ namespace Tango.Integration.ExternalBridge { LogManager.Log("External bridge client failed or disposed. Removing from available machines..."); AvailableMachines.Remove(sender as IExternalBridgeClient); + MachineLost?.Invoke(this, sender as IExternalBridgeClient); } } } -- cgit v1.3.1