1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-29 09:10:09 +00:00
msfs-popout-panel-manager/Orchestration/FlightSimData.cs

69 lines
1.8 KiB
C#
Raw Normal View History

2023-07-12 22:41:31 +00:00
using MSFSPopoutPanelManager.DomainModel.SimConnect;
using MSFSPopoutPanelManager.Shared;
2022-07-23 19:23:32 +00:00
using System;
using System.ComponentModel;
namespace MSFSPopoutPanelManager.Orchestration
{
public class FlightSimData : ObservableObject
{
2023-07-12 22:41:31 +00:00
public FlightSimData()
{
Setup();
InitializeChildPropertyChangeBinding();
}
2022-07-23 19:23:32 +00:00
2023-07-12 22:41:31 +00:00
public string AircraftName { get; set; }
2022-08-05 03:43:51 +00:00
2023-07-12 22:41:31 +00:00
public bool HasAircraftName
2022-07-23 19:23:32 +00:00
{
2023-07-12 22:41:31 +00:00
get { return !String.IsNullOrEmpty(AircraftName); }
2022-07-23 19:23:32 +00:00
}
public bool ElectricalMasterBatteryStatus { get; set; }
2023-07-12 22:41:31 +00:00
public bool AvionicsMasterSwitchStatus { get; set; }
public bool TrackIRStatus { get; set; }
public int CameraState { get; set; }
public bool PlaneInParkingSpot { get; set; }
2022-07-23 19:23:32 +00:00
public bool IsSimulatorStarted { get; set; }
2022-08-19 16:03:12 +00:00
public bool IsInCockpit { get; set; }
2022-07-23 19:23:32 +00:00
2023-07-12 22:41:31 +00:00
public IHudBarData HudBarData { get; set; }
[IgnorePropertyChanged]
internal ProfileData ProfileDataRef { get; set; }
public new void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
2022-07-23 19:23:32 +00:00
{
2023-07-12 22:41:31 +00:00
base.OnPropertyChanged(this, new PropertyChangedEventArgs(e.PropertyName));
2022-08-13 06:14:49 +00:00
2023-07-12 22:41:31 +00:00
// Automatic switching of active profile when SimConnect active aircraft change
if (e.PropertyName == "AircraftName")
ProfileDataRef.AutoSwitchProfile();
}
2022-07-23 19:23:32 +00:00
2023-07-12 22:41:31 +00:00
public void Reset()
{
Setup();
2022-07-23 19:23:32 +00:00
}
2023-07-12 22:41:31 +00:00
private void Setup()
2022-07-23 19:23:32 +00:00
{
2023-07-12 22:41:31 +00:00
AircraftName = null;
2022-07-23 19:23:32 +00:00
ElectricalMasterBatteryStatus = false;
2023-07-12 22:41:31 +00:00
AvionicsMasterSwitchStatus = false;
TrackIRStatus = false;
IsInCockpit = false;
PlaneInParkingSpot = false;
CameraState = -1;
IsSimulatorStarted = false;
2022-07-23 19:23:32 +00:00
}
}
}