aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-18 13:27:02 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-18 13:27:02 +0200
commit41129873d38034c5679eeaf46f48e4f67fd38ba2 (patch)
tree94109a9602e91bcf7f114e3491bc8018e60bef4c /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parent70e3f2699a500666d1ca4e4d5db2dbaafb339e80 (diff)
parenta61a911d1ebde107ba7bf210af7e753e692d93e2 (diff)
downloadTango-41129873d38034c5679eeaf46f48e4f67fd38ba2.tar.gz
Tango-41129873d38034c5679eeaf46f48e4f67fd38ba2.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs5
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs5
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj11
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs17
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs6
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs5
6 files changed, 41 insertions, 8 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 94f98feb2..161a8cca7 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
@@ -24,6 +24,7 @@ using Tango.MachineStudio.Common;
using Tango.Core;
using Tango.BL;
using Tango.Integration.Operation;
+using System.Net;
namespace Tango.MachineStudio.UI
{
@@ -35,7 +36,7 @@ namespace Tango.MachineStudio.UI
private WpfGlobalExceptionTrapper exceptionTrapper;
private LogManager LogManager = LogManager.Default;
- public static String[] StartupArgs { get; set; }
+ public static String[] StartupArgs { get; set; } = Environment.GetCommandLineArgs().Skip(1).ToArray();
protected override void OnStartup(StartupEventArgs e)
{
@@ -98,6 +99,8 @@ namespace Tango.MachineStudio.UI
exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed;
ApplyEFCacheSettings();
+
+ WebRequest.DefaultWebProxy = null;
}
private void ApplyEFCacheSettings()
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
index 3cc5e8b49..c992d0768 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -96,7 +96,10 @@ namespace Tango.MachineStudio.UI.Authentication
var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
- _client.Environment = settings.DeploymentSlot;
+ if (!App.StartupArgs.Contains("-webDebug"))
+ {
+ _client.Environment = settings.DeploymentSlot;
+ }
var appVersion = AssemblyHelper.GetCurrentAssemblyVersion().ToString();
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 991eb9da6..635d372c2 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
@@ -448,6 +448,10 @@
<Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project>
<Name>Tango.SharedUI</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\Tango.SQLExaminer\Tango.SQLExaminer.csproj">
+ <Project>{e1e66ed9-597d-45fa-8048-de90a6930484}</Project>
+ <Name>Tango.SQLExaminer</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.TFS\Tango.TFS.csproj">
<Project>{998f8471-dc1b-41b6-9d96-354e1b4e7a32}</Project>
<Name>Tango.TFS</Name>
@@ -500,6 +504,10 @@
<Project>{d0186ac0-0fcf-4d3b-9619-54812b6e524b}</Project>
<Name>Tango.MachineStudio.RML</Name>
</ProjectReference>
+ <ProjectReference Include="..\Modules\Tango.MachineStudio.Sites\Tango.MachineStudio.Sites.csproj">
+ <Project>{18a27902-9881-4556-8163-f6df2236a14d}</Project>
+ <Name>Tango.MachineStudio.Sites</Name>
+ </ProjectReference>
<ProjectReference Include="..\Modules\Tango.MachineStudio.Statistics\Tango.MachineStudio.Statistics.csproj">
<Project>{8a65ad6a-a9b4-48c0-9301-4b7434b712f8}</Project>
<Name>Tango.MachineStudio.Statistics</Name>
@@ -650,7 +658,8 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)"
copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(TargetDir)"
if $(ConfigurationName) == Release del *.xml
-if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)ProtoCompilers\"</PostBuildEvent>
+if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)ProtoCompilers\"
+if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)Roslyn\"</PostBuildEvent>
</PropertyGroup>
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
index 3fffd69fd..a61f14746 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
@@ -1,5 +1,7 @@
using System;
+using System.Linq;
using System.Windows;
+using Tango.BL.ActionLogs;
using Tango.Core.DI;
using Tango.Integration.ExternalBridge;
using Tango.Logging;
@@ -69,9 +71,19 @@ namespace Tango.MachineStudio.UI
TangoIOC.Default.Unregister<IDispatcherProvider>();
TangoIOC.Default.Unregister<IFirmwareUpgrader>();
TangoIOC.Default.Unregister<MachineStudioWebClient>();
+ TangoIOC.Default.Unregister<IActionLogManager>();
- TangoIOC.Default.Register<MachineStudioWebClient, MachineStudioWebClient>(new MachineStudioWebClient());
+
+ if (App.StartupArgs.Contains("-webDebug"))
+ {
+ TangoIOC.Default.Register<MachineStudioWebClient, MachineStudioWebClient>(new MachineStudioWebClient("http://localhost:1111", null));
+ }
+ else
+ {
+ TangoIOC.Default.Register<MachineStudioWebClient, MachineStudioWebClient>(new MachineStudioWebClient());
+ }
+
TangoIOC.Default.Register<IDispatcherProvider, DefaultDispatcherProvider>(new DefaultDispatcherProvider(Application.Current.Dispatcher));
TangoIOC.Default.Register<INotificationProvider, DefaultNotificationProvider>();
TangoIOC.Default.Register<IAuthenticationProvider, DefaultAuthenticationProvider>();
@@ -83,8 +95,9 @@ namespace Tango.MachineStudio.UI
TangoIOC.Default.Register<IEventLogger, DefaultEventLogger>();
TangoIOC.Default.Register<ISpeechProvider, DefaultSpeechProvider>();
TangoIOC.Default.Register<IFirmwareUpgrader, DefaultFirmwareUpgrader>();
+ TangoIOC.Default.Register<IActionLogManager, DefaultActionLogManager>(new DefaultActionLogManager() { ThrowExceptions = false });
TangoIOC.Default.Register<TeamFoundationServiceExtendedClient>(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa"));
-
+
TangoIOC.Default.Register<MainViewVM>();
TangoIOC.Default.Register<LoadingViewVM>();
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs
index 16f6938a0..40479895d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs
@@ -95,11 +95,11 @@ namespace Tango.MachineStudio.UI.ViewModels
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
- var jobs = await db.Jobs.Include(x => x.JobRuns).Where(x => x.MachineGuid == ApplicationManager.Machine.Guid).ToListAsync();
+ var jobRuns = await db.JobRuns.Where(x => x.MachineGuid == ApplicationManager.Machine.Guid).ToListAsync();
- TotalMachineWorkTime = TimeSpan.FromHours(jobs.SelectMany(x => x.JobRuns).Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToString(@"hh\:mm\:ss");
+ TotalMachineWorkTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToString(@"hh\:mm\:ss");
- int meters = (int)jobs.SelectMany(x => x.JobRuns).Select(x => x.EndPosition).Sum();
+ int meters = (int)jobRuns.Select(x => x.EndPosition).Sum();
TotalMachineMeters = $"{meters.ToString("N0")} meters";
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs
index e45c29f73..365c1db49 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs
@@ -207,6 +207,11 @@ namespace Tango.MachineStudio.UI.ViewModels
}
}
+ protected override bool CanOK()
+ {
+ return base.CanOK() && CanClose;
+ }
+
private async void AbortUpgrade()
{
CanClose = true;