1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-22 05:40:11 +00:00

Version v3.4.2 Release

This commit is contained in:
Stanley 2022-08-19 12:03:12 -04:00
parent d570536c14
commit ee3ca07d6a
9 changed files with 41 additions and 31 deletions

View file

@ -22,7 +22,7 @@ namespace MSFSPopoutPanelManager.Orchestration
public bool IsSimulatorStarted { get; set; } public bool IsSimulatorStarted { get; set; }
public bool IsEnteredFlight { get; set; } public bool IsInCockpit { get; set; }
public new void OnPropertyChanged(string propertyName, object oldValue, object newValue) public new void OnPropertyChanged(string propertyName, object oldValue, object newValue)
{ {
@ -43,7 +43,6 @@ namespace MSFSPopoutPanelManager.Orchestration
CurrentMsfsAircraft = null; CurrentMsfsAircraft = null;
CurrentMsfsLiveryTitle = null; CurrentMsfsLiveryTitle = null;
ElectricalMasterBatteryStatus = false; ElectricalMasterBatteryStatus = false;
IsEnteredFlight = false;
} }
} }
} }

View file

@ -64,8 +64,9 @@ namespace MSFSPopoutPanelManager.Orchestration
ProfileData.AutoSwitchProfile(); ProfileData.AutoSwitchProfile();
} }
}; };
_simConnectProvider.OnFlightStarted += (sender, e) => OnFlightStarted?.Invoke(this, null); _simConnectProvider.OnFlightStarted += HandleOnFlightStarted;
_simConnectProvider.OnFlightStopped += HandleOnFlightStopped; _simConnectProvider.OnFlightStopped += HandleOnFlightStopped;
_simConnectProvider.OnIsInCockpitChanged += (sender, e) => FlightSimData.IsInCockpit = e;
_simConnectProvider.Start(); _simConnectProvider.Start();
} }
@ -110,22 +111,16 @@ namespace MSFSPopoutPanelManager.Orchestration
_simConnectProvider.TurnOffAvionics(ProfileData.ActiveProfile.PowerOnRequiredForColdStart); _simConnectProvider.TurnOffAvionics(ProfileData.ActiveProfile.PowerOnRequiredForColdStart);
} }
public void AutoPanelPopOutActivation(bool activate) private void HandleOnFlightStarted(object sender, EventArgs e)
{ {
if (activate) OnFlightStarted?.Invoke(this, null);
_simConnectProvider.OnFlightStarted += HandleOnFlightStartedForAutoPopOut;
else
_simConnectProvider.OnFlightStarted -= HandleOnFlightStartedForAutoPopOut;
}
private void HandleOnFlightStartedForAutoPopOut(object sender, EventArgs e) if (AppSettingData.AppSetting.AutoPopOutPanels)
{
OnFlightStartedForAutoPopOut?.Invoke(this, null); OnFlightStartedForAutoPopOut?.Invoke(this, null);
} }
private void HandleOnFlightStopped(object sender, EventArgs e) private void HandleOnFlightStopped(object sender, EventArgs e)
{ {
FlightSimData.IsEnteredFlight = false;
OnFlightStopped?.Invoke(this, null); OnFlightStopped?.Invoke(this, null);
} }
} }

View file

@ -24,7 +24,6 @@ namespace MSFSPopoutPanelManager.Orchestration
FlightSimData.CurrentMsfsLiveryTitleChanged += (sernder, e) => { ProfileData.MigrateLiveryToAircraftBinding(); ProfileData.AutoSwitchProfile(); }; FlightSimData.CurrentMsfsLiveryTitleChanged += (sernder, e) => { ProfileData.MigrateLiveryToAircraftBinding(); ProfileData.AutoSwitchProfile(); };
AppSettingData = new AppSettingData(); AppSettingData = new AppSettingData();
AppSettingData.AutoPopOutPanelsChanged += (sender, e) => FlightSim.AutoPanelPopOutActivation(e);
AppSettingData.TouchPanelIntegrationChanged += async (sender, e) => AppSettingData.TouchPanelIntegrationChanged += async (sender, e) =>
{ {
await TouchPanel.TouchPanelIntegrationUpdated(e); await TouchPanel.TouchPanelIntegrationUpdated(e);
@ -99,7 +98,6 @@ namespace MSFSPopoutPanelManager.Orchestration
CheckForAutoUpdate(); CheckForAutoUpdate();
ProfileData.UpdateActiveProfile(AppSettingData.AppSetting.LastUsedProfileId); // Load last used profile ProfileData.UpdateActiveProfile(AppSettingData.AppSetting.LastUsedProfileId); // Load last used profile
FlightSim.AutoPanelPopOutActivation(AppSettingData.AppSetting.AutoPopOutPanels); // Activate auto pop out panel if defined in preferences
FlightSim.StartSimConnectServer(); // Start the SimConnect server FlightSim.StartSimConnectServer(); // Start the SimConnect server
// Enable/Disable touch panel feature (Personal use only feature) // Enable/Disable touch panel feature (Personal use only feature)

View file

@ -57,8 +57,6 @@ namespace MSFSPopoutPanelManager.Orchestration
ProfileData.AutoSwitchProfile(); ProfileData.AutoSwitchProfile();
FlightSimData.IsEnteredFlight = true;
// find the profile with the matching binding aircraft // find the profile with the matching binding aircraft
var profile = ProfileData.Profiles.FirstOrDefault(p => p.BindingAircrafts.Any(p => p == FlightSimData.CurrentMsfsAircraft)); var profile = ProfileData.Profiles.FirstOrDefault(p => p.BindingAircrafts.Any(p => p == FlightSimData.CurrentMsfsAircraft));

View file

@ -175,13 +175,25 @@ namespace MSFSPopoutPanelManager.Orchestration
// Started in v3.4.2 // Started in v3.4.2
public void MigrateLiveryToAircraftBinding(string liveryName, string aircraftName) public void MigrateLiveryToAircraftBinding(string liveryName, string aircraftName)
{ {
bool hasChanges = false;
if (Profiles != null && !string.IsNullOrEmpty(liveryName) && !string.IsNullOrEmpty(aircraftName)) if (Profiles != null && !string.IsNullOrEmpty(liveryName) && !string.IsNullOrEmpty(aircraftName))
{ {
var matchedProfile = Profiles.FirstOrDefault(p => p.BindingAircraftLiveries.Any(t => t == liveryName)); var matchedProfile = Profiles.FirstOrDefault(p => p.BindingAircraftLiveries.Any(t => t == liveryName));
if (matchedProfile != null && !matchedProfile.BindingAircrafts.Any(a => a == aircraftName)) if (matchedProfile != null && !matchedProfile.BindingAircrafts.Any(a => a == aircraftName))
{ {
matchedProfile.BindingAircrafts.Add(aircraftName); matchedProfile.BindingAircrafts.Add(aircraftName);
hasChanges = true;
}
if (matchedProfile != null)
{
matchedProfile.BindingAircraftLiveries.Remove(liveryName); matchedProfile.BindingAircraftLiveries.Remove(liveryName);
hasChanges = true;
}
if (hasChanges)
{
WriteProfiles(); WriteProfiles();
RefreshProfile(); RefreshProfile();
} }

View file

@ -22,6 +22,7 @@ namespace MSFSPopoutPanelManager.SimConnectAgent
public event EventHandler OnConnected; public event EventHandler OnConnected;
public event EventHandler OnDisconnected; public event EventHandler OnDisconnected;
public event EventHandler<bool> OnIsInCockpitChanged;
public event EventHandler OnFlightStarted; public event EventHandler OnFlightStarted;
public event EventHandler OnFlightStopped; public event EventHandler OnFlightStopped;
public event EventHandler<List<SimConnectDataDefinition>> OnSimConnectDataRefreshed; public event EventHandler<List<SimConnectDataDefinition>> OnSimConnectDataRefreshed;
@ -227,7 +228,6 @@ namespace MSFSPopoutPanelManager.SimConnectAgent
DetectFlightStartedOrStopped(); DetectFlightStartedOrStopped();
} }
private const int CAMERA_STATE_INIT = 0;
private const int CAMERA_STATE_COCKPIT = 2; private const int CAMERA_STATE_COCKPIT = 2;
private const int CAMERA_STATE_LOAD_SCREEN = 11; private const int CAMERA_STATE_LOAD_SCREEN = 11;
private const int CAMERA_STATE_HOME_SCREEN = 15; private const int CAMERA_STATE_HOME_SCREEN = 15;
@ -241,9 +241,11 @@ namespace MSFSPopoutPanelManager.SimConnectAgent
if (_currentCameraState == cameraState) if (_currentCameraState == cameraState)
return; return;
if (cameraState == CAMERA_STATE_COCKPIT)
OnIsInCockpitChanged?.Invoke(this, true);
switch (_currentCameraState) switch (_currentCameraState)
{ {
case CAMERA_STATE_INIT:
case CAMERA_STATE_HOME_SCREEN: case CAMERA_STATE_HOME_SCREEN:
case CAMERA_STATE_LOAD_SCREEN: case CAMERA_STATE_LOAD_SCREEN:
if (cameraState == CAMERA_STATE_COCKPIT) if (cameraState == CAMERA_STATE_COCKPIT)
@ -254,16 +256,17 @@ namespace MSFSPopoutPanelManager.SimConnectAgent
break; break;
case CAMERA_STATE_COCKPIT: case CAMERA_STATE_COCKPIT:
if ((cameraState == CAMERA_STATE_LOAD_SCREEN || cameraState == CAMERA_STATE_HOME_SCREEN)) if (cameraState == CAMERA_STATE_LOAD_SCREEN || cameraState == CAMERA_STATE_HOME_SCREEN)
{ {
_currentCameraState = cameraState; _currentCameraState = cameraState;
OnFlightStopped?.Invoke(this, null); OnFlightStopped?.Invoke(this, null);
OnIsInCockpitChanged?.Invoke(this, false);
} }
break; break;
} }
if (cameraState == CAMERA_STATE_INIT || cameraState == CAMERA_STATE_COCKPIT || cameraState == CAMERA_STATE_HOME_SCREEN || cameraState == CAMERA_STATE_LOAD_SCREEN) if (cameraState == CAMERA_STATE_COCKPIT || cameraState == CAMERA_STATE_HOME_SCREEN || cameraState == CAMERA_STATE_LOAD_SCREEN)
_currentCameraState = cameraState; _currentCameraState = cameraState;
} }

View file

@ -12,7 +12,9 @@
* Added work around for SU10 Beta issue when after panel separations, panels' size become so big and they block most of the game window for lower resolution screen and prevented Pop Out Panel Manager from popping out the next panel. * Added work around for SU10 Beta issue when after panel separations, panels' size become so big and they block most of the game window for lower resolution screen and prevented Pop Out Panel Manager from popping out the next panel.
* Made improvement to how panels are separated when using multiple monitors. * Made improvements to how panels are separated during pop out process.
* Fixed an issue when adjusting position and size of a pop out, it may not work correctly on some PC configuration.
Known issue: Known issue:

View file

@ -45,33 +45,33 @@ namespace MSFSPopoutPanelManager.WpfApp.ViewModel
.ObservesProperty(() => ProfileData.ActiveProfile) .ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => FlightSimData.IsSimulatorStarted); .ObservesProperty(() => FlightSimData.IsSimulatorStarted);
StartPanelSelectionCommand = new DelegateCommand(OnStartPanelSelection, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile != null && FlightSimData.IsSimulatorStarted && FlightSimData.IsEnteredFlight) StartPanelSelectionCommand = new DelegateCommand(OnStartPanelSelection, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile != null && FlightSimData.IsSimulatorStarted && FlightSimData.IsInCockpit)
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft) .ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
.ObservesProperty(() => ProfileData.ActiveProfile) .ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => FlightSimData.IsSimulatorStarted) .ObservesProperty(() => FlightSimData.IsSimulatorStarted)
.ObservesProperty(() => FlightSimData.IsEnteredFlight); .ObservesProperty(() => FlightSimData.IsInCockpit);
StartPopOutCommand = new DelegateCommand(OnStartPopOut, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && (ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 || ProfileData.ActiveProfile.TouchPanelBindings.Count > 0) && FlightSimData.IsSimulatorStarted && FlightSimData.IsEnteredFlight) StartPopOutCommand = new DelegateCommand(OnStartPopOut, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && (ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 || ProfileData.ActiveProfile.TouchPanelBindings.Count > 0) && FlightSimData.IsSimulatorStarted && FlightSimData.IsInCockpit)
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft) .ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
.ObservesProperty(() => ProfileData.ActiveProfile) .ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count) .ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count)
.ObservesProperty(() => ProfileData.ActiveProfile.TouchPanelBindings.Count) .ObservesProperty(() => ProfileData.ActiveProfile.TouchPanelBindings.Count)
.ObservesProperty(() => FlightSimData.IsSimulatorStarted) .ObservesProperty(() => FlightSimData.IsSimulatorStarted)
.ObservesProperty(() => FlightSimData.IsEnteredFlight); .ObservesProperty(() => FlightSimData.IsInCockpit);
SaveAutoPanningCameraCommand = new DelegateCommand(OnSaveAutoPanningCamera, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 && FlightSimData.IsSimulatorStarted && FlightSimData.IsEnteredFlight) SaveAutoPanningCameraCommand = new DelegateCommand(OnSaveAutoPanningCamera, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 && FlightSimData.IsSimulatorStarted && FlightSimData.IsInCockpit)
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft) .ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
.ObservesProperty(() => ProfileData.ActiveProfile) .ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count) .ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count)
.ObservesProperty(() => FlightSimData.IsSimulatorStarted) .ObservesProperty(() => FlightSimData.IsSimulatorStarted)
.ObservesProperty(() => FlightSimData.IsEnteredFlight); .ObservesProperty(() => FlightSimData.IsInCockpit);
EditPanelSourceCommand = new DelegateCommand(EditPanelSource, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 && FlightSimData.IsSimulatorStarted && FlightSimData.IsEnteredFlight) EditPanelSourceCommand = new DelegateCommand(EditPanelSource, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 && FlightSimData.IsSimulatorStarted && FlightSimData.IsInCockpit)
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft) .ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
.ObservesProperty(() => ProfileData.ActiveProfile) .ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count) .ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count)
.ObservesProperty(() => FlightSimData.IsSimulatorStarted) .ObservesProperty(() => FlightSimData.IsSimulatorStarted)
.ObservesProperty(() => FlightSimData.IsEnteredFlight); .ObservesProperty(() => FlightSimData.IsInCockpit);
OpenTouchPanelBindingCommand = new DelegateCommand(OnOpenTouchPanelBinding, () => FlightSimData.HasCurrentMsfsAircraft && FlightSimData.IsSimulatorStarted && ProfileData.HasActiveProfile && AppSettingData.AppSetting.TouchPanelSettings.EnableTouchPanelIntegration) OpenTouchPanelBindingCommand = new DelegateCommand(OnOpenTouchPanelBinding, () => FlightSimData.HasCurrentMsfsAircraft && FlightSimData.IsSimulatorStarted && ProfileData.HasActiveProfile && AppSettingData.AppSetting.TouchPanelSettings.EnableTouchPanelIntegration)
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft) .ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)

View file

@ -26,7 +26,10 @@ how to use these new keyboard shortcuts.
so big and they block most of the game window for lower resolution screen and prevented Pop so big and they block most of the game window for lower resolution screen and prevented Pop
Out Panel Manager from popping out the next panel. Out Panel Manager from popping out the next panel.
* Made improvement to how panels are separated when using multiple monitors. * Made improvements to how panels are separated during pop out process.
* Fixed an issue when adjusting position and size of a pop out, it may not work correctly
on some PC configuration.
Known issue: Known issue: