aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
committerMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
commit00a491d93733d4625ad329b2ba8237f445364b3f (patch)
tree4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/PPC/Tango.PPC.UI
parent124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff)
downloadTango-00a491d9.tar.gz
Tango-00a491d9.zip
merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/App.config7
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs102
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItem.cs31
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml30
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItem.cs31
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItemView.xaml30
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItemView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs18
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs44
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/MachineStatusControl.xaml49
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/MachineStatusControl.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs15
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml62
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml32
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs34
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs128
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml52
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs82
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml225
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs245
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml170
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs287
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml21
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error.pngbin810 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting-ready.pngbin586 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service.pngbin844 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutting-down.pngbin1190 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/backup.pngbin1834 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/1.jpgbin57998 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/2.jpgbin58057 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/3.jpgbin59306 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/4.jpgbin55777 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/1.JPGbin50823 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/2.JPGbin36100 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/3.JPGbin52652 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/4.JPGbin62531 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/1.jpgbin50823 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/2.jpgbin36100 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/3.jpgbin52652 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/4.jpgbin62531 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/5.jpgbin123123 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/GuidingUnits/1.JPGbin47345 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpgbin70545 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.JPGbin50823 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.JPGbin36100 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.JPGbin85970 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.JPGbin123123 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.JPGbin67829 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpgbin229536 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpgbin94899 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/machine_full.jpgbin67243 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/1.jpgbin39336 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/2.jpgbin36100 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/3.jpgbin45420 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/4.jpgbin46782 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/5.jpgbin49932 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/backup-big.pngbin3044 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/backup-restore.pngbin89496 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/firmware.pngbin3956 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/loading_anim.gifbin798338 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-image.pngbin138220 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power_off.gifbin397334 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power_off_2.gifbin32040 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/powerup.gifbin380322 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/restore.pngbin3252 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading.gifbin4092741 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading.pngbin7209 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading_preview.pngbin529370 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/update_available.pngbin2856 -> 0 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/InternalModule.cs84
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs21
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultStudioModuleLoader.cs (renamed from Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs)8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs382
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs128
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs52
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml30
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml.cs30
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs252
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/RemoteActions/DefaultRemoteActionsService.cs54
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj223
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs65
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs84
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs52
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/InternalModuleViewVM.cs17
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs250
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs65
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs536
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs154
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/PowerOffViewVM.cs134
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingViewVM.cs27
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/EmergencyView.xaml16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml19
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/InternalModuleView.xaml18
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/InternalModuleView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml131
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml11
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml58
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml20
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml40
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml52
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/firmware_package.tfpbin270787 -> 0 bytes
121 files changed, 396 insertions, 4688 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
index 5272eb35d..77255b814 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
@@ -8,13 +8,8 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
<runtime>
- <legacyCorruptedStateExceptionsPolicy enabled="true" />
- <legacyUnhandledExceptionPolicy enabled="1" />
-
+ <legacyCorruptedStateExceptionsPolicy enabled="true|false"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <!--Required for cefCharp-->
- <probing privatePath="x86"/>
-
<!--<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs
index e478dba77..0bd9f9d1d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs
@@ -5,20 +5,15 @@ using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
-using System.Net;
-using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using Tango.BL;
using Tango.Core;
using Tango.Core.DI;
using Tango.Core.Helpers;
-using Tango.Insights;
-using Tango.Integration.Operation;
using Tango.Logging;
using Tango.PPC.Common;
using Tango.PPC.Common.EventLogging;
-using Tango.PPC.Common.Helpers;
using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.WatchDog;
using Tango.Settings;
@@ -30,7 +25,7 @@ namespace Tango.PPC.UI
/// </summary>
public partial class App : Application
{
- public static WpfGlobalExceptionTrapper ExceptionTrapper;
+ private WpfGlobalExceptionTrapper exceptionTrapper;
public static String[] StartupArgs { get; private set; }
private LogManager LogManager = LogManager.Default;
@@ -41,12 +36,6 @@ namespace Tango.PPC.UI
/// <param name="e">A <see cref="T:System.Windows.StartupEventArgs" /> that contains the event data.</param>
protected override void OnStartup(StartupEventArgs e)
{
- //throw new InvalidOperationException("This is a fake exception!!!");
-
- //removed due to possibly causing this issue:
- //https://stackoverflow.com/questions/41543956/how-to-debug-not-enough-storage-is-available-to-process-this-command
- //ThreadPool.SetMaxThreads(1000, 1000);
-
//If no debugger is attached and the argument -debug was passed launch the debugger.
if (e.Args.Contains("-debug") && !Debugger.IsAttached)
{
@@ -56,34 +45,18 @@ namespace Tango.PPC.UI
StartupArgs = e.Args;
//LogManager.RegisterLogger(new ConsoleLogger("Tango PPC Debug"));
- LogManager.RegisterLogger(new FileLogger()
- {
- EnableAutoLogRemoval = true,
- EnableMaxFileSizeLimit = true,
- AutoLogRemovalPeriod = TimeSpan.FromDays(30)
- });
-
-#if DEBUG
+ LogManager.RegisterLogger(new FileLogger());
LogManager.RegisterLogger(new VSOutputLogger());
-#endif
- //Configure machine operator logger.
- var operatorLogger = MachineOperator.EmbeddedLogManager.RegisteredLoggers.SingleOrDefault(x => x is FileLogger) as FileLogger;
- if (operatorLogger != null)
- {
- operatorLogger.EnableAutoLogRemoval = true;
- operatorLogger.EnableMaxFileSizeLimit = true;
- operatorLogger.AutoLogRemovalPeriod = TimeSpan.FromDays(30);
- }
-
- LogsHelper.SetLogSafe(LogManager.CreateLogSafe());
- LogManager.Log($"Application Started... Version: '{AssemblyHelper.GetCurrentAssemblyVersion()}'.");
+ LogManager.Log("Application Started...");
base.OnStartup(e);
- ExceptionTrapper = new WpfGlobalExceptionTrapper();
- ExceptionTrapper.Initialize(this);
- ExceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed;
+ exceptionTrapper = new WpfGlobalExceptionTrapper();
+ exceptionTrapper.Initialize(this);
+ exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed;
+
+ LogManager.Categories.Clear();
CoreSettings.DefaultDataSource = new DataSource()
{
@@ -92,33 +65,25 @@ namespace Tango.PPC.UI
IntegratedSecurity = true,
};
- WebRequest.DefaultWebProxy = null;
+ SettingsManager.Default.GetOrCreate<CoreSettings>();
- GetLastApplicationCrashFromWindows();
- }
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
- #region Global Exception Trapping
-
- private async void GetLastApplicationCrashFromWindows()
- {
- var logItem = await ExceptionTrapper.GetLastApplicationCrashEventLog(60);
- if (logItem != null)
+ if (settings.LoggingCategories.Count == 0)
{
- LogManager.Log(logItem);
-
- try
- {
- InsightsManager.Default.InsertApplicationException(new InsightsApplicationException()
- {
- Time = DateTime.UtcNow,
- Exception = logItem.Message,
- IsApplicationCrash = true
- });
- }
- catch { }
+ settings.LoggingCategories.Add(LogCategory.Critical);
+ settings.LoggingCategories.Add(LogCategory.Error);
+ settings.LoggingCategories.Add(LogCategory.Info);
+ settings.LoggingCategories.Add(LogCategory.Warning);
}
+
+ settings.Save();
+
+ LogManager.Categories.AddRange(settings.LoggingCategories);
}
+ #region Global Exception Trapping
+
/// <summary>
/// Handles the ApplicationCrashed event of the ExceptionTrapper.
/// </summary>
@@ -126,19 +91,7 @@ namespace Tango.PPC.UI
/// <param name="e">The <see cref="ApplicationCrashedEventArgs"/> instance containing the event data.</param>
private void ExceptionTrapper_ApplicationCrashed(object sender, ApplicationCrashedEventArgs e)
{
- List<String> ignoredExceptions = new List<string>()
- {
- "FocusVisualStyle",
- "ThreadAbortException",
- "A Task's exception(s) were not observed"
- };
-
- String exceptionString = e.Exception.ToStringSafe();
-
- if (ignoredExceptions.Exists(x => exceptionString.Contains(x)))
- {
- return;
- }
+ e.TryRecover = true;
try
{
@@ -147,17 +100,6 @@ namespace Tango.PPC.UI
try
{
- InsightsManager.Default.InsertApplicationException(new InsightsApplicationException()
- {
- Time = DateTime.UtcNow,
- Exception = e.Exception.ToString()
- });
- }
- catch
- { }
-
- try
- {
if (Application.Current == null)
{
new Application { ShutdownMode = ShutdownMode.OnExplicitShutdown };
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItem.cs
deleted file mode 100644
index c2bdc3926..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItem.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.PMR.Power;
-using Tango.PPC.Common.Notifications;
-
-namespace Tango.PPC.UI.AppBarItems
-{
- public class PowerOffAppBarItem : AppBarItem
- {
- private StartPowerDownResponse _status;
- public StartPowerDownResponse Status
- {
- get { return _status; }
- set { _status = value; RaisePropertyChangedAuto(); }
- }
-
- /// <summary>
- /// Gets or sets the view type.
- /// </summary>
- public override Type ViewType
- {
- get
- {
- return typeof(PowerOffAppBarItemView);
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml
deleted file mode 100644
index 9a9f8e912..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml
+++ /dev/null
@@ -1,30 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.AppBarItems.PowerOffAppBarItemView"
- 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:local="clr-namespace:Tango.PPC.UI.AppBarItems"
- mc:Ignorable="d"
- d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:PowerOffAppBarItem, IsDesignTimeCreatable=False}">
- <Grid>
- <touch:TouchButton Style="{StaticResource TangoFlatButton}" Command="{Binding PressedCommand}" Padding="0">
- <StackPanel VerticalAlignment="Center">
- <TextBlock Text="{Binding Status.Message}" FontSize="{StaticResource TangoDefaultFontSize}" TextTrimming="CharacterEllipsis"></TextBlock>
- <ProgressBar Maximum="100" Value="{Binding Status.ProgressPercentage}" Margin="0 10 0 5" Background="{StaticResource TangoGrayBrush}" Height="5" Foreground="{StaticResource TangoPrimaryAccentBrush}" BorderThickness="0" />
- <DockPanel LastChildFill="False">
- <TextBlock DockPanel.Dock="Left">
-
- <Run Text="{Binding Status.ProgressPercentage}"></Run><Run>%</Run>
- <Run>Completed</Run>
- </TextBlock>
-
- <!--<TextBlock DockPanel.Dock="Right">
- <Run Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToTwoDigitsTimeConverter},FallbackValue=5}"></Run>
- <Run FontSize="16" Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToLabelConverter},FallbackValue=min}"></Run>
- </TextBlock>-->
- </DockPanel>
- </StackPanel>
- </touch:TouchButton>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml.cs
deleted file mode 100644
index fdd7bfc30..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.AppBarItems
-{
- /// <summary>
- /// Interaction logic for PowerOffAppBarItemView.xaml
- /// </summary>
- public partial class PowerOffAppBarItemView : UserControl
- {
- public PowerOffAppBarItemView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItem.cs
deleted file mode 100644
index 966e78769..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItem.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.PMR.Power;
-using Tango.PPC.Common.Notifications;
-
-namespace Tango.PPC.UI.AppBarItems
-{
- public class PowerUpAppBarItem : AppBarItem
- {
- private StartPowerUpResponse _status;
- public StartPowerUpResponse Status
- {
- get { return _status; }
- set { _status = value; RaisePropertyChangedAuto(); }
- }
-
- /// <summary>
- /// Gets or sets the view type.
- /// </summary>
- public override Type ViewType
- {
- get
- {
- return typeof(PowerUpAppBarItemView);
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItemView.xaml
deleted file mode 100644
index b6b769c69..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItemView.xaml
+++ /dev/null
@@ -1,30 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.AppBarItems.PowerUpAppBarItemView"
- 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:local="clr-namespace:Tango.PPC.UI.AppBarItems"
- mc:Ignorable="d"
- d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:PowerUpAppBarItem, IsDesignTimeCreatable=False}">
- <Grid>
- <touch:TouchButton Style="{StaticResource TangoFlatButton}" Command="{Binding PressedCommand}" Padding="0">
- <StackPanel VerticalAlignment="Center">
- <TextBlock Text="{Binding Status.Message}" FontSize="{StaticResource TangoDefaultFontSize}" TextTrimming="CharacterEllipsis"></TextBlock>
- <ProgressBar Maximum="100" Value="{Binding Status.ProgressPercentage}" Margin="0 10 0 5" Background="{StaticResource TangoGrayBrush}" Height="5" Foreground="{StaticResource TangoPrimaryAccentBrush}" BorderThickness="0" />
- <DockPanel LastChildFill="False">
- <TextBlock DockPanel.Dock="Left">
-
- <Run Text="{Binding Status.ProgressPercentage}"></Run><Run>%</Run>
- <Run>Completed</Run>
- </TextBlock>
-
- <!--<TextBlock DockPanel.Dock="Right">
- <Run Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToTwoDigitsTimeConverter},FallbackValue=5}"></Run>
- <Run FontSize="16" Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToLabelConverter},FallbackValue=min}"></Run>
- </TextBlock>-->
- </DockPanel>
- </StackPanel>
- </touch:TouchButton>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItemView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItemView.xaml.cs
deleted file mode 100644
index 599f24d3b..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerUpAppBarItemView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.AppBarItems
-{
- /// <summary>
- /// Interaction logic for PowerOffAppBarItemView.xaml
- /// </summary>
- public partial class PowerUpAppBarItemView : UserControl
- {
- public PowerUpAppBarItemView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs
index e7be61b0a..04e968da2 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -46,11 +46,6 @@ namespace Tango.PPC.UI.Authentication
}
/// <summary>
- /// Gets a value indicating whether the authentication provider is using a null user.
- /// </summary>
- public bool AuthenticationRequired { get; private set; }
-
- /// <summary>
/// Performs a user login by the specified email and password.
/// </summary>
/// <param name="email">The email.</param>
@@ -61,9 +56,6 @@ namespace Tango.PPC.UI.Authentication
{
return Task.Factory.StartNew<User>(() =>
{
-
- AuthenticationRequired = true;
-
String hash = encrypt ? User.GetPasswordHash(password) : password;
LogManager.Log($"Logging in user {email}...");
@@ -90,16 +82,6 @@ namespace Tango.PPC.UI.Authentication
});
}
- public Task Login()
- {
- return Task.Factory.StartNew(() =>
- {
- AuthenticationRequired = false;
- CurrentUser = null;
- CurrentUserChanged?.Invoke(this, CurrentUser);
- });
- }
-
/// <summary>
/// Logs-out the current logged-in user.
/// </summary>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
index 5218d9f70..53e143def 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
@@ -4,7 +4,6 @@ using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Net;
-using System.Net.NetworkInformation;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -30,9 +29,7 @@ namespace Tango.PPC.UI.Connectivity
private IMachineProvider _machineProvider;
private Rfc2898Cryptographer _cryptographer;
private System.Timers.Timer _updateTimer;
- private System.Timers.Timer _lanUpdateTimer;
private WiFiNetwork _connectedNetwork;
- private PPCSettings _settings;
/// <summary>
/// Occurs when the connectivity provider state has changed (e.g network connected/disconnected).
@@ -46,17 +43,7 @@ namespace Tango.PPC.UI.Connectivity
public bool IsConnected
{
get { return _isConnected; }
- private set { _isConnected = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isLanConnected;
- /// <summary>
- /// Gets a value indicating whether there is LAN connection.
- /// </summary>
- public bool IsLanConnected
- {
- get { return _isLanConnected; }
- private set { _isLanConnected = value; RaisePropertyChangedAuto(); }
+ set { _isConnected = value; RaisePropertyChangedAuto(); }
}
private bool _isHotspoActive;
@@ -129,8 +116,6 @@ namespace Tango.PPC.UI.Connectivity
{
await RefreshAvailableWiFiNetworks();
});
-
- _settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
}
/// <summary>
@@ -168,28 +153,6 @@ namespace Tango.PPC.UI.Connectivity
_updateTimer = new System.Timers.Timer(TimeSpan.FromSeconds(30).TotalMilliseconds);
_updateTimer.Elapsed += _updateTimer_Elapsed;
_updateTimer.Start();
-
- _lanUpdateTimer = new System.Timers.Timer(TimeSpan.FromSeconds(10).TotalMilliseconds);
- _lanUpdateTimer.Elapsed += _lanUpdateTimer_Elapsed;
- _lanUpdateTimer.Start();
- }
-
- private void _lanUpdateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
- {
- foreach (NetworkInterface net in NetworkInterface.GetAllNetworkInterfaces())
- {
- if ((net.NetworkInterfaceType == NetworkInterfaceType.Ethernet
- || net.NetworkInterfaceType == NetworkInterfaceType.Ethernet3Megabit
- || net.NetworkInterfaceType == NetworkInterfaceType.FastEthernetFx
- || net.NetworkInterfaceType == NetworkInterfaceType.FastEthernetT
- || net.NetworkInterfaceType == NetworkInterfaceType.GigabitEthernet) && net.Name.ToStringOrEmpty().StartsWith("Ethernet") && net.OperationalStatus == OperationalStatus.Up)
- {
- IsLanConnected = true;
- return;
- }
- }
-
- IsLanConnected = false;
}
/// <summary>
@@ -260,11 +223,6 @@ namespace Tango.PPC.UI.Connectivity
/// <returns></returns>
public Task<bool> CheckInternetConnection()
{
- if (_settings.BypassInternetConnectivityCheck)
- {
- return Task.FromResult(true);
- }
-
return Task.Factory.StartNew<bool>(() =>
{
try
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/MachineStatusControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/MachineStatusControl.xaml
deleted file mode 100644
index 3404c032a..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/MachineStatusControl.xaml
+++ /dev/null
@@ -1,49 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Controls.MachineStatusControl"
- 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:operations="clr-namespace:Tango.Integration.Operation;assembly=Tango.Integration"
- xmlns:local="clr-namespace:Tango.PPC.UI.Controls"
- mc:Ignorable="d"
- Width="36" Height="Auto">
- <Grid>
- <touch:TouchGifAnimation Width="36" HorizontalAlignment="Center" EnableAnimation="True">
- <touch:TouchGifAnimation.Style>
- <Style TargetType="touch:TouchGifAnimation">
- <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.Disconnected}">
- <Setter Property="Source" Value="/Images/GlobalStatus/machine_off_Anim.gif"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.PowerUp}">
- <Setter Property="Source" Value="/Images/GlobalStatus/getting_ready_Anim.gif"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.Standby}">
- <Setter Property="Source" Value="/Images/GlobalStatus/standby_Anim.gif"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.ReadyToDye}">
- <Setter Property="Source" Value="/Images/GlobalStatus/Ready_Anim.gif"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.GettingReady}">
- <Setter Property="Source" Value="/Images/GlobalStatus/getting_ready_Anim.gif"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.Printing}">
- <Setter Property="Source" Value="/Images/GlobalStatus/dyeing_Anim.gif"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.ShuttingDown}">
- <Setter Property="Source" Value="/Images/GlobalStatus/shutdown_icon_Anim.gif"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.Error}">
- <Setter Property="Source" Value="/Images/GlobalStatus/error_Anim.gif"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Status}" Value="{x:Static operations:MachineStatuses.Service}">
- <Setter Property="Source" Value="/Images/GlobalStatus/service_Anim.gif"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </touch:TouchGifAnimation.Style>
- </touch:TouchGifAnimation>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/MachineStatusControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/MachineStatusControl.xaml.cs
deleted file mode 100644
index 61ecef0ad..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/MachineStatusControl.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.Controls
-{
- /// <summary>
- /// Interaction logic for MachineStatusControl.xaml
- /// </summary>
- public partial class MachineStatusControl : UserControl
- {
- public MachineStatusControl()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml
deleted file mode 100644
index 66bd0392d..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml
+++ /dev/null
@@ -1,28 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Dialogs.FirmwareUpgradeFromFileView"
- 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:local="clr-namespace:Tango.PPC.UI.Dialogs"
- xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- mc:Ignorable="d"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:FirmwareUpgradeFromFileViewVM, IsDesignTimeCreatable=False}">
- <Grid Margin="20">
- <DockPanel>
- <Grid DockPanel.Dock="Bottom">
- <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton>
- <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">UPGRADE</touch:TouchButton>
- </Grid>
- <StackPanel>
- <Image Source="../Images/firmware.png" Stretch="Uniform" Height="120"></Image>
- <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Tango Firmware Upgrade</TextBlock>
- <TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">The selected file contains a firmware upgrade package. Press 'UPGRADE' to start updating your system.</TextBlock>
-
- <TextBlock TextAlignment="Center" HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">
- <Run FontWeight="SemiBold">Firmware:</Run>
- <Run Text="{Binding Version}"></Run>
- </TextBlock>
- </StackPanel>
- </DockPanel>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs
deleted file mode 100644
index e7e1eb86c..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.Dialogs
-{
- /// <summary>
- /// Interaction logic for UpdateFromFileView.xaml
- /// </summary>
- public partial class FirmwareUpgradeFromFileView : UserControl
- {
- public FirmwareUpgradeFromFileView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs
deleted file mode 100644
index 9a7322565..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/FirmwareUpgradeFromFileViewVM.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.PPC.Common.Publish;
-using Tango.SharedUI;
-
-namespace Tango.PPC.UI.Dialogs
-{
- public class FirmwareUpgradeFromFileViewVM : DialogViewVM
- {
- public String Version { get; set; }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml
index ad1c2ece3..f3c471954 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml
@@ -3,7 +3,7 @@
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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
mc:Ignorable="d"
Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="700" Height="800" d:DataContext="{d:DesignInstance Type=local:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}">
@@ -20,59 +20,28 @@
<Run>The job cannot be completed.</Run>
</TextBlock>
</StackPanel>
- <Grid VerticalAlignment="Top" Margin="0 30 0 0">
+ <Grid>
<ItemsControl ItemsSource="{Binding Exception.IdsPackLevels}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
- <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Vertical" IsItemsHost="True"></StackPanel>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
- <Grid Margin="0 0 0 4">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40" />
- <ColumnDefinition Width="160" />
- <ColumnDefinition Width="1*" />
- </Grid.ColumnDefinitions>
- <touch:TouchIcon VerticalAlignment="Center" Width="24" Height="24">
- <touch:TouchIcon.Style>
- <Style TargetType="touch:TouchIcon">
- <Setter Property="Icon" Value="Check"></Setter>
- <Setter Property="Foreground" Value="{StaticResource TangoGreenBrush}"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsValid}" Value="False">
- <Setter Property="Icon" Value="Alert"></Setter>
- <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding IsOverMax}" Value="True">
- <Setter Property="Icon" Value="AlertOctagon"></Setter>
- <Setter Property="Foreground" Value="{StaticResource TangoRedBrush}"></Setter>
- </DataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsValid}" Value="True" />
- <Condition Binding="{Binding IsOverMax}" Value="False" />
- </MultiDataTrigger.Conditions>
- <Setter Property="Icon" Value="Check"></Setter>
- <Setter Property="Foreground" Value="{StaticResource TangoGreenBrush}"></Setter>
- </MultiDataTrigger>
- </Style.Triggers>
- </Style>
- </touch:TouchIcon.Style>
- </touch:TouchIcon>
-
- <Border Grid.Column="1" Margin="5 0 0 0" Height="45" Width="150" CornerRadius="3" BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}">
+ <StackPanel Margin="15 0" Width="60">
+ <TextBlock HorizontalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}" Margin="-20 0 -20 0" TextTrimming="CharacterEllipsis"></TextBlock>
+ <Border Margin="0 5 0 0" Height="150" Width="50" CornerRadius="3" BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}">
<Grid>
- <Border VerticalAlignment="Center" CornerRadius="3" Loaded="IdsPackLoaded" MinHeight="45" HorizontalAlignment="Left" MinWidth="5">
+ <Border CornerRadius="3" VerticalAlignment="Bottom" Loaded="IdsPackLoaded" MinHeight="5">
<Border.Background>
- <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
+ <LinearGradientBrush>
+ <GradientStop Offset="0" Color="#4DFFFFFF" />
<GradientStop Offset="0.5" Color="{Binding IdsPack.LiquidType.LiquidTypeColor}" />
- <GradientStop Offset="1" Color="#4EFFFFFF" />
</LinearGradientBrush>
</Border.Background>
</Border>
- <Rectangle Loaded="Limit_Loaded" Stroke="{StaticResource TangoRedBrush}" StrokeThickness="2" HorizontalAlignment="Left">
+ <Rectangle Loaded="Limit_Loaded" Stroke="Red" StrokeThickness="2" VerticalAlignment="Bottom">
<Rectangle.Style>
<Style TargetType="Rectangle">
<Style.Triggers>
@@ -97,18 +66,9 @@
</Style>
</Rectangle.Style>
</Rectangle>
-
-
- <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoDarkForegroundBrush}" HorizontalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}" VerticalAlignment="Center">
- <TextBlock.Effect>
- <DropShadowEffect ShadowDepth="1" BlurRadius="1" Color="White" />
- </TextBlock.Effect>
- </TextBlock>
-
</Grid>
</Border>
- <TextBlock Grid.Column="2" HorizontalAlignment="Left" Text="{Binding Message}" VerticalAlignment="Center" Margin="20,0,0,0" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoRedBrush}"></TextBlock>
- </Grid>
+ </StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs
index e0f02e4af..9ec1eec0e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs
@@ -33,7 +33,7 @@ namespace Tango.PPC.UI.Dialogs
Grid parent = border.Parent as Grid;
IDSPackLevel packLevel = border.DataContext as IDSPackLevel;
- border.Width = Math.Max(((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth, 0);
+ border.Height = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight;
}
private void Limit_Loaded(object sender, RoutedEventArgs e)
@@ -42,8 +42,8 @@ namespace Tango.PPC.UI.Dialogs
Grid parent = rect.Parent as Grid;
IDSPackLevel packLevel = rect.DataContext as IDSPackLevel;
- var left = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth;
- rect.Margin = new Thickness(left, 0, 0, 0);
+ var top = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight;
+ rect.Margin = new Thickness(0, 0, 0, top);
if (packLevel.IsValid)
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml
deleted file mode 100644
index 081778434..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml
+++ /dev/null
@@ -1,32 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Dialogs.PowerUpView"
- 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
- mc:Ignorable="d"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="600" Height="800" d:DataContext="{d:DesignInstance Type=local:PowerUpViewVM, IsDesignTimeCreatable=False}">
- <Grid>
- <StackPanel Margin="0 100 0 0" HorizontalAlignment="Center">
- <touch:TouchGifAnimation Source="../Images/powerup.gif" EnableAnimation="{Binding IsVisible}" />
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Margin="0 30 0 0">Continue getting ready for:</TextBlock>
- <DockPanel HorizontalAlignment="Center" Margin="0 40 0 0">
- <touch:TouchRadioButton IsChecked="{Binding IsSelectedRml}" />
- <touch:TouchComboBox Margin="20 0 0 0" Width="300" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="Name" Title="Select thread type"></touch:TouchComboBox>
- </DockPanel>
- <DockPanel HorizontalAlignment="Left" Margin="0 40 0 0">
- <touch:TouchRadioButton IsChecked="{Binding IsMinimalTemperature}" />
- <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">Minimal temperature</TextBlock>
- </DockPanel>
-
- <touch:TouchButton Command="{Binding OKCommand}" Margin="0 150 0 0" Style="{StaticResource TangoHollowButton}" HorizontalAlignment="Center" Padding="60 15" CornerRadius="25">CONTINUE</touch:TouchButton>
-
- <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" Visibility="{Binding IsTimeoutEnabled,Converter={StaticResource BooleanToVisibilityConverter}}">
- <Run>auto select in</Run>
- <Run Text="{Binding RemainingSeconds}"></Run>
- <Run>sec</Run>
- </TextBlock>
- </StackPanel>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs
deleted file mode 100644
index a9767276a..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-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.PPC.UI.Dialogs
-{
- /// <summary>
- /// Interaction logic for PowerUpView.xaml
- /// </summary>
- public partial class PowerUpView : UserControl
- {
- public PowerUpView()
- {
- InitializeComponent();
- }
-
- protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
- {
- base.OnPreviewMouseUp(e);
- (DataContext as PowerUpViewVM).IsTimeoutEnabled = false;
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs
deleted file mode 100644
index ec4b3bb2b..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpViewVM.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Timers;
-using Tango.BL.Entities;
-using Tango.PPC.Common;
-using Tango.Settings;
-using Tango.SharedUI;
-
-namespace Tango.PPC.UI.Dialogs
-{
- public class PowerUpViewVM : DialogViewVM
- {
- private Timer _timer;
-
- private List<Rml> _rmls;
- public List<Rml> Rmls
- {
- get { return _rmls; }
- set { _rmls = value; RaisePropertyChangedAuto(); }
- }
-
- private Rml _selectedRml;
- public Rml SelectedRml
- {
- get { return _selectedRml; }
- set { _selectedRml = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isSelectedRml;
- public bool IsSelectedRml
- {
- get { return _isSelectedRml; }
- set
- {
- _isSelectedRml = value;
- RaisePropertyChangedAuto();
-
- if (_isSelectedRml)
- {
- IsMinimalTemperature = false;
- }
- }
- }
-
- private bool _isMinimalTemperature;
- public bool IsMinimalTemperature
- {
- get { return _isMinimalTemperature; }
- set
- {
- _isMinimalTemperature = value;
- RaisePropertyChangedAuto();
-
- if (_isMinimalTemperature)
- {
- IsSelectedRml = false;
- }
- }
- }
-
- private int _remainingSeconds;
- public int RemainingSeconds
- {
- get { return _remainingSeconds; }
- set { _remainingSeconds = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isTimeoutEnabled;
- public bool IsTimeoutEnabled
- {
- get { return _isTimeoutEnabled; }
- set
- {
- _isTimeoutEnabled = value; RaisePropertyChangedAuto();
-
- if (!_isTimeoutEnabled)
- {
- _timer.Stop();
- }
- }
- }
-
- public PowerUpViewVM()
- {
- RemainingSeconds = (int)SettingsManager.Default.GetOrCreate<PPCSettings>().PowerUpScreenTimeout.TotalSeconds;
- CanClose = true;
- IsMinimalTemperature = true;
- IsTimeoutEnabled = true;
- _timer = new Timer();
- _timer.Interval = TimeSpan.FromSeconds(1).TotalMilliseconds;
- _timer.Elapsed += _timer_Elapsed;
- }
-
- private void _timer_Elapsed(object sender, ElapsedEventArgs e)
- {
- RemainingSeconds--;
-
- if (RemainingSeconds == 0)
- {
- InvokeUI(() =>
- {
- Accept();
- });
- }
- }
-
- protected override void Cancel()
- {
- _timer.Stop();
- base.Cancel();
- }
-
- protected override void Accept()
- {
- _timer.Stop();
- base.Accept();
- }
-
- public override void OnShow()
- {
- base.OnShow();
- _timer.Start();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml
deleted file mode 100644
index e96b39a63..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml
+++ /dev/null
@@ -1,52 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Dialogs.SafetyLevelOperationsConfirmationView"
- 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:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
- xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
- mc:Ignorable="d"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="700" Height="900" d:DataContext="{d:DesignInstance Type=local:SafetyLevelOperationsConfirmationViewVM, IsDesignTimeCreatable=False}">
- <Grid Margin="20">
- <DockPanel>
- <Grid DockPanel.Dock="Bottom">
- <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">DECLINE</touch:TouchButton>
-
- <Grid HorizontalAlignment="Center">
- <touch:TouchRingProgress Width="50" Height="50" Maximum="{Binding MaxSeconds}" Value="{Binding SecondsRemaining}" />
- <TextBlock Text="{Binding SecondsRemaining}" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
- </Grid>
-
- <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">APPROVE</touch:TouchButton>
- </Grid>
- <StackPanel DockPanel.Dock="Top">
- <touch:TouchIcon Icon="Alert" Foreground="{StaticResource TangoWarningBrush}" Height="120"></touch:TouchIcon>
- <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Safety Level Access Request</TextBlock>
- <TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">
- <Run>A remote client is requesting a safety level connection to this machine.</Run>
- <LineBreak/>
- <Run>Once approved, the remote user will be able to perform any mechanical operation remotely.</Run>
- </TextBlock>
- </StackPanel>
- <Grid>
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBlock FontSize="{StaticResource TangoTitleFontSize}">Request Information</TextBlock>
- <controls:TableGrid Margin="0 30 0 0" HorizontalAlignment="Center" RowHeight="30" Width="280">
- <TextBlock FontWeight="Bold">Address:</TextBlock>
- <TextBlock Text="{Binding Connection.Address}"></TextBlock>
-
- <TextBlock FontWeight="Bold">Host Name:</TextBlock>
- <TextBlock Text="{Binding Connection.Request.HostName}"></TextBlock>
-
- <TextBlock FontWeight="Bold">App ID:</TextBlock>
- <TextBlock Text="{Binding Connection.Request.AppID}"></TextBlock>
-
- <TextBlock FontWeight="Bold">User:</TextBlock>
- <TextBlock Text="{Binding Connection.Request.UserName,TargetNullValue='Unknown',FallbackValue='Unknown'}"></TextBlock>
- </controls:TableGrid>
- </StackPanel>
- </Grid>
- </DockPanel>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs
deleted file mode 100644
index ef689f1de..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.Dialogs
-{
- /// <summary>
- /// Interaction logic for SafetyLevelOperationsConfirmationView.xaml
- /// </summary>
- public partial class SafetyLevelOperationsConfirmationView : UserControl
- {
- public SafetyLevelOperationsConfirmationView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs
deleted file mode 100644
index f8027b4c2..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationViewVM.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Threading;
-using Tango.Integration.ExternalBridge;
-using Tango.PMR.Integration;
-using Tango.SharedUI;
-
-namespace Tango.PPC.UI.Dialogs
-{
- public class SafetyLevelOperationsConfirmationViewVM : DialogViewVM
- {
- private DispatcherTimer _timer;
-
- private int _maxSeconds;
- public int MaxSeconds
- {
- get { return _maxSeconds; }
- set { _maxSeconds = value; RaisePropertyChangedAuto(); }
- }
-
- private int _secondsRemaining;
- public int SecondsRemaining
- {
- get { return _secondsRemaining; }
- set { _secondsRemaining = value; RaisePropertyChangedAuto(); }
- }
-
- private ExternalBridgeClientConnectedEventArgs _connection;
- /// <summary>
- /// Gets or sets the last client connection event arguments.
- /// </summary>
- public ExternalBridgeClientConnectedEventArgs Connection
- {
- get { return _connection; }
- set { _connection = value; RaisePropertyChangedAuto(); }
- }
-
- public SafetyLevelOperationsConfirmationViewVM(ExternalBridgeClientConnectedEventArgs connection)
- {
- Connection = connection;
-
- MaxSeconds = 30;
- SecondsRemaining = 30;
-
- _timer = new DispatcherTimer(DispatcherPriority.Background, Application.Current.Dispatcher);
- _timer.Interval = TimeSpan.FromMilliseconds(800);
- _timer.Tick += _timer_Tick;
- }
-
- public override void OnShow()
- {
- base.OnShow();
- _timer.Start();
- }
-
- protected override void Accept()
- {
- _timer.Stop();
- base.Accept();
- }
-
- protected override void Cancel()
- {
- _timer.Stop();
- base.Cancel();
- }
-
- private void _timer_Tick(object sender, EventArgs e)
- {
- SecondsRemaining--;
-
- if (SecondsRemaining == 0)
- {
- Cancel();
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml
deleted file mode 100644
index f17860d42..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml
+++ /dev/null
@@ -1,225 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Dialogs.ThreadBreakView"
- 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
- xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
- xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
- mc:Ignorable="d"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="700" Height="1150" d:DataContext="{d:DesignInstance Type=local:ThreadBreakViewVM, IsDesignTimeCreatable=False}">
- <Grid>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top" Margin="0 30 0 0">
- <Image HorizontalAlignment="Center" Source="/Images/thread_loading.png" Stretch="None"></Image>
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="0 30 0 0">Thread Break Wizard</TextBlock>
- </StackPanel>
-
- <StackPanel Margin="10 0 0 0" Orientation="Horizontal" DockPanel.Dock="Bottom">
- <touch:TouchButton Command="{Binding BackCommand}">
- <touch:TouchButton.Style>
- <Style TargetType="touch:TouchButton" BasedOn="{StaticResource TangoFlatButton}">
- <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
- <Style.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter>
- </Trigger>
- </Style.Triggers>
- </Style>
- </touch:TouchButton.Style>
- <StackPanel>
- <touch:TouchIcon Icon="ArrowLeft" Width="24" Height="24" />
- <TextBlock Margin="0 5 0 0" HorizontalAlignment="Center">Back</TextBlock>
- </StackPanel>
- </touch:TouchButton>
- </StackPanel>
-
- <Grid Margin="0 20 0 0">
- <controls:NavigationControl Margin="0 5 0 0" SelectedObject="{Binding Stage}" TransitionType="Slide" TransitionAlwaysFades="False" TransitionDuration="00:00:0.1" SelectedIndex="0">
-
- <!--Guiding Units-->
- <Grid controls:NavigationControl.NavigationName="GuidingUnits" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="20" Columns="3" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Padding="30 0" HorizontalAlignment="Left" Command="{Binding GuidingUnitsFoundCantFixCommand}">Found But Can't Fix</touch:TouchButton>
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Padding="40 0" HorizontalAlignment="Right" Command="{Binding GuidingUnitsFoundAndFixedCommand}">Found and Fixed</touch:TouchButton>
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Padding="50 0" HorizontalAlignment="Right" Command="{Binding GuidingUnitsCantFindItCommand}">Can't Find It</touch:TouchButton>
- </UniformGrid>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top">
- <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Please check guiding units on both sides of the system and fix/tie the thread if possible.</TextBlock>
- </StackPanel>
-
- <commonControls:ImageGalleryControl Duration="00:00:03">
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/GuidingUnits/1.jpg"></Image>
- </commonControls:ImageGalleryControl>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Feeding Units-->
- <Grid controls:NavigationControl.NavigationName="FeedingUnits" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="20" Columns="2" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Left" Command="{Binding FeedingUnitsFoundAndFixedCommand}">Found and Fixed</touch:TouchButton>
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding FeedingUnitsCantFixCommand}">Can't Fix</touch:TouchButton>
- </UniformGrid>
- <TextBlock Foreground="{StaticResource TangoErrorBrush}" DockPanel.Dock="Bottom" TextWrapping="Wrap" TextAlignment="Center" Margin="50 20">
- if the thread is out of is route or tangle on one of the components you can go to the maintenance screen and open the component to solve the problem
- </TextBlock>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top">
- <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
- Open the covers and check the feeder and puller and fix/tie if possible.
- </TextBlock>
- </StackPanel>
-
- <Grid>
- <Grid Visibility="{Binding IsArcHead,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
- <commonControls:ImageGalleryControl Duration="00:00:03">
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/1.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/2.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/3.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/4.jpg"></Image>
- </commonControls:ImageGalleryControl>
- </Grid>
-
- <Grid Visibility="{Binding IsArcHead,Converter={StaticResource BooleanToVisibilityConverter}}">
- <commonControls:ImageGalleryControl Duration="00:00:03">
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/1.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/2.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/3.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/4.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/FeedingUnits/arc/5.jpg"></Image>
- </commonControls:ImageGalleryControl>
- </Grid>
- </Grid>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--The Dryer-->
- <Grid controls:NavigationControl.NavigationName="TheDryer" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="20" Columns="2" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Left" Command="{Binding TheDryerRemovedSuccessfullyCommand}">Removed Successfully</touch:TouchButton>
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding TheDryerCantRemoveCommand}">Can't Remove</touch:TouchButton>
- </UniformGrid>
- <StackPanel DockPanel.Dock="Bottom" TextElement.Foreground="{StaticResource TangoErrorBrush}" Margin="50 20">
- <DockPanel HorizontalAlignment="Center">
- <touch:TouchIcon Icon="Alert" Foreground="{StaticResource TangoErrorBrush}" />
- <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">HOT SURFACE!</TextBlock>
- </DockPanel>
- <TextBlock Margin="0 5 0 0" Foreground="{StaticResource TangoErrorBrush}" TextWrapping="Wrap" TextAlignment="Center">
- Recommended to cool down and/or to wear safety gloves
- </TextBlock>
- </StackPanel>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top">
- <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
- Open the dryer, cut the thread and remove any residue.
- </TextBlock>
- </StackPanel>
-
- <commonControls:ImageGalleryControl Duration="00:00:03">
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/1.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/2.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/3.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/4.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/TheDryer/5.jpg"></Image>
- </commonControls:ImageGalleryControl>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Dryer Close-->
- <Grid controls:NavigationControl.NavigationName="DryerClose" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="20" Columns="1" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="300" HorizontalAlignment="Center" Command="{Binding OpenThreadLoadingWizardCommand}">Open The Thread Loading Wizard</touch:TouchButton>
- </UniformGrid>
- <TextBlock DockPanel.Dock="Bottom" TextWrapping="Wrap" TextAlignment="Center" Margin="50 20">
- You will be able to open the thread loading wizard once the dryer door is closed
- </TextBlock>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top">
- <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
- Close the dryer door
- </TextBlock>
- </StackPanel>
-
- <commonControls:ImageGalleryControl Duration="00:00:03">
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/DryerClose/1.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/DryerClose/2.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/DryerClose/3.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/DryerClose/4.jpg"></Image>
- </commonControls:ImageGalleryControl>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Contact Support-->
- <Grid controls:NavigationControl.NavigationName="ContactSupport" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="20" Columns="1" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding CloseCommand}">Close</touch:TouchButton>
- </UniformGrid>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top">
- <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
- Please Contact Twine Customer Care
- </TextBlock>
- </StackPanel>
-
- <Grid>
- <TextBlock HorizontalAlignment="Center" Margin="0 50 0 0" FontSize="40" Foreground="{StaticResource TangoPrimaryAccentBrush}">support@twine-s.com</TextBlock>
- </Grid>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Jogging-->
- <Grid controls:NavigationControl.NavigationName="Jogging" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top">
- <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
- Verifying thread movement
- </TextBlock>
- </StackPanel>
-
- <StackPanel Margin="0 100 0 0">
- <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold">working...</TextBlock>
- <touch:TouchBusyIndicator Foreground="{StaticResource TangoGrayBrush}" Width="130" Height="130" Margin="0 40 0 0" StrokeThickness="8" IsIndeterminate="{Binding IsVisible}" />
- </StackPanel>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Fixed-->
- <Grid controls:NavigationControl.NavigationName="Fixed" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="20" Columns="1" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding CloseCommand}">Close</touch:TouchButton>
- </UniformGrid>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top">
- <TextBlock TextWrapping="Wrap" TextAlignment="Center" Margin="40 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
- Issue Resolved
- </TextBlock>
- </StackPanel>
-
- <Grid>
- <touch:TouchIcon Icon="CheckCircleOutline" Foreground="{StaticResource TangoSuccessBrush}" HorizontalAlignment="Center" VerticalAlignment="Top" Width="100" Margin="0 100 0 0" />
- </Grid>
- </DockPanel>
- </DockPanel>
- </Grid>
- </controls:NavigationControl>
- </Grid>
- </DockPanel>
-
- <touch:TouchIconButton Command="{Binding CloseCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Icon="Close" Width="45" Height="45" Padding="14" Foreground="{StaticResource TangoDarkForegroundBrush}" />
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs
deleted file mode 100644
index c105a9a15..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.Dialogs
-{
- /// <summary>
- /// Interaction logic for ThreadBreakWizard.xaml
- /// </summary>
- public partial class ThreadBreakView : UserControl
- {
- public ThreadBreakView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs
deleted file mode 100644
index e737f3b12..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadBreakViewVM.cs
+++ /dev/null
@@ -1,245 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.Core.Commands;
-using Tango.Core.DI;
-using Tango.Logging;
-using Tango.PPC.Common.Connection;
-using Tango.PPC.Common.Notifications;
-using Tango.SharedUI;
-
-namespace Tango.PPC.UI.Dialogs
-{
- public class ThreadBreakViewVM : DialogViewVM
- {
- public enum ThreadBreakWizardResult
- {
- None,
- StartThreadLoading
- }
-
- public enum WizardStage
- {
- Welcome,
- GuidingUnits,
- FeedingUnits,
- Jogging,
- TheDryer,
- DryerClose,
- Fixed,
- ContactSupport,
- }
-
- [TangoInject]
- private IMachineProvider MachineProvider { get; set; }
-
- [TangoInject]
- private INotificationProvider NotificationProvider { get; set; }
-
- public ThreadBreakWizardResult Result { get; set; }
-
- private WizardStage _stage;
- public WizardStage Stage
- {
- get { return _stage; }
- set { _stage = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
- }
-
- private bool _isArcHead;
- public bool IsArcHead
- {
- get { return _isArcHead; }
- set { _isArcHead = value; RaisePropertyChangedAuto(); }
- }
-
- public RelayCommand BackCommand { get; set; }
-
- //Guiding Units
- public RelayCommand GuidingUnitsFoundCantFixCommand { get; set; }
- public RelayCommand GuidingUnitsCantFindItCommand { get; set; }
- public RelayCommand GuidingUnitsFoundAndFixedCommand { get; set; }
-
- //Feeding Units
- public RelayCommand FeedingUnitsCantFixCommand { get; set; }
- public RelayCommand FeedingUnitsFoundAndFixedCommand { get; set; }
-
- //The Dryer
- public RelayCommand TheDryerCantRemoveCommand { get; set; }
- public RelayCommand TheDryerRemovedSuccessfullyCommand { get; set; }
-
- //Dryer Close
- public RelayCommand OpenThreadLoadingWizardCommand { get; set; }
-
- public ThreadBreakViewVM()
- {
- CanClose = true;
- TangoIOC.Default.Inject(this);
-
- MachineProvider.MachineOperator.MachineEventsStateProvider.EventsChanged += MachineEventsStateProvider_EventsChanged;
- MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected;
-
- IsArcHead = MachineProvider.Machine.MachineHeadType == BL.Enumerations.HeadTypes.Arc;
-
- BackCommand = new RelayCommand(GoBack, CanGoBack);
-
- //Guiding Units Commands
- GuidingUnitsFoundCantFixCommand = new RelayCommand(GuidingUnitsFoundCantFix);
- GuidingUnitsCantFindItCommand = new RelayCommand(GuidingUnitsCantFindIt);
- GuidingUnitsFoundAndFixedCommand = new RelayCommand(GuidingUnitsFoundAndFixed);
-
- //Feeding Units Commands
- FeedingUnitsCantFixCommand = new RelayCommand(FeedingUnitsCantFix);
- FeedingUnitsFoundAndFixedCommand = new RelayCommand(FeedingUnitsFoundAndFixed);
-
- //The Dryer Commands
- TheDryerRemovedSuccessfullyCommand = new RelayCommand(TheDryerRemovedSuccessfully);
- TheDryerCantRemoveCommand = new RelayCommand(TheDryerCantRemove);
-
- OpenThreadLoadingWizardCommand = new RelayCommand(OpenThreadLoadingWizard, () => !MachineProvider.MachineOperator.MachineEventsStateProvider.Events.Any(x => x.Type == BL.Enumerations.EventTypes.DRYER_DOOR_OPEN));
- }
-
- private void MachineProvider_MachineDisconnected(object sender, EventArgs e)
- {
- InvokeUI(() =>
- {
- Cancel();
- });
- }
-
- private void MachineEventsStateProvider_EventsChanged(object sender, IEnumerable<BL.Entities.MachinesEvent> e)
- {
- InvalidateRelayCommands();
- }
-
- #region Back
-
- private bool CanGoBack()
- {
- return Stage != WizardStage.GuidingUnits &&
- Stage != WizardStage.Jogging &&
- Stage != WizardStage.Fixed;
- }
-
- private void GoBack()
- {
- switch (Stage)
- {
- case WizardStage.FeedingUnits:
- Stage = WizardStage.GuidingUnits;
- break;
- case WizardStage.TheDryer:
- Stage = WizardStage.GuidingUnits;
- break;
- case WizardStage.ContactSupport:
- Stage = WizardStage.TheDryer;
- break;
- case WizardStage.DryerClose:
- Stage = WizardStage.TheDryer;
- break;
- }
- }
-
- #endregion
-
- #region Guiding Units Commands
-
- private async void GuidingUnitsFoundAndFixed()
- {
- Stage = WizardStage.Jogging;
-
- try
- {
- await MachineProvider.MachineOperator.AttemptThreadJogging();
- Stage = WizardStage.Fixed;
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, LogCategory.Warning, "Error occurred while attempting to perform thread jogging.");
- await NotificationProvider.ShowError($"Thread movement verification failed.\n{ex.FlattenMessage()}");
- Stage = WizardStage.FeedingUnits;
- }
- }
-
- private void GuidingUnitsCantFindIt()
- {
- Stage = WizardStage.FeedingUnits;
- }
-
- private void GuidingUnitsFoundCantFix()
- {
- Stage = WizardStage.TheDryer;
- }
-
- #endregion
-
- #region Feeding Units Commands
-
- private void FeedingUnitsCantFix()
- {
- Stage = WizardStage.TheDryer;
- }
-
- private async void FeedingUnitsFoundAndFixed()
- {
- Stage = WizardStage.Jogging;
-
- try
- {
- await MachineProvider.MachineOperator.AttemptThreadJogging();
- Stage = WizardStage.Fixed;
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, LogCategory.Warning, "Error occurred while attempting to perform thread jogging.");
- await NotificationProvider.ShowError($"Thread movement verification failed.\n{ex.FlattenMessage()}");
- Stage = WizardStage.TheDryer;
- }
- }
-
- #endregion
-
- #region The Dryer Commands
-
- private void TheDryerCantRemove()
- {
- Stage = WizardStage.ContactSupport;
- }
-
- private void TheDryerRemovedSuccessfully()
- {
- Stage = WizardStage.DryerClose;
- }
-
- #endregion
-
- #region Dryer Close Commands
-
- private void OpenThreadLoadingWizard()
- {
- Result = ThreadBreakWizardResult.StartThreadLoading;
- Accept();
- }
-
- #endregion
-
- protected override void Accept()
- {
- base.Accept();
- CleanUp();
- }
-
- protected override void Cancel()
- {
- base.Cancel();
- CleanUp();
- }
-
- private void CleanUp()
- {
- MachineProvider.MachineOperator.MachineEventsStateProvider.EventsChanged -= MachineEventsStateProvider_EventsChanged;
- MachineProvider.MachineDisconnected -= MachineProvider_MachineDisconnected;
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml
deleted file mode 100644
index e45065c61..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml
+++ /dev/null
@@ -1,170 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Dialogs.ThreadLoadingView"
- 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
- xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
- xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
- mc:Ignorable="d"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="700" Height="1150" d:DataContext="{d:DesignInstance Type=local:ThreadLoadingViewVM, IsDesignTimeCreatable=False}">
- <Grid>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top" Margin="0 30 0 0">
- <Image HorizontalAlignment="Center" Source="/Images/thread_loading.png" Stretch="None"></Image>
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="0 30 0 0">Thread Loading</TextBlock>
- </StackPanel>
-
- <Grid Margin="0 20 0 0">
- <controls:NavigationControl Margin="0 5 0 0" SelectedObject="{Binding Stage}" TransitionType="Slide" TransitionAlwaysFades="False" TransitionDuration="00:00:0.1" SelectedIndex="0">
- <!--Welcome-->
- <Grid controls:NavigationControl.NavigationName="Welcome" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="50" Columns="1" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding ContinueCommand}">Continue</touch:TouchButton>
- </UniformGrid>
- <DockPanel Margin="0 50 0 0" >
- <StackPanel DockPanel.Dock="Top">
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Welcome to the automatic thread loading wizard.</TextBlock>
- <StackPanel HorizontalAlignment="Center" Margin="0 20 0 0">
- <touch:TouchIcon Icon="Alert" VerticalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}" />
- <TextBlock TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Margin="0 10 0 0" Width="400">
- <Run>Please ensure there are no thread residue in the system and press</Run>
- <Run FontWeight="SemiBold">continue</Run>
- </TextBlock>
- </StackPanel>
- </StackPanel>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpg" VerticalAlignment="Center" Margin="50"></Image>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Preparing-->
- <Grid controls:NavigationControl.NavigationName="Preparing" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="50" Columns="1" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding ContinueCommand}">Continue</touch:TouchButton>
- </UniformGrid>
- <DockPanel Margin="0 20 0 0">
- <StackPanel VerticalAlignment="Top" DockPanel.Dock="Top" Margin="0 40 0 0">
- <TextBlock Margin="0 50 0 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">
- The system is now preparing...
- </TextBlock>
- <touch:TouchBusyIndicator Width="140" Height="140" StrokeThickness="8" IsIndeterminate="{Binding IsVisible}" Margin="0 50 0 0" Foreground="{StaticResource TangoGrayBrush}" />
- </StackPanel>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Ready For Loading-->
- <Grid controls:NavigationControl.NavigationName="ReadyForLoading" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="50" Columns="1" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding ContinueCommand}">Continue</touch:TouchButton>
- </UniformGrid>
- <DockPanel Margin="0 50 0 0">
- <StackPanel DockPanel.Dock="Top">
- <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">
- <Run>Please select the thread type you are going to load and press</Run>
- <Run FontWeight="SemiBold">continue</Run>
- </TextBlock>
- <touch:TouchComboBox Margin="0 40 0 0" Width="500" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="Name" Title="Select thread type"></touch:TouchComboBox>
- </StackPanel>
-
- <Grid>
- <Grid Visibility="{Binding IsArcHead,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
- <touch:TouchGifAnimation Margin="50" Source="/Images/thread_loading.gif" VerticalAlignment="Center" Stretch="Uniform" EnableAnimation="{Binding IsVisible}" />
- </Grid>
-
- <Grid>
- <commonControls:ImageGalleryControl Duration="00:00:03">
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.jpg"></Image>
- <Image Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpg"></Image>
- </commonControls:ImageGalleryControl>
- </Grid>
- </Grid>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Finalizing-->
- <Grid controls:NavigationControl.NavigationName="Finalizing" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="50" Columns="1" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding ContinueCommand}">Continue</touch:TouchButton>
- </UniformGrid>
- <DockPanel Margin="0 20 0 0">
- <StackPanel VerticalAlignment="Center" DockPanel.Dock="Top">
- <TextBlock Margin="0 50 0 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">
- The system is now loading the thread...
- </TextBlock>
- <touch:TouchProgressBar Margin="50 40 50 0" Height="10" IsIndeterminate="{Binding IsVisible}" />
- </StackPanel>
-
- <Image VerticalAlignment="Center" Margin="50" Stretch="Uniform" Source="/Images/ThreadLoading/NewThread/machine_full.jpg"></Image>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Completed-->
- <Grid controls:NavigationControl.NavigationName="Completed" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="50" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Center" Command="{Binding AbortCommand}">Close</touch:TouchButton>
- </UniformGrid>
- <DockPanel Margin="0 50 0 0" >
- <StackPanel DockPanel.Dock="Top">
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Thread loading completed successfully!</TextBlock>
- <touch:TouchIcon Margin="0 40 0 0" Icon="CheckCircleOutline" HorizontalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Width="100" Height="100" />
- </StackPanel>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Preparation Error-->
- <Grid controls:NavigationControl.NavigationName="PreparationError" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="50" Columns="2" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Left" Command="{Binding AbortCommand}">Close</touch:TouchButton>
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding ContinueCommand}">Retry</touch:TouchButton>
- </UniformGrid>
- <DockPanel Margin="0 50 0 0" >
- <StackPanel DockPanel.Dock="Top">
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Something went wrong, press 'retry' to try again</TextBlock>
- <touch:TouchIcon Icon="AlertCircleOutline" Margin="0 40 0 0" HorizontalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}" Width="100" Height="100" />
- <TextBlock Margin="0 10 0 0" FontSize="{StaticResource TangoSmallFontSize}" TextAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Text="{Binding Error}"></TextBlock>
- </StackPanel>
- </DockPanel>
- </DockPanel>
- </Grid>
-
- <!--Finalization Error-->
- <Grid controls:NavigationControl.NavigationName="FinalizationError" Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <DockPanel>
- <UniformGrid Margin="50" Columns="2" DockPanel.Dock="Bottom" Height="55">
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Left" Command="{Binding AbortCommand}">Close</touch:TouchButton>
- <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="250" HorizontalAlignment="Right" Command="{Binding ContinueCommand}">Retry</touch:TouchButton>
- </UniformGrid>
- <DockPanel Margin="0 50 0 0" >
- <StackPanel DockPanel.Dock="Top">
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Something went wrong, press 'retry' to try again</TextBlock>
- <touch:TouchIcon Icon="AlertCircleOutline" Margin="0 40 0 0" HorizontalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}" Width="100" Height="100" />
- <TextBlock Margin="0 10 0 0" FontSize="{StaticResource TangoSmallFontSize}" TextAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Text="{Binding Error}"></TextBlock>
- </StackPanel>
- </DockPanel>
- </DockPanel>
- </Grid>
- </controls:NavigationControl>
-
- </Grid>
- </DockPanel>
-
- <touch:TouchIconButton Command="{Binding AbortCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Icon="Close" Width="45" Height="45" Padding="14" Foreground="{StaticResource TangoDarkForegroundBrush}" />
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs
deleted file mode 100644
index d4c737bcc..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.Dialogs
-{
- /// <summary>
- /// Interaction logic for PowerUpView.xaml
- /// </summary>
- public partial class ThreadLoadingView : UserControl
- {
- public ThreadLoadingView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
deleted file mode 100644
index bb503e718..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
+++ /dev/null
@@ -1,287 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.BL;
-using Tango.BL.Builders;
-using Tango.BL.Entities;
-using Tango.Core.Commands;
-using Tango.Core.DI;
-using Tango.Integration.Operation;
-using Tango.PMR.ThreadLoading;
-using Tango.PPC.Common;
-using Tango.PPC.Common.Connection;
-using Tango.PPC.Common.Notifications;
-using Tango.Settings;
-using Tango.SharedUI;
-
-namespace Tango.PPC.UI.Dialogs
-{
- public class ThreadLoadingViewVM : DialogViewVM
- {
- public enum ThreadLoadingStage
- {
- Welcome,
- Preparing,
- ReadyForLoading,
- Finalizing,
- Completed,
- PreparationError,
- FinalizationError,
- }
-
- [TangoInject]
- private IMachineProvider MachineProvider { get; set; }
-
- [TangoInject]
- private INotificationProvider NotificationProvider { get; set; }
-
- private PPCSettings _settings;
-
- private StartThreadLoadingResponse _status;
- public StartThreadLoadingResponse Status
- {
- get { return _status; }
- set { _status = value; RaisePropertyChangedAuto(); }
- }
-
- private List<Rml> _rmls;
- public List<Rml> Rmls
- {
- get { return _rmls; }
- set { _rmls = value; RaisePropertyChangedAuto(); }
- }
-
- private Rml _selectedRml;
- public Rml SelectedRml
- {
- get { return _selectedRml; }
- set { _selectedRml = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
- }
-
- private ThreadLoadingStage _stage;
- public ThreadLoadingStage Stage
- {
- get { return _stage; }
- set { _stage = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
- }
-
- private bool _isArcHead;
- public bool IsArcHead
- {
- get { return _isArcHead; }
- set { _isArcHead = value; RaisePropertyChangedAuto(); }
- }
-
- private String _error;
- public String Error
- {
- get { return _error; }
- set { _error = value; RaisePropertyChangedAuto(); }
- }
-
- public RelayCommand ContinueCommand { get; set; }
- public RelayCommand AbortCommand { get; set; }
-
- public ThreadLoadingViewVM(bool userInvoked = false)
- {
- CanClose = false;
-
- TangoIOC.Default.Inject(this);
- _settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
-
- MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged;
- MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected;
-
- IsArcHead = MachineProvider.Machine.MachineHeadType == BL.Enumerations.HeadTypes.Arc;
-
- ContinueCommand = new RelayCommand(Continue, CanContinue);
- AbortCommand = new RelayCommand(Abort);
-
- AdaptToState(userInvoked);
- }
-
- private void MachineProvider_MachineDisconnected(object sender, EventArgs e)
- {
- InvokeUI(() =>
- {
- Cancel();
- });
- }
-
- private void AdaptToState(bool userInvoked = false)
- {
- var status = MachineProvider.MachineOperator.ThreadLoadingStatus;
-
- if (status != null)
- {
- if (status.State == ThreadLoadingState.Preparing)
- {
- Stage = ThreadLoadingStage.Preparing;
- }
- else if (status.State == ThreadLoadingState.ReadyForLoading)
- {
- Stage = ThreadLoadingStage.ReadyForLoading;
- }
- else if (status.State == ThreadLoadingState.Finalizing)
- {
- Stage = ThreadLoadingStage.Finalizing;
- }
- else if (status.State == ThreadLoadingState.PreparationError)
- {
- OnPreparationError(status.ErrorReason);
- }
- else if (status.State == ThreadLoadingState.FinalizationError)
- {
- OnFinalizationError(status.ErrorReason);
- }
- else if (status.State == ThreadLoadingState.Completed)
- {
- if (userInvoked)
- {
- Stage = ThreadLoadingStage.Welcome;
- }
- else
- {
- Stage = ThreadLoadingStage.Completed;
- }
- }
- }
- }
-
- private void MachineOperator_ThreadLoadingStatusChanged(object sender, StartThreadLoadingResponse e)
- {
- Status = e;
- AdaptToState();
- }
-
- private void Continue()
- {
- if (Stage == ThreadLoadingStage.Welcome)
- {
- Stage = ThreadLoadingStage.Preparing;
- StartPreparing();
- }
- else if (Stage == ThreadLoadingStage.ReadyForLoading)
- {
- ContinueThreadLoading();
- }
- else if (Stage == ThreadLoadingStage.Completed)
- {
- Accept();
- }
- else if (Stage == ThreadLoadingStage.PreparationError)
- {
- Stage = ThreadLoadingStage.Preparing;
- StartPreparing();
- }
- else if (Stage == ThreadLoadingStage.FinalizationError)
- {
- ContinueThreadLoading();
- }
- }
-
- private async void StartPreparing()
- {
- try
- {
- await MachineProvider.MachineOperator.StartThreadLoading();
- }
- catch (Exception ex)
- {
- OnPreparationError(ex.Message);
- }
- }
-
- private async void ContinueThreadLoading()
- {
- try
- {
- Stage = ThreadLoadingStage.Finalizing;
- await MachineProvider.MachineOperator.ContinueThreadLoading(SelectedRml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault());
- }
- catch (Exception ex)
- {
- OnFinalizationError(ex.Message);
- }
- }
-
- private bool CanContinue()
- {
- bool canContinue = false;
-
- if (Stage != ThreadLoadingStage.Preparing && Stage != ThreadLoadingStage.Finalizing)
- {
- canContinue = true;
- }
-
- if (Stage == ThreadLoadingStage.ReadyForLoading && SelectedRml == null)
- {
- canContinue = false;
- }
-
- return canContinue;
- }
-
- private void OnPreparationError(String error)
- {
- Error = error;
- Stage = ThreadLoadingStage.PreparationError;
- }
-
- private void OnFinalizationError(String error)
- {
- Error = error;
- Stage = ThreadLoadingStage.FinalizationError;
- }
-
- private void Abort()
- {
- Cancel();
- }
-
- public async override void OnShow()
- {
- base.OnShow();
-
- LogManager.Log("Loading site RMLS...");
-
- List<Rml> rmls = new List<Rml>();
-
- using (ObservablesContext db = ObservablesContext.CreateDefault())
- {
- rmls = await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).WithActiveParametersGroup().BuildListAsync();
- }
-
- var selectedRml = rmls.SingleOrDefault(x => x.Guid == _settings.LoadedRmlGuid);
-
- Rmls = rmls;
- SelectedRml = selectedRml != null ? selectedRml : rmls.FirstOrDefault();
- }
-
- protected override void Cancel()
- {
- CleanUp();
- base.Cancel();
- }
-
- protected override void Accept()
- {
- CleanUp();
- base.Accept();
- }
-
- private void CleanUp()
- {
- MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged;
- MachineProvider.MachineDisconnected -= MachineProvider_MachineDisconnected;
-
- if (SelectedRml != null)
- {
- _settings.LoadedRmlGuid = SelectedRml.Guid;
- _settings.Save();
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml
index 6f70b954d..231f5dabb 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileView.xaml
@@ -6,24 +6,21 @@
xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
mc:Ignorable="d"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:UpdateFromFileViewVM, IsDesignTimeCreatable=False}">
+ Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="550" Height="450" d:DataContext="{d:DesignInstance Type=local:UpdateFromFileViewVM, IsDesignTimeCreatable=False}">
<Grid Margin="20">
<DockPanel>
- <Grid DockPanel.Dock="Bottom">
- <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton>
- <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">UPDATE</touch:TouchButton>
- </Grid>
+ <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal">
+ <touch:TouchButton Command="{Binding CloseCommand}" CornerRadius="25" Style="{StaticResource TangoMessageBoxButton}" HorizontalContentAlignment="Center" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton>
+ <touch:TouchButton Command="{Binding OKCommand}" CornerRadius="25" Style="{StaticResource TangoMessageBoxButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}" HorizontalContentAlignment="Center" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">UPDATE</touch:TouchButton>
+ </StackPanel>
<StackPanel>
<Image Source="../Images/update.png" Stretch="Uniform" Height="120"></Image>
- <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Tango Update Package</TextBlock>
+ <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">UPDATE PACKAGE</TextBlock>
<TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">The selected file contains a software update package. Press 'UPDATE' to start updating your system.</TextBlock>
- <TextBlock TextAlignment="Center" HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">
- <Run FontWeight="SemiBold">Application:</Run>
- <Run Text="{Binding PublishInfo.ApplicationVersion}"></Run>
- <LineBreak/>
- <Run FontWeight="SemiBold">Firmware:</Run>
- <Run Text="{Binding FirmwareVersion,Mode=OneWay}"></Run>
+ <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">
+ <Run>Version</Run>
+ <Run Text="{Binding Version}"></Run>
</TextBlock>
</StackPanel>
</DockPanel>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs
index a38b0431a..b9e876809 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/UpdateFromFileViewVM.cs
@@ -3,18 +3,12 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using Tango.PPC.Common.Publish;
using Tango.SharedUI;
namespace Tango.PPC.UI.Dialogs
{
public class UpdateFromFileViewVM : DialogViewVM
{
- public PublishInfo PublishInfo { get; set; }
-
- public String FirmwareVersion
- {
- get { return PublishInfo.GetFirmwareVersion(); }
- }
+ public String Version { get; set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error.png
deleted file mode 100644
index b4b50e4ac..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting-ready.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting-ready.png
deleted file mode 100644
index a0dc77f92..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting-ready.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service.png
deleted file mode 100644
index ba351ee66..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutting-down.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutting-down.png
deleted file mode 100644
index 9aa8e2db6..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutting-down.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/backup.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/backup.png
deleted file mode 100644
index 158bab095..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/backup.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/1.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/1.jpg
deleted file mode 100644
index 3b2f58620..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/1.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/2.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/2.jpg
deleted file mode 100644
index a2f5ae568..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/2.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/3.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/3.jpg
deleted file mode 100644
index 6069e9c29..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/3.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/4.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/4.jpg
deleted file mode 100644
index 7588d68e2..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/DryerClose/4.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/1.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/1.JPG
deleted file mode 100644
index 68921f1ca..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/1.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/2.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/2.JPG
deleted file mode 100644
index a8b5d9ba4..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/2.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/3.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/3.JPG
deleted file mode 100644
index 407f1eae6..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/3.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/4.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/4.JPG
deleted file mode 100644
index 52063b213..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/4.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/1.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/1.jpg
deleted file mode 100644
index 68921f1ca..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/1.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/2.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/2.jpg
deleted file mode 100644
index a8b5d9ba4..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/2.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/3.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/3.jpg
deleted file mode 100644
index 407f1eae6..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/3.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/4.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/4.jpg
deleted file mode 100644
index 52063b213..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/4.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/5.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/5.jpg
deleted file mode 100644
index fa2c8312d..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/FeedingUnits/arc/5.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/GuidingUnits/1.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/GuidingUnits/1.JPG
deleted file mode 100644
index 8d58771d4..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/GuidingUnits/1.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpg
deleted file mode 100644
index 81aa412ec..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/1.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.JPG
deleted file mode 100644
index 68921f1ca..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/2.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.JPG
deleted file mode 100644
index a8b5d9ba4..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/3.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.JPG
deleted file mode 100644
index 9f200198d..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/4.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.JPG
deleted file mode 100644
index fa2c8312d..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/5.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.JPG b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.JPG
deleted file mode 100644
index 7956b0695..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/6.JPG
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpg
deleted file mode 100644
index 4ca8677cd..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/ReadyForLoading/arc/7.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpg
deleted file mode 100644
index f41898bc1..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/TS1800_CloseUp_Feeder_P.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/machine_full.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/machine_full.jpg
deleted file mode 100644
index 212edc547..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/NewThread/machine_full.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/1.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/1.jpg
deleted file mode 100644
index d8da5726d..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/1.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/2.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/2.jpg
deleted file mode 100644
index a8b5d9ba4..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/2.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/3.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/3.jpg
deleted file mode 100644
index 86dd6f397..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/3.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/4.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/4.jpg
deleted file mode 100644
index 9d36f3642..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/4.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/5.jpg b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/5.jpg
deleted file mode 100644
index 6ac67aa46..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/ThreadLoading/TheDryer/5.jpg
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/backup-big.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/backup-big.png
deleted file mode 100644
index 3a712af49..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/backup-big.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/backup-restore.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/backup-restore.png
deleted file mode 100644
index 15be3b163..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/backup-restore.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/firmware.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/firmware.png
deleted file mode 100644
index af3ea4850..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/firmware.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/loading_anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/loading_anim.gif
deleted file mode 100644
index 793007cc4..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/loading_anim.gif
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-image.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-image.png
deleted file mode 100644
index 277599070..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/machine-image.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power_off.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power_off.gif
deleted file mode 100644
index dd07593e2..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power_off.gif
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power_off_2.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power_off_2.gif
deleted file mode 100644
index 867107140..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/power_off_2.gif
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/powerup.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/powerup.gif
deleted file mode 100644
index f435d38d1..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/powerup.gif
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/restore.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/restore.png
deleted file mode 100644
index e60aaf425..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/restore.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading.gif
deleted file mode 100644
index b6a974084..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading.gif
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading.png
deleted file mode 100644
index 5d536e7ae..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading_preview.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading_preview.png
deleted file mode 100644
index 9bbea3368..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/thread_loading_preview.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/update_available.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/update_available.png
deleted file mode 100644
index c95dfa015..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/update_available.png
+++ /dev/null
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/InternalModule.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/InternalModule.cs
deleted file mode 100644
index e960fa020..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/InternalModule.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Media.Imaging;
-using Tango.BL.Enumerations;
-using Tango.PPC.Common;
-using Tango.PPC.UI.Views;
-
-namespace Tango.PPC.UI
-{
- [PPCModule(100)]
- public class InternalModule : PPCModuleBase
- {
- public InternalModule()
- {
- IsVisibleInMenu = false;
- }
-
- /// <summary>
- /// Gets the module name.
- /// </summary>
- public override string Name
- {
- get
- {
- return "Internal";
- }
- }
-
- /// <summary>
- /// Gets the module description.
- /// </summary>
- public override string Description
- {
- get
- {
- return "Internal Module";
- }
- }
-
- /// <summary>
- /// Gets the module cover image.
- /// </summary>
- public override BitmapSource Image
- {
- get
- {
- return null;
- }
- }
-
- /// <summary>
- /// Gets the module entry point view type.
- /// </summary>
- public override Type MainViewType
- {
- get
- {
- return typeof(InternalModuleView);
- }
- }
-
- /// <summary>
- /// Gets the permission required to see and load this module.
- /// </summary>
- public override Permissions Permission
- {
- get
- {
- return Permissions.RunPPC;
- }
- }
-
- /// <summary>
- /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- /// </summary>
- public override void Dispose()
- {
- //Dispose module here...
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
index bf621ff2e..b90a1afff 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
@@ -61,12 +61,6 @@ namespace Tango.PPC.UI
has_touch = true;
}
}
-
-#if !DEBUG
- ForceTouch();
- has_touch = true;
-#endif
-
#endif
if (!has_touch)
@@ -78,7 +72,7 @@ namespace Tango.PPC.UI
gridMain.Height = 1280;
viewBox.Child = gridMain;
LockAspectRatio();
- this.SizeChanged += (x, y) =>
+ this.SizeChanged += (x, y) =>
{
LockAspectRatio();
};
@@ -87,18 +81,6 @@ namespace Tango.PPC.UI
Closing += MainWindow_Closing;
}
- private void ForceTouch()
- {
- WindowStyle = WindowStyle.None;
- ResizeMode = ResizeMode.NoResize;
- WindowStartupLocation = WindowStartupLocation.Manual;
- Topmost = false; // sure?
- Left = 0;
- Top = 0;
- Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
- Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
- }
-
protected override void OnSourceInitialized(EventArgs e)
{
//var hwndSource = PresentationSource.FromVisual(this) as HwndSource;
@@ -116,7 +98,6 @@ namespace Tango.PPC.UI
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
- e.Cancel = true;
TangoIOC.Default.GetInstance<IPPCApplicationManager>().ShutDown();
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultStudioModuleLoader.cs
index bbabed225..feb7e371f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultStudioModuleLoader.cs
@@ -103,7 +103,7 @@ namespace Tango.PPC.UI.Modules
if (moduleAssembly != null)
{
- foreach (var moduleType in moduleAssembly.GetLoadableTypes().Where(x => !x.IsInterface && typeof(IPPCModule).IsAssignableFrom(x) && !x.IsAbstract))
+ foreach (var moduleType in moduleAssembly.GetTypes().Where(x => !x.IsInterface && typeof(IPPCModule).IsAssignableFrom(x) && !x.IsAbstract))
{
if (!AllModules.ToList().Exists(x => x.GetType() == moduleType))
{
@@ -131,14 +131,10 @@ namespace Tango.PPC.UI.Modules
UserModules.Clear();
- if (_authenticationProvider.AuthenticationRequired && _authenticationProvider.CurrentUser != null)
+ if (_authenticationProvider.CurrentUser != null)
{
UserModules = AllModules.Where(x => _authenticationProvider.CurrentUser.HasPermission(x.Permission)).ToObservableCollection();
}
- else if (!_authenticationProvider.AuthenticationRequired)
- {
- UserModules = AllModules.ToObservableCollection();
- }
ModulesLoaded?.Invoke(this, new EventArgs());
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
index d247ab23c..fe3cabcc1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
@@ -13,7 +12,6 @@ using Tango.Core.Commands;
using Tango.PPC.Common;
using Tango.PPC.Common.Modules;
using Tango.PPC.Common.Navigation;
-using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.Threading;
using Tango.PPC.UI.Views;
using Tango.SharedUI.Controls;
@@ -26,49 +24,23 @@ namespace Tango.PPC.UI.Navigation
/// <seealso cref="Tango.PPC.Common.Navigation.INavigationManager" />
public class DefaultNavigationManager : ExtendedObject, INavigationManager
{
- //private event Action<Object, Object> NavigationCycleCompleted;
- //private event Action<Object, Object> BeforeNavigationCycleCompleted;
- private class AwaitingVMResult
- {
- public PPCViewModel FromVM { get; set; }
- public PPCViewModel ToVM { get; set; }
- public Action Action { get; set; }
- }
+ private event Action<Object, Object> NavigationCycleCompleted;
- private List<AwaitingVMResult> _awaitingVMResults;
private IDispatcherProvider _dispatcherProvider;
private IPPCModuleLoader _moduleLoader;
- private INotificationProvider _notificationProvider;
+ private Object _currentVM;
private String _lastFullPath;
private bool _preventHistory;
private bool _navigating_back;
- public event EventHandler<PPCViewModel> CurrentVMChanged;
-
private Stack<String> _navigationHistory;
- private Object _currentVM;
/// <summary>
/// Gets the current view model.
/// </summary>
public PPCViewModel CurrentVM
{
- set
- {
- var previous = _currentVM;
- _currentVM = value;
-
- var vm = _currentVM as PPCViewModel;
-
- if (_currentVM != previous && vm != null)
- {
- CurrentVMChanged?.Invoke(this, vm);
- }
- }
- get
- {
- return _currentVM as PPCViewModel;
- }
+ get { return _currentVM as PPCViewModel; }
}
private IPPCModule _currentModule;
@@ -95,13 +67,10 @@ namespace Tango.PPC.UI.Navigation
/// Initializes a new instance of the <see cref="DefaultNavigationManager"/> class.
/// </summary>
/// <param name="moduleLoader">The module loader.</param>
- public DefaultNavigationManager(IPPCModuleLoader moduleLoader, IDispatcherProvider dispatcherProvider, INotificationProvider notificationProvider)
+ public DefaultNavigationManager(IPPCModuleLoader moduleLoader, IDispatcherProvider dispatcherProvider)
{
- IsBackEnabled = true;
- _awaitingVMResults = new List<AwaitingVMResult>();
_navigationHistory = new Stack<String>();
_moduleLoader = moduleLoader;
- _notificationProvider = notificationProvider;
NavigateToCommand = new RelayCommand<string>(async (x) => await NavigateTo(x));
NavigateBackCommand = new RelayCommand(async () => await NavigateBack());
@@ -144,19 +113,7 @@ namespace Tango.PPC.UI.Navigation
{
LogManager.Log($"Navigating to: {view.ToString()}...");
-
- var fromView = MainView.Instance.NavigationControl.SelectedElement;
- FrameworkElement toView = null;
-
- toView = MainView.Instance.NavigationControl.NavigateTo(view.ToString(), (Action)(() =>
- {
- CurrentVM = toView.DataContext as PPCViewModel;
- NotifyOnNavigated(fromView.DataContext, toView.DataContext);
-
- }));
-
- NotifyOnBeforeNavigated(fromView.DataContext, toView.DataContext);
-
+ MainView.Instance.NavigationControl.NavigateTo(view.ToString());
return Task.FromResult(true);
}
}
@@ -216,155 +173,88 @@ namespace Tango.PPC.UI.Navigation
/// Navigates to the specified module and view by full path (e.g Jobs.JobsView).
/// </summary>
/// <param name="fullPath">The full path.</param>
- public async Task<bool> NavigateTo(String fullPath, bool pushToHistory = true, Action<PPCViewModel, PPCViewModel> onNavigating = null, Action<PPCViewModel, PPCViewModel> onNavigated = null)
+ public async Task<bool> NavigateTo(String fullPath, bool pushToHistory = true)
{
- try
- {
- IsNavigating = true;
+ String[] path = fullPath.Split('.');
+ var module = _moduleLoader.UserModules.SingleOrDefault(x => x.GetType().Name == path[0] || x.Name == path[0]);
- String[] path = fullPath.Split('.');
- var module = _moduleLoader.UserModules.SingleOrDefault(x => x.GetType().Name == path[0] || x.Name == path[0]);
+ if (path.Length == 1 && path[0] == CurrentModule.Name) return true;
- if (module == null)
- {
- await _notificationProvider.ShowError("The specified module was not loaded.");
- IsNavigating = false;
- return false;
- }
+ LogManager.Log($"Navigating to: {fullPath}...");
- if (path.Length == 1 && path[0] == CurrentModule.Name)
- {
- IsNavigating = false;
- return true;
- }
-
- LogManager.Log($"Navigating to: {fullPath}...");
+ var fromVM = _currentVM;
- var fromVM = CurrentVM;
-
- if (CurrentVM != null && CurrentVM is INavigationBlocker)
+ if (_currentVM != null && _currentVM is INavigationBlocker)
+ {
+ if (_navigating_back)
{
- if (_navigating_back)
+ if (!await (_currentVM as INavigationBlocker).OnNavigateBackRequest())
{
- if (!await (CurrentVM as INavigationBlocker).OnNavigateBackRequest())
- {
- IsNavigating = false;
- return false;
- }
+ return false;
}
- else
+ }
+ else
+ {
+ if (!await (_currentVM as INavigationBlocker).OnNavigateOutRequest())
{
- if (!await (CurrentVM as INavigationBlocker).OnNavigateOutRequest())
- {
- IsNavigating = false;
- return false;
- }
+ return false;
}
}
+ }
+ if (pushToHistory && _lastFullPath != null && !_preventHistory)
+ {
+ _navigationHistory.Push(_lastFullPath);
+ RaisePropertyChanged(nameof(CanNavigateBack));
+ }
+ _lastFullPath = fullPath;
- if (pushToHistory && _lastFullPath != null && !_preventHistory)
- {
- _navigationHistory.Push(_lastFullPath);
- RaisePropertyChanged(nameof(CanNavigateBack));
- }
-
- _lastFullPath = fullPath;
+ MainView.Instance.NavigationControl.NavigateTo(NavigationView.LayoutView.ToString());
+ var navigationControl = LayoutView.Instance.NavigationControl;
+ CurrentModule = module;
+ var moduleView = navigationControl.NavigateTo(module.Name);
- MainView.Instance.NavigationControl.NavigateTo(NavigationView.LayoutView.ToString());
- var navigationControl = LayoutView.Instance.NavigationControl;
- CurrentModule = module;
- var moduleView = navigationControl.NavigateTo(module.Name);
+ _currentVM = moduleView.DataContext;
- CurrentVM = moduleView.DataContext as PPCViewModel;
+ if (path.Length > 1)
+ {
+ var moduleNavigation = moduleView.FindChildOffline<NavigationControl>();
- if (path.Length > 1)
+ if (moduleNavigation != null)
{
- var moduleNavigation = moduleView.FindChildOffline<NavigationControl>();
-
- if (moduleNavigation != null)
+ moduleNavigation.RegisterForLoadedOrNow(async (x, e) =>
{
- moduleNavigation.RegisterForLoadedOrNow(async (x, e) =>
+ foreach (var view in path.Skip(1))
{
- var lastView = moduleNavigation.GetElement(path.Last());
-
- if (lastView != null)
- {
- onNavigating?.Invoke(fromVM as PPCViewModel, lastView.DataContext as PPCViewModel);
- }
+ await Task.Delay(100);
+ var v = moduleNavigation.NavigateTo(view);
- foreach (var view in path.Skip(1))
+ if (v != null)
{
- await Task.Delay(100);
-
- FrameworkElement v = null;
-
- v = moduleNavigation.NavigateTo(view, () =>
- {
- if (v != null)
- {
- NotifyOnNavigated(fromVM, v.DataContext);
- onNavigated?.Invoke(fromVM as PPCViewModel, v.DataContext as PPCViewModel);
- NotifyAwaitingVMResults(fromVM as PPCViewModel, v.DataContext as PPCViewModel);
- }
- });
+ _currentVM = v.DataContext;
- NotifyOnBeforeNavigated(fromVM, v.DataContext);
-
- if (v != null)
- {
- CurrentVM = v.DataContext as PPCViewModel;
-
- if (view != path.Last())
- {
- moduleNavigation = v.FindChildOffline<NavigationControl>();
- }
- }
- else
+ if (view != path.Last())
{
- throw LogManager.Log(new ArgumentNullException("Could not navigate to " + fullPath));
+ moduleNavigation = v.FindChildOffline<NavigationControl>();
}
}
- });
- }
- else
- {
- onNavigating?.Invoke(fromVM as PPCViewModel, CurrentVM as PPCViewModel);
-
- NotifyOnBeforeNavigated(fromVM, CurrentVM);
-
- await Task.Delay(navigationControl.TransitionDuration.TimeSpan);
-
- NotifyOnNavigated(fromVM, CurrentVM);
+ else
+ {
+ throw LogManager.Log(new ArgumentNullException("Could not navigate to " + fullPath));
+ }
+ }
- onNavigated?.Invoke(fromVM as PPCViewModel, CurrentVM as PPCViewModel);
- NotifyAwaitingVMResults(fromVM as PPCViewModel, CurrentVM as PPCViewModel);
- }
+ NavigationCycleCompleted?.Invoke(fromVM, _currentVM);
+ });
}
else
{
- NotifyOnBeforeNavigated(fromVM, CurrentVM);
-
- onNavigating?.Invoke(fromVM as PPCViewModel, CurrentVM as PPCViewModel);
-
- await Task.Delay(navigationControl.TransitionDuration.TimeSpan);
-
- NotifyOnNavigated(fromVM, CurrentVM);
-
- onNavigated?.Invoke(fromVM as PPCViewModel, CurrentVM as PPCViewModel);
- NotifyAwaitingVMResults(fromVM as PPCViewModel, CurrentVM as PPCViewModel);
+ NavigationCycleCompleted?.Invoke(fromVM, _currentVM);
}
-
- return true;
- }
- catch (Exception ex)
- {
- IsNavigating = false;
- LogManager.Log(ex, $"Error navigating to '{fullPath}'.");
- await _notificationProvider.ShowError($"Error navigating to '{fullPath}'.");
- return false;
}
+
+ return true;
}
/// <summary>
@@ -377,35 +267,46 @@ namespace Tango.PPC.UI.Navigation
/// <param name="obj">The object.</param>
/// <param name="pushToHistory">if set to <c>true</c> [push to history].</param>
/// <returns></returns>
- public async Task<TResult> NavigateForResult<TModule, TView, TResult, TObject>(TObject obj, bool pushToHistory = true)
+ public Task<TResult> NavigateForResult<TModule, TView, TResult, TObject>(TObject obj, bool pushToHistory = true)
where TModule : IPPCModule
{
TaskCompletionSource<TResult> source = new TaskCompletionSource<TResult>();
- var fromVM = CurrentVM;
+ var fromVM = _currentVM;
+ Object toVM = null;
+
+
+ Action<Object, Object> handler = null;
- await NavigateTo(typeof(TModule).Name + "." + typeof(TView).Name, pushToHistory, (from, to) =>
+ handler = (from, to) =>
{
- _awaitingVMResults.Add(new AwaitingVMResult()
+ if (toVM == null)
+ {
+ toVM = to;
+ if (toVM is INavigationResultProvider<TResult, TObject>)
+ {
+ (toVM as INavigationResultProvider<TResult, TObject>).OnNavigationObjectReceived(obj);
+ }
+ }
+ else
{
- FromVM = fromVM as PPCViewModel,
- ToVM = to as PPCViewModel,
- Action = () =>
+ if (to == fromVM && from == toVM)
{
- if (to is INavigationResultProvider<TResult, TObject>)
+ if (from is INavigationResultProvider<TResult, TObject>)
{
- source.SetResult((to as INavigationResultProvider<TResult, TObject>).GetNavigationResult());
+ source.SetResult((from as INavigationResultProvider<TResult, TObject>).GetNavigationResult());
}
}
- });
- if (to is INavigationResultProvider<TResult, TObject>)
- {
- (to as INavigationResultProvider<TResult, TObject>).OnNavigationObjectReceived(obj);
+ NavigationCycleCompleted -= handler;
}
- });
+ };
+
+ NavigationCycleCompleted += handler;
- return await source.Task;
+ NavigateTo<TModule>(typeof(TView).Name, pushToHistory);
+
+ return source.Task;
}
/// <summary>
@@ -419,13 +320,25 @@ namespace Tango.PPC.UI.Navigation
/// <returns></returns>
public Task<bool> NavigateWithObject<TModule, TView, TPass>(TPass obj, bool pushToHistory = true) where TModule : IPPCModule
{
- return NavigateTo(typeof(TModule).Name + "." + typeof(TView).Name, pushToHistory, (fromVM, toVM) =>
+ TaskCompletionSource<bool> source = new TaskCompletionSource<bool>();
+
+ Action<Object, Object> handler = null;
+
+ handler = (from, to) =>
{
- if (toVM is INavigationObjectReceiver<TPass>)
+ if (to is INavigationObjectReceiver<TPass>)
{
- (toVM as INavigationObjectReceiver<TPass>).OnNavigatedToWithObject(obj);
+ (to as INavigationObjectReceiver<TPass>).OnNavigatedToWithObject(obj);
}
- });
+
+ NavigationCycleCompleted -= handler;
+ };
+
+ NavigationCycleCompleted += handler;
+
+ NavigateTo<TModule>(typeof(TView).Name, pushToHistory);
+
+ return source.Task;
}
private Task<bool> NavigateTo(Type moduleType, bool pushToHistory = true, params String[] viewPath)
@@ -448,30 +361,6 @@ namespace Tango.PPC.UI.Navigation
get { return _navigationHistory.Count > 0; }
}
- private bool _isBackEnabled;
- /// <summary>
- /// Gets a value indicating whether the back should be enabled.
- /// </summary>
- public bool IsBackEnabled
- {
- get { return _isBackEnabled; }
- set { _isBackEnabled = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isNavigating;
- /// <summary>
- /// Gets or sets a value indicating whether the navigation system is currently navigating.
- /// </summary>
- public bool IsNavigating
- {
- get { return _isNavigating; }
- set
- {
- _isNavigating = value;
- RaisePropertyChangedAuto();
- }
- }
-
/// <summary>
/// Navigates to the previous view if <see cref="P:Tango.PPC.Common.Navigation.INavigationManager.CanNavigateBack" /> is true.
/// </summary>
@@ -481,35 +370,25 @@ namespace Tango.PPC.UI.Navigation
_navigating_back = true;
- if (_navigationHistory.Count > 0)
- {
- String first = _navigationHistory.Pop();
- _preventHistory = true;
+ String first = _navigationHistory.Pop();
+ _preventHistory = true;
- if (await NavigateTo(first))
- {
- RaisePropertyChanged(nameof(CanNavigateBack));
- _preventHistory = false;
- _navigating_back = false;
- return true;
- }
- else
- {
- _navigationHistory.Push(first);
- _preventHistory = false;
- _navigating_back = false;
- RaisePropertyChanged(nameof(CanNavigateBack));
- return false;
- }
- }
- else
+
+ if (await NavigateTo(first))
{
- await NavigateTo(NavigationView.HomeModule);
RaisePropertyChanged(nameof(CanNavigateBack));
_preventHistory = false;
_navigating_back = false;
return true;
}
+ else
+ {
+ _navigationHistory.Push(first);
+ _preventHistory = false;
+ _navigating_back = false;
+ RaisePropertyChanged(nameof(CanNavigateBack));
+ return false;
+ }
}
/// <summary>
@@ -541,48 +420,5 @@ namespace Tango.PPC.UI.Navigation
RaisePropertyChanged(nameof(CanNavigateBack));
}
-
- private void NotifyOnBeforeNavigated(object fromVM, object toVM)
- {
- if (fromVM == toVM) return;
-
- if (fromVM is PPCViewModel)
- {
- (fromVM as PPCViewModel)?.OnBeforeNavigatedFrom();
- }
-
- if (toVM is PPCViewModel)
- {
- (toVM as PPCViewModel)?.OnBeforeNavigatedTo();
- }
- }
-
- private void NotifyOnNavigated(object fromVM, object toVM)
- {
- IsNavigating = false;
-
- if (fromVM == toVM) return;
-
- if (fromVM is PPCViewModel)
- {
- (fromVM as PPCViewModel)?.OnNavigatedFrom();
- }
-
- if (toVM is PPCViewModel)
- {
- (toVM as PPCViewModel)?.OnNavigatedTo();
- (toVM as PPCViewModel)?.OnNavigatedTo(fromVM as PPCViewModel);
- }
- }
-
- private void NotifyAwaitingVMResults(PPCViewModel fromVM, PPCViewModel toVM)
- {
- var awaiter = _awaitingVMResults.SingleOrDefault(x => x.FromVM == toVM && x.ToVM == fromVM);
- if (awaiter != null)
- {
- _awaitingVMResults.Remove(awaiter);
- awaiter.Action();
- }
- }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
index e9de2538e..65337a892 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
@@ -17,8 +17,6 @@ using Tango.Touch.Controls;
using Tango.SharedUI;
using System.Reflection;
using Tango.Core.DI;
-using System.ComponentModel;
-using System.Windows.Data;
namespace Tango.PPC.UI.Notifications
{
@@ -49,16 +47,6 @@ namespace Tango.PPC.UI.Notifications
public ObservableCollection<NotificationItem> NotificationItems { get; private set; }
/// <summary>
- /// Gets the application bar items.
- /// </summary>
- public ObservableCollection<AppBarItem> AppBarItems { get; private set; }
-
- /// <summary>
- /// Gets the notification items view.
- /// </summary>
- public ICollectionView NotificationItemsView { get; private set; }
-
- /// <summary>
/// Gets the collection of taskbar items.
/// </summary>
public ObservableCollection<TaskBarItem> TaskBarItems { get; private set; }
@@ -70,10 +58,6 @@ namespace Tango.PPC.UI.Notifications
{
NotificationsVisible = true;
NotificationItems = new ObservableCollection<NotificationItem>();
-
- AppBarItems = new ObservableCollection<AppBarItem>();
- CollectionViewSource.GetDefaultView(AppBarItems).SortDescriptions.Add(new SortDescription(nameof(AppBarItem.Priority), ListSortDirection.Ascending));
-
TaskBarItems = new ObservableCollection<TaskBarItem>();
_pendingMessageBoxes = new ConcurrentQueue<PendingNotification<MessageBoxVM, bool>>();
_pendingDialogs = new ConcurrentQueue<PendingNotification<DialogAndView, DialogViewVM>>();
@@ -82,9 +66,6 @@ namespace Tango.PPC.UI.Notifications
PopNotificationCommand = new RelayCommand<NotificationItem>((x) => PopNotification(x));
NotificationItems.EnableCrossThreadOperations();
-
- NotificationItemsView = CollectionViewSource.GetDefaultView(NotificationItems);
- NotificationItemsView.SortDescriptions.Add(new SortDescription(nameof(NotificationItem.Priority), ListSortDirection.Descending));
}
private MessageBoxVM _currentMessageBox;
@@ -341,33 +322,29 @@ namespace Tango.PPC.UI.Notifications
/// <returns></returns>
public async Task<T> ShowDialog<T>(T datacontext, FrameworkElement view) where T : DialogViewVM
{
- TaskCompletionSource<DialogViewVM> source = new TaskCompletionSource<DialogViewVM>();
+ view.DataContext = datacontext;
+
+ TangoIOC.Default.Inject(datacontext);
- InvokeUI(() =>
+ view.Loaded += (_, __) =>
{
view.DataContext = datacontext;
+ datacontext.OnShow();
+ };
- TangoIOC.Default.Inject(datacontext);
-
- view.Loaded += (_, __) =>
- {
- view.DataContext = datacontext;
- datacontext.OnShow();
- };
-
- datacontext.Accepted += () => { OnDialogClosed(); source.SetResult(datacontext); };
- datacontext.Canceled += () => { OnDialogClosed(); source.SetResult(datacontext); };
+ TaskCompletionSource<DialogViewVM> source = new TaskCompletionSource<DialogViewVM>();
- if (CurrentDialog == null)
- {
- CurrentDialog = view;
- }
- else
- {
- _pendingDialogs.Enqueue(new PendingNotification<DialogAndView, DialogViewVM>(new DialogAndView(datacontext, view), source));
- }
+ datacontext.Accepted += () => { OnDialogClosed(); source.SetResult(datacontext); };
+ datacontext.Canceled += () => { OnDialogClosed(); source.SetResult(datacontext); };
- });
+ if (CurrentDialog == null)
+ {
+ CurrentDialog = view;
+ }
+ else
+ {
+ _pendingDialogs.Enqueue(new PendingNotification<DialogAndView, DialogViewVM>(new DialogAndView(datacontext, view), source));
+ }
var result = await source.Task;
return result as T;
@@ -399,31 +376,23 @@ namespace Tango.PPC.UI.Notifications
/// <returns></returns>
public Task<T> ShowDialog<T>(T datacontext) where T : DialogViewVM
{
- TaskCompletionSource<T> source = new TaskCompletionSource<T>();
+ var callingAssembly = datacontext.GetType().Assembly;
+ String viewName = datacontext.GetType().FullName.Replace("VM", "");
+ var viewType = callingAssembly.GetType(viewName);
- InvokeUI(async () =>
+ if (viewType == null)
{
- var callingAssembly = datacontext.GetType().Assembly;
- String viewName = datacontext.GetType().FullName.Replace("VM", "");
- var viewType = callingAssembly.GetType(viewName);
-
- if (viewType == null)
- {
- throw new NullReferenceException("View type for " + datacontext.GetType().Name + " could not be found!");
- }
-
- var view = Activator.CreateInstance(viewType) as FrameworkElement;
+ throw new NullReferenceException("View type for " + datacontext.GetType().Name + " could not be found!");
+ }
- if (view == null)
- {
- throw new NullReferenceException("The view " + viewType.ToString() + " is not of type framework element.");
- }
+ var view = Activator.CreateInstance(viewType) as FrameworkElement;
- T result = await ShowDialog<T>(datacontext, view);
- source.SetResult(result);
- });
+ if (view == null)
+ {
+ throw new NullReferenceException("The view " + viewType.ToString() + " is not of type framework element.");
+ }
- return source.Task;
+ return ShowDialog<T>(datacontext, view);
}
/// <summary>
@@ -435,15 +404,7 @@ namespace Tango.PPC.UI.Notifications
/// <returns></returns>
public Task<T> ShowDialog<T>() where T : DialogViewVM
{
- TaskCompletionSource<T> source = new TaskCompletionSource<T>();
-
- InvokeUI(async () =>
- {
- var result = await ShowDialog<T>(Activator.CreateInstance<T>());
- source.SetResult(result);
- });
-
- return source.Task;
+ return ShowDialog<T>(Activator.CreateInstance<T>());
}
/// <summary>
@@ -481,12 +442,22 @@ namespace Tango.PPC.UI.Notifications
/// </summary>
public bool IsInGlobalBusyState { get; private set; }
+ private AppBarItem _currentAppBarItem;
+ /// <summary>
+ /// Gets the current application bar item.
+ /// </summary>
+ public AppBarItem CurrentAppBarItem
+ {
+ get { return _currentAppBarItem; }
+ set { _currentAppBarItem = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasAppBarItem)); }
+ }
+
/// <summary>
/// Gets a value indicating whether this instance has application bar item.
/// </summary>
- public bool HasAppBarItems
+ public bool HasAppBarItem
{
- get { return AppBarItems.Count > 0; }
+ get { return CurrentAppBarItem != null; }
}
/// <summary>
@@ -497,9 +468,8 @@ namespace Tango.PPC.UI.Notifications
public AppBarItem PushAppBarItem(AppBarItem appBarItem)
{
LogManager.Log($"Pushing AppBarItem '{appBarItem.GetType().Name}'.");
- AppBarItems.Add(appBarItem);
+ CurrentAppBarItem = appBarItem;
appBarItem.RemoveAction = () => PopAppBarItem(appBarItem);
- RaisePropertyChanged(nameof(HasAppBarItems));
return appBarItem;
}
@@ -508,9 +478,9 @@ namespace Tango.PPC.UI.Notifications
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
- public T PushAppBarItem<T>() where T : AppBarItem
+ public AppBarItem PushAppBarItem<T>() where T : AppBarItem
{
- return PushAppBarItem(Activator.CreateInstance<T>()) as T;
+ return PushAppBarItem(Activator.CreateInstance<T>());
}
/// <summary>
@@ -519,12 +489,8 @@ namespace Tango.PPC.UI.Notifications
/// <param name="appBarItem">The application bar item.</param>
public void PopAppBarItem(AppBarItem appBarItem)
{
- InvokeUI(() =>
- {
- LogManager.Log($"Popping out AppBarItem '{appBarItem.GetType().Name}'.");
- AppBarItems.Remove(appBarItem);
- RaisePropertyChanged(nameof(HasAppBarItems));
- });
+ LogManager.Log($"Popping out AppBarItem '{appBarItem.GetType().Name}'.");
+ CurrentAppBarItem = null;
}
/// <summary>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs
deleted file mode 100644
index 9e336f276..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.PPC.Common.Notifications;
-
-namespace Tango.PPC.UI.Notifications.NotificationItems
-{
- /// <summary>
- /// Represents a simple text message notification item which can be inserted into the application notifications panel.
- /// </summary>
- /// <seealso cref="Tango.PPC.Common.Notifications.NotificationItem" />
- public class UpdateAvailableNotificationItem : NotificationItem
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="UpdateAvailableNotificationItem"/> class.
- /// </summary>
- public UpdateAvailableNotificationItem()
- {
- CanClose = true;
- }
-
- private String _version;
- /// <summary>
- /// Gets or sets the message.
- /// </summary>
- public String Version
- {
- get { return _version; }
- set { _version = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isDatabaseUpdate;
- /// <summary>
- /// Gets or sets a value indicating whether this instance is database update.
- /// </summary>
- public bool IsDatabaseUpdate
- {
- get { return _isDatabaseUpdate; }
- set { _isDatabaseUpdate = value; RaisePropertyChangedAuto(); }
- }
-
- /// <summary>
- /// Gets or sets the view type.
- /// </summary>
- public override Type ViewType
- {
- get { return typeof(UpdateAvailableNotificationItemView); }
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml
deleted file mode 100644
index 1d4dd6fc7..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml
+++ /dev/null
@@ -1,30 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Notifications.NotificationItems.UpdateAvailableNotificationItemView"
- 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:local="clr-namespace:Tango.PPC.UI.Notifications.NotificationItems"
- xmlns:common="clr-namespace:Tango.PPC.Common.Converters"
- mc:Ignorable="d"
- x:Name="MessageNotificationItemControl"
- d:DesignHeight="60" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:UpdateAvailableNotificationItem, IsDesignTimeCreatable=False}" MinHeight="90" Height="90" MaxHeight="150" Background="{StaticResource TangoPrimaryBackgroundBrush}">
-
- <Grid>
- <Border BorderThickness="0 0 0 2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" Padding="15">
- <DockPanel>
- <Image Source="/Images/update_available.png" MaxHeight="50" />
-
- <Grid>
- <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" Visibility="{Binding IsDatabaseUpdate,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
- <Run>Version</Run>
- <Run Foreground="{StaticResource TangoPrimaryAccentBrush}" FontWeight="SemiBold" Text="{Binding Version,FallbackValue='1.0.0.0',TargetNullValue='1.0.0.0'}"></Run>
- <Run>is available!</Run>
- <Run>Tap to start updating your system.</Run>
- </TextBlock>
- <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" Text="Database updates are available. Tap to start updating your system." Visibility="{Binding IsDatabaseUpdate,Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
- </Grid>
- </DockPanel>
- </Border>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml.cs
deleted file mode 100644
index 791d40540..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-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.PPC.UI.Notifications.NotificationItems
-{
- /// <summary>
- /// Represents the <see cref="UpdateAvailableNotificationItemView"/> view.
- /// </summary>
- /// <seealso cref="System.Windows.Controls.UserControl" />
- /// <seealso cref="System.Windows.Markup.IComponentConnector" />
- public partial class UpdateAvailableNotificationItemView : UserControl
- {
- public UpdateAvailableNotificationItemView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
index 83790a56f..c7351aa4a 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -32,10 +32,6 @@ using Tango.PPC.UI.Dialogs;
using Tango.Core.Threading;
using Tango.PPC.Common.Messages;
using Tango.Core.ExtensionMethods;
-using Tango.PPC.Common.Navigation;
-using Tango.PPC.Common.Synchronization;
-using Tango.Insights;
-using System.Threading;
namespace Tango.PPC.UI.PPCApplication
{
@@ -53,7 +49,6 @@ namespace Tango.PPC.UI.PPCApplication
private IEventLogger _eventLogger;
private IPPCModuleLoader _moduleLoader;
private INotificationProvider _notificationProvider;
- private IMachineDataSynchronizer _machineDataSynchronizer;
private WatchDogServer _watchdogServer;
private ObservablesContext _machineContext;
private ActionTimer _screenLockTimer;
@@ -64,11 +59,6 @@ namespace Tango.PPC.UI.PPCApplication
public event EventHandler SystemRestartRequired;
/// <summary>
- /// Occurs when the updater utility has failed to perform the last update.
- /// </summary>
- public event EventHandler UpdaterFailed;
-
- /// <summary>
/// Occurs when the application has started.
/// </summary>
public event EventHandler ApplicationStarted;
@@ -103,15 +93,10 @@ namespace Tango.PPC.UI.PPCApplication
/// </summary>
public bool IsShuttingDown { get; private set; }
- private bool _isInTechnicianMode;
/// <summary>
/// Gets a value indicating whether the application is in technician mode.
/// </summary>
- public bool IsInTechnicianMode
- {
- get { return _isInTechnicianMode; }
- set { _isInTechnicianMode = value; RaisePropertyChangedAuto(); }
- }
+ public bool IsInTechnicianMode { get; private set; }
/// <summary>
/// Gets the application version.
@@ -140,16 +125,6 @@ namespace Tango.PPC.UI.PPCApplication
/// </summary>
public DateTime StartUpDate { get; private set; }
- /// <summary>
- /// Gets a value indicating whether an update has occurred before the application started.
- /// </summary>
- public bool IsAfterUpdate { get; private set; }
-
- /// <summary>
- /// Gets a value indicating whether the updater utility has failed to perform the last update.
- /// </summary>
- public bool IsUpdateFailed { get; private set; }
-
private bool _isScreenLocked;
/// <summary>
/// Gets or sets a value indicating whether the screen is currently locked.
@@ -161,34 +136,15 @@ namespace Tango.PPC.UI.PPCApplication
}
/// <summary>
- /// Gets the firmware version.
- /// </summary>
- public Version FirmwareVersion
- {
- get
- {
- return Version.Parse(SettingsManager.Default.GetOrCreate<PPCSettings>().FirmwareVersion);
- }
- }
-
- /// <summary>
- /// Gets or sets the application folder.
- /// </summary>
- public String StartPath { get; private set; }
-
- /// <summary>
/// Initializes a new instance of the <see cref="DefaultPPCApplicationManager"/> class.
/// </summary>
- public DefaultPPCApplicationManager(IMachineProvider machineProvider, IDispatcherProvider dispatcherProvider, IEventLogger eventLogger, IPPCModuleLoader moduleLoader, INotificationProvider notificationProvider, IMachineDataSynchronizer machineDataSynchronizer)
+ public DefaultPPCApplicationManager(IMachineProvider machineProvider, IDispatcherProvider dispatcherProvider, IEventLogger eventLogger, IPPCModuleLoader moduleLoader, INotificationProvider notificationProvider)
{
- StartPath = AssemblyHelper.GetCurrentAssemblyFolder();
-
_notificationProvider = notificationProvider;
_machineProvider = machineProvider;
_dispatcher = dispatcherProvider;
_eventLogger = eventLogger;
_moduleLoader = moduleLoader;
- _machineDataSynchronizer = machineDataSynchronizer;
if (!DesignMode)
{
@@ -254,15 +210,11 @@ namespace Tango.PPC.UI.PPCApplication
{
LogManager.Log("Application started with '-update_ok' startup arguments. The application has been successfully updated.");
- if (settings.ApplicationState == ApplicationStates.PreSetup || settings.ApplicationState == ApplicationStates.FactoryRestore)
+ if (settings.ApplicationState == ApplicationStates.PreSetup)
{
isAfterSetup = true;
LogManager.Log("System restart is required.");
}
- else
- {
- IsAfterUpdate = true;
- }
settings.ApplicationState = ApplicationStates.Ready;
settings.Save();
@@ -274,27 +226,13 @@ namespace Tango.PPC.UI.PPCApplication
}
}
- if (App.StartupArgs.Contains("-update_failed"))
- {
- LogManager.Log("Application started with '-update_failed' startup arguments. The updater utility has failed.");
-
- IsUpdateFailed = true;
-
- settings.ApplicationState = ApplicationStates.Ready;
- settings.Save();
- UpdaterFailed?.Invoke(this, new EventArgs());
- return;
- }
-
if (settings.ApplicationState == ApplicationStates.Ready)
{
LogManager.Log("Initializing ObservablesStaticCollections...");
ObservablesStaticCollections.Instance.Initialize();
LogManager.Log("Loading machine from database...");
_machineContext = ObservablesContext.CreateDefault();
- _machine = new MachineBuilder(_machineContext).SetFirst().WithVersion().WithOrganization().WithConfiguration().WithSpools().WithCats().Build();
-
-
+ _machine = new MachineBuilder(_machineContext).SetFirst().WithVersion().WithSettings().WithOrganization().WithConfiguration().WithSpools().WithCats().Build();
}
initialized = true;
@@ -338,6 +276,7 @@ namespace Tango.PPC.UI.PPCApplication
{
LogManager.Log($"Raising {nameof(ApplicationStarted)} event...");
+ _eventLogger.Log(EventTypes.APPLICATION_STARTED, "Application Started!");
ApplicationStarted?.Invoke(this, new EventArgs());
LogManager.Log("Invoking PPC view models OnApplicationStarted methods...");
@@ -351,8 +290,6 @@ namespace Tango.PPC.UI.PPCApplication
}
}
- var internalModules = this.GetType().Assembly.GetTypes().Where(xx => typeof(PPCModuleBase).IsAssignableFrom(xx)).ToList();
-
LogManager.Log("Waiting for IPPCModuleLoader instance injection...");
TangoIOC.Default.GetInstanceWhenAvailable<IPPCModuleLoader>((loader) =>
{
@@ -367,32 +304,12 @@ namespace Tango.PPC.UI.PPCApplication
{
if (!Views.LayoutView.Instance.NavigationControl.Elements.ToList().Exists(m => m.GetType() == module.MainViewType))
{
- try
- {
- LogManager.Log("Loading module view " + module.Name + "...");
- FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement;
- SharedUI.Controls.NavigationControl.SetNavigationName(view, module.Name);
- Views.LayoutView.Instance.NavigationControl.Elements.Add(view);
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, $"Error loading module view for module {module.Name}.");
- }
+ LogManager.Log("Loading module view " + module.Name + "...");
+ FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement;
+ SharedUI.Controls.NavigationControl.SetNavigationName(view, module.Name);
+ Views.LayoutView.Instance.NavigationControl.Elements.Add(view);
}
}
-
- //Adding internal modules.
- LogManager.Log("Loading internal modules...");
- foreach (var type in internalModules)
- {
- var module = Activator.CreateInstance(type) as IPPCModule;
- LogManager.Log("Loading module view " + module.Name + "...");
- FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement;
- SharedUI.Controls.NavigationControl.SetNavigationName(view, module.Name);
- Views.LayoutView.Instance.NavigationControl.Elements.Add(view);
- _moduleLoader.AllModules.Add(module);
- _moduleLoader.UserModules.Add(module);
- }
});
LogManager.Log($"{loader.UserModules.Count} modules loaded.");
@@ -417,9 +334,6 @@ namespace Tango.PPC.UI.PPCApplication
LogManager.Log("Initializing Machine Provider...");
_machineProvider.Init(_machine, _machineContext);
- LogManager.Log("Starting Machine Data Synchronizer...");
- _machineDataSynchronizer.IsEnabled = true;
-
LogManager.Log("Applications initialization completed!");
LogManager.Log("Checking for un-notified PPC view models...");
@@ -436,7 +350,6 @@ namespace Tango.PPC.UI.PPCApplication
_dispatcher.Invoke(() =>
{
LogManager.Log($"Invoking {nameof(ApplicationReady)} event.");
- _eventLogger.Log(EventTypes.APPLICATION_STARTED, "Application Started!");
ApplicationReady?.Invoke(this, new EventArgs());
LogManager.Log("Notifying view models about application ready...");
@@ -477,7 +390,7 @@ namespace Tango.PPC.UI.PPCApplication
/// <summary>
/// Shutdown the application.
/// </summary>
- public async void ShutDown()
+ public void ShutDown()
{
if (IsShuttingDown) return;
@@ -495,22 +408,13 @@ namespace Tango.PPC.UI.PPCApplication
}
catch { }
- try
- {
- await FinalizeApplication();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error occurred on application shutdown finalization.");
- }
-
Environment.Exit(0);
}
/// <summary>
/// Restarts the application.
/// </summary>
- public async void Restart()
+ public void Restart()
{
if (IsShuttingDown) return;
@@ -518,28 +422,13 @@ namespace Tango.PPC.UI.PPCApplication
try
{
- _dispatcher.Invoke(() =>
- {
- var nav = TangoIOC.Default.GetInstance<INavigationManager>();
- if (nav != null)
- {
- nav.NavigateTo(NavigationView.RestartingView);
- }
- });
-
LogManager.Log("Restarting the application...");
- await Task.Delay(8000);
-
_watchdogServer.Dispose();
foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>())
{
- try
- {
- vm.OnApplicationShuttingDown();
- }
- catch { }
+ vm.OnApplicationShuttingDown();
}
}
catch { }
@@ -553,15 +442,6 @@ namespace Tango.PPC.UI.PPCApplication
}
catch { }
- try
- {
- await FinalizeApplication();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error occurred on application shutdown finalization.");
- }
-
Process.Start(Application.ResourceAssembly.Location);
Environment.Exit(0);
}
@@ -569,82 +449,25 @@ namespace Tango.PPC.UI.PPCApplication
/// <summary>
/// Runs the updater utility and exits the application.
/// </summary>
- public async void UpdateApplication(String updaterPath, String arguments)
+ public void UpdateApplication(String updaterPath, String arguments)
{
if (IsShuttingDown) return;
IsShuttingDown = true;
- LogManager.Log("Restarting application for update...");
-
try
{
- LogManager.Log("Navigating to restart view...");
- _dispatcher.Invoke(() =>
- {
- var nav = TangoIOC.Default.GetInstance<INavigationManager>();
- if (nav != null)
- {
- nav.NavigateTo(NavigationView.RestartingView);
- }
- });
-
- LogManager.Log("Waiting 2 seconds...");
- await Task.Delay(2000);
-
- try
- {
- LogManager.Log("Disposing watch dog...");
- _watchdogServer.Dispose();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error disposing watch dog.");
- }
+ _watchdogServer.Dispose();
- LogManager.Log("Raising OnApplicationShutDown for all view models...");
foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>())
{
- try
- {
- vm.OnApplicationShuttingDown();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, $"Error on {vm.GetType().Name}.OnApplicationShutDown().");
- }
+ vm.OnApplicationShuttingDown();
}
}
catch { }
- try
- {
- LogManager.Log("Saving application settings...");
- SettingsManager.Default.GetOrCreate<PPCSettings>().PreviousApplicationVersion = Version.ToString();
- SettingsManager.Default.Save();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error saving application settings.");
- }
-
- try
- {
- await FinalizeApplication();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error occurred on application shutdown finalization.");
- }
-
LogManager.Log($"Executing '{updaterPath}' with arguments '{arguments}'...");
-
- Process p = new Process();
- p.StartInfo.FileName = updaterPath;
- p.StartInfo.Arguments = arguments;
- p.StartInfo.LoadUserProfile = true;
- p.StartInfo.UseShellExecute = true;
- p.Start();
+ Process.Start(updaterPath, arguments);
LogManager.Log("Terminating application...");
Environment.Exit(0);
@@ -723,48 +546,5 @@ namespace Tango.PPC.UI.PPCApplication
{
IsScreenLocked = true;
}
-
- public void SetWindowState(WindowState state)
- {
- InvokeUI(() =>
- {
- MainWindow.Instance.WindowState = state;
- });
- }
-
- private Task FinalizeApplication()
- {
- LogManager.Log("Finalizing application...");
-
- return LimitedTimeTask.StartNew(() =>
- {
- try
- {
- LogManager.Log("Flushing machine events...");
- _eventLogger.Log(EventTypes.APPLICATION_TERMINATED, "User Interface Terminated.");
- _eventLogger.FlushAll();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error flushing machine events.");
- }
-
- try
- {
- LogManager.Log("Disposing insights manager (max 40 seconds to complete)...");
- Stopwatch watch = new Stopwatch();
- watch.Start();
- var frame = InsightsFrame.CreateEmpty(DateTime.UtcNow);
- InsightsManager.Default.InsertFrame(frame);
- InsightsManager.Default.Dispose();
- watch.Stop();
- LogManager.Log($"Insights manager disposed after {(int)watch.Elapsed.TotalSeconds} seconds.");
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error disposing insights manager.");
- }
- }, TimeSpan.FromSeconds(40));
- }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
index 1f2895f26..56ec2fa7e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
@@ -259,11 +259,7 @@ namespace Tango.PPC.UI.Printing
{
throw new InvalidOperationException("Error starting job. Color is out of range.");
}
- if (job.Segments.SelectMany(x => x.BrushStops).Any(x => x.IsLiquidVolumesOutOfRange))
- {
- throw new InvalidOperationException("Error starting job. Total ink volume is out of range.");
- }
- if (job.Segments.SelectMany(x => x.BrushStops).Any(x => x.BrushColorSpace == ColorSpaces.Catalog && x.ColorCatalogsItem == null && !x.IsTransparent && !x.IsWhite))
+ if (job.Segments.SelectMany(x => x.BrushStops).Any(x => x.BrushColorSpace == ColorSpaces.Catalog && x.ColorCatalogsItem == null))
{
throw new InvalidOperationException("Error starting job. Please select a catalog color.");
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
index 0540cfa9b..02099e659 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
@@ -8,4 +8,4 @@ using System.Windows;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tango PPC Application")]
-[assembly: AssemblyVersion("1.2.9.0")]
+[assembly: AssemblyVersion("1.0.50.0")]
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/RemoteActions/DefaultRemoteActionsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/RemoteActions/DefaultRemoteActionsService.cs
deleted file mode 100644
index 1b8780f91..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/RemoteActions/DefaultRemoteActionsService.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Tango.Core.DI;
-using Tango.Core.Threading;
-using Tango.Integration.ExternalBridge;
-using Tango.PPC.Common.ExternalBridge;
-using Tango.PPC.Common.RemoteActions;
-using Tango.PPC.Common.Threading;
-using Tango.PPC.Shared.RemoteActions;
-
-namespace Tango.PPC.UI.RemoteActions
-{
- [TangoCreateWhenRegistered]
- public class DefaultRemoteActionsService : IRemoteActionsService, IExternalBridgeRequestHandler
- {
- [TangoInject]
- private IDispatcherProvider DispatcherProvider { get; set; }
-
- public DefaultRemoteActionsService(IPPCExternalBridgeService externalBridge)
- {
- externalBridge.RegisterRequestHandler(this);
- }
-
- public void OnReceiverDisconnected(ExternalBridgeReceiver receiver)
- {
- //Do nothing.
- }
-
- [ExternalBridgeRequestHandlerMethod(typeof(SimulateApplicationExceptionRequest), RequestHandlerLoggingMode.LogRequestName)]
- public async Task OnSimulateApplicationExceptionRequest(SimulateApplicationExceptionRequest request, String token, ExternalBridgeReceiver receiver)
- {
- await receiver.SendGenericResponse(new SimulateApplicationExceptionResponse(), token);
-
- Thread.Sleep(500);
-
- DispatcherProvider.Invoke(() =>
- {
- if (request.CrashApplication)
- {
- App.ExceptionTrapper.Disable();
- throw new OutOfMemoryException("This is a simulated exception to cause the application to crash.");
- }
- else
- {
- throw new ApplicationException("This is a simulated exception to cause an unhandled application error.");
- }
- });
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml
index d6cd842d5..f0e872285 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml
@@ -13,6 +13,4 @@
<SolidColorBrush x:Key="TangoMessageBoxHeaderSuccessBrush" Color="#F1FFF4" />
<SolidColorBrush x:Key="TangoMessageBoxHeaderQuestionBrush" Color="#DCE7FC" />
- <SolidColorBrush x:Key="TangoEmergecyScreenBackgroundBrush" Color="#FFD9E4" />
-
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
index 081d79f3e..c5045abf3 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
@@ -114,23 +114,12 @@
<Compile Include="..\..\Versioning\GlobalVersionInfo.cs">
<Link>GlobalVersionInfo.cs</Link>
</Compile>
- <Compile Include="AppBarItems\PowerUpAppBarItem.cs" />
- <Compile Include="AppBarItems\PowerOffAppBarItem.cs" />
- <Compile Include="AppBarItems\PowerUpAppBarItemView.xaml.cs">
- <DependentUpon>PowerUpAppBarItemView.xaml</DependentUpon>
- </Compile>
- <Compile Include="AppBarItems\PowerOffAppBarItemView.xaml.cs">
- <DependentUpon>PowerOffAppBarItemView.xaml</DependentUpon>
- </Compile>
<Compile Include="Authentication\DefaultAuthenticationProvider.cs" />
<Compile Include="Connectivity\DefaultConnectivityProvider.cs" />
<Compile Include="Connectivity\WiFiAuthenticationView.xaml.cs">
<DependentUpon>WiFiAuthenticationView.xaml</DependentUpon>
</Compile>
<Compile Include="Connectivity\WiFiAuthenticationViewVM.cs" />
- <Compile Include="Controls\MachineStatusControl.xaml.cs">
- <DependentUpon>MachineStatusControl.xaml</DependentUpon>
- </Compile>
<Compile Include="Converters\AppBarItemConverter.cs" />
<Compile Include="Converters\ItemBaseConverter.cs" />
<Compile Include="Dialogs\CartridgeValidationView.xaml.cs">
@@ -140,21 +129,6 @@
<DependentUpon>InsufficientLiquidQuantityView.xaml</DependentUpon>
</Compile>
<Compile Include="Dialogs\InsufficientLiquidQuantityViewVM.cs" />
- <Compile Include="Dialogs\SafetyLevelOperationsConfirmationView.xaml.cs">
- <DependentUpon>SafetyLevelOperationsConfirmationView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Dialogs\SafetyLevelOperationsConfirmationViewVM.cs" />
- <Compile Include="Dialogs\ThreadBreakView.xaml.cs">
- <DependentUpon>ThreadBreakView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Dialogs\ThreadBreakViewVM.cs" />
- <Compile Include="Dialogs\ThreadLoadingView.xaml.cs">
- <DependentUpon>ThreadLoadingView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Dialogs\PowerUpView.xaml.cs">
- <DependentUpon>PowerUpView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Dialogs\PowerUpViewVM.cs" />
<Compile Include="Dialogs\ScreenLockView.xaml.cs">
<DependentUpon>ScreenLockView.xaml</DependentUpon>
</Compile>
@@ -164,34 +138,21 @@
</Compile>
<Compile Include="Dialogs\ScreenLockViewVM.cs" />
<Compile Include="Dialogs\TechnicianModeLoginViewVM.cs" />
- <Compile Include="Dialogs\ThreadLoadingViewVM.cs" />
- <Compile Include="Dialogs\FirmwareUpgradeFromFileView.xaml.cs">
- <DependentUpon>FirmwareUpgradeFromFileView.xaml</DependentUpon>
- </Compile>
<Compile Include="Dialogs\UpdateFromFileView.xaml.cs">
<DependentUpon>UpdateFromFileView.xaml</DependentUpon>
</Compile>
- <Compile Include="Dialogs\FirmwareUpgradeFromFileViewVM.cs" />
<Compile Include="Dialogs\UpdateFromFileViewVM.cs" />
- <Compile Include="InternalModule.cs" />
- <Compile Include="Modules\DefaultPPCModuleLoader.cs" />
+ <Compile Include="Modules\DefaultStudioModuleLoader.cs" />
<Compile Include="Navigation\DefaultNavigationManager.cs" />
<Compile Include="Notifications\DefaultNotificationProvider.cs" />
<Compile Include="Notifications\DialogAndView.cs" />
- <Compile Include="Notifications\NotificationItems\UpdateAvailableNotificationItem.cs" />
- <Compile Include="Notifications\NotificationItems\UpdateAvailableNotificationItemView.xaml.cs">
- <DependentUpon>UpdateAvailableNotificationItemView.xaml</DependentUpon>
- </Compile>
<Compile Include="Notifications\PendingNotification.cs" />
<Compile Include="PPCApplication\DefaultPPCApplicationManager.cs" />
<Compile Include="Printing\DefaultPrintingManager.cs" />
- <Compile Include="RemoteActions\DefaultRemoteActionsService.cs" />
<Compile Include="Threading\DefaultDispatcherProvider.cs" />
- <Compile Include="ThreadLoading\DefaultThreadLoadingService.cs" />
<Compile Include="ViewModelLocator.cs" />
<Compile Include="ViewModels\EmergencyViewVM.cs" />
<Compile Include="ViewModels\ExternalBridgeViewVM.cs" />
- <Compile Include="ViewModels\InternalModuleViewVM.cs" />
<Compile Include="ViewModels\LayoutViewVM.cs" />
<Compile Include="ViewModels\LoadingErrorViewVM.cs" />
<Compile Include="ViewModels\LoadingViewVM.cs" />
@@ -200,18 +161,13 @@
<Compile Include="ViewModels\MainViewVM.cs" />
<Compile Include="ViewModels\MachineUpdateViewVM.cs" />
<Compile Include="ViewModels\NoPermissionsViewVM.cs" />
- <Compile Include="ViewModels\PowerOffViewVM.cs" />
<Compile Include="ViewModels\RestartingSystemViewVM.cs" />
- <Compile Include="ViewModels\RestartingViewVM.cs" />
<Compile Include="ViewsContracts\ILayoutView.cs" />
<Compile Include="ViewsContracts\IMachineSetupView.cs" />
<Compile Include="ViewsContracts\IMachineUpdateView.cs" />
<Compile Include="Views\ExternalBridgeView.xaml.cs">
<DependentUpon>ExternalBridgeView.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\InternalModuleView.xaml.cs">
- <DependentUpon>InternalModuleView.xaml</DependentUpon>
- </Compile>
<Compile Include="Views\LayoutView.xaml.cs">
<DependentUpon>LayoutView.xaml</DependentUpon>
</Compile>
@@ -221,12 +177,6 @@
<Compile Include="Views\LoadingErrorView.xaml.cs">
<DependentUpon>LoadingErrorView.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\PowerOffView.xaml.cs">
- <DependentUpon>PowerOffView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\RestartingView.xaml.cs">
- <DependentUpon>RestartingView.xaml</DependentUpon>
- </Compile>
<Compile Include="Views\LoadingView.xaml.cs">
<DependentUpon>LoadingView.xaml</DependentUpon>
</Compile>
@@ -248,43 +198,15 @@
<Compile Include="Views\RestartingSystemView.xaml.cs">
<DependentUpon>RestartingSystemView.xaml</DependentUpon>
</Compile>
- <Page Include="AppBarItems\PowerUpAppBarItemView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="AppBarItems\PowerOffAppBarItemView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
<Page Include="Connectivity\WiFiAuthenticationView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Controls\MachineStatusControl.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
<Page Include="Dialogs\CartridgeValidationView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Dialogs\InsufficientLiquidQuantityView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Dialogs\SafetyLevelOperationsConfirmationView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Dialogs\ThreadBreakView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Dialogs\ThreadLoadingView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Dialogs\PowerUpView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -296,10 +218,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Dialogs\FirmwareUpgradeFromFileView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
<Page Include="Dialogs\UpdateFromFileView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -316,10 +234,6 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
- <Page Include="Notifications\NotificationItems\UpdateAvailableNotificationItemView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
<Page Include="Resources\Colors.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -336,10 +250,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\InternalModuleView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
<Page Include="Views\LayoutView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -352,14 +262,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\PowerOffView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Views\RestartingView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
<Page Include="Views\LoadingView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -425,59 +327,18 @@
<Resource Include="Images\GlobalStatus\service_Anim.gif" />
<Resource Include="Images\GlobalStatus\shutdown_icon_Anim.gif" />
<Resource Include="Images\GlobalStatus\standby_Anim.gif" />
- <Resource Include="Images\bug.png" />
<Resource Include="Images\cartridge_validation.png" />
- <Resource Include="Images\machine-image.png" />
- <Resource Include="Images\Menu\backup.png" />
- <Resource Include="Images\backup-restore.png" />
- <Resource Include="Images\restore.png" />
- <Resource Include="Images\backup-big.png" />
- <Resource Include="Images\GlobalStatus\getting-ready.png" />
- <Resource Include="Images\GlobalStatus\shutting-down.png" />
- <Resource Include="Images\GlobalStatus\error.png" />
- <Resource Include="Images\GlobalStatus\service.png" />
- <Resource Include="Images\update_available.png" />
- <Resource Include="Images\powerup.gif" />
- <Resource Include="Images\power_off.gif" />
- <Resource Include="Images\thread_loading.gif" />
- <Resource Include="Images\thread_loading.png" />
- <Resource Include="Images\firmware.png" />
- <Resource Include="Images\power_off_2.gif" />
- <Resource Include="Images\loading_anim.gif" />
- <Resource Include="Images\thread_loading_preview.png" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\1.JPG" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\2.JPG" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\3.JPG" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\4.JPG" />
- <Resource Include="Images\ThreadLoading\GuidingUnits\1.JPG" />
- <Resource Include="Images\ThreadLoading\TheDryer\1.jpg" />
- <Resource Include="Images\ThreadLoading\TheDryer\2.jpg" />
- <Resource Include="Images\ThreadLoading\TheDryer\3.jpg" />
- <Resource Include="Images\ThreadLoading\TheDryer\4.jpg" />
- <Resource Include="Images\ThreadLoading\TheDryer\5.jpg" />
- <Resource Include="Images\ThreadLoading\DryerClose\1.jpg" />
- <Resource Include="Images\ThreadLoading\DryerClose\2.jpg" />
- <Resource Include="Images\ThreadLoading\DryerClose\3.jpg" />
- <Resource Include="Images\ThreadLoading\DryerClose\4.jpg" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\arc\1.jpg" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\arc\2.jpg" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\arc\3.jpg" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\arc\4.jpg" />
- <Resource Include="Images\ThreadLoading\FeedingUnits\arc\5.jpg" />
- <Resource Include="Images\ThreadLoading\NewThread\TS1800_CloseUp_Feeder_P.jpg" />
- <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\1.jpg" />
- <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\2.JPG" />
- <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\3.JPG" />
- <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\4.JPG" />
- <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\5.JPG" />
- <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\6.JPG" />
- <Resource Include="Images\ThreadLoading\NewThread\ReadyForLoading\arc\7.jpg" />
- <Resource Include="Images\ThreadLoading\NewThread\machine_full.jpg" />
+ <Resource Include="Images\bug.png" />
+ <Content Include="..\..\Build\ColorLib\Debug\Tango.ColorLib_v1.dll">
+ <Link>Tango.ColorLib_v1.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\..\Build\ColorLib\Debug\Tango.ColorLib_v2.dll">
+ <Link>Tango.ColorLib_v2.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="Manifests\release.xml" />
<Content Include="Manifests\debug.xml" />
- <None Include="firmware_package.tfp">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@@ -512,10 +373,6 @@
<Project>{4399af76-db52-4cfb-8020-6f85bdb29fd5}</Project>
<Name>Tango.Explorer</Name>
</ProjectReference>
- <ProjectReference Include="..\..\Tango.Insights\Tango.Insights.csproj">
- <Project>{4A55C185-3F8D-41B0-8815-C15F6213A14A}</Project>
- <Name>Tango.Insights</Name>
- </ProjectReference>
<ProjectReference Include="..\..\Tango.Integration\Tango.Integration.csproj">
<Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project>
<Name>Tango.Integration</Name>
@@ -564,10 +421,6 @@
<Project>{6aa425c9-ea6a-4b01-aaed-5ff122e8b663}</Project>
<Name>Tango.WiFi</Name>
</ProjectReference>
- <ProjectReference Include="..\Modules\Tango.PPC.BackupRestore\Tango.PPC.BackupRestore.csproj">
- <Project>{bc2753f8-c0f7-48f5-a85c-149ec7a2f8c7}</Project>
- <Name>Tango.PPC.BackupRestore</Name>
- </ProjectReference>
<ProjectReference Include="..\Modules\Tango.PPC.BugReporting\Tango.PPC.BugReporting.csproj">
<Project>{8146fa0a-0725-4a1a-82e6-696c58f33a2b}</Project>
<Name>Tango.PPC.BugReporting</Name>
@@ -584,10 +437,6 @@
<Project>{91b70e9b-66a7-4873-ae10-400e71cf404f}</Project>
<Name>Tango.PPC.MachineSettings</Name>
</ProjectReference>
- <ProjectReference Include="..\Modules\Tango.PPC.Maintenance\Tango.PPC.Maintenance.csproj">
- <Project>{011470ac-6bd6-4366-b5f2-c82c065d4a84}</Project>
- <Name>Tango.PPC.Maintenance</Name>
- </ProjectReference>
<ProjectReference Include="..\Modules\Tango.PPC.Storage\Tango.PPC.Storage.csproj">
<Project>{04febb02-f782-4b96-b47d-f6902afa43be}</Project>
<Name>Tango.PPC.Storage</Name>
@@ -600,40 +449,6 @@
<Project>{0be74eee-22cb-4dba-b896-793b9e1a3ac0}</Project>
<Name>Tango.PPC.Common</Name>
</ProjectReference>
- <ProjectReference Include="..\Tango.PPC.Shared\Tango.PPC.Shared.csproj">
- <Project>{208c8bd8-72c6-4e3c-acaa-351091a2acc7}</Project>
- <Name>Tango.PPC.Shared</Name>
- </ProjectReference>
- <!--ColorLib-->
- <ProjectReference Include="..\..\ColorLib\Tango.ColorLib_v4\Tango.ColorLib_v4.vcxproj">
- <Project>{E9528353-7D41-4AA8-BBAC-D65B7FE3A0D6}</Project>
- <Name>Tango.ColorLib_v4</Name>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- <OutputItemType>Content</OutputItemType>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </ProjectReference>
- <ProjectReference Include="..\..\ColorLib\Tango.ColorLib_v3\Tango.ColorLib_v3.vcxproj">
- <Project>{A3A8ADA0-C150-4E30-A60D-11F291FDBF7A}</Project>
- <Name>Tango.ColorLib_v3</Name>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- <OutputItemType>Content</OutputItemType>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </ProjectReference>
- <ProjectReference Include="..\..\ColorLib\Tango.ColorLib_v2\Tango.ColorLib_v2.vcxproj">
- <Project>{1A3FC7FB-403C-4B3D-B705-28FCE11317DD}</Project>
- <Name>Tango.ColorLib_v2</Name>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- <OutputItemType>Content</OutputItemType>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </ProjectReference>
- <ProjectReference Include="..\..\ColorLib\Tango.ColorLib_v1\Tango.ColorLib_v1.vcxproj">
- <Project>{CF4C66B0-CD13-4D31-8133-339A01E7E6F2}</Project>
- <Name>Tango.ColorLib_v1</Name>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- <OutputItemType>Content</OutputItemType>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </ProjectReference>
- <!--ColorLib-->
</ItemGroup>
<ItemGroup>
<Resource Include="Images\liquid.png" />
@@ -689,7 +504,6 @@
<Resource Include="Images\machine-update.png" />
<Resource Include="Images\home.png" />
</ItemGroup>
- <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<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">
@@ -746,12 +560,6 @@ RD /S /Q "$(TargetDir)nb-NO\"
RD /S /Q "$(TargetDir)pt-BR\"
RD /S /Q "$(TargetDir)roslyn\"
-RD /S /Q "$(TargetDir)ProtoCompilers\"
-RD /S /Q "$(TargetDir)Packages\ProtoCompilers\"
-if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)x86\"
-if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)x64\"
-
-if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)lib\"
copy /Y "$(SolutionDir)Referenced Assemblies\mscoree.dll" "$(TargetDir)"
copy /Y "$(SolutionDir)Referenced Assemblies\msvcp140d.dll" "$(TargetDir)"
@@ -760,17 +568,12 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140.dll" "$(TargetDir)"
copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)"
copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(TargetDir)"
-if $(ConfigurationName) == Release del "$(TargetDir)firmware_package.tfp"
-
-if $(ConfigurationName) == Release del *.xml
-
-if $(ConfigurationName) == Release del WebRtc.NET.pdb
+del "$(TargetDir)firmware_package.tfp"
-if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)"</PostBuildEvent>
+if $(ConfigurationName) == Release del *.xml</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
- <PreBuildEvent>copy /Y "$(ProjectDir)Manifests\$(ConfigurationName).xml" "$(ProjectDir)app.manifest"
-</PreBuildEvent>
+ <PreBuildEvent>copy /Y "$(ProjectDir)Manifests\$(ConfigurationName).xml" "$(ProjectDir)app.manifest"</PreBuildEvent>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs
deleted file mode 100644
index a6479da63..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.Integration.Operation;
-using Tango.PPC.Common.Connection;
-using Tango.PPC.Common.Notifications;
-using Tango.PPC.Common.Threading;
-using Tango.PPC.Common.ThreadLoading;
-using Tango.PPC.UI.Dialogs;
-
-namespace Tango.PPC.UI.ThreadLoading
-{
- public class DefaultThreadLoadingService : IThreadLoadingService
- {
- private INotificationProvider _notificationsProvider;
- private IMachineProvider _machineProvider;
- private IDispatcherProvider _dispatcher;
- private bool _dialogShown;
-
- public DefaultThreadLoadingService(INotificationProvider notificationsProvider, IMachineProvider machineProvider, IDispatcherProvider dispatcher)
- {
- _notificationsProvider = notificationsProvider;
- _machineProvider = machineProvider;
- _dispatcher = dispatcher;
- _machineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged;
- }
-
- private void MachineOperator_ThreadLoadingStatusChanged(object sender, PMR.ThreadLoading.StartThreadLoadingResponse e)
- {
- if (!_dialogShown && e.State != PMR.ThreadLoading.ThreadLoadingState.None)
- {
- _dialogShown = true;
- _dispatcher.Invoke(async () =>
- {
- await _notificationsProvider.ShowDialog<ThreadLoadingViewVM>(new ThreadLoadingViewVM());
- _dialogShown = false;
- });
- }
- }
-
- public async void StartThreadLoadingWizard()
- {
- _dialogShown = true;
- await _notificationsProvider.ShowDialog<ThreadLoadingViewVM>(new ThreadLoadingViewVM(true));
- _dialogShown = false;
- }
-
- public async void StartThreadBreakWizard()
- {
- if (!_dialogShown)
- {
- _dialogShown = true;
- var vm = await _notificationsProvider.ShowDialog<ThreadBreakViewVM>();
- _dialogShown = false;
-
- if (vm.Result == ThreadBreakViewVM.ThreadBreakWizardResult.StartThreadLoading)
- {
- StartThreadLoadingWizard();
- }
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
index 222d3a1e8..67b5dc19b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
@@ -1,41 +1,26 @@
using System;
-using System.Linq;
using System.Windows;
using Tango.Core.DI;
using Tango.Integration.ExternalBridge;
using Tango.Logging;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Authentication;
-using Tango.PPC.Common.BackupRestore;
using Tango.PPC.Common.Connection;
using Tango.PPC.Common.Connectivity;
-using Tango.PPC.Common.Console;
-using Tango.PPC.Common.DataStore;
using Tango.PPC.Common.Diagnostics;
using Tango.PPC.Common.EventLogging;
using Tango.PPC.Common.ExternalBridge;
-using Tango.PPC.Common.FileSystem;
using Tango.PPC.Common.HotSpot;
-using Tango.PPC.Common.Insights;
using Tango.PPC.Common.MachineSetup;
using Tango.PPC.Common.MachineUpdate;
using Tango.PPC.Common.Modules;
using Tango.PPC.Common.Navigation;
using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.OS;
-using Tango.PPC.Common.Performance;
using Tango.PPC.Common.Printing;
-using Tango.PPC.Common.RemoteActions;
using Tango.PPC.Common.RemoteAssistance;
-using Tango.PPC.Common.RemoteDesktop;
-using Tango.PPC.Common.RemoteJob;
-using Tango.PPC.Common.SQL;
using Tango.PPC.Common.Storage;
-using Tango.PPC.Common.Synchronization;
-using Tango.PPC.Common.SystemInfo;
using Tango.PPC.Common.Threading;
-using Tango.PPC.Common.ThreadLoading;
-using Tango.PPC.Common.UpdatePackages;
using Tango.PPC.Common.UWF;
using Tango.PPC.Common.Web;
using Tango.PPC.UI.Authentication;
@@ -45,9 +30,7 @@ using Tango.PPC.UI.Navigation;
using Tango.PPC.UI.Notifications;
using Tango.PPC.UI.PPCApplication;
using Tango.PPC.UI.Printing;
-using Tango.PPC.UI.RemoteActions;
using Tango.PPC.UI.Threading;
-using Tango.PPC.UI.ThreadLoading;
using Tango.PPC.UI.ViewModels;
using Tango.PPC.UI.Views;
using Tango.PPC.UI.ViewsContracts;
@@ -88,30 +71,8 @@ namespace Tango.PPC.UI
TangoIOC.Default.Unregister<IUnifiedWriteFilterManager>();
TangoIOC.Default.Unregister<IOperationSystemManager>();
TangoIOC.Default.Unregister<PPCWebClient>();
- TangoIOC.Default.Unregister<IBackupManager>();
- TangoIOC.Default.Unregister<IPackageRunner>();
- TangoIOC.Default.Unregister<IMachineDataSynchronizer>();
- TangoIOC.Default.Unregister<IConsoleEngineService>();
- TangoIOC.Default.Unregister<IRemoteDesktopService>();
- TangoIOC.Default.Unregister<IPerformanceService>();
- TangoIOC.Default.Unregister<ISystemInfoService>();
- TangoIOC.Default.Unregister<IFileSystemService>();
- TangoIOC.Default.Unregister<IRemoteJobService>();
- TangoIOC.Default.Unregister<IRemoteSqlService>();
- TangoIOC.Default.Unregister<IInsightsService>();
- TangoIOC.Default.Unregister<IRemoteActionsService>();
- TangoIOC.Default.Unregister<IThreadLoadingService>();
- TangoIOC.Default.Unregister<IDataStoreService>();
-
- if (App.StartupArgs != null && App.StartupArgs.Contains("-webDebug"))
- {
- TangoIOC.Default.Register<PPCWebClient, PPCWebClient>(new PPCWebClient("http://localhost:1111", null));
- }
- else
- {
- TangoIOC.Default.Register<PPCWebClient, PPCWebClient>(new PPCWebClient());
- }
+ TangoIOC.Default.Register<PPCWebClient, PPCWebClient>(new PPCWebClient());
TangoIOC.Default.Register<IDispatcherProvider, DefaultDispatcherProvider>(new DefaultDispatcherProvider(Application.Current.Dispatcher));
TangoIOC.Default.Register<INotificationProvider, DefaultNotificationProvider>();
TangoIOC.Default.Register<IAuthenticationProvider, DefaultAuthenticationProvider>();
@@ -119,14 +80,11 @@ namespace Tango.PPC.UI
TangoIOC.Default.Register<INavigationManager, DefaultNavigationManager>();
TangoIOC.Default.Register<IMachineProvider, DefaultMachineProvider>();
TangoIOC.Default.Register<IEventLogger, DefaultEventLogger>();
- TangoIOC.Default.Register<IMachineDataSynchronizer, DefaultMachineDataSynchronizer>();
TangoIOC.Default.Register<IPPCApplicationManager, DefaultPPCApplicationManager>();
TangoIOC.Default.Register<ExternalBridgeScanner, ExternalBridgeScanner>();
TangoIOC.Default.Register<IDiagnosticsFrameProvider, DefaultDiagnosticsFrameProvider>();
TangoIOC.Default.Register<IPPCExternalBridgeService, PPCExternalBridgeService>();
- TangoIOC.Default.Register<IConsoleEngineService, DefaultConsoleEngineService>();
TangoIOC.Default.Register<IRemoteAssistanceProvider, DefaultRemoteAssistanceProvider>();
- TangoIOC.Default.Register<IPackageRunner, DefaultPackageRunner>();
TangoIOC.Default.Register<IMachineSetupManager, MachineSetupManager>();
TangoIOC.Default.Register<IMachineUpdateManager, MachineUpdateManager>();
TangoIOC.Default.Register<IPrintingManager, DefaultPrintingManager>();
@@ -135,17 +93,8 @@ namespace Tango.PPC.UI
TangoIOC.Default.Register<IStorageProvider, DefaultStorageProvider>();
TangoIOC.Default.Register<IUnifiedWriteFilterManager, AlternativeUnifiedWriteFilterManager>();
TangoIOC.Default.Register<IOperationSystemManager, DefaultOperationSystemManager>();
- TangoIOC.Default.Register<IBackupManager, DefaultBackupManager>();
- TangoIOC.Default.Register<IPerformanceService, DefaultPerformanceService>();
- TangoIOC.Default.Register<ISystemInfoService, DefaultSystemInfoService>();
- TangoIOC.Default.Register<IFileSystemService, DefaultFileSystemService>();
- TangoIOC.Default.Register<IRemoteDesktopService, DefaultRemoteDesktopService>();
- TangoIOC.Default.Register<IRemoteJobService, DefaultRemoteJobService>();
- TangoIOC.Default.Register<IRemoteSqlService, DefaultRemoteSqlService>();
- TangoIOC.Default.Register<IInsightsService, DefaultInsightsService>();
- TangoIOC.Default.Register<IRemoteActionsService, DefaultRemoteActionsService>();
- TangoIOC.Default.Register<IThreadLoadingService, DefaultThreadLoadingService>();
- TangoIOC.Default.Register<IDataStoreService, DefaultDataStoreService>();
+
+ //TangoIOC.Default.Register<TeamFoundationServiceExtendedClient>(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa"));
TangoIOC.Default.Register<LoadingViewVM>();
TangoIOC.Default.Register<MainViewVM>();
@@ -158,9 +107,6 @@ namespace Tango.PPC.UI
TangoIOC.Default.Register<NoPermissionsViewVM>();
TangoIOC.Default.Register<RestartingSystemViewVM>();
TangoIOC.Default.Register<EmergencyViewVM>();
- TangoIOC.Default.Register<RestartingViewVM>();
- TangoIOC.Default.Register<InternalModuleViewVM>();
- TangoIOC.Default.Register<PowerOffViewVM>();
TangoIOC.Default.GetInstance<IPPCApplicationManager>().ContentRendered += (_, __) =>
@@ -266,29 +212,5 @@ namespace Tango.PPC.UI
return TangoIOC.Default.GetInstance<EmergencyViewVM>();
}
}
-
- public static RestartingViewVM RestartingViewVM
- {
- get
- {
- return TangoIOC.Default.GetInstance<RestartingViewVM>();
- }
- }
-
- public static InternalModuleViewVM InternalModuleViewVM
- {
- get
- {
- return TangoIOC.Default.GetInstance<InternalModuleViewVM>();
- }
- }
-
- public static PowerOffViewVM PowerOffViewVM
- {
- get
- {
- return TangoIOC.Default.GetInstance<PowerOffViewVM>();
- }
- }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
index f10e84d05..f1127ebfe 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
@@ -12,7 +12,6 @@ using Tango.PMR.Integration;
using Tango.PPC.Common;
using Tango.PPC.Common.ExternalBridge;
using Tango.PPC.Common.Navigation;
-using Tango.PPC.UI.Dialogs;
namespace Tango.PPC.UI.ViewModels
{
@@ -25,8 +24,6 @@ namespace Tango.PPC.UI.ViewModels
{
private bool _disconnecting;
- private const int KEEP_SAFETY_AUTHENTICATION_MINUTES = 5;
-
#region Properties
private ExternalBridgeClientConnectedEventArgs _connection;
@@ -82,7 +79,7 @@ namespace Tango.PPC.UI.ViewModels
LogManager.Log("Disconnecting current external bridge session.");
_disconnecting = true;
InvalidateRelayCommands();
- ExternalBridgeService.DisconnectFullControlSession();
+ ExternalBridgeService.DisconnectSession();
}
#endregion
@@ -106,7 +103,7 @@ namespace Tango.PPC.UI.ViewModels
public override void OnApplicationStarted()
{
ExternalBridgeService.ConnectionRequest += ExternalBridgeService_ConnectionRequest;
- ExternalBridgeService.FullControlSessionDisconnected += ExternalBridgeService_FullControlSessionDisconnected;
+ ExternalBridgeService.ClientDisconnected += ExternalBridgeService_ClientDisconnected;
}
#endregion
@@ -114,11 +111,11 @@ namespace Tango.PPC.UI.ViewModels
#region Event Handlers
/// <summary>
- /// Handles the <see cref="ExternalBridgeService.FullControlSessionDisconnected"/> event.
+ /// Handles the <see cref="ExternalBridgeService.ClientDisconnected"/> event.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
- private void ExternalBridgeService_FullControlSessionDisconnected(object sender, EventArgs e)
+ private void ExternalBridgeService_ClientDisconnected(object sender, EventArgs e)
{
if (IsVisible)
{
@@ -136,14 +133,13 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="ExternalBridgeClientConnectedEventArgs"/> instance containing the event data.</param>
- private async void ExternalBridgeService_ConnectionRequest(object sender, ExternalBridgeClientConnectedEventArgs e)
+ private void ExternalBridgeService_ConnectionRequest(object sender, ExternalBridgeClientConnectedEventArgs e)
{
LogManager.Log($"External bridge connection request received.\n{e.ToJsonString()}");
if (!e.Request.Intent.RequiresPassword() || e.Request.Password == Settings.ExternalBridgePassword)
{
- e.ApplicationInformation.Version = ApplicationManager.Version.ToString();
- e.ApplicationInformation.StartupDate = ApplicationManager.StartUpDate.ToUniversalTime().ToString();
+ e.Confirmed = true;
Connection = e;
@@ -154,41 +150,6 @@ namespace Tango.PPC.UI.ViewModels
LogManager.Log($"External bridge connection user has been identified as {User.Contact.FullName}");
}
- if (e.Request.RequireSafetyLevelOperations)
- {
- DateTime lastAuthenticationTime;
- bool bypassSafetyConfirmation = false;
-
- if (ExternalBridgeReceiver.LastSafetyLevelContactsTimes.TryGetValue(e.Request.UserName, out lastAuthenticationTime))
- {
- if (DateTime.Now < lastAuthenticationTime.AddMinutes(KEEP_SAFETY_AUTHENTICATION_MINUTES))
- {
- bypassSafetyConfirmation = true;
- e.Confirm();
- }
- }
-
- if (!bypassSafetyConfirmation)
- {
- SafetyLevelOperationsConfirmationViewVM vm = new SafetyLevelOperationsConfirmationViewVM(e);
- await NotificationProvider.ShowDialog(vm);
-
- if (vm.DialogResult)
- {
- e.Confirm();
- }
- else
- {
- e.Decline("Safety level connection refused by the remote user.");
- return;
- }
- }
- }
- else
- {
- e.Confirm();
- }
-
if (e.Request.Intent == ExternalBridgeLoginIntent.FullControl)
{
LogManager.Log("Navigating to external bridge view...");
@@ -200,7 +161,6 @@ namespace Tango.PPC.UI.ViewModels
}
else
{
- e.Decline("Connection password did not match the machine external bridge password.");
LogManager.Log("Connection password did not match the machine external bridge password.");
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/InternalModuleViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/InternalModuleViewVM.cs
deleted file mode 100644
index 29e6417f4..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/InternalModuleViewVM.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.PPC.Common;
-
-namespace Tango.PPC.UI.ViewModels
-{
- public class InternalModuleViewVM : PPCViewModel
- {
- public override void OnApplicationStarted()
- {
-
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
index a2baec8b8..9e8a9fe34 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
@@ -3,19 +3,13 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Media;
using System.Windows.Threading;
-using Tango.Core;
using Tango.Core.Commands;
using Tango.Core.DI;
using Tango.Integration.Operation;
-using Tango.PMR.IFS;
using Tango.PPC.Common;
-using Tango.PPC.Common.Connection;
using Tango.PPC.Common.Modules;
using Tango.PPC.Common.Navigation;
-using Tango.PPC.UI.Views;
using Tango.PPC.UI.ViewsContracts;
using Tango.SharedUI;
@@ -28,7 +22,6 @@ namespace Tango.PPC.UI.ViewModels
public class LayoutViewVM : PPCViewModel<ILayoutView>
{
private JobHandler _jobHandler;
- private bool _resettingDevice;
/// <summary>
/// Gets or sets the module loader.
@@ -36,86 +29,6 @@ namespace Tango.PPC.UI.ViewModels
[TangoInject]
public IPPCModuleLoader ModuleLoader { get; set; }
- #region Classes
-
- public class CartridgeModel : ExtendedObject
- {
- private IMachineProvider _machineProvider;
-
- public CartridgeStatus Status { get; set; }
-
- public bool InProgress
- {
- get { return Status.State == CartridgeState.Filling || Status.State == CartridgeState.Emptying; }
- }
-
- public String Message
- {
- get { return Status.Cartridge.Slot == PMR.Diagnostics.CartridgeSlot.Ink ? "Ink filling is in progress..." : "Waste emptying is in progress..."; }
- }
-
- public Brush Brush
- {
- get
- {
- if (Status.Cartridge.Slot == PMR.Diagnostics.CartridgeSlot.Ink)
- {
- try
- {
- int index = Status.Cartridge.Index;
-
- var idsPack = _machineProvider.Machine.Configuration.NoneEmptyIdsPacks.FirstOrDefault(x => x.PackIndex == index);
-
- if (idsPack != null)
- {
- switch (idsPack.LiquidType.Type)
- {
- case BL.Enumerations.LiquidTypes.Cyan:
- return Application.Current.Resources["TangoCyanInkBrush"] as Brush;
- case BL.Enumerations.LiquidTypes.Magenta:
- return Application.Current.Resources["TangoMagentaInkBrush"] as Brush;
- case BL.Enumerations.LiquidTypes.Yellow:
- return Application.Current.Resources["TangoYellowInkBrush"] as Brush;
- case BL.Enumerations.LiquidTypes.Black:
- return Application.Current.Resources["TangoBlackInkBrush"] as Brush;
- case BL.Enumerations.LiquidTypes.Lubricant:
- return Application.Current.Resources["TangoLubricantBrush"] as Brush;
- case BL.Enumerations.LiquidTypes.Cleaner:
- return Application.Current.Resources["TangoCleanerBrush"] as Brush;
- case BL.Enumerations.LiquidTypes.TransparentInk:
- return Application.Current.Resources["TangoTransparentInkBrush"] as Brush;
- }
- }
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error generating ink filling brush.");
- }
-
- return Application.Current.Resources["TangoPrimaryAccentBrush"] as Brush;
- }
- else
- {
- return Application.Current.Resources["TangoWasteBrush"] as Brush;
- }
- }
- }
-
- public CartridgeModel(IMachineProvider machineProvider)
- {
- _machineProvider = machineProvider;
- Status = new CartridgeStatus();
- }
-
- public void Invalidate()
- {
- RaisePropertyChanged(nameof(InProgress));
- RaisePropertyChanged(nameof(Status));
- }
- }
-
- #endregion
-
#region Properties
private bool _isMenuOpened;
@@ -159,23 +72,6 @@ namespace Tango.PPC.UI.ViewModels
set { _isPowerOpened = value; RaisePropertyChangedAuto(); }
}
- private bool _isInkFillingOrWasteEmptying;
- /// <summary>
- /// Gets or sets a value indicating whether ink filling or waste emptying is active.
- /// </summary>
- public bool IsInkFillingOrWasteEmptying
- {
- get { return _isInkFillingOrWasteEmptying; }
- set { _isInkFillingOrWasteEmptying = value; RaisePropertyChangedAuto(); }
- }
-
- private List<CartridgeModel> _cartridges;
- public List<CartridgeModel> Cartridges
- {
- get { return _cartridges; }
- set { _cartridges = value; RaisePropertyChangedAuto(); }
- }
-
#endregion
#region Commands
@@ -225,21 +121,6 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
public RelayCommand RestartApplicationCommand { get; set; }
- /// <summary>
- /// Gets or sets the power off command.
- /// </summary>
- public RelayCommand PowerOffCommand { get; set; }
-
- /// <summary>
- /// Gets or sets the reset command.
- /// </summary>
- public RelayCommand ResetCommand { get; set; }
-
- /// <summary>
- /// Gets or sets the stand by command.
- /// </summary>
- public RelayCommand StandByCommand { get; set; }
-
#endregion
#region Constructors
@@ -256,13 +137,15 @@ namespace Tango.PPC.UI.ViewModels
StopPrintingCommand = new RelayCommand(StopPrinting);
SignOutCommand = new RelayCommand(SignOut);
- UpdateCommand = new RelayCommand(UpdateMachine);
+ UpdateCommand = new RelayCommand(() =>
+ {
+ NavigationManager.NavigateTo(NavigationView.MachineUpdateView);
+ TangoIOC.Default.GetInstance<MachineUpdateViewVM>().CheckForUpdates();
+ IsMenuOpened = false;
+ });
PowerCommand = new RelayCommand(() => IsPowerOpened = true);
RestartApplicationCommand = new RelayCommand(RestartApplication);
- PowerOffCommand = new RelayCommand(PowerOffMachine, () => MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected);
- ResetCommand = new RelayCommand(ResetMachine, () => MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected);
- StandByCommand = new RelayCommand(StandBy, () => MachineProvider.MachineOperator.CanPrint);
}
#endregion
@@ -356,83 +239,6 @@ namespace Tango.PPC.UI.ViewModels
}
}
- /// <summary>
- /// Powers off the machine.
- /// </summary>
- private async void PowerOffMachine()
- {
- IsMenuOpened = false;
-
- if (await NotificationProvider.ShowQuestion("Are you sure you wish to turn off the machine?"))
- {
- try
- {
- await MachineProvider.MachineOperator.PowerDown();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error triggering power down.");
- await NotificationProvider.ShowError(ex.FlattenMessage());
- }
- }
- }
-
- /// <summary>
- /// Resets the machine.
- /// </summary>
- private async void ResetMachine()
- {
- IsMenuOpened = false;
-
- if (!await NotificationProvider.ShowQuestion("Are you sure you want to reset the machine?")) return;
-
- try
- {
- _resettingDevice = true;
- ResetCommand.RaiseCanExecuteChanged();
- await MachineProvider.MachineOperator.Reset();
- await NotificationProvider.ShowInfo("Machine was successfully restarted.");
- }
- catch (Exception ex)
- {
- await NotificationProvider.ShowError(ex.FlattenMessage());
- }
- finally
- {
- _resettingDevice = false;
- ResetCommand.RaiseCanExecuteChanged();
- }
- }
-
- private async void StandBy()
- {
- IsMenuOpened = false;
-
- try
- {
- LogManager.Log("Executing stand-by command.");
- await MachineProvider.MachineOperator.StandBy();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error switching to stand-by mode.");
- await NotificationProvider.ShowError($"Error switching to stand-by mode.\n{ex.FlattenMessage()}");
- }
- }
-
- private void UpdateMachine()
- {
- if (MachineProvider.MachineOperator.IsPrinting)
- {
- NotificationProvider.ShowInfo("Cannot perform a machine update while the machine is dyeing.");
- return;
- }
-
- NavigationManager.NavigateTo(NavigationView.MachineUpdateView);
- TangoIOC.Default.GetInstance<MachineUpdateViewVM>().CheckForUpdates();
- IsMenuOpened = false;
- }
-
#endregion
#region Override Methods
@@ -444,34 +250,6 @@ namespace Tango.PPC.UI.ViewModels
{
base.OnApplicationStarted();
MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted;
- MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged;
- }
-
- private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e)
- {
- if (Cartridges == null)
- {
- Cartridges = MachineProvider.MachineOperator.InkFillingStatus.CartridgesStatuses.Select(x => new CartridgeModel(MachineProvider) { Status = x }).ToList();
- }
- else
- {
- foreach (var cartridgeStatus in e.Status.CartridgesStatuses)
- {
- var model = Cartridges.SingleOrDefault(x => x.Status == cartridgeStatus);
-
- if (model != null)
- {
- model.Status = cartridgeStatus;
- }
- }
- }
-
- foreach (var cartridgeModel in Cartridges)
- {
- cartridgeModel.Invalidate();
- }
-
- IsInkFillingOrWasteEmptying = Cartridges.Any(x => x.Status.State == CartridgeState.Filling || x.Status.State == CartridgeState.Emptying);
}
/// <summary>
@@ -482,22 +260,6 @@ namespace Tango.PPC.UI.ViewModels
}
- public override void OnApplicationReady()
- {
- base.OnApplicationReady();
- MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged;
- }
-
- private void MachineOperator_StatusChanged(object sender, MachineStatuses e)
- {
- InvokeUI(() =>
- {
- PowerOffCommand.RaiseCanExecuteChanged();
- ResetCommand.RaiseCanExecuteChanged();
- StandByCommand.RaiseCanExecuteChanged();
- });
- }
-
#endregion
#region Public Methods
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
index 38dd569e1..f926a0f4c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
@@ -74,46 +74,37 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
public async override void OnApplicationStarted()
{
- //We don't use authentication!
-
- //using (ObservablesContext db = ObservablesContext.CreateDefault())
- //{
- // var machine = await db.Machines.FirstAsync();
-
- // if (db.Users.Count() == 1 || machine.AutoLogin)
- // {
- // var user = await new UserBuilder(db).SetFirst().WithRolesAndPermissions().BuildAsync();
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ var machine = await db.Machines.FirstAsync();
- // if (!user.HasRole(Roles.PPCUser))
- // {
- // var role = db.Roles.Single(x => x.Code == (int)Roles.PPCUser);
- // user.Roles.Add(role);
- // db.UsersRoles.Add(new BL.Entities.UsersRole()
- // {
- // User = user,
- // Role = role,
- // });
- // await db.SaveChangesAsync();
- // }
+ if (db.Users.Count() == 1 || machine.AutoLogin)
+ {
+ var user = await new UserBuilder(db).SetFirst().WithRolesAndPermissions().BuildAsync();
- // LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView...");
- // await AuthenticationProvider.Login(user.Email, user.Password, false);
- // await Task.Delay(1000);
- // IsLoading = false;
- // }
- // else
- // {
- // LogManager.Log("Application started. Navigating to LoginView...");
- // await NavigationManager.NavigateTo(NavigationView.LoginView);
- // await Task.Delay(1000);
- // IsLoading = false;
- // }
- //}
+ if (!user.HasRole(Roles.PPCUser))
+ {
+ var role = db.Roles.Single(x => x.Code == (int)Roles.PPCUser);
+ user.Roles.Add(role);
+ db.UsersRoles.Add(new BL.Entities.UsersRole()
+ {
+ User = user,
+ Role = role,
+ });
+ await db.SaveChangesAsync();
+ }
- LogManager.Log($"Application started with no authentication mode...");
- await AuthenticationProvider.Login();
- await Task.Delay(1000);
- IsLoading = false;
+ LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView...");
+ await AuthenticationProvider.Login(user.Email, user.Password, false);
+ IsLoading = false;
+ }
+ else
+ {
+ LogManager.Log("Application started. Navigating to LoginView...");
+ await NavigationManager.NavigateTo(NavigationView.LoginView);
+ IsLoading = false;
+ }
+ }
}
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
index ec316989f..aa9689ef3 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
@@ -92,13 +92,7 @@ namespace Tango.PPC.UI.ViewModels
await Task.Delay(500);
- if (!AuthenticationProvider.AuthenticationRequired)
- {
- LogManager.Log("Application is ready! Navigating to home module...");
- await NavigationManager.NavigateTo(NavigationView.HomeModule);
- IsLoading = false;
- }
- else if (AuthenticationProvider.CurrentUser != null && AuthenticationProvider.CurrentUser.HasPermission(Permissions.RunPPC))
+ if (AuthenticationProvider.CurrentUser != null && AuthenticationProvider.CurrentUser.HasPermission(Permissions.RunPPC))
{
LogManager.Log("Application is ready! Navigating to home module...");
await NavigationManager.NavigateTo(NavigationView.HomeModule);
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs
index ae31a64a1..aca9dbcf7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs
@@ -347,10 +347,7 @@ namespace Tango.PPC.UI.ViewModels
try
{
- if (!App.StartupArgs.Contains("-webDebug"))
- {
- _ppcWebClient.Environment = DeploymentSlot;
- }
+ _ppcWebClient.Environment = DeploymentSlot;
await _operationSystemManager.ChangeTimeZone(SelectedTimeZone);
_setup_result = await MachineSetupManager.Setup(SerialNumber);
State = MachineSetupStates.Completed;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
index 5fe153ee9..01e67d3ce 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
@@ -1,38 +1,22 @@
using System;
using System.Collections.Generic;
-using System.Data.Entity;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
-using System.Threading;
using System.Threading.Tasks;
-using Tango.BL;
-using Tango.Core;
using Tango.Core.Commands;
-using Tango.Core.ExtensionMethods;
using Tango.Core.Helpers;
-using Tango.Core.Threading;
using Tango.Explorer;
-using Tango.Integration.ExternalBridge;
-using Tango.PMR.FirmwareUpgrade;
using Tango.PPC.Common;
-using Tango.PPC.Common.Application;
-using Tango.PPC.Common.ExternalBridge;
using Tango.PPC.Common.MachineUpdate;
-using Tango.PPC.Common.Navigation;
-using Tango.PPC.Common.Notifications;
-using Tango.PPC.Common.Publish;
using Tango.PPC.Common.Web;
-using Tango.PPC.Shared.RemoteUpgrade;
using Tango.PPC.UI.Dialogs;
-using Tango.PPC.UI.Notifications.NotificationItems;
using Tango.PPC.UI.ViewsContracts;
-using Tango.Transport;
namespace Tango.PPC.UI.ViewModels
{
- public class MachineUpdateViewVM : PPCViewModel<IMachineUpdateView>, IExternalBridgeRequestHandler
+ public class MachineUpdateViewVM : PPCViewModel<IMachineUpdateView>
{
public enum MachineUpdateView
{
@@ -52,7 +36,6 @@ namespace Tango.PPC.UI.ViewModels
private DbCompareResult _db_compare_result;
private bool _isChecking;
private CheckForUpdateResponse _checkUpdateResponse;
- private UpdateAvailableNotificationItem _updateNotificationItem;
#region Properties
@@ -124,10 +107,9 @@ namespace Tango.PPC.UI.ViewModels
#region Constructors
- public MachineUpdateViewVM(IMachineUpdateManager machineUpdateManager, IPPCExternalBridgeService externalBridge, IPPCApplicationManager applicationManager, INavigationManager navigationManager, INotificationProvider notificationProvider)
+ public MachineUpdateViewVM(IMachineUpdateManager machineUpdateManager)
{
MachineUpdateManager = machineUpdateManager;
- externalBridge.RegisterRequestHandler(this);
CompleteCommand = new RelayCommand(CompleteUpdate);
UpdateCommand = new RelayCommand(Update);
@@ -143,13 +125,6 @@ namespace Tango.PPC.UI.ViewModels
NavigationManager.NavigateTo(Common.Navigation.NavigationView.HomeModule);
NavigateTo(MachineUpdateView.UpdateCheckView);
});
-
- machineUpdateManager.UpdateAvailable += MachineUpdateManager_UpdateAvailable;
-
- NavigationManager = navigationManager;
- NotificationProvider = notificationProvider;
- ApplicationManager = applicationManager;
- ApplicationManager.UpdaterFailed += ApplicationManager_UpdaterFailed;
}
#endregion
@@ -175,28 +150,7 @@ namespace Tango.PPC.UI.ViewModels
return;
}
- var response = await MachineUpdateManager.CheckForUpdate();
-
- try
- {
- if (response.UsedNotExistingRmlsGuids.Count > 0)
- {
- using (ObservablesContext db = ObservablesContext.CreateDefault())
- {
- var arr = response.UsedNotExistingRmlsGuids.ToArray();
- var jobs = await db.Jobs.Where(x => arr.Contains(x.RmlGuid)).ToListAsync();
- FailedError = $"The following jobs must be removed or change thread type before the system can be updated:\n{String.Join("\n", jobs.Select(x => x.Name))}";
- _isChecking = false;
- await NavigateTo(MachineUpdateView.UpdateFailedView);
- return;
- }
- }
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error on used RML check procedure.");
- }
-
+ var response = await MachineUpdateManager.CheckForUpdate(MachineProvider.Machine.SerialNumber);
_checkUpdateResponse = response;
if (response.IsUpdateAvailable)
@@ -204,19 +158,9 @@ namespace Tango.PPC.UI.ViewModels
LatestVersion = response.Version;
await NavigateTo(MachineUpdateView.UpdateAvailableView);
}
- else if (response.IsDatabaseUpdateAvailable)
- {
- IsDbUpdate = true;
- _db_compare_result = new DbCompareResult()
- {
- RequiresUpdate = true,
- UpdateDBResponse = response.UpdateDBResponse
- };
- await NavigateTo(MachineUpdateView.UpdateAvailableView);
- }
else
{
- _db_compare_result = await MachineUpdateManager.UpdateDBCheck();
+ _db_compare_result = await MachineUpdateManager.UpdateDBCheck(MachineProvider.Machine.SerialNumber);
if (_db_compare_result.RequiresUpdate)
{
@@ -251,7 +195,7 @@ namespace Tango.PPC.UI.ViewModels
try
{
- _update_result = await MachineUpdateManager.Update(_checkUpdateResponse.SetupFirmware, _checkUpdateResponse.SetupFPGA);
+ _update_result = await MachineUpdateManager.Update(MachineProvider.Machine.SerialNumber, _checkUpdateResponse.SetupFirmware, _checkUpdateResponse.SetupFPGA);
LogManager.Log("Machine update completed.");
await NavigateTo(MachineUpdateView.UpdateCompletedView);
}
@@ -269,7 +213,7 @@ namespace Tango.PPC.UI.ViewModels
try
{
- await MachineUpdateManager.UpdateDB(_db_compare_result);
+ await MachineUpdateManager.UpdateDB(_db_compare_result, MachineProvider.Machine.SerialNumber);
LogManager.Log("Database update completed.");
await NavigateTo(MachineUpdateView.UpdateCompletedView);
}
@@ -290,15 +234,15 @@ namespace Tango.PPC.UI.ViewModels
{
LogManager.Log("Completing machine update...");
- if (IsDbUpdate || !_update_result.RequiresBinariesUpdate)
+ if (!IsDbUpdate)
{
- LogManager.Log("Restarting Application...");
- ApplicationManager.Restart();
+ String updater_exe = Path.Combine(_update_result.UpdatePackagePath, "Tango.PPC.Updater.exe");
+ ApplicationManager.UpdateApplication(updater_exe, PathHelper.GetStartupPath());
}
else
{
- String updater_exe = Path.Combine(_update_result.UpdatePackagePath, "Tango.PPC.Updater.exe");
- ApplicationManager.UpdateApplication(updater_exe, PathHelper.GetStartupPath());
+ LogManager.Log("Restarting Application...");
+ ApplicationManager.Restart();
}
}
@@ -331,100 +275,15 @@ namespace Tango.PPC.UI.ViewModels
base.OnApplicationReady();
StorageProvider.RegisterFileHandler(ExplorerFileDefinition.Update.Extension, HandleSoftwareUpdatePackageLoaded);
- StorageProvider.RegisterFileHandler(ExplorerFileDefinition.Firmware.Extension, HandleFirmwareUpgradeLoaded);
-
- if (ApplicationManager.IsAfterUpdate)
- {
- RunPostUpdatePackages();
- }
- else
- {
- MachineUpdateManager.EnableAutoCheckForUpdates = true;
- }
- }
-
- /// <summary>
- /// Called when the navigation system has navigated to this VM view.
- /// </summary>
- public override void OnNavigatedTo()
- {
- base.OnNavigatedTo();
-
- if (_updateNotificationItem != null)
- {
- _updateNotificationItem.Close();
- _updateNotificationItem = null;
- }
- }
-
- #endregion
-
- #region Post Update Packages
-
- private async void RunPostUpdatePackages()
- {
- await Task.Delay(1000);
-
- LogManager.Log("Application was loaded after an update. Checking for required post-update packages...");
-
- bool required = false;
-
- try
- {
- required = await MachineUpdateManager.PostUpdatePackagesRequired();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error checking for post-update packages.");
- }
-
- if (required)
- {
- LogManager.Log("Post-update packages found and needs to be installed. Navigating to machine update and running post-update packages...");
- await NavigationManager.NavigateTo(Common.Navigation.NavigationView.MachineUpdateView);
- await NavigateTo(MachineUpdateView.UpdateProgressView);
- try
- {
- var result = await MachineUpdateManager.RunPostUpdatePackages();
-
- LogManager.Log("Post-update packages installed successfully.");
-
- await Task.Delay(2000);
-
- if (result.RestartRequired)
- {
- LogManager.Log("Restart required. Restarting...");
- ApplicationManager.Restart();
- }
- else
- {
- await NavigationManager.NavigateTo(Common.Navigation.NavigationView.LayoutView);
- }
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error occurred while running post-update packages.");
- }
- }
- else
- {
- LogManager.Log("No post-update packages installation required.");
- }
}
#endregion
#region Handle USB Update
- private async void HandleSoftwareUpdatePackageLoaded(List<ExplorerFileItem> fileItems)
+ private async void HandleSoftwareUpdatePackageLoaded(ExplorerFileItem fileItem)
{
- var fileItem = fileItems.FirstOrDefault();
-
- if (fileItem == null) return;
-
- PublishInfo packageFile = null;
-
- LogManager.Log("TUP file loaded from storage...");
+ UpdatePackageFile packageFile = null;
try
{
@@ -432,394 +291,43 @@ namespace Tango.PPC.UI.ViewModels
}
catch (Exception ex)
{
- LogManager.Log(ex, $"Error loading publish info from {fileItem.Path}.");
+ LogManager.Log(ex, $"Error loading update package file from {fileItem.Path}.");
await NotificationProvider.ShowError("An error occurred while trying to load the selected software update package. Please make sure the package is valid.");
return;
}
- UpdateFromFileViewVM vm = new UpdateFromFileViewVM();
- vm.PublishInfo = packageFile;
-
- LogManager.Log($"TUP publish info:\n{packageFile.ToJson()}");
-
- LogManager.Log("Displaying TUP update dialog...");
-
- await NotificationProvider.ShowDialog(vm);
-
- if (vm.DialogResult)
+ if (ApplicationManager.Version <= packageFile.Version)
{
- await NavigationManager.NavigateTo(Common.Navigation.NavigationView.MachineUpdateView);
- await NavigateTo(MachineUpdateView.UpdateProgressView);
-
- LogManager.Log("Starting machine update from package...");
-
- try
- {
- _update_result = await MachineUpdateManager.UpdateFromTUP(fileItem.Path, MachineProvider.Machine.SetupFirmware, MachineProvider.Machine.SetupFpga);
- LogManager.Log("Machine update from package completed.");
- await NavigateTo(MachineUpdateView.UpdateCompletedView);
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Machine update from package failed.");
- FailedError = ex.FlattenMessage();
- await NavigateTo(MachineUpdateView.UpdateFailedFromPackageView);
- }
- }
- }
-
- private async void HandleFirmwareUpgradeLoaded(List<ExplorerFileItem> fileItems)
- {
- var fileItem = fileItems.FirstOrDefault();
-
- if (fileItem == null) return;
-
- LogManager.Log("TFP file loaded from storage...");
-
- VersionPackageDescriptor packageInfo;
- FirmwareUpgradeFromFileViewVM vm = new FirmwareUpgradeFromFileViewVM();
-
- try
- {
- using (FileStream st = File.OpenRead(fileItem.Path))
- {
- packageInfo = await MachineProvider.MachineOperator.GetFirmwarePackageInfo(st);
- }
-
- packageInfo.Validate();
-
- vm.Version = packageInfo.GetMcuVersion().ToString();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, $"Error loading package info from {fileItem.Path}.");
- await NotificationProvider.ShowError($"An error occurred while trying to load the selected firmware upgrade package.\n{ex.FlattenMessage()}");
+ await NotificationProvider.ShowError($"The selected update package (v{packageFile.Version.ToString()}) contains an older software version.");
return;
}
-
- LogManager.Log($"TFP publish info:\n{packageInfo.ToJsonString()}");
-
- LogManager.Log("Displaying TFP update dialog...");
+ UpdateFromFileViewVM vm = new UpdateFromFileViewVM();
+ vm.Version = packageFile.Version.ToString();
await NotificationProvider.ShowDialog(vm);
if (vm.DialogResult)
{
await NavigationManager.NavigateTo(Common.Navigation.NavigationView.MachineUpdateView);
- await NavigateTo(MachineUpdateView.UpdateProgressView);
-
- LogManager.Log("Starting firmware upgrade from package...");
-
- try
- {
- await MachineUpdateManager.UpdateFromTFP(fileItem.Path);
- LogManager.Log("Firmware upgrade from package completed.");
- _update_result = new MachineUpdateResult()
- {
- RequiresBinariesUpdate = false,
- };
- await NavigateTo(MachineUpdateView.UpdateCompletedView);
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Firmware upgrade from package failed.");
- FailedError = ex.FlattenMessage();
- await NavigateTo(MachineUpdateView.UpdateFailedFromPackageView);
- }
- }
- }
-
- #endregion
-
- #region Auto Check For Update
-
- private void MachineUpdateManager_UpdateAvailable(object sender, CheckForUpdateResponse e)
- {
- if (!IsVisible && _updateNotificationItem == null)
- {
- LogManager.Log($"New {(e.IsDatabaseUpdateAvailable ? "database updates" : "application version")} detected ({e.Version}). Pushing notification...");
-
- InvokeUI(() =>
- {
- _updateNotificationItem = new UpdateAvailableNotificationItem();
- _updateNotificationItem.Version = Version.Parse(e.Version).ToString(3);
- _updateNotificationItem.IsDatabaseUpdate = e.IsDatabaseUpdateAvailable && !e.IsUpdateAvailable;
- _updateNotificationItem.Pressed += (_, __) =>
- {
- if (MachineProvider.MachineOperator.IsPrinting)
- {
- NotificationProvider.ShowInfo("Cannot perform a machine update while the machine is dyeing.");
- return;
- }
-
- _updateNotificationItem = null;
-
- if (!IsVisible)
- {
- LogManager.Log("Update available notification pressed. Navigating to update view...");
- NavigationManager.NavigateTo(Common.Navigation.NavigationView.MachineUpdateView);
- CheckForUpdates();
- }
- };
- _updateNotificationItem.Closed += (_, __) =>
- {
- _updateNotificationItem = null;
- };
- NotificationProvider.PushNotification(_updateNotificationItem);
- });
- }
- }
-
- #endregion
-
- #region Updater Failed
-
- private void ApplicationManager_UpdaterFailed(object sender, EventArgs e)
- {
- InvokeUI(async () =>
- {
- try
- {
- await NavigationManager.NavigateTo(NavigationView.MachineUpdateView);
- await NavigateTo(MachineUpdateView.UpdateProgressView);
- await MachineUpdateManager.RestoreLastDatabaseBackup();
- await Task.Delay(5000);
- ApplicationManager.Restart();
- }
- catch (Exception ex)
- {
- await NotificationProvider.ShowError($"Could not restore the application to its previous state.\n{ex.FlattenMessage()}");
- ApplicationManager.Restart();
- }
- });
- }
-
- #endregion
-
- #region External Bridge Handler
-
- [ExternalBridgeRequestHandlerMethod(typeof(StartRemoteApplicationUpgradeRequest), RequestHandlerLoggingMode.LogRequestName)]
- public async Task OnStartRemoteApplicationUpgradeRequest(StartRemoteApplicationUpgradeRequest request, String token, ExternalBridgeReceiver receiver)
- {
- await receiver.SendGenericResponse(new StartRemoteApplicationUpgradeResponse(), token);
-
- bool stopReporting = false;
-
- try
- {
- ThreadFactory.StartNew(async () =>
- {
- while (!stopReporting)
- {
- if (MachineUpdateManager.Status != null)
- {
- try
- {
- await receiver.SendGenericResponse(new StartRemoteApplicationUpgradeResponse()
- {
- Progress = new TangoProgress<double>()
- {
- Message = MachineUpdateManager.Status.Message,
- IsIndeterminate = MachineUpdateManager.Status.IsIntermediate,
- Maximum = MachineUpdateManager.Status.Total,
- Value = MachineUpdateManager.Status.Progress
- },
- }, token, new TransportResponseConfig() { Priority = QueuePriority.Low });
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error sending remote upgrade progress.");
- }
- }
-
- Thread.Sleep(500);
- }
- });
-
- InvokeUI(() =>
- {
- NavigationManager.NavigateTo(Common.Navigation.NavigationView.MachineUpdateView);
- NavigateTo(MachineUpdateView.UpdateProgressView);
- });
+ await NavigateTo(MachineUpdateView.UpdateFromPackageView);
LogManager.Log("Starting machine update from package...");
try
{
- _update_result = await MachineUpdateManager.UpdateFromTUP(request.RemoteTupFilePath, request.SetupFirmware, request.SetupFPGA);
+ _update_result = await MachineUpdateManager.UpdateFromTUP(fileItem.Path);
LogManager.Log("Machine update from package completed.");
- stopReporting = true;
-
- InvokeUI(() =>
- {
- NavigateTo(MachineUpdateView.UpdateCompletedView);
- });
+ await NavigateTo(MachineUpdateView.UpdateCompletedView);
}
catch (Exception ex)
{
LogManager.Log(ex, "Machine update from package failed.");
- FailedError = ex.FlattenMessage();
-
- InvokeUI(() =>
- {
- NavigateTo(MachineUpdateView.UpdateFailedFromPackageView);
- });
-
- throw ex;
- }
-
- await receiver.SendGenericResponse(new StartRemoteApplicationUpgradeResponse()
- {
- Progress = new TangoProgress<double>("Completed", false, 100, 100),
- }, token, new TransportResponseConfig()
- {
- Completed = true
- });
-
- try
- {
- File.Delete(request.RemoteTupFilePath);
- }
- catch { }
-
- await Task.Delay(2000);
-
- CompleteUpdate();
- }
- catch (Exception ex)
- {
- stopReporting = true;
- await receiver.SendErrorResponse(ex, token);
- }
- finally
- {
- stopReporting = true;
-
- try
- {
- File.Delete(request.RemoteTupFilePath);
- }
- catch { }
- }
- }
-
- [ExternalBridgeRequestHandlerMethod(typeof(StartRemoteFirmwareUpgradeRequest), RequestHandlerLoggingMode.LogRequestName)]
- public async Task OnStartRemoteFirmwareUpgradeRequest(StartRemoteFirmwareUpgradeRequest request, String token, ExternalBridgeReceiver receiver)
- {
- await receiver.SendGenericResponse(new StartRemoteFirmwareUpgradeResponse(), token);
-
- bool stopReporting = false;
-
- try
- {
- ThreadFactory.StartNew(async () =>
- {
- while (!stopReporting)
- {
- if (MachineUpdateManager.Status != null)
- {
- try
- {
- await receiver.SendGenericResponse(new StartRemoteFirmwareUpgradeResponse()
- {
- Progress = new TangoProgress<double>()
- {
- Message = MachineUpdateManager.Status.Message,
- IsIndeterminate = MachineUpdateManager.Status.IsIntermediate,
- Maximum = MachineUpdateManager.Status.Total,
- Value = MachineUpdateManager.Status.Progress
- }
- }, token, new TransportResponseConfig() { Priority = QueuePriority.Low });
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error sending remote upgrade progress.");
- }
- }
-
- Thread.Sleep(500);
- }
- });
-
- InvokeUI(() =>
- {
- NavigationManager.NavigateTo(Common.Navigation.NavigationView.MachineUpdateView);
- NavigateTo(MachineUpdateView.UpdateProgressView);
- });
-
- LogManager.Log("Starting firmware upgrade from package...");
-
- try
- {
- await MachineUpdateManager.UpdateFromTFP(request.RemoteTfpFilePath);
- stopReporting = true;
- LogManager.Log("Firmware upgrade from package completed.");
- _update_result = new MachineUpdateResult()
- {
- RequiresBinariesUpdate = false,
- };
-
- InvokeUI(() =>
- {
- NavigateTo(MachineUpdateView.UpdateCompletedView);
- });
- }
- catch (Exception ex)
- {
- stopReporting = true;
-
- LogManager.Log(ex, "Firmware upgrade from package failed.");
- FailedError = ex.FlattenMessage();
-
- InvokeUI(() =>
- {
- NavigateTo(MachineUpdateView.UpdateFailedFromPackageView);
- });
-
- throw ex;
- }
-
- await receiver.SendGenericResponse(new StartRemoteFirmwareUpgradeResponse()
- {
- Progress = new TangoProgress<double>("Completed", false, 100, 100),
- }, token, new TransportResponseConfig()
- {
- Completed = true
- });
-
- try
- {
- File.Delete(request.RemoteTfpFilePath);
- }
- catch { }
-
- await Task.Delay(2000);
-
- CompleteUpdate();
- }
- catch (Exception ex)
- {
- stopReporting = true;
- await receiver.SendErrorResponse(ex, token);
- }
- finally
- {
- stopReporting = true;
-
- try
- {
- File.Delete(request.RemoteTfpFilePath);
+ await NavigateTo(MachineUpdateView.UpdateFailedFromPackageView);
}
- catch { }
}
}
- public void OnReceiverDisconnected(ExternalBridgeReceiver receiver)
- {
- //Do Nothing.
- }
-
#endregion
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
index 05fb610c8..01a47539e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -4,9 +4,6 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
-using Tango.BL;
-using Tango.BL.Builders;
-using Tango.BL.Entities;
using Tango.Core.DI;
using Tango.Integration.ExternalBridge;
using Tango.Integration.Operation;
@@ -20,8 +17,6 @@ using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.WatchDog;
using Tango.PPC.UI.Dialogs;
using Tango.SharedUI;
-using System.Data.Entity;
-using Tango.PPC.UI.AppBarItems;
namespace Tango.PPC.UI.ViewModels
{
@@ -32,10 +27,6 @@ namespace Tango.PPC.UI.ViewModels
public class MainViewVM : PPCViewModel
{
private DispatcherTimer _date_timer;
- private bool _isPowerUpDialogShown;
- private bool _isThreadLoadingShown;
- private PowerUpAppBarItem _powerUpAppBar;
- private bool _started;
private DateTime _currentDateTime;
/// <summary>
@@ -67,53 +58,8 @@ namespace Tango.PPC.UI.ViewModels
{
base.OnApplicationReady();
MachineProvider.MachineOperator.CartridgeValidationRequestReceived += MachineOperator_CartridgeValidationRequestReceived;
- MachineProvider.MachineOperator.FirmwareStarted += MachineOperator_FirmwareStarted;
- MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged;
- MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired;
-
- MachineProvider.MachineOperator.PowerUpStarted += MachineOperator_PowerUpStarted;
- MachineProvider.MachineOperator.PowerUpProgress += MachineOperator_PowerUpProgress;
- MachineProvider.MachineOperator.PowerUpEnded += MachineOperator_PowerUpEnded;
- }
-
- #region Power Up
-
- private void MachineOperator_PowerUpEnded(object sender, EventArgs e)
- {
- _started = false;
- _powerUpAppBar?.Close();
- _powerUpAppBar = null;
- }
-
- private void MachineOperator_PowerUpProgress(object sender, PMR.Power.StartPowerUpResponse status)
- {
- if (_powerUpAppBar != null)
- {
- _powerUpAppBar.Status = status;
- }
- }
-
- private void MachineOperator_PowerUpStarted(object sender, PMR.Power.StartPowerUpResponse e)
- {
- _started = true;
-
- InvokeUI(() =>
- {
- if (_powerUpAppBar != null)
- {
- _powerUpAppBar.Close();
- }
-
- if (_started)
- {
- _powerUpAppBar = NotificationProvider.PushAppBarItem<PowerUpAppBarItem>();
- _powerUpAppBar.Priority = AppBarPriority.Low;
- }
- });
}
- #endregion
-
#region Event Handlers
/// <summary>
@@ -146,106 +92,6 @@ namespace Tango.PPC.UI.ViewModels
});
}
- private async void MachineOperator_FirmwareStarted(object sender, EventArgs e)
- {
- if (_isPowerUpDialogShown)
- {
- LogManager.Log("Power up detected but power up dialog is already shown. Skipping...");
- return;
- }
-
- LogManager.Log("Power up detected, showing power up screen...");
-
- if (!Settings.DisplayPowerUpScreen)
- {
- LogManager.Log("Power up screen disabled. skipping...");
- return;
- }
-
- PowerUpViewVM vm;
-
- try
- {
- LogManager.Log("Loading site rmls...");
-
- List<Rml> rmls = new List<Rml>();
-
- using (ObservablesContext db = ObservablesContext.CreateDefault())
- {
- rmls = await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildListAsync();
- }
-
- var selectedRml = rmls.SingleOrDefault(x => x.Guid == Settings.LoadedRmlGuid);
-
- vm = new PowerUpViewVM();
- vm.Rmls = rmls;
- vm.SelectedRml = selectedRml != null ? selectedRml : rmls.FirstOrDefault();
- vm.IsSelectedRml = selectedRml != null;
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error initializing power up screen.");
- return;
- }
-
- InvokeUI(async () =>
- {
- _isPowerUpDialogShown = true;
- await NotificationProvider.ShowDialog<PowerUpViewVM>(vm);
- _isPowerUpDialogShown = false;
-
- await Task.Factory.StartNew(() =>
- {
- LogManager.Log("Power up screen closed.");
-
- try
- {
- using (ObservablesContext db = ObservablesContext.CreateDefault())
- {
- List<ProcessParametersTable> processTables = new List<ProcessParametersTable>();
-
- if (vm.IsSelectedRml)
- {
- LogManager.Log($"Selected rml '{vm.SelectedRml.Name}'...");
- processTables = new RmlBuilder(db).Set(vm.SelectedRml.Guid).WithActiveParametersGroup().Build().GetActiveProcessGroup().ProcessParametersTables.ToList();
- }
- else
- {
- LogManager.Log("Selected minimal temperature...");
- var rmlsToAvg = new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).WithActiveParametersGroup().Build();
- processTables = rmlsToAvg.Select(x => x.GetActiveProcessGroup()).SelectMany(x => x.ProcessParametersTables).ToList();
- }
-
- var processToLoad = processTables.OrderBy(x => x.GetAverageTemperature()).First();
-
- LogManager.Log($"Selected process parameters:\nRML: {processToLoad.ProcessParametersTablesGroup.Rml.Name}\nGroup: {processToLoad.ProcessParametersTablesGroup.Name}\nProcess Table: {processToLoad.Name}");
- LogManager.Log("Uploading process parameters...");
- var r = MachineProvider.MachineOperator.UploadProcessParameters(processToLoad).Result;
-
- Settings.LoadedRmlGuid = vm.IsSelectedRml ? vm.SelectedRml.Guid : null;
- Settings.Save();
- }
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error occurred while trying to get and upload the proper process parameters after power screen closed.");
- }
- });
- });
- }
-
- private void MachineOperator_ThreadLoadingStatusChanged(object sender, PMR.ThreadLoading.StartThreadLoadingResponse e)
- {
- //if (e.State == PMR.ThreadLoading.ThreadLoadingState.Preparing)
- //{
- // DisplayThreadLoading();
- //}
- }
-
- private void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e)
- {
-// DisplayThreadLoading(e);
- }
#endregion
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/PowerOffViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/PowerOffViewVM.cs
deleted file mode 100644
index e3ab7d111..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/PowerOffViewVM.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.Core.Commands;
-using Tango.Integration.Operation;
-using Tango.PMR.Power;
-using Tango.PPC.Common;
-using Tango.PPC.UI.AppBarItems;
-using Tango.PPC.UI.Views;
-
-namespace Tango.PPC.UI.ViewModels
-{
- public class PowerOffViewVM : PPCViewModel
- {
- private PowerDownHandler _handler;
- private PowerOffAppBarItem _appBarItem;
- private int _abortTries;
-
- private StartPowerDownResponse _status;
- public StartPowerDownResponse Status
- {
- get { return _status; }
- set { _status = value; RaisePropertyChangedAuto(); }
- }
-
- public RelayCommand AbortCommand { get; set; }
-
- public PowerOffViewVM()
- {
- _appBarItem = new PowerOffAppBarItem();
- _appBarItem.Pressed += (x, e) =>
- {
- NavigationManager.NavigateTo<InternalModule>(nameof(PowerOffView));
- };
- AbortCommand = new RelayCommand(AbortPowerOff);
- }
-
- public override void OnApplicationStarted()
- {
-
- }
-
- public override void OnApplicationReady()
- {
- base.OnApplicationReady();
- MachineProvider.MachineOperator.PowerDownStarted += MachineOperator_PowerDownStarted;
- }
-
- private void MachineOperator_PowerDownStarted(object sender, PowerDownStartedEventArgs e)
- {
- _abortTries = 0;
- _handler = e.Handler;
-
- _handler.StatusChanged += OnStatusChanged;
- _handler.Failed += OnFailed;
- _handler.Completed += OnCompleted;
-
- InvokeUI(async () =>
- {
- await NavigationManager.NavigateTo<InternalModule>(nameof(PowerOffView));
- NotificationProvider.PushAppBarItem(_appBarItem);
- });
- }
-
- private void OnStatusChanged(object sender, PowerDownStatusChangedEventArgs e)
- {
- Status = e.Status;
- _appBarItem.Status = Status;
- }
-
- private void OnCompleted(object sender, EventArgs e)
- {
- InvokeUI(async () =>
- {
- if (IsVisible)
- {
- await NavigationManager.NavigateBack();
- }
-
- NotificationProvider.PopAppBarItem(_appBarItem);
- });
- }
-
- private void OnFailed(object sender, Exception ex)
- {
- InvokeUI(async () =>
- {
- await NotificationProvider.ShowError($"An error occurred while powering off the machine.\n{ex.FlattenMessage()}");
-
- if (IsVisible)
- {
- await NavigationManager.NavigateBack();
- }
-
- NotificationProvider.PopAppBarItem(_appBarItem);
- });
- }
-
- private async void AbortPowerOff()
- {
- try
- {
- NotificationProvider.SetGlobalBusyMessage("Aborting machine power off...");
- await _handler.Abort();
- await NavigationManager.NavigateBack();
- NotificationProvider.PopAppBarItem(_appBarItem);
- }
- catch (Exception ex)
- {
- _abortTries++;
- LogManager.Log(ex, "Power down abort error.");
- NotificationProvider.ReleaseGlobalBusyMessage();
- await NotificationProvider.ShowError($"An error occurred while trying to abort the power off sequence.\n{ex.FlattenMessage()}");
-
- if (_abortTries > 2)
- {
- if (IsVisible)
- {
- await NavigationManager.NavigateBack();
- }
-
- NotificationProvider.PopAppBarItem(_appBarItem);
- }
- }
- finally
- {
- NotificationProvider.ReleaseGlobalBusyMessage();
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingViewVM.cs
deleted file mode 100644
index 46111031b..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingViewVM.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.PPC.Common;
-
-namespace Tango.PPC.UI.ViewModels
-{
- public class RestartingViewVM : PPCViewModel
- {
- public override void OnApplicationStarted()
- {
-
- }
-
- public override void OnNavigatedTo()
- {
- base.OnNavigatedTo();
- }
-
- public override void OnNavigatedFrom()
- {
- base.OnNavigatedFrom();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/EmergencyView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/EmergencyView.xaml
index f2b018bfa..dfc70e602 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/EmergencyView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/EmergencyView.xaml
@@ -9,18 +9,12 @@
xmlns:local="clr-namespace:Tango.PPC.UI.Views"
mc:Ignorable="d"
d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:EmergencyViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.EmergencyViewVM}">
- <Grid Background="{StaticResource TangoEmergecyScreenBackgroundBrush}">
+ <Grid>
<DockPanel Margin="20 60 20 20">
- <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center">
- <touch:TouchIcon Icon="Alert" Width="120" Height="120" Foreground="{StaticResource TangoErrorBrush}" HorizontalAlignment="Center"></touch:TouchIcon>
- <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">EMERGENCY PUSH BUTTON PRESSED</TextBlock>
- <TextBlock Margin="0 60 0 0" FontWeight="SemiBold" FontSize="24">How to handle:</TextBlock>
- <Rectangle Margin="0 20 240 5" StrokeThickness="1" Stroke="{StaticResource TangoGrayBrush}" />
- <TextBlock Margin="0 8 0 0" FontSize="{StaticResource TangoTitleFontSize}">1. Verify that it is safe to restart the system.</TextBlock>
- <TextBlock Margin="0 8 0 0" FontSize="{StaticResource TangoTitleFontSize}">2. Release the emergency button.</TextBlock>
- <TextBlock Margin="0 8 0 0" FontSize="{StaticResource TangoTitleFontSize}">3. Press the power button to power up the system.</TextBlock>
-
- <Image Source="../Images/machine-image.png" Width="500" HorizontalAlignment="Left" Margin="0 150 0 0" />
+ <StackPanel DockPanel.Dock="Top">
+ <Image Source="../Images/warning-red.png" Width="300" Stretch="Uniform" HorizontalAlignment="Center"></Image>
+ <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Emergency Switch Activated</TextBlock>
+ <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoTitleFontSize}">Please release the emergency switch to exit this screen.</TextBlock>
</StackPanel>
</DockPanel>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml
index fddd15fe7..d83128007 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/ExternalBridgeView.xaml
@@ -7,23 +7,18 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:localControls="clr-namespace:Tango.PPC.UI.Controls"
xmlns:local="clr-namespace:Tango.PPC.UI.Views"
mc:Ignorable="d"
d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:ExternalBridgeViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.ExternalBridgeViewVM}" Background="{StaticResource TangoPrimaryBackgroundBrush}">
<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
- <Grid HorizontalAlignment="Center" VerticalAlignment="Center" >
- <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" Width="50" Height="50"/>
- <localControls:MachineStatusControl Margin="0 0 0 -1" VerticalAlignment="Center" DataContext="{Binding MachineProvider.MachineOperator}" />
- </Grid>
- <Grid HorizontalAlignment="Center" Margin="0 20 0 0">
- <Image Source="/Images/machine.png" Stretch="None" RenderOptions.BitmapScalingMode="Fant"></Image>
- <touch:TouchIcon Icon="Wifi" Foreground="{StaticResource TangoGreenBrush}" Width="30" Height="30" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 40 45">
+ <Grid HorizontalAlignment="Center">
+ <Image Source="/Images/machine-trans.png" Stretch="None" RenderOptions.BitmapScalingMode="Fant"></Image>
+ <touch:TouchIcon Icon="Wifi" Foreground="{StaticResource TangoGreenBrush}" Width="30" Height="30" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 25 30">
<touch:TouchIcon.Style>
<Style TargetType="touch:TouchIcon">
<Style.Triggers>
- <DataTrigger Binding="{Binding ExternalBridgeService.HasSessions}" Value="True">
+ <DataTrigger Binding="{Binding ExternalBridgeService.IsInSession}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard x:Name="Blink">
<Storyboard>
@@ -48,8 +43,8 @@
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 50 0 0" FontSize="{StaticResource TangoTitleFontSize}">This machine is currently being controlled by a remote client</TextBlock>
<controls:TableGrid Margin="0 30 0 0" HorizontalAlignment="Center" RowHeight="30" Width="280">
- <TextBlock FontWeight="Bold">Address:</TextBlock>
- <TextBlock Text="{Binding Connection.Address}"></TextBlock>
+ <TextBlock FontWeight="Bold">IP Address:</TextBlock>
+ <TextBlock Text="{Binding Connection.IpAddress}"></TextBlock>
<TextBlock FontWeight="Bold">Host Name:</TextBlock>
<TextBlock Text="{Binding Connection.Request.HostName}"></TextBlock>
@@ -62,7 +57,7 @@
<TextBlock FontWeight="Bold" Text="Transfer Rate:" />
<TextBlock>
- <Run Text="{Binding ExternalBridgeService.FullControlSessionReceiver.Adapter.TransferRate,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}"></Run>
+ <Run Text="{Binding ExternalBridgeService.Adapter.TransferRate,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}"></Run>
<Run Text="/ sec"></Run>
</TextBlock>
</controls:TableGrid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/InternalModuleView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/InternalModuleView.xaml
deleted file mode 100644
index 88981a9fa..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/InternalModuleView.xaml
+++ /dev/null
@@ -1,18 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Views.InternalModuleView"
- 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:local="clr-namespace:Tango.PPC.UI.Views"
- xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
- xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
- xmlns:global="clr-namespace:Tango.PPC.UI"
- mc:Ignorable="d"
- d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:InternalModuleViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.InternalModuleViewVM}">
- <Grid>
- <controls:NavigationControl TransitionType="Zoom" KeepElementsAttached="True">
- <local:PowerOffView/>
- </controls:NavigationControl>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/InternalModuleView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/InternalModuleView.xaml.cs
deleted file mode 100644
index f67d16dd9..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/InternalModuleView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.Views
-{
- /// <summary>
- /// Interaction logic for InternalModuleView.xaml
- /// </summary>
- public partial class InternalModuleView : UserControl
- {
- public InternalModuleView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
index 3e1f50e41..890d3863b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -14,7 +14,6 @@
xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:components="clr-namespace:Tango.Touch.Components;assembly=Tango.Touch"
- xmlns:locaControls="clr-namespace:Tango.PPC.UI.Controls"
xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
mc:Ignorable="d"
d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LayoutViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LayoutViewVM}">
@@ -130,21 +129,6 @@
<Border Background="{StaticResource TangoPowerMenuOpenedBackgroundBrush}" Height="350" Padding="20" RenderTransformOrigin="0.5,1" VerticalAlignment="Bottom">
- <Border.Resources>
- <Style x:Key="PowerButton" TargetType="touch:TouchButton" BasedOn="{StaticResource TangoLinkButton}">
- <Setter Property="Foreground" Value="{StaticResource TangoPrimaryBackgroundBrush}"></Setter>
- <Setter Property="FontSize" Value="{StaticResource TangoTitleFontSize}"></Setter>
- <Setter Property="HorizontalAlignment" Value="Left"></Setter>
- <Setter Property="VerticalAlignment" Value="Center"></Setter>
- <Setter Property="Padding" Value="50 20"></Setter>
- <Setter Property="Height" Value="Auto"></Setter>
- <Style.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter>
- </Trigger>
- </Style.Triggers>
- </Style>
- </Border.Resources>
<Border.Style>
<Style TargetType="Border">
<Setter Property="RenderTransform">
@@ -174,7 +158,7 @@
</Border.Style>
<Grid>
<Grid.RowDefinitions>
- <RowDefinition Height="1.4*"/>
+ <RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
@@ -186,10 +170,9 @@
<Image Source="/Images/power-machine.png" Margin="30" />
- <UniformGrid Grid.Column="1" Rows="3">
- <touch:TouchButton Style="{StaticResource PowerButton}" Command="{Binding PowerOffCommand}">Turn Off</touch:TouchButton>
- <touch:TouchButton Style="{StaticResource PowerButton}" Command="{Binding StandByCommand}">Stand By</touch:TouchButton>
- <touch:TouchButton Style="{StaticResource PowerButton}" Command="{Binding ResetCommand}">Reset</touch:TouchButton>
+ <UniformGrid Grid.Column="1" Rows="2">
+ <touch:TouchButton HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}">Turn Off</touch:TouchButton>
+ <touch:TouchButton HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}">Stand By</touch:TouchButton>
</UniformGrid>
</Grid>
@@ -202,7 +185,7 @@
</Grid.ColumnDefinitions>
<Image Source="/Images/power-tablet.png" Margin="30" />
- <touch:TouchButton Command="{Binding RestartApplicationCommand}" Grid.Column="1" Style="{StaticResource PowerButton}">Restart</touch:TouchButton>
+ <touch:TouchButton Command="{Binding RestartApplicationCommand}" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50 20" Height="Auto" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}" FontSize="{StaticResource TangoTitleFontSize}">Restart</touch:TouchButton>
</Grid>
</Grid>
</Border>
@@ -249,21 +232,20 @@
<touch:TouchNotificationBar
NotificationBarVisibility="{Binding NotificationProvider.NotificationsVisible,Converter={StaticResource BooleanToVisibilityConverter}}"
- HasNotifications="{Binding NotificationProvider.HasNotificationItems}" Notifications="{Binding NotificationProvider.NotificationItems}">
+ HasNotifications="{Binding NotificationProvider.HasNotificationItems}"
+ Notifications="{Binding NotificationProvider.NotificationItems}"
+ ItemExpandedPropertyPath="IsExpanded">
<touch:TouchNotificationBar.NotificationTemplate>
<DataTemplate>
<components:Ripple Padding="0">
<Grid Background="Transparent">
- <touch:TouchClickableControl Command="{Binding PressedCommand}">
- <ContentControl Content="{Binding Converter={StaticResource ItemBaseConverter}}"/>
- </touch:TouchClickableControl>
- <Grid Width="40" HorizontalAlignment="Right" VerticalAlignment="Stretch" Visibility="{Binding CanClose,Converter={StaticResource BooleanToVisibilityConverter}}">
- <Grid Margin="0 0 20 0" HorizontalAlignment="Right" VerticalAlignment="Center" Width="18" Height="18">
- <!--<Ellipse Fill="Black" StrokeThickness="1" Stroke="{StaticResource TangoDarkForegroundBrush}" />-->
- <touch:TouchIcon Icon="Close" Foreground="Black" />
- </Grid>
- <touch:TouchButton Opacity="0" Background="Red" Style="{StaticResource TangoFlatButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" Foreground="{StaticResource TangoPrimaryBackgroundBrush}" Padding="5" />
- </Grid>
+ <i:Interaction.Triggers>
+ <i:EventTrigger EventName="PreviewMouseUp">
+ <i:InvokeCommandAction Command="{Binding PressedCommand}" />
+ </i:EventTrigger>
+ </i:Interaction.Triggers>
+ <ContentControl Content="{Binding Converter={StaticResource ItemBaseConverter}}"/>
+ <touch:TouchIconButton Visibility="{Binding CanClose,Converter={StaticResource BooleanToVisibilityConverter}}" DockPanel.Dock="Right" Background="Transparent" Padding="35" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="90" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="{StaticResource TangoDarkForegroundBrush}" />
</Grid>
</components:Ripple>
</DataTemplate>
@@ -272,13 +254,46 @@
<Border BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" DockPanel.Dock="Top">
<DockPanel>
<Border BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}">
- <touch:TouchHamburgerButton IsHitTestVisible="{Binding NavigationManager.IsNavigating,Converter={StaticResource BooleanInverseConverter}}" IsEnabled="{Binding NavigationManager.IsBackEnabled}" Width="100" Height="100" Padding="15" Command="{Binding MenuOrBackCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" IsBack="{Binding NavigationManager.CanNavigateBack}"/>
+ <touch:TouchHamburgerButton Width="100" Height="100" Padding="15" Command="{Binding MenuOrBackCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" IsBack="{Binding NavigationManager.CanNavigateBack}">
+ </touch:TouchHamburgerButton>
</Border>
<Grid DockPanel.Dock="Right" Margin="0 0 20 0">
<StackPanel Orientation="Horizontal">
<StackPanel x:Name="techPressElement" VerticalAlignment="Center" Background="Transparent">
- <locaControls:MachineStatusControl HorizontalAlignment="Center" DataContext="{Binding MachineProvider.MachineOperator}" />
+ <touch:TouchGifAnimation Width="36" HorizontalAlignment="Center" EnableAnimation="True">
+ <touch:TouchGifAnimation.Style>
+ <Style TargetType="touch:TouchGifAnimation">
+ <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Disconnected}">
+ <Setter Property="Source" Value="/Images/GlobalStatus/machine_off_Anim.gif"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Standby}">
+ <Setter Property="Source" Value="/Images/GlobalStatus/standby_Anim.gif"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.ReadyToDye}">
+ <Setter Property="Source" Value="/Images/GlobalStatus/Ready_Anim.gif"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.GettingReady}">
+ <Setter Property="Source" Value="/Images/GlobalStatus/getting_ready_Anim.gif"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Printing}">
+ <Setter Property="Source" Value="/Images/GlobalStatus/dyeing_Anim.gif"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.ShuttingDown}">
+ <Setter Property="Source" Value="/Images/GlobalStatus/shutdown_icon_Anim.gif"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Error}">
+ <Setter Property="Source" Value="/Images/GlobalStatus/error_Anim.gif"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Service}">
+ <Setter Property="Source" Value="/Images/GlobalStatus/service_Anim.gif"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </touch:TouchGifAnimation.Style>
+ </touch:TouchGifAnimation>
<TextBlock Margin="0 10 0 0" Text="{Binding MachineProvider.MachineOperator.Status,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
</StackPanel>
@@ -287,21 +302,8 @@
</Grid>
<Grid>
- <Grid Margin="20 0 60 0" Height="80" Visibility="{Binding NotificationProvider.HasAppBarItems,Converter={StaticResource BooleanToVisibilityConverter}}">
- <ItemsControl ItemsSource="{Binding NotificationProvider.AppBarItems}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <Grid IsItemsHost="True" />
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
- <ContentControl Content="{Binding Converter={StaticResource AppBarItemConverter}}"></ContentControl>
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
+ <Grid Margin="20 0 60 0" Height="80" Visibility="{Binding NotificationProvider.HasAppBarItem,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <ContentControl Content="{Binding NotificationProvider.CurrentAppBarItem,Converter={StaticResource AppBarItemConverter}}"></ContentControl>
</Grid>
<!--External Header Content Here-->
@@ -328,35 +330,6 @@
</DockPanel>
</Border>
- <Border Margin="0 0 0 0" DockPanel.Dock="Top" Visibility="{Binding IsInkFillingOrWasteEmptying,Converter={StaticResource BooleanToVisibilityConverter}}">
- <ItemsControl ItemsSource="{Binding Cartridges}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Border Margin="0 5 0 0" Visibility="{Binding InProgress,Converter={StaticResource BooleanToVisibilityConverter}}">
- <StackPanel>
- <DockPanel Margin="2 0 0 0">
- <touch:TouchIcon>
- <touch:TouchIcon.Style>
- <Style TargetType="touch:TouchIcon" BasedOn="{StaticResource {x:Type touch:TouchIcon}}">
- <Setter Property="Icon" Value="Recycle"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Status.Cartridge.Slot}" Value="Ink">
- <Setter Property="Icon" Value="FormatColorFill"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </touch:TouchIcon.Style>
- </touch:TouchIcon>
- <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Text="{Binding Message,Mode=OneWay}" FontSize="{StaticResource TangoSmallFontSize}"></TextBlock>
- </DockPanel>
- <touch:TouchProgressBar Foreground="{Binding Brush,Mode=OneWay}" Background="#DBDBDB" Height="3" Margin="0 2 0 0" Minimum="0" Maximum="100" Value="{Binding Status.ProgressPercentage}" />
- </StackPanel>
- </Border>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Border>
-
<Grid Background="{StaticResource TangoKeyboardBackground}">
<controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Zoom" KeepElementsAttached="False" UseDefferedRendering="True">
<!--MODULES GOES HERE-->
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs
index b87f14b89..883d3f893 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs
@@ -30,7 +30,7 @@ namespace Tango.PPC.UI.Views
{
public static LayoutView Instance { get; private set; }
private LayoutViewVM _vm;
- private System.Timers.Timer _timer;
+ private DispatcherTimer _timer;
public LayoutView()
{
@@ -39,9 +39,9 @@ namespace Tango.PPC.UI.Views
Loaded += (_, __) => _vm = DataContext as LayoutViewVM;
techPressElement.RegisterForPreviewMouseOrTouchDown(OnMouseOrTouchDown);
techPressElement.RegisterForPreviewMouseOrTouchUp(OnMouseOrTouchUp);
- _timer = new System.Timers.Timer();
- _timer.Interval = TimeSpan.FromSeconds(10).TotalMilliseconds;
- _timer.Elapsed += _timer_Elapsed;
+ _timer = new DispatcherTimer();
+ _timer.Interval = TimeSpan.FromSeconds(10);
+ _timer.Tick += _timer_Tick;
this.PreviewMouseUp += LayoutView_PreviewMouseUp;
}
@@ -51,14 +51,10 @@ namespace Tango.PPC.UI.Views
_vm.ApplicationManager.ResetScreenLockTimer();
}
- private void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
+ private void _timer_Tick(object sender, EventArgs e)
{
_timer.Stop();
-
- Dispatcher.BeginInvoke(new Action(() =>
- {
- _vm.ToggleTechnicianMode();
- }));
+ _vm.ToggleTechnicianMode();
}
private void OnMouseOrTouchDown(object sender, MouseOrTouchEventArgs e)
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml
index a917695af..79d9cd54b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml
@@ -10,9 +10,9 @@
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:local="clr-namespace:Tango.PPC.UI.Views"
mc:Ignorable="d"
- d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:LoadingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoadingView}">
+ d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LoadingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoadingView}">
<Grid>
- <StackPanel HorizontalAlignment="Center">
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<!--<Image gif:ImageBehavior.EnableAnimation="{Binding IsLoading}" gif:ImageBehavior.AnimatedSource="/Images/Twine_Loading_GIF.gif" Margin="100 100 100 0" RenderTransformOrigin="0.5,0.5" RenderOptions.BitmapScalingMode="Fant" Height="382">
<Image.Style>
<Style TargetType="Image">
@@ -47,10 +47,9 @@
</Image.Style>
</Image>-->
- <Grid Margin="0 0 0 0">
- <!--<Image Source="/Images/machine.png" Stretch="Uniform" Width="250" RenderOptions.BitmapScalingMode="Fant"></Image>
- <touch:TouchBusyIndicator Width="350" Height="350" IsIndeterminate="{Binding IsLoading}" />-->
- <touch:TouchGifAnimation Source="/Images/loading_anim.gif" EnableAnimation="{Binding IsLoading}" />
+ <Grid Margin="0 100 0 0">
+ <Image Source="/Images/machine.png" Stretch="Uniform" Width="250" RenderOptions.BitmapScalingMode="Fant"></Image>
+ <touch:TouchBusyIndicator Width="350" Height="350" IsIndeterminate="{Binding IsLoading}" />
</Grid>
<TextBlock Margin="0 40 0 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
index 40b296d1e..9437caac9 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
@@ -25,7 +25,7 @@
<Grid DockPanel.Dock="Bottom" Height="200" Background="{StaticResource TangoMidBackgroundBrush}">
<Border BorderThickness="0 1 0 0" BorderBrush="{StaticResource TangoGrayBrush}">
- <TextBox x:Name="txtLog" Foreground="{StaticResource TangoGrayTextBrush}" FontSize="12" SelectionBrush="#8BB0B0B0" IsReadOnly="True" Padding="5" Background="Transparent" AcceptsReturn="True" TextWrapping="Wrap" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
+ <TextBox x:Name="txtLog" Foreground="{StaticResource TangoGrayTextBrush}" FontSize="12" SelectionBrush="Transparent" IsReadOnly="True" Padding="5" Background="Transparent" AcceptsReturn="True" TextWrapping="Wrap" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
</TextBox>
</Border>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml
index beb09be0d..fba8a599d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml
@@ -194,9 +194,8 @@
<touch:TouchButton Padding="20" Width="300" Margin="0 0 0 130" CornerRadius="35" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 50 0 0">
- <touch:TouchIcon Icon="AlertOutline" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" />
- <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" FontSize="{StaticResource TangoTitleFontSize}">Update Failed</TextBlock>
- <TextBlock HorizontalAlignment="Center" Margin="0 5 0 0" Foreground="{StaticResource TangoErrorBrush}" TextAlignment="Center" Text="{Binding FailedError,FallbackValue='Unexpected error'}"></TextBlock>
+ <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" />
+ <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoTitleFontSize}">An error occurred while trying to update the machine.</TextBlock>
</StackPanel>
</DockPanel>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml.cs
index 13a605774..f63899932 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -38,10 +37,7 @@ namespace Tango.PPC.UI.Views
navigationControl.NavigateTo(view.ToString(), () =>
{
- if (!source.Task.IsCompleted)
- {
- source.SetResult(new object());
- }
+ source.SetResult(new object());
});
return source.Task;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
index 2e36347a3..6d6d57526 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
@@ -7,7 +7,6 @@
xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
xmlns:global="clr-namespace:Tango.PPC.UI"
- xmlns:operations="clr-namespace:Tango.Integration.Operation;assembly=Tango.Integration"
xmlns:local="clr-namespace:Tango.PPC.UI.Views"
xmlns:notifications="clr-namespace:Tango.PPC.UI.Notifications"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
@@ -47,21 +46,6 @@
</touch:TouchIcon.Style>
</touch:TouchIcon>
- <touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center">
- <touch:TouchIcon.Style>
- <Style TargetType="touch:TouchIcon" BasedOn="{StaticResource {x:Type touch:TouchIcon}}">
- <Setter Property="Icon" Value="LanDisconnect"></Setter>
- <Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding ConnectivityProvider.IsLanConnected}" Value="True">
- <Setter Property="Icon" Value="LanConnect"></Setter>
- <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </touch:TouchIcon.Style>
- </touch:TouchIcon>
-
<touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Icon="AccessPointNetwork" Visibility="{Binding HotSpotProvider.IsEnabled,Converter={StaticResource BooleanToVisibilityConverter}}" />
<touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Icon="Bridge" Visibility="{Binding ExternalBridgeService.Enabled,Converter={StaticResource BooleanToVisibilityConverter}}">
@@ -69,7 +53,7 @@
<Style TargetType="touch:TouchIcon">
<Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding ExternalBridgeService.HasSessions}" Value="True">
+ <DataTrigger Binding="{Binding ExternalBridgeService.IsInSession}" Value="True">
<Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter>
</DataTrigger>
</Style.Triggers>
@@ -77,8 +61,6 @@
</touch:TouchIcon.Style>
</touch:TouchIcon>
- <touch:TouchIcon Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" Foreground="{StaticResource TangoSuccessBrush}" Icon="RemoteDesktop" Visibility="{Binding RemoteDesktopService.InSession,Converter={StaticResource BooleanToVisibilityConverter}}" />
-
<ItemsControl ItemsSource="{Binding NotificationProvider.TaskBarItems}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@@ -91,43 +73,6 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
-
- <Image Margin="10 0 0 0" Width="18" Height="18" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="Fant">
- <Image.Style>
- <Style TargetType="Image">
- <Setter Property="Source" Value="/Images/GlobalStatus/machine-off.png"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Disconnected}">
- <Setter Property="Source" Value="/Images/GlobalStatus/machine-off.png"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.PowerUp}">
- <Setter Property="Source" Value="/Images/GlobalStatus/getting-ready.png"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Standby}">
- <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.ReadyToDye}">
- <Setter Property="Source" Value="/Images/GlobalStatus/ready-to-dye.png"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.GettingReady}">
- <Setter Property="Source" Value="/Images/GlobalStatus/getting-ready.png"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Printing}">
- <Setter Property="Source" Value="/Images/GlobalStatus/dyeing.png"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.ShuttingDown}">
- <Setter Property="Source" Value="/Images/GlobalStatus/shutting-down.png"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Error}">
- <Setter Property="Source" Value="/Images/GlobalStatus/error.png"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Service}">
- <Setter Property="Source" Value="/Images/GlobalStatus/service.png"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Image.Style>
- </Image>
<Grid></Grid>
</DockPanel>
</Border>
@@ -144,7 +89,6 @@
<local:MachineUpdateView></local:MachineUpdateView>
<local:RestartingSystemView></local:RestartingSystemView>
<local:EmergencyView></local:EmergencyView>
- <local:RestartingView></local:RestartingView>
</controls:NavigationControl>
</touch:TouchPanel>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml
deleted file mode 100644
index 22952a827..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml
+++ /dev/null
@@ -1,20 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Views.PowerOffView"
- 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.PPC.UI.ViewModels"
- xmlns:global="clr-namespace:Tango.PPC.UI"
- xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:local="clr-namespace:Tango.PPC.UI.Views"
- mc:Ignorable="d"
- d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:PowerOffViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.PowerOffViewVM}">
- <Grid>
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
- <touch:TouchGifAnimation Source="/Images/power_off_2.gif" EnableAnimation="{Binding IsVisible}" HorizontalAlignment="Center" />
- <TextBlock HorizontalAlignment="Center" Margin="0 60 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Machine is turning Off</TextBlock>
- <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">Do not unplug machine while turning off</TextBlock>
- <touch:TouchButton Command="{Binding AbortCommand}" Style="{StaticResource TangoHollowButton}" Margin="0 100 0 0" HorizontalAlignment="Center" Width="200" Height="50">ABORT</touch:TouchButton>
- </StackPanel>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml.cs
deleted file mode 100644
index ead34ae12..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/PowerOffView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.Views
-{
- /// <summary>
- /// Interaction logic for LoadingView.xaml
- /// </summary>
- public partial class PowerOffView : UserControl
- {
- public PowerOffView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml
index dd4d2f5d5..996b1788d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingSystemView.xaml
@@ -10,37 +10,17 @@
mc:Ignorable="d"
d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:RestartingSystemViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.RestartingSystemViewVM}" Background="{StaticResource TangoPrimaryBackgroundBrush}">
<Grid>
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
- <Grid Margin="0 100 0 0">
- <Image Source="/Images/machine.png" Stretch="Uniform" Width="250" RenderOptions.BitmapScalingMode="Fant"></Image>
- <touch:TouchBusyIndicator Foreground="{StaticResource TangoGrayBrush}" Width="350" Height="350" IsIndeterminate="{Binding IsVisible}" />
- </Grid>
- <TextBlock FontSize="{StaticResource TangoHeaderFontSize}" Margin="0 100 0 0" HorizontalAlignment="Center" Width="250">
- <TextBlock.Style>
- <Style TargetType="TextBlock">
- <Setter Property="Text" Value="Restarting device"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsVisible}" Value="True">
- <DataTrigger.EnterActions>
- <BeginStoryboard x:Name="storyRes">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Text" RepeatBehavior="5x">
- <DiscreteObjectKeyFrame KeyTime="00:00:0.2" Value="Restarting." />
- <DiscreteObjectKeyFrame KeyTime="00:00:0.6" Value="Restarting.." />
- <DiscreteObjectKeyFrame KeyTime="00:00:0.9" Value="Restarting..." />
- <DiscreteObjectKeyFrame KeyTime="00:00:1.4" Value="Restarting..." />
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <RemoveStoryboard BeginStoryboardName="storyRes" />
- </DataTrigger.ExitActions>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </TextBlock.Style>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
+ <touch:TouchBusyIndicator Width="350" Height="350" IsIndeterminate="{Binding IsVisible}" Foreground="{StaticResource TangoGrayBrush}" />
+ <TextBlock Margin="0 40 0 0" TextAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">
+ <Run>
+ Setup completed.
+ </Run>
+ <LineBreak/>
+ <Run>
+ Restarting the system for the last time...
+ </Run>
</TextBlock>
</StackPanel>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml
deleted file mode 100644
index 41017f629..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml
+++ /dev/null
@@ -1,52 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Views.RestartingView"
- 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.PPC.UI.ViewModels"
- xmlns:fx="clr-namespace:Tango.SharedUI.Effects;assembly=Tango.SharedUI"
- xmlns:gif="clr-namespace:Tango.AnimatedGif;assembly=Tango.AnimatedGif"
- xmlns:global="clr-namespace:Tango.PPC.UI"
- xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
- xmlns:local="clr-namespace:Tango.PPC.UI.Views"
- mc:Ignorable="d"
- d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:RestartingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.RestartingViewVM}">
- <Grid>
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
- <Grid Margin="0 100 0 0">
- <Image Source="/Images/machine.png" Stretch="Uniform" Width="250" RenderOptions.BitmapScalingMode="Fant"></Image>
- <touch:TouchBusyIndicator Foreground="{StaticResource TangoGrayBrush}" Width="350" Height="350" IsIndeterminate="{Binding IsVisible}" />
- </Grid>
-
- <TextBlock Margin="0 40 0 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">
- <Run>v</Run><Run Text="{Binding ApplicationManager.Version,Mode=OneWay}"></Run>
- </TextBlock>
- <TextBlock FontSize="{StaticResource TangoHeaderFontSize}" Margin="0 100 0 0" HorizontalAlignment="Center" Width="170">
- <TextBlock.Style>
- <Style TargetType="TextBlock">
- <Setter Property="Text" Value="Restarting"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsVisible}" Value="True">
- <DataTrigger.EnterActions>
- <BeginStoryboard x:Name="storyRes">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Text" RepeatBehavior="5x">
- <DiscreteObjectKeyFrame KeyTime="00:00:0.2" Value="Restarting." />
- <DiscreteObjectKeyFrame KeyTime="00:00:0.6" Value="Restarting.." />
- <DiscreteObjectKeyFrame KeyTime="00:00:0.9" Value="Restarting..." />
- <DiscreteObjectKeyFrame KeyTime="00:00:1.4" Value="Restarting..." />
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <RemoveStoryboard BeginStoryboardName="storyRes" />
- </DataTrigger.ExitActions>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </TextBlock.Style>
- </TextBlock>
- </StackPanel>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml.cs
deleted file mode 100644
index fabd7b47b..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/RestartingView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.PPC.UI.Views
-{
- /// <summary>
- /// Interaction logic for LoadingView.xaml
- /// </summary>
- public partial class RestartingView : UserControl
- {
- public RestartingView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/firmware_package.tfp b/Software/Visual_Studio/PPC/Tango.PPC.UI/firmware_package.tfp
deleted file mode 100644
index bc33e385a..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/firmware_package.tfp
+++ /dev/null
Binary files differ