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

76 lines
2 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();
2023-08-05 03:40:29 +00:00
IsSimConnectActive = false;
2023-07-12 22:41:31 +00:00
}
2022-07-23 19:23:32 +00:00
2023-08-05 03:40:29 +00:00
public bool IsSimConnectActive { get; set; }
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; }
2023-07-30 21:30:47 +00:00
public int CockpitCameraZoom { get; set; }
2023-08-14 04:35:14 +00:00
public int CameraViewTypeAndIndex1 { get; set; }
2023-07-12 22:41:31 +00:00
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
}
}
}