From 87437f979da7baf9a65d98140b361ee85d6966d5 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Fri, 12 Oct 2018 00:37:41 +0300 Subject: Implemented import project tabs in tech board. Implemented auto update of observables LAST_UPDATE via ObservableContext. --- .../Editors/HeaterElementEditor.xaml | 2 +- .../Tango.MachineStudio.Technician.csproj | 10 +++- .../ViewModels/ImportProjectTabViewVM.cs | 25 +++++++++ .../ViewModels/MachineTechViewVM.cs | 64 +++++++++++++++++++--- .../Views/ImportProjectTabView.xaml | 43 +++++++++++++++ .../Views/ImportProjectTabView.xaml.cs | 28 ++++++++++ .../Views/MachineTechView.xaml | 11 ++++ 7 files changed, 172 insertions(+), 11 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/ImportProjectTabViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml index 3ffeaaa77..5c7d361ef 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml @@ -146,7 +146,7 @@ - ITC + TWI + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml.cs new file mode 100644 index 000000000..31b403dc7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.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.MachineStudio.Technician.Views +{ + /// + /// Interaction logic for ImportProjectTabView.xaml + /// + public partial class ImportProjectTabView : UserControl + { + public ImportProjectTabView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml index 3d129a252..0b2cad073 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml @@ -147,6 +147,17 @@ + + + + + + + + + + + -- cgit v1.3.1 From ba650e5a15528a673d3427ca218a7ea639709f8f Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 14 Oct 2018 10:38:04 +0300 Subject: Machine Studio v3.5.46 --- .../Advanced Installer Projects/Machine Studio Installer.aip | 6 +++--- .../MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') 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 5a82b5464..9b758eba3 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip @@ -11,10 +11,10 @@ - + - + @@ -590,7 +590,7 @@ - + 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 4524e0622..0e9c8cc08 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("3.5.45.18238")] +[assembly: AssemblyVersion("3.5.46.18238")] [assembly: ComVisible(false)] \ No newline at end of file -- cgit v1.3.1 From 433b17357847457029775512097eed0a4ade70a6 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 14 Oct 2018 11:22:26 +0300 Subject: Added Heater Set Point Editing in Tech Board. --- .gitignore | 1 + .../Editors/HeaterElementEditor.xaml | 54 ++++++++++++++++++++-- .../Editors/HeaterElementEditor.xaml.cs | 6 +++ .../TechItems/HeaterItem.cs | 20 +++++++- .../Tango.Emulations/Emulators/MachineEmulator.cs | 1 + 5 files changed, 78 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/.gitignore b/.gitignore index db77895f3..4ea289c2d 100644 --- a/.gitignore +++ b/.gitignore @@ -298,3 +298,4 @@ __pycache__/ /.metadata /RemoteSystemsTempFiles /Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer-cache +/Software/Visual_Studio/Build diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml index 5c7d361ef..d550cbccb 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" @@ -76,14 +77,61 @@ - + + + + + SV + + + + + + + + + + + + + + @@ -149,7 +197,7 @@ TWI - + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml.cs new file mode 100644 index 000000000..50f0429a4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.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.MachineStudio.UI.Views +{ + /// + /// Interaction logic for ConnectionLostView.xaml + /// + public partial class ConnectionLostView : UserControl + { + public ConnectionLostView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Transport/ITransporter.cs b/Software/Visual_Studio/Tango.Transport/ITransporter.cs index b7e016d56..61e4c7376 100644 --- a/Software/Visual_Studio/Tango.Transport/ITransporter.cs +++ b/Software/Visual_Studio/Tango.Transport/ITransporter.cs @@ -29,6 +29,11 @@ namespace Tango.Transport /// ITransportEncoder Encoder { get; set; } + /// + /// Gets the last failed state exception/reason. + /// + Exception FailedStateException { get; } + /// /// Sends a request. /// diff --git a/Software/Visual_Studio/Tango.Transport/KeepAliveException.cs b/Software/Visual_Studio/Tango.Transport/KeepAliveException.cs new file mode 100644 index 000000000..35ba716ff --- /dev/null +++ b/Software/Visual_Studio/Tango.Transport/KeepAliveException.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Transport +{ + /// + /// Represents a 'Keep Alive' timeout exception. + /// + /// + public class KeepAliveException : TimeoutException + { + /// + /// Initializes a new instance of the class. + /// + /// The message that describes the error. + public KeepAliveException(String message) : base(message) + { + + } + } +} diff --git a/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj b/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj index 52284f80b..ead68f9cc 100644 --- a/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj +++ b/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj @@ -87,6 +87,7 @@ + @@ -130,7 +131,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index 94dbd54f7..798445cf3 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -100,14 +100,15 @@ namespace Tango.Transport set { _useKeepAlive = value; + RaisePropertyChangedAuto(); - if (UseKeepAlive) + if (_useKeepAlive) { - LogManager.Log("KeepAlive is now working..."); + LogManager.Log("KeepAlive is activated..."); } else { - LogManager.Log("KeepAlive is now shutdown."); + LogManager.Log("KeepAlive is deactivated."); } } } @@ -141,6 +142,12 @@ namespace Tango.Transport /// If multiple messages of the same type are found and buffer exceeds the maximum they will be trimmed. /// public int MaxMessageBufferCount { get; set; } + + /// + /// Gets the last failed state exception/reason. + /// + public Exception FailedStateException { get; private set; } + #endregion #region Virtual Methods @@ -215,6 +222,7 @@ namespace Tango.Transport protected virtual void OnFailed(Exception ex) { Disconnect().Wait(); + FailedStateException = ex; State = TransportComponentState.Failed; LogManager.Log(ex, "Transporter failed."); } @@ -764,12 +772,9 @@ namespace Tango.Transport _pushThread.IsBackground = true; _pushThread.Start(); - if (UseKeepAlive) - { - _keepAliveThread = new Thread(KeepAliveThreadMethod); - _keepAliveThread.IsBackground = true; - _keepAliveThread.Start(); - } + _keepAliveThread = new Thread(KeepAliveThreadMethod); + _keepAliveThread.IsBackground = true; + _keepAliveThread.Start(); } /// @@ -1041,16 +1046,15 @@ namespace Tango.Transport var task = SendRequest(new KeepAliveRequest(), TimeSpan.FromSeconds(5)); task.Wait(); var response = task.Result; - } } - catch (TimeoutException) + catch (Exception ex) when (ex is TimeoutException || ex is AggregateException) { if (State != TransportComponentState.Connected) return; if (UseKeepAlive) { - OnFailed(new TimeoutException("The transporter has not received a KeepAlive response within the given time.")); + OnFailed(new KeepAliveException("The transporter has not received a KeepAlive response within the given time.")); return; } } @@ -1064,10 +1068,6 @@ namespace Tango.Transport return; } } - - if (State != TransportComponentState.Connected) return; - - if (State != TransportComponentState.Connected) return; } } -- cgit v1.3.1 From 27ef734e78b8b11f06cf4f01e68a8f9c9efb75d1 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 14 Oct 2018 12:49:20 +0300 Subject: Machine Studio v3.5.47 --- .../Visual_Studio/Build/Shortcuts/Machine Studio.lnk | Bin 1516 -> 1532 bytes .../Tango.MachineStudio.UI/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk index 41c6efe80..3cdd0db6d 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk differ 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 0e9c8cc08..631804544 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("3.5.46.18238")] +[assembly: AssemblyVersion("3.5.47.18238")] [assembly: ComVisible(false)] \ No newline at end of file -- cgit v1.3.1