aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs23
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj10
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs14
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml58
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml.cs28
7 files changed, 134 insertions, 5 deletions
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..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.45.18238")]
+[assembly: AssemblyVersion("3.5.47.18238")]
[assembly: ComVisible(false)] \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
index 8eff9ea4e..e6c687b92 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -22,6 +22,9 @@ using Tango.Core.DI;
using Tango.BL.Entities;
using Tango.BL;
using Tango.MachineStudio.UI.ViewModels;
+using Tango.MachineStudio.Common.Notifications;
+using Tango.MachineStudio.UI.Views;
+using Tango.Integration.Operation;
namespace Tango.MachineStudio.UI.StudioApplication
{
@@ -34,16 +37,18 @@ namespace Tango.MachineStudio.UI.StudioApplication
{
private INavigationManager _navigationManager;
private IStudioModuleLoader _moduleLoader;
+ private INotificationProvider _notification;
private List<Window> _openedWindows;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultStudioApplicationManager" /> class.
/// </summary>
/// <param name="navigationManager">The navigation manager.</param>
- public DefaultStudioApplicationManager(INavigationManager navigationManager, IStudioModuleLoader moduleLoader)
+ public DefaultStudioApplicationManager(INavigationManager navigationManager, IStudioModuleLoader moduleLoader, INotificationProvider notification)
{
_moduleLoader = moduleLoader;
_navigationManager = navigationManager;
+ _notification = notification;
_openedWindows = new List<Window>();
Application.Current.MainWindow.ContentRendered += (_, __) =>
@@ -109,8 +114,22 @@ namespace Tango.MachineStudio.UI.StudioApplication
if (e == Transport.TransportComponentState.Disconnected || e == Transport.TransportComponentState.Failed)
{
ConnectedMachine = null;
- }
+ if (e == Transport.TransportComponentState.Failed)
+ {
+ String failed_reason = (sender as IMachineOperator).FailedStateException.Message;
+
+ ConnectionLostViewVM vm = new ConnectionLostViewVM()
+ {
+ Exception = failed_reason
+ };
+
+ InvokeUI(() =>
+ {
+ _notification.ShowModalDialog<ConnectionLostViewVM, ConnectionLostView>(vm, (x) => { }, () => { });
+ });
+ }
+ }
}
/// <summary>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
index 003a7f194..39f748ceb 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
@@ -171,6 +171,7 @@
<Compile Include="Threading\DefaultDispatcherProvider.cs" />
<Compile Include="ViewModels\AboutViewVM.cs" />
<Compile Include="ViewModels\ConnectedMachineViewVM.cs" />
+ <Compile Include="ViewModels\ConnectionLostViewVM.cs" />
<Compile Include="ViewModels\LoadingViewVM.cs" />
<Compile Include="ViewModels\LoginViewVM.cs" />
<Compile Include="ViewModels\MachineConnectionViewVM.cs" />
@@ -189,6 +190,9 @@
<Compile Include="Views\ConnectedMachineView.xaml.cs">
<DependentUpon>ConnectedMachineView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\ConnectionLostView.xaml.cs">
+ <DependentUpon>ConnectionLostView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\LoadingView.xaml.cs">
<DependentUpon>LoadingView.xaml</DependentUpon>
</Compile>
@@ -269,6 +273,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Views\ConnectionLostView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Views\LoadingView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -583,7 +591,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(Ta
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_UpdateFileVersion="True" BuildVersion_DetectChanges="True" BuildVersion_UseGlobalSettings="False" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
new file mode 100644
index 000000000..f1f4f69c0
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.SharedUI;
+
+namespace Tango.MachineStudio.UI.ViewModels
+{
+ public class ConnectionLostViewVM : DialogViewVM
+ {
+ public String Exception { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml
index 4e3de9e60..b1502f374 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml
@@ -12,7 +12,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="440" Background="White" DataContext="{Binding ConnectedMachineViewVM, Source={StaticResource Locator}}">
+ d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="480" Background="White" DataContext="{Binding ConnectedMachineViewVM, Source={StaticResource Locator}}">
<UserControl.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></converters:BooleanToVisibilityConverter>
@@ -138,6 +138,8 @@
<ToggleButton IsChecked="{Binding EnableDiagnostics}" HorizontalAlignment="Left"></ToggleButton>
<TextBlock FontWeight="SemiBold" Text="Enable Embedded Debug Logs:" />
<ToggleButton IsChecked="{Binding EnableEmbeddedDebugging}" HorizontalAlignment="Left"></ToggleButton>
+ <TextBlock FontWeight="SemiBold" Text="Enable KeepAlive:" />
+ <ToggleButton IsChecked="{Binding UseKeepAlive}" HorizontalAlignment="Left"></ToggleButton>
<TextBlock FontWeight="SemiBold" Text="Enable Events:" />
<ToggleButton IsChecked="{Binding EnableEventsNotification}" HorizontalAlignment="Left"></ToggleButton>
</controls:TableGrid>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml
new file mode 100644
index 000000000..bac704fe0
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml
@@ -0,0 +1,58 @@
+<UserControl x:Class="Tango.MachineStudio.UI.Views.ConnectionLostView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ 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:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
+ mc:Ignorable="d"
+ Width="559" Height="266" Background="White" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}">
+ <Grid>
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="80"/>
+ <RowDefinition Height="1*"/>
+ </Grid.RowDefinitions>
+
+ <Grid>
+ <StackPanel Orientation="Horizontal" Margin="10">
+ <Grid>
+ <Image Source="/Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant"></Image>
+
+ <Ellipse Fill="#FF2626" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="30" Height="30" Margin="0 0 -5 -5">
+ </Ellipse>
+ <materialDesign:PackIcon Foreground="White" Kind="LanDisconnect" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="20" Height="20" Margin="0 0 0 0" />
+ </Grid>
+ <TextBlock Text="Connection Lost" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20"></TextBlock>
+ </StackPanel>
+ </Grid>
+
+ <Grid Grid.Row="1" Margin="10 0 10 10">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="1*"/>
+ <RowDefinition Height="50"/>
+ </Grid.RowDefinitions>
+
+ <Grid>
+ <StackPanel Margin="0 10 0 0" >
+ <TextBlock TextWrapping="Wrap">
+ <Run>The machine connection has entered an invalid or inactive state and will be regarded as.</Run>
+ <LineBreak/>
+ <Run>disconnected.</Run>
+ </TextBlock>
+
+ <TextBlock Margin="0 20 0 0" FontWeight="SemiBold">Reason:</TextBlock>
+ <TextBlock Foreground="Gray" Margin="0 2 0 0" Text="{Binding Exception}" Height="75" TextWrapping="Wrap" TextTrimming="CharacterEllipsis">
+
+ </TextBlock>
+ </StackPanel>
+ </Grid>
+
+ <Grid Grid.Row="1">
+ <Button HorizontalAlignment="Right" Width="140" Command="{Binding OKCommand}">CLOSE</Button>
+ </Grid>
+ </Grid>
+ </Grid>
+ </Grid>
+</UserControl>
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
+{
+ /// <summary>
+ /// Interaction logic for ConnectionLostView.xaml
+ /// </summary>
+ public partial class ConnectionLostView : UserControl
+ {
+ public ConnectionLostView()
+ {
+ InitializeComponent();
+ }
+ }
+}