aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-02-26 13:24:31 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-02-26 13:24:31 +0200
commit6b223bcd7f7e1e0b76a33ecd00c17d7b846c91a9 (patch)
tree832169bbbb3fb93063230b8c767f6f6ac777f3ca /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
parenta64cfe8b7dec8417a3d380b55f4ae79c5459f49d (diff)
parent5cedf7cc7de176c6b3ecdcef9b7ad1382400e880 (diff)
downloadTango-6b223bcd7f7e1e0b76a33ecd00c17d7b846c91a9.tar.gz
Tango-6b223bcd7f7e1e0b76a33ecd00c17d7b846c91a9.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs20
1 files changed, 6 insertions, 14 deletions
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..46491c823 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);
}
@@ -748,7 +737,7 @@ namespace Tango.MachineStudio.UI.ViewModels
/// Opens the module in a new window.
/// </summary>
/// <param name="module">The module.</param>
- private async void OpenModuleInWindow(IStudioModule module, Rect? bounds = null, WindowState? state = null)
+ private async void OpenModuleInWindow(IStudioModule module, Rect? bounds = null, WindowState? state = null, bool setHomeModule = true)
{
if (module == null) return;
@@ -756,7 +745,10 @@ namespace Tango.MachineStudio.UI.ViewModels
{
module.InNewWindow = true;
- StartModule(null);
+ if (setHomeModule)
+ {
+ StartModule(null);
+ }
await Task.Delay(1000);
@@ -954,7 +946,7 @@ namespace Tango.MachineStudio.UI.ViewModels
if (module != null && !module.InNewWindow)
{
- OpenModuleInWindow(module, item.Bounds, item.State);
+ OpenModuleInWindow(module, item.Bounds, item.State, false);
}
}