/*------------------------------------------------------------------------- // 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 MeasurementManagerLib; using Raytheon.Instruments; namespace ProgramLib { /// /// Initialization of measurement managers and get methods /// public partial class Program { private ProgramGuiManager _guiManager = null; internal bool _isUutPwrOn = false; internal PowerSupplySharedData PowerSupplySharedData { get; set; } /// /// Initialize power supply measurement manager /// /// /// public void InitializePowerSupplyMeasurementManager() { try { PowerSupplySharedData = new PowerSupplySharedData(); MalMeasurementLibManager.InitializePowerSupplyMeasurementManager(); } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand TerminateTestOnMainThreadError(ex); } } /// /// Initialize DIO measurement manager /// /// /// public void InitializeDioMeasurementManager() { try { MalMeasurementLibManager.InitializeDioMeasurementManager(); ; } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand TerminateTestOnMainThreadError(ex); } } /// /// Initialize switch measurement manager /// /// /// public void InitializeSwitchMeasurementManager() { try { MalMeasurementLibManager.InitializeSwitchMeasurementManager(); } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand TerminateTestOnMainThreadError(ex); } } /// /// Initialize GUI manager /// /// /// public void InitializeGuiManager() { try { _guiManager = new ProgramGuiManager(); _guiManager.Initialize(); } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand TerminateTestOnMainThreadError(ex); } } /// /// Start all the monitor/read threads here /// Call this only after ProgramGuiManager and PowerSupplyManager has been initialized since these threads could be /// accessing those objects /// /// /// public void InitializeSupportThreads() { try { if (_threadList.Count() == 0) { _threadList.Add(new FailureMonitorThread()); _threadList.Last().Start(); ICollection powerSystemList = _instrumentManager.GetInstruments(typeof(IPowerSupplySystem)); foreach (IPowerSupplySystem powerSystem in powerSystemList) { _threadList.Add(new PowerSupplyReadThread(powerSystem.Name)); _threadList.Last().Start(); } _threadList.Add(new PassthroughDataUpdateThread()); _threadList.Last().Start(); _threadList.Add(new PowerSupplyUpdateThread()); _threadList.Last().Start(); } } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand TerminateTestOnMainThreadError(ex); } } /// /// Get Gui manager object /// /// /// internal ProgramGuiManager GetGuiManager() { if (_guiManager == null) InitializeGuiManager(); return _guiManager; } } }