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/App.xaml.cs10
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs30
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs11
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml15
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml2
8 files changed, 33 insertions, 41 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
index e51247337..cb17a5a83 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
@@ -154,16 +154,6 @@ namespace Tango.MachineStudio.UI
return;
}
- try
- {
- var eventLogger = TangoIOC.Default.GetInstance<IEventLogger>();
- if (eventLogger != null)
- {
- eventLogger.Log(e.Exception, "Application Crashed!");
- }
- }
- catch { }
-
Application.Current.Dispatcher.Invoke(() =>
{
WorkItem bug = null;
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml
index 7d888d784..fc777ac7f 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml
@@ -8,7 +8,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
mc:Ignorable="d"
- Title="Machine Studio" MinHeight="220" MaxHeight="600" SizeToContent="Height" Width="570" Opacity="0" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent" ShowInTaskbar="False" FontFamily="{StaticResource flexo}" >
+ Title="Machine Studio" MinHeight="220" MaxHeight="600" SizeToContent="Height" Width="570" Opacity="0" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent" ShowInTaskbar="False" FontFamily="{StaticResource flexo}" Foreground="{StaticResource Dialog.Foreground}" >
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></BooleanToVisibilityConverter>
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 2c3c9ccb9..ed5f8b394 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -42,6 +42,7 @@ namespace Tango.MachineStudio.UI.StudioApplication
private INotificationProvider _notification;
private List<Window> _openedWindows;
private List<IStudioViewModel> _notified_view_models;
+ private bool _isDialogShown;
/// <summary>
/// Occurs when the application is ready.
@@ -139,19 +140,28 @@ namespace Tango.MachineStudio.UI.StudioApplication
{
String failed_reason = (sender as IMachineOperator).FailedStateException.Message;
- ConnectionLostViewVM vm = new ConnectionLostViewVM()
+ if (!_isDialogShown)
{
- Exception = failed_reason,
- AutoReconnect = reconnect,
- };
+ _isDialogShown = true;
- InvokeUI(() =>
- {
- _notification.ShowModalDialog<ConnectionLostViewVM, ConnectionLostView>(vm, (x) =>
+ ConnectionLostViewVM vm = new ConnectionLostViewVM()
+ {
+ Exception = failed_reason,
+ AutoReconnect = reconnect,
+ };
+
+ InvokeUI(() =>
{
- ReconnectionRequired?.Invoke(this, new EventArgs());
- }, () => { });
- });
+ _notification.ShowModalDialog<ConnectionLostViewVM, ConnectionLostView>(vm, (x) =>
+ {
+ _isDialogShown = false;
+ ReconnectionRequired?.Invoke(this, new EventArgs());
+ }, () =>
+ {
+ _isDialogShown = false;
+ });
+ });
+ }
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
index c00caf72a..97ff894df 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
@@ -273,8 +273,6 @@ namespace Tango.MachineStudio.UI.ViewModels
_settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null;
_settings.Save();
- _eventLogger.Log("User logged in.");
-
EnableSlotSelection = false;
IsLogging = false;
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs
index 7584617ed..9bee35697 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs
@@ -41,7 +41,7 @@ namespace Tango.MachineStudio.UI.ViewModels
/// </summary>
public MachineLoginViewVM()
{
- Intent = ExternalBridgeLoginIntent.FullControl;
+ Intent = ExternalBridgeLoginIntent.Diagnostics;
LoginCommand = new RelayCommand<string>(Login);
CancelCommand = new RelayCommand(Cancel);
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
index 2a00386dc..4d37321dd 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
@@ -410,13 +410,11 @@ namespace Tango.MachineStudio.UI.ViewModels
String serial = ApplicationManager.ConnectedMachine.SerialNumber;
await ApplicationManager.ConnectedMachine.Disconnect();
ApplicationManager.SetConnectedMachine(null);
- _eventLogger.Log("Disconnected from machine " + serial);
PostMessage(new MachineConnectionChangedMessage() { Machine = null });
}
catch (Exception ex)
{
- _eventLogger.Log(ex, "Error disconnecting from machine.");
LogManager.Log(ex, "Could not disconnect from machine.");
}
finally
@@ -497,7 +495,6 @@ namespace Tango.MachineStudio.UI.ViewModels
ApplicationManager.SetConnectedMachine(x.SelectedMachine);
PostMessage(new MachineConnectionChangedMessage() { Machine = x.SelectedMachine });
- _eventLogger.Log(String.Format("Successfully connected to machine {0} via USB", x.SelectedMachine.SerialNumber));
_settings.LastVirtualMachineSerialNumber = vm.SelectedMachine.SerialNumber;
_settings.Save();
@@ -510,11 +507,6 @@ namespace Tango.MachineStudio.UI.ViewModels
{
LogManager.Log(ex);
- if (x.SelectedMachine != null)
- {
- _eventLogger.Log(ex, "Error connecting to machine " + x.SelectedMachine.SerialNumber);
- }
-
_notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message);
}
@@ -615,7 +607,6 @@ namespace Tango.MachineStudio.UI.ViewModels
machine.SessionClosed -= Machine_SessionClosed;
machine.SessionClosed += Machine_SessionClosed;
PostMessage(new MachineConnectionChangedMessage() { Machine = machine });
- _eventLogger.Log(String.Format("Successfully connected to machine {0} via TCP", machine.SerialNumber));
//if (x.UploadHardwareConfiguration)
//{
@@ -626,13 +617,11 @@ namespace Tango.MachineStudio.UI.ViewModels
catch (ResponseErrorException ex)
{
LogManager.Log(ex);
- _eventLogger.Log(ex, "Error connecting to machine " + machine.SerialNumber);
_notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Container.ErrorMessage);
}
catch (Exception ex)
{
LogManager.Log(ex);
- _eventLogger.Log(ex, "Error connecting to machine " + machine.SerialNumber);
_notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message);
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
index 15f2a30e0..ea6e93412 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
@@ -47,13 +47,18 @@
<materialDesign:DrawerHost IsLeftDrawerOpen="{Binding Source={x:Reference MenuToggleButton}, Path=IsChecked}">
<materialDesign:DrawerHost.LeftDrawerContent>
- <DockPanel LastChildFill="False" TextElement.Foreground="{StaticResource MainWindow.Foreground}" >
- <StackPanel MinWidth="300" DockPanel.Dock="Top">
+ <DockPanel LastChildFill="False" >
+ <DockPanel.Style>
+ <Style TargetType="{x:Type DockPanel}">
+ <Setter Property="TextElement.Foreground" Value="{StaticResource MainWindow.Foreground}"/>
+ </Style>
+ </DockPanel.Style>
+ <StackPanel MinWidth="300" DockPanel.Dock="Top" >
<Grid>
- <Button Foreground="{StaticResource BlackBrush}" Style="{StaticResource MaterialDesignFlatButton}" Command="{Binding HomeCommand}" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Margin="5 10 0 0" Width="200" Height="40" Padding="5 8 8 8">
+ <Button Style="{StaticResource MaterialDesignFlatButton}" Command="{Binding HomeCommand}" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Margin="5 10 0 0" Width="200" Height="40" Padding="5 8 8 8" Foreground="{StaticResource BlackBrush}">
<StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon VerticalAlignment="Center" Kind="Home" Width="32" Height="32"></materialDesign:PackIcon>
- <TextBlock FontSize="16" VerticalAlignment="Center" Margin="10 0 0 0">Home</TextBlock>
+ <materialDesign:PackIcon VerticalAlignment="Center" Kind="Home" Width="32" Height="32" Foreground="{StaticResource HomePageForeground}"></materialDesign:PackIcon>
+ <TextBlock FontSize="16" VerticalAlignment="Center" Margin="10 0 0 0" Foreground="{StaticResource HomePageForeground}">Home</TextBlock>
</StackPanel>
</Button>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml
index 6b80fad43..01f08491a 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Windows"
mc:Ignorable="d"
- WindowStyle="None" ResizeMode="NoResize" Topmost="True" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Width="800" Height="600" Background="Transparent" d:DataContext="{d:DesignInstance Type=local:ExceptionWindow, IsDesignTimeCreatable=False}" FontFamily="{StaticResource flexo}" >
+ WindowStyle="None" ResizeMode="NoResize" Topmost="True" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Width="800" Height="600" Background="Transparent" d:DataContext="{d:DesignInstance Type=local:ExceptionWindow, IsDesignTimeCreatable=False}" FontFamily="{StaticResource flexo}" Foreground="{StaticResource Dialog.Foreground}">
<Grid>
<Border BorderThickness="1" BorderBrush="DodgerBlue" Background="{StaticResource Dialog.Background}" Margin="10" CornerRadius="10">
<Border.Effect>