diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-15 13:12:20 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-15 13:12:20 +0200 |
| commit | 13c57f7ccabadd3ed75ffaef195d35c15c2a8c68 (patch) | |
| tree | 938bd6dd844cf2645510aa3d42f3bfbe24e52a7e /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | d1859415972bb991cba6639482c1cd2a9e19e8d8 (diff) | |
| parent | 957ca86b8e899eb488626c456d9c37dd4545bd80 (diff) | |
| download | Tango-13c57f7ccabadd3ed75ffaef195d35c15c2a8c68.tar.gz Tango-13c57f7ccabadd3ed75ffaef195d35c15c2a8c68.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
6 files changed, 35 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 345503ed3..161a8cca7 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -36,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) { 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..25843d1c3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Windows; using Tango.Core.DI; using Tango.Integration.ExternalBridge; @@ -71,7 +72,16 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Unregister<MachineStudioWebClient>(); - 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>(); @@ -84,7 +94,7 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Register<ISpeechProvider, DefaultSpeechProvider>(); TangoIOC.Default.Register<IFirmwareUpgrader, DefaultFirmwareUpgrader>(); 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; |
