aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-09-03 16:18:55 +0300
committerRoy <Roy.mail.net@gmail.com>2023-09-03 16:18:55 +0300
commitc66acc359b311ecc940f3c4e74bd9e21dc0bfd51 (patch)
tree8869b9d48fbad776c94df401680afc43fc350e69 /Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
parent6cdea71fa07d092139697d9c67651dade37aed96 (diff)
parentb271fe1c21172ed22a34b987a2cb9457b39ce8a3 (diff)
downloadTango-c66acc359b311ecc940f3c4e74bd9e21dc0bfd51.tar.gz
Tango-c66acc359b311ecc940f3c4e74bd9e21dc0bfd51.zip
Merged Eureka Branch !!!
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs18
1 files changed, 12 insertions, 6 deletions
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 9b57da988..0f65f833e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -37,6 +37,8 @@ using Tango.PPC.Common.Synchronization;
using Tango.Insights;
using System.Threading;
using System.Reflection;
+using Tango.PPC.UI.ViewsContracts;
+using Tango.PPC.Common.Build;
namespace Tango.PPC.UI.PPCApplication
{
@@ -55,6 +57,7 @@ namespace Tango.PPC.UI.PPCApplication
private IPPCModuleLoader _moduleLoader;
private INotificationProvider _notificationProvider;
private IMachineDataSynchronizer _machineDataSynchronizer;
+ private IBuildProvider _buildProvider;
private WatchDogServer _watchdogServer;
private ObservablesContext _machineContext;
private ActionTimer _screenLockTimer;
@@ -201,7 +204,7 @@ namespace Tango.PPC.UI.PPCApplication
/// <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, IMachineDataSynchronizer machineDataSynchronizer, IBuildProvider buildProvider)
{
StartPath = AssemblyHelper.GetCurrentAssemblyFolder();
@@ -211,6 +214,7 @@ namespace Tango.PPC.UI.PPCApplication
_eventLogger = eventLogger;
_moduleLoader = moduleLoader;
_machineDataSynchronizer = machineDataSynchronizer;
+ _buildProvider = buildProvider;
if (!DesignMode)
{
@@ -255,7 +259,7 @@ namespace Tango.PPC.UI.PPCApplication
//Start watchdog
_watchdogServer = new WatchDogServer(Application.Current.Dispatcher);
-#if !DEBUG
+#if (!DEBUG && !Eureka)
if (settings.EnableWatchDog)
{
@@ -289,7 +293,7 @@ namespace Tango.PPC.UI.PPCApplication
settings.ApplicationState = ApplicationStates.Ready;
settings.Save();
- if (isAfterSetup)
+ if (isAfterSetup && !_buildProvider.IsEureka)
{
SystemRestartRequired?.Invoke(this, new EventArgs());
return;
@@ -380,6 +384,8 @@ namespace Tango.PPC.UI.PPCApplication
{
LogManager.Log("Module loader instance has been registered. Registering for the ModulesLoaded event...");
+ ILayoutView layoutView = TangoIOC.Default.GetInstance<ILayoutView>();
+
loader.ModulesLoaded += (x, y) =>
{
LogManager.Log("Loading modules views");
@@ -387,14 +393,14 @@ namespace Tango.PPC.UI.PPCApplication
{
foreach (var module in TangoIOC.Default.GetInstance<IPPCModuleLoader>().UserModules)
{
- if (!Views.LayoutView.Instance.NavigationControl.Elements.ToList().Exists(m => m.GetType() == module.MainViewType))
+ if (!layoutView.GetNavigationControl().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);
+ layoutView.GetNavigationControl().Elements.Add(view);
}
catch (Exception ex)
{
@@ -411,7 +417,7 @@ namespace Tango.PPC.UI.PPCApplication
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);
+ layoutView.GetNavigationControl().Elements.Add(view);
_moduleLoader.AllModules.Add(module);
_moduleLoader.UserModules.Add(module);
}