Skip to content

Commit

Permalink
0.9.5 (#3)
Browse files Browse the repository at this point in the history
* Support Metic fuel weight in model
* Scrollbar colors
* Tooltip
* Start minimized and minimize to tray
* Installer
* Start automatically
* Notify Icon
* Update README.md
* Pre release 0.9.5
  • Loading branch information
o4oren authored Jun 8, 2023
1 parent 21b024e commit 1ff209b
Show file tree
Hide file tree
Showing 53 changed files with 2,219 additions and 907 deletions.
15 changes: 7 additions & 8 deletions FSTRaK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 17.5.33530.505
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSTrAk", "FSTRaK\FSTrAk.csproj", "{B23FF8BA-B0CF-4388-9B13-5AB81059D6AB}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FSTrAkSetup", "FSTrAkSetup\FSTrAkSetup.vdproj", "{6040B889-5FA2-4BDC-B58F-8E84301C6D1B}"
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "Setup\Setup.vdproj", "{EAE8465A-3480-40A5-8ABA-29D8998C9CD1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -25,13 +25,12 @@ Global
{B23FF8BA-B0CF-4388-9B13-5AB81059D6AB}.Release|x64.ActiveCfg = Release|x64
{B23FF8BA-B0CF-4388-9B13-5AB81059D6AB}.Release|x64.Build.0 = Release|x64
{B23FF8BA-B0CF-4388-9B13-5AB81059D6AB}.Release|x86.ActiveCfg = Release|x64
{6040B889-5FA2-4BDC-B58F-8E84301C6D1B}.Debug|Any CPU.ActiveCfg = Debug
{6040B889-5FA2-4BDC-B58F-8E84301C6D1B}.Debug|x64.ActiveCfg = Release
{6040B889-5FA2-4BDC-B58F-8E84301C6D1B}.Debug|x64.Build.0 = Release
{6040B889-5FA2-4BDC-B58F-8E84301C6D1B}.Debug|x86.ActiveCfg = Debug
{6040B889-5FA2-4BDC-B58F-8E84301C6D1B}.Release|Any CPU.ActiveCfg = Release
{6040B889-5FA2-4BDC-B58F-8E84301C6D1B}.Release|x64.ActiveCfg = Release
{6040B889-5FA2-4BDC-B58F-8E84301C6D1B}.Release|x86.ActiveCfg = Release
{EAE8465A-3480-40A5-8ABA-29D8998C9CD1}.Debug|Any CPU.ActiveCfg = Debug
{EAE8465A-3480-40A5-8ABA-29D8998C9CD1}.Debug|x64.ActiveCfg = Debug
{EAE8465A-3480-40A5-8ABA-29D8998C9CD1}.Debug|x86.ActiveCfg = Debug
{EAE8465A-3480-40A5-8ABA-29D8998C9CD1}.Release|Any CPU.ActiveCfg = Release
{EAE8465A-3480-40A5-8ABA-29D8998C9CD1}.Release|x64.ActiveCfg = Release
{EAE8465A-3480-40A5-8ABA-29D8998C9CD1}.Release|x86.ActiveCfg = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
17 changes: 13 additions & 4 deletions FSTRaK/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0"/>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</DbProviderFactories>
</system.data>

Expand All @@ -35,7 +35,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down Expand Up @@ -68,10 +68,19 @@
<setting name="Height" serializeAs="String">
<value>768</value>
</setting>
<setting name="IsStartMinimized" serializeAs="String">
<value>False</value>
</setting>
<setting name="IsMinimizeToTray" serializeAs="String">
<value>False</value>
</setting>
<setting name="IsRunAutomatically" serializeAs="String">
<value>True</value>
</setting>
</FSTRaK.Properties.Settings>
</userSettings>
<connectionStrings>
<add name="FSTrAkDatabase" providerName="System.Data.SQLite" connectionString="Data Source=FSTrAk.db;Version=3;New=True;Compress=True;"/>
<add name="FSTrAkCompactDatabase" providerName="System.Data.SqlServerCe.4.0" connectionString="Data Source=db.sdf;"/>
<add name="FSTrAkDatabase" providerName="System.Data.SQLite" connectionString="Data Source=|DataDirectory|FSTrAk.db;Version=3;New=True;Compress=True;"/>
<add name="FSTrAkCompactDatabase" providerName="System.Data.SqlServerCe.4.0" connectionString="Data Source=|DataDirectory|db.sdf;"/>
</connectionStrings>
</configuration>
2 changes: 1 addition & 1 deletion FSTRaK/App.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Application x:Class="FSTRaK.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FSTRaK"
Startup="OnApplicationStart"
Exit="OnApplicationExit"
DispatcherUnhandledException="App_DispatcherUnhandledException"
Expand All @@ -16,6 +15,7 @@
<ResourceDictionary Source="Resources/Theme.xaml" />
<ResourceDictionary Source="Resources/Images.xaml" />
<ResourceDictionary Source="Resources/MapProvidersDictionary.xaml"/>
<ResourceDictionary Source="../Resources/AircraftIconsDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
</ResourceDictionary>
Expand Down
77 changes: 51 additions & 26 deletions FSTRaK/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
using Serilog;
using Serilog.Exceptions;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using FSTRaK.Utils;
using Microsoft.Win32;

namespace FSTRaK
{
Expand All @@ -17,53 +20,75 @@ public partial class App : Application
{
private static Mutex _mutex = null;



const string appName = "FSTrAk";
const string AppName = "FSTrAk";

protected override void OnStartup(StartupEventArgs e)
{
_mutex = new Mutex(true, appName, out var createdNew);
_mutex = new Mutex(true, AppName, out var createdNew);

if (!createdNew)
{
MessageBox.Show("An instance of FSTrAk is already running...", "FSTrAk");
Application.Current.Shutdown();

}

base.OnStartup(e);
}


void OnApplicationStart(object sender, StartupEventArgs args)
{
Log.Logger = new LoggerConfiguration()
.Enrich.WithExceptionDetails()
.MinimumLevel.Information()
{
var logPath = Path.Combine(PathUtil.GetApplicationLocalDataPath(), "log.txt");

Log.Logger = new LoggerConfiguration()
.Enrich.WithExceptionDetails()
.MinimumLevel.Information()
#if DEBUG
.MinimumLevel.Debug()
.MinimumLevel.Debug()
#endif
.WriteTo.Trace()
.WriteTo.File("log.txt")
.CreateLogger();
.WriteTo.Trace()
.WriteTo.File(logPath)
.CreateLogger();

Task.Run(() =>

Task.Run(() =>
{
using (var logbookContext = new LogbookContext())
{
using (var logbookContext = new LogbookContext())
try
{
logbookContext.Aircraft.Find(1);
}
catch (Exception ex)
{
try
{
logbookContext.Aircraft.Find(1);
}
catch (Exception ex)
{
Log.Error(ex, ex.Message);
}
Log.Error(ex, ex.Message);
}
});
}
});

var airportResolder = AirportResolver.Instance;
}
Task.Run(() =>
{
if (FSTRaK.Properties.Settings.Default.IsRunAutomatically)
{
// Start up with windows login
RegistryKey rkStartUp = Registry.CurrentUser;
var applicationLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
var startupPathSubKey = rkStartUp.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
AppDomain.CurrentDomain.SetData("DataDirectory", PathUtil.GetApplicationLocalDataPath());
if (startupPathSubKey?.GetValue("FSTrAk") == null)
{
startupPathSubKey?.SetValue("FSTrAk", applicationLocation, RegistryValueKind.ExpandString);
}
}
});

var airportResolver = AirportResolver.Instance;
}


void OnApplicationExit(object sender, ExitEventArgs e)
Expand All @@ -78,7 +103,7 @@ void OnApplicationExit(object sender, ExitEventArgs e)

void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
Log.Error(e.Exception, "Unhandled error occured!");
Log.Error(e.Exception, "Unhandled error occurred!");
// Prevent default unhandled exception processing
e.Handled = true;
}
Expand Down
7 changes: 1 addition & 6 deletions FSTRaK/DataTypes/FlightOutcome.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace FSTRaK.DataTypes
{
public enum FlightOutcome
Expand Down
2 changes: 1 addition & 1 deletion FSTRaK/DataTypes/FlightParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public struct FlightParams
public double Longitude;
public double IndicatedAirspeed;
public double GroundSpeed;
public double VeticalSpeed;
public double VerticalSpeed;
public double Altitude;
public bool IsOnGround;
}
Expand Down
5 changes: 3 additions & 2 deletions FSTRaK/DataTypes/LandingRate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
public enum LandingRate
{
Soft,
Aceeptable,
Fair,
Good,
Perfect,
Hard
Hard,
NotSet
}
}
2 changes: 1 addition & 1 deletion FSTRaK/DataTypes/SimConnectDataTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public enum DataDefinitions
NearbyAirports
}

public enum EVENTS
public enum Events
{
FlightLoaded,
AircraftLoaded,
Expand Down
25 changes: 15 additions & 10 deletions FSTRaK/FSTRaK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down Expand Up @@ -82,6 +82,7 @@
<HintPath>.\Microsoft.FlightSimulator.SimConnect.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -153,8 +154,8 @@
<Compile Include="Models\FlightManager\State\TaxiInState.cs" />
<Compile Include="Models\FlightManager\State\TaxiOutState.cs" />
<Compile Include="RelayCommand.cs" />
<Compile Include="Utils\FlightExtentionMethods.cs" />
<Compile Include="Utils\MathUtils.cs" />
<Compile Include="Utils\PathUtil.cs" />
<Compile Include="Utils\ResourceUtils.cs" />
<Compile Include="ViewModels\FlightDetailsViewModel.cs" />
<Compile Include="ViewModels\LogbookViewModel.cs" />
Expand Down Expand Up @@ -271,8 +272,12 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\FSTrAk.ico" />
<Resource Include="FSTrAk.ico" />
<Resource Include="Resources\Images\FSTrAk.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="FSTrAk.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Content Include="sqlceca40.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand All @@ -291,16 +296,16 @@
<Content Include="sqlcese40.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\Data\airports.json">
<Content Include="Resources\Data\airports.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</Content>
<None Include="Resources\Images\FSTrAk-Icon.xcf" />
<None Include="System.Data.SqlServerCe.dll">
<Content Include="System.Data.SqlServerCe.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="System.Data.SqlServerCe.Entity.dll">
</Content>
<Content Include="System.Data.SqlServerCe.Entity.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</Content>
<Content Include="Microsoft.FlightSimulator.SimConnect.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
25 changes: 15 additions & 10 deletions FSTRaK/FSTrAk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down Expand Up @@ -82,6 +82,7 @@
<HintPath>.\Microsoft.FlightSimulator.SimConnect.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -153,8 +154,8 @@
<Compile Include="Models\FlightManager\State\TaxiInState.cs" />
<Compile Include="Models\FlightManager\State\TaxiOutState.cs" />
<Compile Include="RelayCommand.cs" />
<Compile Include="Utils\FlightExtentionMethods.cs" />
<Compile Include="Utils\MathUtils.cs" />
<Compile Include="Utils\PathUtil.cs" />
<Compile Include="Utils\ResourceUtils.cs" />
<Compile Include="ViewModels\FlightDetailsViewModel.cs" />
<Compile Include="ViewModels\LogbookViewModel.cs" />
Expand Down Expand Up @@ -271,8 +272,12 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\FSTrAk.ico" />
<Resource Include="FSTrAk.ico" />
<Resource Include="Resources\Images\FSTrAk.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="FSTrAk.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Content Include="sqlceca40.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand All @@ -291,16 +296,16 @@
<Content Include="sqlcese40.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\Data\airports.json">
<Content Include="Resources\Data\airports.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</Content>
<None Include="Resources\Images\FSTrAk-Icon.xcf" />
<None Include="System.Data.SqlServerCe.dll">
<Content Include="System.Data.SqlServerCe.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="System.Data.SqlServerCe.Entity.dll">
</Content>
<Content Include="System.Data.SqlServerCe.Entity.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</Content>
<Content Include="Microsoft.FlightSimulator.SimConnect.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
Loading

0 comments on commit 1ff209b

Please sign in to comment.