1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-10-16 14:10:45 +00:00
msfs-popout-panel-manager/Orchestration/FlightSimData.cs
2023-08-14 00:35:14 -04:00

75 lines
2 KiB
C#

using MSFSPopoutPanelManager.DomainModel.SimConnect;
using MSFSPopoutPanelManager.Shared;
using System;
using System.ComponentModel;
namespace MSFSPopoutPanelManager.Orchestration
{
public class FlightSimData : ObservableObject
{
public FlightSimData()
{
Setup();
InitializeChildPropertyChangeBinding();
IsSimConnectActive = false;
}
public bool IsSimConnectActive { get; set; }
public string AircraftName { get; set; }
public bool HasAircraftName
{
get { return !String.IsNullOrEmpty(AircraftName); }
}
public bool ElectricalMasterBatteryStatus { get; set; }
public bool AvionicsMasterSwitchStatus { get; set; }
public bool TrackIRStatus { get; set; }
public int CameraState { get; set; }
public int CockpitCameraZoom { get; set; }
public int CameraViewTypeAndIndex1 { get; set; }
public bool PlaneInParkingSpot { get; set; }
public bool IsSimulatorStarted { get; set; }
public bool IsInCockpit { get; set; }
public IHudBarData HudBarData { get; set; }
[IgnorePropertyChanged]
internal ProfileData ProfileDataRef { get; set; }
public new void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnPropertyChanged(this, new PropertyChangedEventArgs(e.PropertyName));
// Automatic switching of active profile when SimConnect active aircraft change
if (e.PropertyName == "AircraftName")
ProfileDataRef.AutoSwitchProfile();
}
public void Reset()
{
Setup();
}
private void Setup()
{
AircraftName = null;
ElectricalMasterBatteryStatus = false;
AvionicsMasterSwitchStatus = false;
TrackIRStatus = false;
IsInCockpit = false;
PlaneInParkingSpot = false;
CameraState = -1;
IsSimulatorStarted = false;
}
}
}