Skip to content

Commit

Permalink
V 0.69-B69
Browse files Browse the repository at this point in the history
- Fix Startup Problem with Bar type HudBar
  • Loading branch information
bm98 committed Apr 25, 2024
1 parent 2e4497a commit 13f804a
Show file tree
Hide file tree
Showing 47 changed files with 199 additions and 75 deletions.
3 changes: 3 additions & 0 deletions DbgLib/DbgLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="Dbg.cs" />
<Compile Include="DbgLogger.cs" />
<Compile Include="IDbg.cs" />
Expand Down
6 changes: 4 additions & 2 deletions DbgLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.0.0.9" )]
[assembly: AssemblyFileVersion( "1.0.0.9" )]
//[assembly: AssemblyVersion( "1.0.0.9" )]
//[assembly: AssemblyFileVersion( "1.0.0.9" )]
// *** USES SolutionInfo.cs

3 changes: 3 additions & 0 deletions FCamControl/FCamControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="AppSettings.cs" />
<Compile Include="frmCamera.cs">
<SubType>Form</SubType>
Expand Down
5 changes: 3 additions & 2 deletions FCamControl/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.0.0.10" )]
[assembly: AssemblyFileVersion( "1.0.0.10" )]
//[assembly: AssemblyVersion( "1.0.0.10" )]
//[assembly: AssemblyFileVersion( "1.0.0.10" )]
// *** USES SolutionInfo.cs
3 changes: 3 additions & 0 deletions FChecklistBox/FChecklistBox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="AppSettings.cs" />
<Compile Include="frmChecklistBox.cs">
<SubType>Form</SubType>
Expand Down
5 changes: 3 additions & 2 deletions FChecklistBox/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.0.0.9" )]
[assembly: AssemblyFileVersion( "1.0.0.9" )]
//[assembly: AssemblyVersion( "1.0.0.9" )]
//[assembly: AssemblyFileVersion( "1.0.0.9" )]
// *** USES SolutionInfo.cs
3 changes: 3 additions & 0 deletions FS20_CamControl/FS20_CamControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
Expand Down
5 changes: 3 additions & 2 deletions FS20_CamControl/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "0.68.0.68" )]
[assembly: AssemblyFileVersion( "0.68.0.68" )]
//[assembly: AssemblyVersion( "0.68.0.68" )]
//[assembly: AssemblyFileVersion( "0.68.0.68" )]
// *** USES SolutionInfo.cs
3 changes: 3 additions & 0 deletions FS20_ChecklistBox/FS20_ChecklistBox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
Expand Down
5 changes: 3 additions & 2 deletions FS20_ChecklistBox/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "0.68.0.68" )]
[assembly: AssemblyFileVersion( "0.68.0.68" )]
//[assembly: AssemblyVersion( "0.68.0.68" )]
//[assembly: AssemblyFileVersion( "0.68.0.68" )]
// *** USES SolutionInfo.cs
3 changes: 3 additions & 0 deletions FS20_FlightBag/FS20_FlightBag.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
Expand Down
5 changes: 3 additions & 2 deletions FS20_FlightBag/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "0.68.0.68" )]
[assembly: AssemblyFileVersion( "0.68.0.68" )]
//[assembly: AssemblyVersion( "0.68.0.68" )]
//[assembly: AssemblyFileVersion( "0.68.0.68" )]
// *** USES SolutionInfo.cs
1 change: 1 addition & 0 deletions FS20_HudBar.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Checklist.ico = Checklist.ico
FlightBag.ico = FlightBag.ico
HudBar.ico = HudBar.ico
SolutionInfo.cs = SolutionInfo.cs
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FS20_FlightBag", "FS20_FlightBag\FS20_FlightBag.csproj", "{AA8069F5-89D4-4390-877E-5F8E56190144}"
Expand Down
41 changes: 21 additions & 20 deletions FS20_HudBar/AApp/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,27 @@ public frmMain( )
mDistMetric.CheckState = AS.Distance_Metric ? CheckState.Checked : CheckState.Unchecked;
mShowUnits.CheckState = AS.ShowUnits ? CheckState.Checked : CheckState.Unchecked;

// Setup the screen the bar/tile is attached to
// bugfix- set m_barScreen before it is used....
m_barScreenNumber = AS.ScreenNumber;
m_barScreen = null;
// Find and hold the Primary Screen
Screen[] screens = Screen.AllScreens;
m_mainScreen = screens[0];
// now get the Primary one and the stored one
for (int scIndex = 0; scIndex < screens.Length; scIndex++) {
if (screens[scIndex].Primary) {
m_mainScreen = screens[scIndex];
}
if (scIndex == m_barScreenNumber) {
m_barScreen = screens[scIndex];
}
}
// did not find the stored screen ?? disconnected, changed ??
if (m_barScreen == null) {
m_barScreen = m_mainScreen; // to main
}

// ShowUnits and Opacity are set via HUD in InitGUI
LOG.Log( "frmMain", "Load GUI Forms" );
m_frmGui = new frmGui {
Expand Down Expand Up @@ -591,26 +612,6 @@ public frmMain( )
m_shelf = new FShelf.frmShelf( Program.Instance );
UpdateShelfSettings( ); // needed for transition to new AppSettings concept

// Setup the screen the bar/tile is attached to
m_barScreenNumber = AS.ScreenNumber;
m_barScreen = null;
// Find and hold the Primary Screen
Screen[] screens = Screen.AllScreens;
m_mainScreen = screens[0];
// now get the Primary one and the stored one
for (int scIndex = 0; scIndex < screens.Length; scIndex++) {
if (screens[scIndex].Primary) {
m_mainScreen = screens[scIndex];
}
if (scIndex == m_barScreenNumber) {
m_barScreen = screens[scIndex];
}
}
// did not find the stored screen ?? disconnected, changed ??
if (m_barScreen == null) {
m_barScreen = m_mainScreen; // to main
}

LOG.Log( "frmMain", "Init Form Done" );
}

Expand Down
1 change: 1 addition & 0 deletions FS20_HudBar/AApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static void Main( )
// TODO REMOVE FOR FINAL TEST AND RELEASE
// Init the Folders Utility with our AppSettings File
Folders.InitStorage( "HudBarAppSettings-NEXT.json" );
// Folders.InitStorage( "HudBarAppSettings.json" );
#else
// Init the Folders Utility with our AppSettings File
Folders.InitStorage( "HudBarAppSettings.json" );
Expand Down
3 changes: 3 additions & 0 deletions FS20_HudBar/FS20_HudBar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="AApp\AppSettings.cs" />
<Compile Include="AApp\AppSettingsV2.cs" />
<Compile Include="AApp\AppSettingsUpgrade.cs" />
Expand Down
5 changes: 3 additions & 2 deletions FS20_HudBar/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "0.68.0.68" )]
[assembly: AssemblyFileVersion( "0.68.0.68" )]
//[assembly: AssemblyVersion( "0.68.0.68" )]
//[assembly: AssemblyFileVersion( "0.68.0.68" )]
// *** USES SolutionInfo.cs
3 changes: 3 additions & 0 deletions FShelf/FShelf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="AppSettings.cs" />
<Compile Include="AptReport\AptReportTable.cs" />
<Compile Include="AptReport\AptTableGen.cs" />
Expand Down
35 changes: 25 additions & 10 deletions FShelf/LandPerf/PerfTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using FSimFacilityIF;
using System.Diagnostics;
using System.Drawing;
using DbgLib;

namespace FShelf.LandPerf
{
Expand All @@ -26,6 +27,11 @@ namespace FShelf.LandPerf
/// </summary>
public sealed class PerfTracker
{
// A logger
private static readonly IDbg LOG = Dbg.Instance.GetLogger(
System.Reflection.Assembly.GetCallingAssembly( ),
System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );

// Singleton var
private static readonly Lazy<PerfTracker> lazy = new Lazy<PerfTracker>( ( ) => new PerfTracker( ) );

Expand Down Expand Up @@ -220,7 +226,7 @@ private PerfData CreateRecord( LandingPerfData perfData )
if (apt != null) {
pd.AirportIdent = apt.Ident;

IRunway rwy = GetRunway( apt, acftPos, perfData.TdGTRK_degm );
IRunway rwy = GetRunway( apt, acftPos, perfData.TdGTRK_deg );
if (rwy != null) {
pd.RunwayIdent = rwy.Ident;
pd.RunwayBearing_deg = rwy.Bearing_deg;
Expand Down Expand Up @@ -276,6 +282,7 @@ private void WriteTouchDownV3( )
+ $"{lPerf.TdCount};";

sw.WriteLine( log );
LOG.Log( $"PerfTracker.WriteTouchDownV3 - <{log}>" );
}
}
catch { }
Expand All @@ -286,40 +293,47 @@ private void WriteTouchDownV3( )
private IAirport GetAirport( LatLon acftPos )
{
using (var _db = new FSFData.DbConnection( ) { ReadOnly = true, SharedAccess = true }) {
if (!_db.Open( Folders.GenAptDBFile )) return null; // no db available

if (!_db.Open( Folders.GenAptDBFile )) {
LOG.LogError( $"PerfTracker.GetAirport - No Apt found: DB file not available" );
return null; // no db available
}
var apt = _db.DbReader.GetAirport_ByLatLon( acftPos );
LOG.Log( $"PerfTracker.GetAirport - EVAL airport as <{((apt == null) ? "not found" : apt.Ident)}>" );
return apt;
}
}

// return a possible runway or null
private IRunway GetRunway( IAirport apt, LatLon acftPos, float gtrk_degm )
private IRunway GetRunway( IAirport apt, LatLon acftPos, float gtrk_deg )
{
// sanity
if (apt == null) return null;

// runways where the bearing of the RW start towards the acft matches about the ground track

// select runways with bearing of the track
var possibleRwyList = apt.Runways.Where( rw => dNetBm98.XMath.AboutEqual( rw.Bearing_deg, gtrk_degm, 15 ) ); // +- 7.5 deg
//Debug.WriteLine( $"PerfTracker.GetRunway - EVAL from <{possibleRwyList.Count( )}> possible runways" );
// select runways with bearing of the track (detecting landings across 60m wide to 230+m dist)
var possibleRwyList = apt.Runways.Where( rw => dNetBm98.XMath.AboutEqual( rw.Bearing_deg, gtrk_deg, 15 ) ); // +- 15 deg
LOG.Log( $"PerfTracker.GetRunway - EVAL from <{possibleRwyList.Count( )}> possible runways" );
if (possibleRwyList.Count( ) == 0) {
LOG.Log( $" no Runway found for apt <{apt.Ident}> gtrk <{gtrk_deg:000}> " );
return null; // no match
}
if (possibleRwyList.Count( ) == 1) {
LOG.Log( $" One Runway found for apt <{apt.Ident}> gtrk <{gtrk_deg:000}> - {possibleRwyList.FirstOrDefault( ).Ident} " );
return possibleRwyList.FirstOrDefault( ); // one match
}

// select from parallel runways the one where rw-start and acft pos lineup with the runway
// select from parallel runways the one where rw-start-1000m and acft pos lineup with the runway
var selectedRwyList = possibleRwyList.Where( rw =>
dNetBm98.XMath.AboutEqual( rw.StartCoordinate.DestinationPoint( -1000, rw.Bearing_deg ).BearingTo( acftPos ), rw.Bearing_deg, 9 ) ); // +- 4.5 deg
//Debug.WriteLine( $"PerfTracker.GetRunway - EVAL from <{selectedRwyList.Count( )}> selected runways" );
dNetBm98.XMath.AboutEqual( rw.StartCoordinate.DestinationPoint( -1000, rw.Bearing_deg ).BearingTo( acftPos ), rw.Bearing_deg, 9 ) ); // +- 9 deg
LOG.Log( $"PerfTracker.GetRunway - EVAL from <{selectedRwyList.Count( )}> selected runways" );

if (selectedRwyList.Count( ) == 0) {
LOG.Log( $" no Runway matched for apt <{apt.Ident}> gtrk <{gtrk_deg:000}> " );
return default; // no match
}
if (selectedRwyList.Count( ) == 1) {
LOG.Log( $" One Runway matched for apt <{apt.Ident}> gtrk <{gtrk_deg:000}> - {selectedRwyList.FirstOrDefault( ).Ident} " );
return selectedRwyList.FirstOrDefault( ); // one match
}

Expand All @@ -334,6 +348,7 @@ private IRunway GetRunway( IAirport apt, LatLon acftPos, float gtrk_degm )
dist = d;
}
}
LOG.Log( $" Returned closest Runway for apt <{apt.Ident}> gtrk <{gtrk_deg:000}> - {rwy.Ident} " );
return rwy;
}

Expand Down
5 changes: 3 additions & 2 deletions FShelf/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.1.0.12" )]
[assembly: AssemblyFileVersion( "1.1.0.12" )]
//[assembly: AssemblyVersion( "1.1.0.12" )]
//[assembly: AssemblyFileVersion( "1.1.0.12" )]
// *** USES SolutionInfo.cs
3 changes: 3 additions & 0 deletions FSimMap/MapLib/MapLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="LoadCompleteEventArgs.cs" />
<Compile Include="MapImage.cs" />
<Compile Include="MSiniHelper\IniItem.cs" />
Expand Down
5 changes: 3 additions & 2 deletions FSimMap/MapLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.1.0.12" )]
[assembly: AssemblyFileVersion( "1.1.0.12" )]
//[assembly: AssemblyVersion( "1.1.0.12" )]
//[assembly: AssemblyFileVersion( "1.1.0.12" )]
// *** USES SolutionInfo.cs
6 changes: 4 additions & 2 deletions FSimMap/bm98_Map/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.1.0.12" )]
[assembly: AssemblyFileVersion( "1.1.0.12" )]
//[assembly: AssemblyVersion( "1.1.0.12" )]
//[assembly: AssemblyFileVersion( "1.1.0.12" )]
// *** USES SolutionInfo.cs

3 changes: 3 additions & 0 deletions FSimMap/bm98_Map/bm98_Map.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="Data\Airport.cs" />
<Compile Include="Data\AverageCls.cs" />
<Compile Include="Data\ITrackedAircraft.cs" />
Expand Down
3 changes: 3 additions & 0 deletions FlightplanLib/FlightplanLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="FileLink.cs" />
<Compile Include="FlightPlan.cs" />
<Compile Include="GPX\GPXpln.cs" />
Expand Down
5 changes: 3 additions & 2 deletions FlightplanLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.1.0.12" )]
[assembly: AssemblyFileVersion( "1.1.0.12" )]
//[assembly: AssemblyVersion( "1.1.0.12" )]
//[assembly: AssemblyFileVersion( "1.1.0.12" )]
// *** USES SolutionInfo.cs
3 changes: 3 additions & 0 deletions MSALib/MSALib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
<Compile Include="Endianess.cs" />
<Compile Include="MSA.cs" />
<Compile Include="MSAdata0_5Deg.cs" />
Expand Down
Loading

0 comments on commit 13f804a

Please sign in to comment.