aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-08-13 16:12:45 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-08-13 16:12:45 +0300
commit998cc8d4d91a7f85389cd0918f127257576c2c13 (patch)
tree368ecd76f09b8ff1c4156a554b799cd231c42119 /Software/Visual_Studio/PPC/Tango.PPC.UI
parent4490b0a76d4188cb285d62b106e208803ceaa133 (diff)
downloadTango-998cc8d4d91a7f85389cd0918f127257576c2c13.tar.gz
Tango-998cc8d4d91a7f85389cd0918f127257576c2c13.zip
Logs and comments for PPC.UI !
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs13
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs19
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DialogAndView.cs17
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/PendingNotification.cs19
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs161
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj18
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs82
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs92
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs54
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs81
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewsContracts/IMachineSetupView.cs8
17 files changed, 462 insertions, 153 deletions
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 0bae5a237..4096abc24 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -53,7 +53,19 @@ namespace Tango.PPC.UI.Authentication
public User Login(string email, string password)
{
String hash = User.GetPasswordHash(password);
+
+ LogManager.Log($"Logging in user {email}...");
CurrentUser = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email && x.Password == hash);
+
+ if (CurrentUser != null)
+ {
+ LogManager.Log($"Current user is now: {CurrentUser.Contact.FullName}.");
+ }
+ else
+ {
+ LogManager.Log("Login failed!");
+ }
+
CurrentUserChanged?.Invoke(this, CurrentUser);
return CurrentUser;
}
@@ -63,6 +75,7 @@ namespace Tango.PPC.UI.Authentication
/// </summary>
public void LogOut()
{
+ LogManager.Log("Logging out current user.");
CurrentUser = null;
CurrentUserChanged?.Invoke(this, CurrentUser);
NavigationManager.NavigateTo(NavigationView.LoginView);
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml
deleted file mode 100644
index 5b07e1fa2..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml
+++ /dev/null
@@ -1,16 +0,0 @@
-<UserControl x:Class="Tango.PPC.UI.Controls.HeaderLoadingControl"
- 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.Controls"
- mc:Ignorable="d"
- d:DesignHeight="80" d:DesignWidth="300" IsHitTestVisible="False">
- <Grid>
- <StackPanel Orientation="Horizontal" Margin="20 0 0 0">
- <touch:TouchBusyIndicator IsIndeterminate="True" Width="50" Height="50" />
- <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Loading...</TextBlock>
- </StackPanel>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml.cs
deleted file mode 100644
index 540e829c9..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.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 HeaderLoadingControl.xaml
- /// </summary>
- public partial class HeaderLoadingControl : UserControl
- {
- public HeaderLoadingControl()
- {
- InitializeComponent();
- }
- }
-}
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 a05d5fc5c..eee37b2e0 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
@@ -102,6 +103,8 @@ namespace Tango.PPC.UI.Navigation
}
else
{
+
+ LogManager.Log($"Navigating to: {view.ToString()}...");
MainView.Instance.NavigationControl.NavigateTo(view.ToString());
return Task.FromResult(true);
}
@@ -116,8 +119,9 @@ namespace Tango.PPC.UI.Navigation
/// <returns></returns>
public Task<bool> NavigateWithObject<TPass>(NavigationView view, TPass obj, bool pushToHistory = true)
{
+ LogManager.Log($"Navigating to: {view.ToString()}, with object {typeof(TPass).Name}...");
MainView.Instance.NavigationControl.NavigateTo(view.ToString());
- INavigationObjectReceiver<TPass> receiver = MainView.Instance.NavigationControl.Elements.FirstOrDefault(x => (x.GetType().Name == view.ToString() || NavigationControl.GetNavigationName(x) == view.ToString()) && x.DataContext is INavigationObjectReceiver<TPass>).DataContext as INavigationObjectReceiver<TPass>;
+ INavigationObjectReceiver<TPass> receiver = MainView.Instance.NavigationControl.Elements.FirstOrDefault(x => (x.GetType().Name == view.ToString() || NavigationControl.GetNavigationName(x) == view.ToString()) && x.DataContext is INavigationObjectReceiver<TPass>).DataContext as INavigationObjectReceiver<TPass>;
if (receiver != null)
{
@@ -168,6 +172,8 @@ namespace Tango.PPC.UI.Navigation
if (path.Length == 1 && path[0] == CurrentModule.Name) return true;
+ LogManager.Log($"Navigating to: {fullPath}...");
+
var fromVM = _currentVM;
if (_currentVM != null && _currentVM is INavigationBlocker)
@@ -225,7 +231,7 @@ namespace Tango.PPC.UI.Navigation
}
else
{
- throw new ArgumentNullException("Could not navigate to " + fullPath);
+ throw LogManager.Log(new ArgumentNullException("Could not navigate to " + fullPath));
}
}
@@ -345,6 +351,8 @@ namespace Tango.PPC.UI.Navigation
/// </summary>
public async Task<bool> NavigateBack()
{
+ LogManager.Log("Navigating back...");
+
_navigating_back = true;
String first = _navigationHistory.Pop();
@@ -373,12 +381,19 @@ namespace Tango.PPC.UI.Navigation
/// </summary>
public void ClearHistory()
{
+ LogManager.Log("Navigation history cleared.");
_navigationHistory.Clear();
RaisePropertyChanged(nameof(CanNavigateBack));
}
+ /// <summary>
+ /// Clears the navigation back history except the specified view type.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
public void ClearHistoryExcept<T>()
{
+ LogManager.Log($"Navigation history cleared except for {typeof(T).Name}.");
+
var history_list = _navigationHistory.ToList();
history_list = history_list.Where(x => x.Contains(typeof(T).Name)).Distinct().ToList();
_navigationHistory.Clear();
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DialogAndView.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DialogAndView.cs
index ea622ee48..2a85e2cb6 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DialogAndView.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DialogAndView.cs
@@ -8,17 +8,34 @@ using Tango.SharedUI;
namespace Tango.PPC.UI.Notifications
{
+ /// <summary>
+ /// Represents a dialog and view couple.
+ /// </summary>
public class DialogAndView
{
+ /// <summary>
+ /// Gets or sets the vm.
+ /// </summary>
public DialogViewVM VM { get; set; }
+ /// <summary>
+ /// Gets or sets the view.
+ /// </summary>
public FrameworkElement View { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DialogAndView"/> class.
+ /// </summary>
public DialogAndView()
{
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DialogAndView"/> class.
+ /// </summary>
+ /// <param name="vm">The vm.</param>
+ /// <param name="view">The view.</param>
public DialogAndView(DialogViewVM vm, FrameworkElement view) : this()
{
VM = vm;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/PendingNotification.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/PendingNotification.cs
index 791577964..cf76e90d9 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/PendingNotification.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/PendingNotification.cs
@@ -6,17 +6,36 @@ using System.Threading.Tasks;
namespace Tango.PPC.UI.Notifications
{
+ /// <summary>
+ /// Represents a pending notification item.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <typeparam name="TResult">The type of the result.</typeparam>
public class PendingNotification<T, TResult>
{
+ /// <summary>
+ /// Gets or sets the item.
+ /// </summary>
public T Item { get; set; }
+ /// <summary>
+ /// Gets or sets the completion source.
+ /// </summary>
public TaskCompletionSource<TResult> CompletionSource { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PendingNotification{T, TResult}"/> class.
+ /// </summary>
public PendingNotification()
{
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PendingNotification{T, TResult}"/> class.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="completionSource">The completion source.</param>
public PendingNotification(T item, TaskCompletionSource<TResult> completionSource) : this()
{
Item = item;
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 f2fba05fe..e984b7452 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -45,6 +45,21 @@ namespace Tango.PPC.UI.PPCApplication
public event EventHandler ModulesInitialized;
/// <summary>
+ /// Occurs when the all components are ready.
+ /// </summary>
+ public event EventHandler Ready;
+
+ /// <summary>
+ /// Occurs when machine setup is required.
+ /// </summary>
+ public event EventHandler SetupRequired;
+
+ /// <summary>
+ /// Occurs when the main window content has been rendered.
+ /// </summary>
+ public event EventHandler ContentRendered;
+
+ /// <summary>
/// Gets a value indicating whether the application is shutting down.
/// </summary>
public bool IsShuttingDown { get; private set; }
@@ -62,6 +77,17 @@ namespace Tango.PPC.UI.PPCApplication
}
/// <summary>
+ /// Gets the application build date.
+ /// </summary>
+ public String BuildDate
+ {
+ get
+ {
+ return AssemblyHelper.GetCurrentAssemblyBuildDate().ToShortDateString();
+ }
+ }
+
+ /// <summary>
/// Initializes a new instance of the <see cref="DefaultPPCApplicationManager"/> class.
/// </summary>
public DefaultPPCApplicationManager(IMachineProvider machineProvider)
@@ -72,78 +98,95 @@ namespace Tango.PPC.UI.PPCApplication
{
_notifiedViewModels = new List<PPCViewModel>();
- PPCSettings settings = null;
-
- MainWindow.Instance.ContentRendered += async (_, __) =>
+ MainWindow.Instance.ContentRendered += (_, __) =>
{
- ContentRendered?.Invoke(this, new EventArgs());
+ OnMainWindowContentRendered();
+ };
+ }
+ }
- await Task.Factory.StartNew(() =>
- {
- //TODO: Use this in the future.
+ /// <summary>
+ /// Called when the main window content has been rendered
+ /// </summary>
+ private async void OnMainWindowContentRendered()
+ {
+ LogManager.Log("Main window content rendered.");
- //#if DEBUG
- // DataSource = "localhost\\SQLEXPRESS";
- //#else
- // DataBaseSettings.DefaultDataSource = Path.Combine(PathHelper.GetUserTangoFolder(), "DB", "Tango.db");
- //#endif
+ PPCSettings settings = null;
- if (!File.Exists(CoreSettings.DefaultDataBaseSource))
- {
- Directory.CreateDirectory(Path.GetDirectoryName(CoreSettings.DefaultDataBaseSource));
- File.Copy(Path.Combine(PathHelper.GetStartupPath(), "DB", "Tango.mdf"), CoreSettings.DefaultDataBaseSource);
- }
+ ContentRendered?.Invoke(this, new EventArgs());
- settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
- var coreSettings = SettingsManager.Default.GetOrCreate<CoreSettings>();
+ await Task.Factory.StartNew(() =>
+ {
+ LogManager.Log("Reading PPC settings...");
+ settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
- if (!SettingsManager.Default.IsFileExists())
- {
- settings.Save();
- }
+ LogManager.Log(settings.ToJsonString());
- if (App.StartupArgs.Contains("-update_ok"))
- {
- settings.ApplicationState = ApplicationStates.Default;
- settings.Save();
- }
+ LogManager.Log("Reading Core settings...");
+ var coreSettings = SettingsManager.Default.GetOrCreate<CoreSettings>();
- if (settings.ApplicationState == ApplicationStates.Default)
- {
- ObservablesEntitiesAdapter.Instance.Initialize();
- }
- });
+ if (!SettingsManager.Default.IsFileExists())
+ {
+ LogManager.Log("Settings file does not exists. creating...");
+ settings.Save();
+ }
+ if (App.StartupArgs.Contains("-update_ok"))
+ {
+ LogManager.Log("Application started with '-update_ok' startup arguments. The application has been successfully updated.");
+ settings.ApplicationState = ApplicationStates.Default;
+ settings.Save();
+ }
- if (settings.ApplicationState == ApplicationStates.PreSetup || settings.ApplicationState == ApplicationStates.SemiSetup)
- {
- SetupRequired?.Invoke(this, new EventArgs());
- }
- else
- {
- PostSetup();
- }
- };
+ if (settings.ApplicationState == ApplicationStates.Default)
+ {
+ LogManager.Log("Initializing ObservablesEntitiesAdapter...");
+ ObservablesEntitiesAdapter.Instance.Initialize();
+ }
+ });
+
+
+ if (settings.ApplicationState == ApplicationStates.PreSetup || settings.ApplicationState == ApplicationStates.SemiSetup)
+ {
+ LogManager.Log($"The application is in {settings.ApplicationState} state. database initialization skipped. Invoking setup required event!");
+ SetupRequired?.Invoke(this, new EventArgs());
+ }
+ else
+ {
+ OnDbInitialized();
}
}
- private void PostSetup()
+ /// <summary>
+ /// Called when the database has been initialized
+ /// </summary>
+ private void OnDbInitialized()
{
+ LogManager.Log($"Raising {nameof(ApplicationStarted)} event...");
+
ApplicationStarted?.Invoke(this, new EventArgs());
+ LogManager.Log("Invoking PPC view models OnApplicationStarted methods...");
foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>())
{
if (!_notifiedViewModels.Contains(vm))
{
+ LogManager.Log($"Invoking {vm.GetType().Name}.OnApplicationStarted...");
vm.OnApplicationStarted();
_notifiedViewModels.Add(vm);
}
}
+ LogManager.Log("Waiting for IPPCModuleLoader instance injection...");
TangoIOC.Default.GetInstanceWhenAvailable<IPPCModuleLoader>((loader) =>
{
+ LogManager.Log("Module loader instance has been registered. Registering for the ModulesLoaded event...");
+
loader.ModulesLoaded += (x, y) =>
{
+ LogManager.Log($"{loader.UserModules.Count} loaded. Waiting for last module initialization...");
+
if (loader.UserModules.Count > 0)
{
if (loader.UserModules.ToList().Exists(m => !m.IsInitialized))
@@ -162,19 +205,34 @@ namespace Tango.PPC.UI.PPCApplication
});
}
+ /// <summary>
+ /// Finalizes the module initialization.
+ /// </summary>
private void FinalizeModuleInitialization()
{
+ LogManager.Log("Finalizing application initialization...");
+
+ LogManager.Log("Checking for un-notified PPC view models...");
foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>())
{
if (!_notifiedViewModels.Contains(vm))
{
+ LogManager.Log($"Invoking {vm.GetType().Name}.OnApplicationStarted...");
vm.OnApplicationStarted();
_notifiedViewModels.Add(vm);
}
}
+ LogManager.Log($"Invoking {nameof(ModulesInitialized)} event.");
+
ModulesInitialized?.Invoke(this, new EventArgs());
+
+ LogManager.Log("Initializing Machine Provider...");
_machineProvider.Init();
+
+ LogManager.Log("Applications initialization completed!");
+
+ LogManager.Log($"Invoking {nameof(Ready)} event.");
Ready?.Invoke(this, new EventArgs());
}
@@ -183,6 +241,10 @@ namespace Tango.PPC.UI.PPCApplication
/// </summary>
public void ShutDown()
{
+ //TODO: Needs some work on logging and shutdown procedures! Do I really need this?
+
+ LogManager.Log("Shutting down application...");
+
IsShuttingDown = true;
foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>())
@@ -190,18 +252,5 @@ namespace Tango.PPC.UI.PPCApplication
vm.OnApplicationShuttingDown();
}
}
-
- public event EventHandler Ready;
- public event EventHandler SetupRequired;
- public event EventHandler ContentRendered;
-
- public String BuildDate
- {
- get
- {
- return AssemblyHelper.GetCurrentAssemblyBuildDate().ToShortDateString();
- }
- }
-
}
}
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 594afcc86..d3e28de8d 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
@@ -112,9 +112,6 @@
<Link>GlobalVersionInfo.cs</Link>
</Compile>
<Compile Include="Authentication\DefaultAuthenticationProvider.cs" />
- <Compile Include="Controls\HeaderLoadingControl.xaml.cs">
- <DependentUpon>HeaderLoadingControl.xaml</DependentUpon>
- </Compile>
<Compile Include="Converters\AppBarItemConverter.cs" />
<Compile Include="Converters\NotificationItemConverter.cs" />
<Compile Include="Modules\DefaultStudioModuleLoader.cs" />
@@ -151,10 +148,6 @@
<Compile Include="Views\MainView.xaml.cs">
<DependentUpon>MainView.xaml</DependentUpon>
</Compile>
- <Page Include="Controls\HeaderLoadingControl.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -335,15 +328,6 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
- <Content Include="..\..\..\DB\PPC\Tango.mdf">
- <Link>DB\Tango.mdf</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\..\..\DB\PPC\Tango_log.ldf">
- <Link>DB\Tango_log.ldf</Link>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- <DependentUpon>Tango.mdf</DependentUpon>
- </Content>
<Content Include="..\..\Build\Debug\Tango.ColorLib.dll">
<Link>Tango.ColorLib.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -420,7 +404,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)"</
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ 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 a5a8d9ac3..3b672411d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
@@ -13,12 +13,21 @@ using Tango.PPC.Common.Navigation;
namespace Tango.PPC.UI.ViewModels
{
+ /// <summary>
+ /// Represents the external bridge view ViewModel.
+ /// </summary>
+ /// <seealso cref="Tango.PPC.Common.PPCViewModel" />
[TangoCreateWhenRegistered]
public class ExternalBridgeViewVM : PPCViewModel
{
private bool _disconnecting;
+ #region Properties
+
private ExternalBridgeClientConnectedEventArgs _connection;
+ /// <summary>
+ /// Gets or sets the last client connection event arguments.
+ /// </summary>
public ExternalBridgeClientConnectedEventArgs Connection
{
get { return _connection; }
@@ -26,26 +35,58 @@ namespace Tango.PPC.UI.ViewModels
}
private User _user;
+ /// <summary>
+ /// Gets or sets the user connected user.
+ /// </summary>
public User User
{
get { return _user; }
- set { _user = value; RaisePropertyChangedAuto(); }
+ set { _user = value; RaisePropertyChangedAuto(); }
}
+ #endregion
+
+ #region Commands
+
+ /// <summary>
+ /// Gets or sets the close session command.
+ /// </summary>
public RelayCommand CloseSessionCommand { get; set; }
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ExternalBridgeViewVM"/> class.
+ /// </summary>
public ExternalBridgeViewVM()
{
- CloseSessionCommand = new RelayCommand(CloseSession,() => !_disconnecting);
+ CloseSessionCommand = new RelayCommand(CloseSession, () => !_disconnecting);
}
+ #endregion
+
+ #region Private Methods
+
+ /// <summary>
+ /// Closes the current session.
+ /// </summary>
private void CloseSession()
{
+ LogManager.Log("Disconnecting current external bridge session.");
_disconnecting = true;
InvalidateRelayCommands();
ExternalBridgeService.DisconnectSession();
}
+ #endregion
+
+ #region Override Methods
+
+ /// <summary>
+ /// Called when the navigation system has navigated to this VM view.
+ /// </summary>
public override void OnNavigatedTo()
{
base.OnNavigatedTo();
@@ -54,22 +95,43 @@ namespace Tango.PPC.UI.ViewModels
InvalidateRelayCommands();
}
+ /// <summary>
+ /// Called when the application has been started.
+ /// </summary>
public override void OnApplicationStarted()
{
- ExternalBridgeService.ConnectionRequest += ExternalBridgeService_ClientConnected;
+ ExternalBridgeService.ConnectionRequest += ExternalBridgeService_ConnectionRequest;
ExternalBridgeService.ClientDisconnected += ExternalBridgeService_ClientDisconnected;
}
+ #endregion
+
+ #region Event Handlers
+
+ /// <summary>
+ /// 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_ClientDisconnected(object sender, EventArgs e)
{
+ LogManager.Log("External bridge client disconnected. Navigating to home module...");
+
InvokeUI(() =>
{
NavigationManager.NavigateTo(NavigationView.HomeModule);
});
}
- private void ExternalBridgeService_ClientConnected(object sender, ExternalBridgeClientConnectedEventArgs e)
+ /// <summary>
+ /// Handles the <see cref="ExternalBridgeService.ConnectionRequest"/> event.
+ /// </summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The <see cref="ExternalBridgeClientConnectedEventArgs"/> instance containing the event data.</param>
+ private void ExternalBridgeService_ConnectionRequest(object sender, ExternalBridgeClientConnectedEventArgs e)
{
+ LogManager.Log($"External bridge connection request received.\n{e.ToJsonString()}");
+
if (e.Request.Password == MachineProvider.Machine.ExternalBridgePassword)
{
e.Confirmed = true;
@@ -78,11 +140,23 @@ namespace Tango.PPC.UI.ViewModels
User = Adapter.Users.SingleOrDefault(x => x.Guid == e.Request.UserGuid);
+ if (User != null)
+ {
+ LogManager.Log($"External bridge connection user has been identified as {User.Contact.FullName}");
+ }
+
+ LogManager.Log("Navigating to external bridge view...");
InvokeUI(() =>
{
NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false);
});
}
+ else
+ {
+ LogManager.Log("Connection password did not match the machine external bridge password.");
+ }
}
+
+ #endregion
}
}
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 268f42ce9..3bcacc989 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
@@ -28,6 +28,8 @@ namespace Tango.PPC.UI.ViewModels
[TangoInject]
public IPPCModuleLoader ModuleLoader { get; set; }
+ #region Properties
+
private bool _isMenuOpened;
/// <summary>
/// Gets or sets a value indicating whether the side menu is opened.
@@ -48,6 +50,10 @@ namespace Tango.PPC.UI.ViewModels
set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); }
}
+ #endregion
+
+ #region Commands
+
/// <summary>
/// Gets or sets the module navigation command.
/// </summary>
@@ -78,6 +84,10 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
public RelayCommand SignOutCommand { get; set; }
+ #endregion
+
+ #region Constructors
+
/// <summary>
/// Initializes a new instance of the <see cref="LayoutViewVM"/> class.
/// </summary>
@@ -92,8 +102,17 @@ namespace Tango.PPC.UI.ViewModels
SignOutCommand = new RelayCommand(SignOut);
}
+ #endregion
+
+ #region Private Methods
+
+ /// <summary>
+ /// Stops the printing.
+ /// </summary>
private void StopPrinting()
{
+ LogManager.Log("Stop printing layout command pressed!");
+
if (_jobHandler != null)
{
_jobHandler.Cancel();
@@ -107,10 +126,12 @@ namespace Tango.PPC.UI.ViewModels
{
if (NavigationManager.CanNavigateBack)
{
+ LogManager.Log("Back command pressed.");
NavigationManager.NavigateBack();
}
else
{
+ LogManager.Log("Menu command pressed.");
IsMenuOpened = true;
}
}
@@ -121,6 +142,7 @@ namespace Tango.PPC.UI.ViewModels
/// <param name="moduleName">Name of the module.</param>
private void NavigateToModule(string moduleName)
{
+ LogManager.Log("Navigate to module command pressed.");
IsMenuOpened = false;
NavigationManager.NavigateTo(moduleName);
}
@@ -130,33 +152,48 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
private void NavigateHome()
{
+ LogManager.Log("Navigate home command pressed.");
IsMenuOpened = false;
NavigationManager.NavigateTo(NavigationView.HomeModule);
}
/// <summary>
- /// Called when the application has been started.
+ /// Represents an event that is raised when the sign-out operation is complete.
/// </summary>
- public override void OnApplicationStarted()
+ private void SignOut()
{
- base.OnApplicationStarted();
- ModuleLoader.ModulesLoaded += ModuleLoader_ModulesLoaded;
- MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted;
+ LogManager.Log("SignOut command pressed.");
+ AuthenticationProvider.LogOut();
+ IsMenuOpened = false;
}
- private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e)
+ /// <summary>
+ /// Opens the first notification or display all.
+ /// </summary>
+ private void OpenFirstNotificationOrDisplayAll()
{
- _jobHandler = e.JobHandler;
+ if (NotificationProvider.NotificationItems.Count == 1)
+ {
+ //Open first
+ }
+ else
+ {
+ IsNotificationsOpened = true;
+ }
}
+ #endregion
+
+ #region Override Methods
+
/// <summary>
- /// Handles the ModulesLoaded event of the ModuleLoader.
+ /// Called when the application has been started.
/// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
- private void ModuleLoader_ModulesLoaded(object sender, EventArgs e)
+ public override void OnApplicationStarted()
{
- View.ApplyModules(ModuleLoader.UserModules);
+ base.OnApplicationStarted();
+ ModuleLoader.ModulesLoaded += ModuleLoader_ModulesLoaded;
+ MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted;
}
/// <summary>
@@ -167,28 +204,31 @@ namespace Tango.PPC.UI.ViewModels
}
+ #endregion
+
+ #region Event Handlers
+
/// <summary>
- /// Represents an event that is raised when the sign-out operation is complete.
+ /// Handles the PrintingStarted event of the MachineOperator.
/// </summary>
- private void SignOut()
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="PrintingEventArgs"/> instance containing the event data.</param>
+ private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e)
{
- AuthenticationProvider.LogOut();
- IsMenuOpened = false;
+ _jobHandler = e.JobHandler;
}
/// <summary>
- /// Opens the first notification or display all.
+ /// Handles the ModulesLoaded event of the ModuleLoader.
/// </summary>
- private void OpenFirstNotificationOrDisplayAll()
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
+ private void ModuleLoader_ModulesLoaded(object sender, EventArgs e)
{
- if (NotificationProvider.NotificationItems.Count == 1)
- {
- //Open first
- }
- else
- {
- IsNotificationsOpened = true;
- }
+ LogManager.Log("Modules loaded. Applying modules to main navigation control...");
+ View.ApplyModules(ModuleLoader.UserModules);
}
+
+ #endregion
}
}
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 77767d588..852997f87 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
@@ -61,6 +61,7 @@ namespace Tango.PPC.UI.ViewModels
public override void OnApplicationStarted()
{
IsLoading = false;
+ LogManager.Log("Application started. Navigating to LoginView...");
NavigationManager.NavigateTo(NavigationView.LoginView);
}
}
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 022efd9b8..812f10121 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
@@ -9,14 +9,25 @@ using Tango.PPC.Common.Navigation;
using SimpleValidator.Extensions;
using System.ComponentModel.DataAnnotations;
using Tango.SharedUI.Helpers;
+using Tango.PPC.Common.Authentication;
+using Tango.BL.Entities;
namespace Tango.PPC.UI.ViewModels
{
+ /// <summary>
+ /// Represents the PPC login view ViewModel.
+ /// </summary>
+ /// <seealso cref="Tango.PPC.Common.PPCViewModel" />
public class LoginViewVM : PPCViewModel
{
public RelayCommand LoginCommand { get; set; }
+ #region Properties
+
private String _email;
+ /// <summary>
+ /// Gets or sets the email.
+ /// </summary>
[Required(ErrorMessage = "Email is required")]
[EmailAddress(ErrorMessage = "Please enter a valid email address")]
public String Email
@@ -26,6 +37,9 @@ namespace Tango.PPC.UI.ViewModels
}
private String _password;
+ /// <summary>
+ /// Gets or sets the password.
+ /// </summary>
[Required(ErrorMessage = "Password is required")]
public String Password
{
@@ -43,7 +57,13 @@ namespace Tango.PPC.UI.ViewModels
set { _isLoading = value; RaisePropertyChangedAuto(); }
}
+ #endregion
+
+ #region Constructors
+ /// <summary>
+ /// Initializes a new instance of the <see cref="LoginViewVM"/> class.
+ /// </summary>
public LoginViewVM()
{
LoginCommand = new RelayCommand(Login);
@@ -52,12 +72,28 @@ namespace Tango.PPC.UI.ViewModels
Password = "1234";
}
+ #endregion
+
+ #region Override Methods
+
+ /// <summary>
+ /// Called when the application has been started.
+ /// </summary>
public override void OnApplicationStarted()
{
AuthenticationProvider.CurrentUserChanged += AuthenticationProvider_CurrentUserChanged;
}
- private void AuthenticationProvider_CurrentUserChanged(object sender, BL.Entities.User user)
+ #endregion
+
+ #region Event Handlers
+
+ /// <summary>
+ /// Handles the <see cref="IAuthenticationProvider.CurrentUserChanged"/> event.
+ /// </summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="user">The user.</param>
+ private void AuthenticationProvider_CurrentUserChanged(object sender, User user)
{
if (user == null)
{
@@ -65,8 +101,17 @@ namespace Tango.PPC.UI.ViewModels
}
}
+ #endregion
+
+ #region Private Methods
+
+ /// <summary>
+ /// Login to the application using the user name and password.
+ /// </summary>
private void Login()
{
+ LogManager.Log("Login command pressed.");
+
if (Validate())
{
IsLoading = true;
@@ -83,10 +128,17 @@ namespace Tango.PPC.UI.ViewModels
ApplicationManager.ModulesInitialized += async (_, __) =>
{
await Task.Delay(500);
+ LogManager.Log("Modules initialized. Navigating to home module...");
await NavigationManager.NavigateTo(NavigationView.HomeModule);
IsLoading = false;
};
}
+ else
+ {
+ LogManager.Log("Invalid user credentials.");
+ }
}
+
+ #endregion
}
}
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 2877d52b3..a81db331c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs
@@ -19,8 +19,15 @@ using Tango.SQLExaminer;
namespace Tango.PPC.UI.ViewModels
{
+ /// <summary>
+ /// Represents the machine setup view ViewModel.
+ /// </summary>
+ /// <seealso cref="Tango.PPC.Common.PPCViewModel{Tango.PPC.UI.ViewsContracts.IMachineSetupView}" />
public class MachineSetupViewVM : PPCViewModel<IMachineSetupView>
{
+ /// <summary>
+ /// Represents the various machine setup view states.
+ /// </summary>
public enum MachineSetupStates
{
None,
@@ -31,9 +38,17 @@ namespace Tango.PPC.UI.ViewModels
private MachineSetupResult _setup_result;
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the machine setup manager.
+ /// </summary>
public IMachineSetupManager MachineSetupManager { get; set; }
private String _serialNumber;
+ /// <summary>
+ /// Gets or sets the serial number.
+ /// </summary>
public String SerialNumber
{
get { return _serialNumber; }
@@ -41,6 +56,9 @@ namespace Tango.PPC.UI.ViewModels
}
private String _hostAddress;
+ /// <summary>
+ /// Gets or sets the host address.
+ /// </summary>
public String HostAddress
{
get { return _hostAddress; }
@@ -48,6 +66,9 @@ namespace Tango.PPC.UI.ViewModels
}
private String _log;
+ /// <summary>
+ /// Gets or sets the log.
+ /// </summary>
public String Log
{
get { return _log; }
@@ -55,16 +76,38 @@ namespace Tango.PPC.UI.ViewModels
}
private MachineSetupStates _state;
+ /// <summary>
+ /// Gets or sets the state.
+ /// </summary>
public MachineSetupStates State
{
get { return _state; }
set { _state = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
+ #endregion
+
+ #region Commands
+
+ /// <summary>
+ /// Gets or sets the start command.
+ /// </summary>
public RelayCommand StartCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the complete command.
+ /// </summary>
public RelayCommand CompleteCommand { get; set; }
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MachineSetupViewVM"/> class.
+ /// </summary>
+ /// <param name="applicationManager">The application manager.</param>
+ /// <param name="machineSetupManager">The machine setup manager.</param>
public MachineSetupViewVM(IPPCApplicationManager applicationManager, IMachineSetupManager machineSetupManager)
{
MachineSetupManager = machineSetupManager;
@@ -80,11 +123,29 @@ namespace Tango.PPC.UI.ViewModels
applicationManager.SetupRequired += ApplicationManager_SetupRequired;
}
+ #endregion
+
+ #region Event Handlers
+
+ /// <summary>
+ /// Handles the SetupRequired event of the ApplicationManager.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void ApplicationManager_SetupRequired(object sender, EventArgs e)
{
+ LogManager.Log("SetupRequired event received. Navigating to MachineSetupView...");
NavigationManager.NavigateTo(NavigationView.MachineSetupView);
}
+ #endregion
+
+ #region Private Methods
+
+ /// <summary>
+ /// Appends the log.
+ /// </summary>
+ /// <param name="msg">The MSG.</param>
private void AppendLog(String msg)
{
if (msg != null && !msg.Contains("SQL Examiner"))
@@ -96,8 +157,13 @@ namespace Tango.PPC.UI.ViewModels
}
}
+ /// <summary>
+ /// Starts the setup.
+ /// </summary>
private async void StartSetup()
{
+ LogManager.Log("Starting machine setup...");
+
State = MachineSetupStates.Working;
try
@@ -106,18 +172,31 @@ namespace Tango.PPC.UI.ViewModels
Settings.ApplicationState = ApplicationStates.SemiSetup;
Settings.Save();
State = MachineSetupStates.Completed;
+
+ LogManager.Log("Machine setup completed.");
}
catch (Exception ex)
{
+ LogManager.Log(ex, "Machine setup failed.");
State = MachineSetupStates.Failed;
await NotificationProvider.ShowInfo(ex.Message);
}
}
+ /// <summary>
+ /// Completes the setup.
+ /// </summary>
private void CompleteSetup()
{
- Process.Start(AssemblyHelper.GetCurrentAssemblyFolder() + "\\Tango.PPC.Updater.exe", _setup_result.UpdatePackagePath);
+ String updater_exe = AssemblyHelper.GetCurrentAssemblyFolder() + "\\Tango.PPC.Updater.exe";
+
+ LogManager.Log("Completing machine setup...");
+ LogManager.Log($"Executing '{updater_exe}' with arguments '{_setup_result.UpdatePackagePath}'...");
+ Process.Start(updater_exe, _setup_result.UpdatePackagePath);
+ LogManager.Log("Terminating application process!");
Environment.Exit(0);
}
+
+ #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 67d885685..e207c30b3 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -22,6 +22,9 @@ namespace Tango.PPC.UI.ViewModels
/// <seealso cref="Tango.PPC.Common.PPCViewModel" />
public class MainViewVM : PPCViewModel
{
+ /// <summary>
+ /// Called when the application has been started.
+ /// </summary>
public override void OnApplicationStarted()
{
}
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 9900a5b27..92b029b26 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -4,7 +4,6 @@
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:localControls="clr-namespace:Tango.PPC.UI.Controls"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
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 9ef698656..9b5c26984 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
@@ -42,7 +42,7 @@ namespace Tango.PPC.UI.Views
{
if (!NavigationControl.Elements.ToList().Exists(x => x.GetType() == module.MainViewType))
{
- LogManager.Default.Log("Loading module " + module.Name + "...");
+ LogManager.Default.Log("Loading module view " + module.Name + "...");
FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement;
SharedUI.Controls.NavigationControl.SetNavigationName(view, module.Name);
NavigationControl.Elements.Add(view);
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewsContracts/IMachineSetupView.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewsContracts/IMachineSetupView.cs
index 3926f07be..c9ff93280 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewsContracts/IMachineSetupView.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewsContracts/IMachineSetupView.cs
@@ -7,8 +7,16 @@ using Tango.PPC.Common;
namespace Tango.PPC.UI.ViewsContracts
{
+ /// <summary>
+ /// Represents the machine setup view contract.
+ /// </summary>
+ /// <seealso cref="Tango.PPC.Common.IPPCView" />
public interface IMachineSetupView : IPPCView
{
+ /// <summary>
+ /// Appends the log.
+ /// </summary>
+ /// <param name="log">The log.</param>
void AppendLog(String log);
}
}