Major upgrade

This commit is contained in:
Duc
2025-10-24 15:18:11 -07:00
parent fd85735c93
commit ce583d1664
478 changed files with 237518 additions and 47610 deletions

View File

@@ -1,14 +1,34 @@
using NLog;
using ProgramLib.GUI.View;
/*-------------------------------------------------------------------------
// UNCLASSIFIED
/*-------------------------------------------------------------------------
RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION
PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS
AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO
UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO
RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS
CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS
OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON
COMPANY.
THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S.
GOVERNMENT.
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
-------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Threading;
using NLog;
using ProgramLib.GUI.View;
namespace ProgramLib
{
/// <summary>
/// Class that manages all GUIs
/// </summary>
internal class ProgramGuiManager : IDisposable
{
#region Private Members
@@ -23,7 +43,13 @@ namespace ProgramLib
public enum WINDOWS
{
LIVE_DATA,
IMPEDANCE_CHECK
MANUAL_CONTROL,
IMPEDANCE_CHECK,
MSFR_TEST_CASES,
CONFIRMATION,
// DO NOT modify this.
DEFAULT
}
#endregion
@@ -35,18 +61,16 @@ namespace ProgramLib
_logger = LogManager.GetCurrentClassLogger();
}
/// <summary>
/// The Finalizer
/// Do not call Dispose() in here
/// </summary>
~ProgramGuiManager()
{
_logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ...");
}
public Window this[WINDOWS window]
{
get { return _windowDict[window]; }
get
{
if (window == WINDOWS.DEFAULT)
{
return _windowDict[(WINDOWS)0];
}
return _windowDict[window];
}
}
/// <summary>
@@ -61,13 +85,19 @@ namespace ProgramLib
_allGuiInitializedEvent.WaitOne();
}
/// <summary>
/// Constructor
/// </summary>
private void GuiManagerThread()
{
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running...");
// instantiate all the windows here
_windowDict[WINDOWS.LIVE_DATA] = new LiveDataWindow();
_windowDict[WINDOWS.MANUAL_CONTROL] = new ManualControlWindow();
_windowDict[WINDOWS.IMPEDANCE_CHECK] = new ImpedanceCheckWindow();
_windowDict[WINDOWS.MSFR_TEST_CASES] = new MsfrTestCasesWindow();
_windowDict[WINDOWS.CONFIRMATION] = new ConfirmationWindow();
_allGuiInitializedEvent.Set();
@@ -77,6 +107,29 @@ namespace ProgramLib
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting...");
}
/// <summary>
/// Destructor
/// </summary>
~ProgramGuiManager()
{
_logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ...");
}
/// <summary>
/// Open a wait window with countdown timer
/// </summary>
/// <param name="message">message to display</param>
/// <param name="delaySec">number to seconds to wait</param>
/// <returns></returns>
public void DisplayWaitMessage(string message, double delaySec)
{
this[ProgramGuiManager.WINDOWS.DEFAULT].Dispatcher.Invoke((Action)delegate
{
WaitWindow waitWindow = new WaitWindow(message, delaySec);
waitWindow.ShowDialog();
});
}
/// <summary>
/// Dispose of this object.
/// </summary>