Skip to content

Navigation Menu

Sign in
Sign up

Add OLED friendly colour scheme and quit with MSFS #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TyraelDLee wants to merge 3 commits into scelts:master
base: master
Choose a base branch
Loading
from TyraelDLee:master
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions GeesWPF/App.xaml.cs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ private void LogUnhandledException(Exception e, string source)
{
MessageBox.Show(e.Message);
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
string logout = "\n\n" + DateTime.Now.ToString() + "\n" + System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location).FileVersion + "\n" +
e.Message + "\n" + e.Source + "\n" + e.StackTrace;
string logout = "\n\n" + DateTime.Now.ToString() + "\n" +
System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location).FileVersion + "\n" +
e.Message + "\n" + e.Source + "\n" + e.StackTrace;
System.IO.File.AppendAllText(@"./log.txt", logout);
}
}
}
}
22 changes: 18 additions & 4 deletions GeesWPF/GeesWPF.csproj
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>B:\Developing\DotNet\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
Expand All @@ -26,10 +27,10 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -76,6 +77,18 @@
<PropertyGroup>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>27476CADC67C484CB3458653A00BFBF10F77E3DF</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>GeesWPF_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="CsvHelper, Version=15.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
<HintPath>..\packages\CsvHelper.15.0.7\lib\net47\CsvHelper.dll</HintPath>
Expand Down Expand Up @@ -170,6 +183,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="GeesWPF_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down Expand Up @@ -212,7 +226,7 @@
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
Expand Down
5 changes: 3 additions & 2 deletions GeesWPF/LRMDisplay.xaml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:properties="clr-namespace:GeesWPF.Properties"
xmlns:local="clr-namespace:GeesWPF"
mc:Ignorable="d"
Title="LRMDisplay" Height="260" Width="1" Topmost="True" WindowStyle="None" Background="#FF1D3557" ResizeMode="NoResize" Left="-1" Top="40" ShowInTaskbar="False">
Title="LRMDisplay" Height="260" Width="1" Topmost="True" WindowStyle="None" Background="{Binding OledColourScheme, Source={x:Static properties:Settings.Default}}" ResizeMode="NoResize" Left="-1" Top="40" ShowInTaskbar="False" Cursor="">
<Window.Resources>
<Storyboard x:Key="show" TargetProperty="Margin">
<DoubleAnimation Duration="0:0:0.3" Storyboard.TargetProperty="Width" From="2" To="350" AccelerationRatio=".5">
Expand Down Expand Up @@ -62,7 +63,7 @@
</Image>
<Image x:Name="image_Copy3" HorizontalAlignment="Left" Height="32" Margin="31,168,0,0" VerticalAlignment="Top" Width="32" Source="Images/slidew.png" RenderTransformOrigin="0.5,0.5"/>
<Image x:Name="image1" HorizontalAlignment="Left" Height="260" Margin="311,0,-0.6,0" Width="40" Source="Images/chevron.png" Cursor="Hand" MouseDown="image1_MouseDown" Stretch="None"/>
<Button x:Name="button" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="5" Height="260" Background="#FFA8DADC" BorderBrush="{x:Null}" Cursor="SizeWE" Click="button_Click"/>
<Button x:Name="button" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="10" Height="260" Background="{Binding OledColourSchemeBtn, Source={x:Static properties:Settings.Default}}" BorderBrush="{x:Null}" Cursor="SizeWE" Click="button_Click"/>
<Label x:Name="labelBounces" Content="{Binding BouncesText}" HorizontalAlignment="Left" Margin="68,208,0,0" VerticalAlignment="Top" Foreground="#FFF1FAEE" FontSize="18"/>
<Image x:Name="image_Copy2" HorizontalAlignment="Left" Height="32" Margin="31,210,0,0" VerticalAlignment="Top" Width="32" Source="Images/bounce.png" RenderTransformOrigin="0.5,0.5"/>

Expand Down
7 changes: 6 additions & 1 deletion GeesWPF/LRMDisplay.xaml.cs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace GeesWPF
public partial class LRMDisplay : Window
{
#region Don't ever take focus

protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
Expand All @@ -43,9 +44,11 @@ protected override void OnSourceInitialized(EventArgs e)

[DllImport("user32.dll")]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);

#endregion

DispatcherTimer timerClose = new DispatcherTimer();

public LRMDisplay(ViewModel landingModel)
{
this.DataContext = landingModel;
Expand All @@ -66,8 +69,10 @@ public void SlideLeft()
{
timerClose.Start();
}

this.BeginStoryboard(FindResource("show") as Storyboard);
}

private void image1_MouseDown(object sender, MouseButtonEventArgs e)
{
this.BeginStoryboard(FindResource("hide") as Storyboard);
Expand All @@ -81,4 +86,4 @@ private void button_Click(object sender, RoutedEventArgs e)
}
}
}
}
}
36 changes: 14 additions & 22 deletions GeesWPF/LandingLogger.cs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,16 @@ public class LandingLogger
{
public class LogEntry
{
[Name("Time")]
public DateTime Time { get; set; }
[Name("Plane")]
public string Plane { get; set; }
[Name("FPM")]
public int Fpm { get; set; }
[Name("Impact (G)")]
public double G { get; set; }
[Name("Air Speed (kt)")]
public double AirV { get; set; }
[Name("Ground Speed (kt)")]
public double GroundV { get; set; }
[Name("Headwind (kt)")]
public double HeadV { get; set; }
[Name("Crosswind (kt)")]
public double CrossV { get; set; }
[Name("Sideslip (deg)")]
public double Sideslip { get; set; }
[Name("Bounces")]
public double Bounces { get; set; }
[Name("Time")] public DateTime Time { get; set; }
[Name("Plane")] public string Plane { get; set; }
[Name("FPM")] public int Fpm { get; set; }
[Name("Impact (G)")] public double G { get; set; }
[Name("Air Speed (kt)")] public double AirV { get; set; }
[Name("Ground Speed (kt)")] public double GroundV { get; set; }
[Name("Headwind (kt)")] public double HeadV { get; set; }
[Name("Crosswind (kt)")] public double CrossV { get; set; }
[Name("Sideslip (deg)")] public double Sideslip { get; set; }
[Name("Bounces")] public double Bounces { get; set; }
}

public string MakeLogIfEmpty()
Expand All @@ -52,6 +42,7 @@ public string MakeLogIfEmpty()
csv.WriteRecords(new List<LogEntry>());
}
}

return path;
}

Expand Down Expand Up @@ -102,7 +93,8 @@ public DataTable LandingLog
// Populate the DataTable with values from the list
foreach (var record in records)
{
dt.Rows.Add(record.Time, record.Plane, record.Fpm, record.G, record.AirV, record.GroundV, record.HeadV, record.CrossV, record.Sideslip, record.Bounces);
dt.Rows.Add(record.Time, record.Plane, record.Fpm, record.G, record.AirV, record.GroundV,
record.HeadV, record.CrossV, record.Sideslip, record.Bounces);
}

// Sort the DataTable by Time in descending order
Expand All @@ -111,4 +103,4 @@ public DataTable LandingLog
}
}
}
}
}
3 changes: 1 addition & 2 deletions GeesWPF/LandingsWindow.xaml.cs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace GeesWPF
{
public partial class LandingsWindow : Window
{

public LandingsWindow(ViewModel viewModel)
{
this.DataContext = viewModel;
Expand All @@ -37,4 +36,4 @@ private void button_Click(object sender, RoutedEventArgs e)
Process.Start(path);
}
}
}
}
6 changes: 4 additions & 2 deletions GeesWPF/MainWindow.xaml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:properties="clr-namespace:GeesWPF.Properties"
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="GeesWPF.MainWindow"
mc:Ignorable="d"
Title="MainWindow" Height="490.8" Width="343.2" ResizeMode="NoResize" Background="#FF1D3557" Deactivated="Window_Deactivated" Topmost="True" WindowStyle="None" ShowInTaskbar="False">
Title="MainWindow" Height="490.8" Width="343.2" ResizeMode="NoResize" Background="{Binding OledColourScheme, Source={x:Static properties:Settings.Default}}" Deactivated="Window_Deactivated" Topmost="True" WindowStyle="None" ShowInTaskbar="False">
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
<Style TargetType="{x:Type Button}" x:Key="DarkButton">
Expand All @@ -31,7 +31,9 @@
<Grid Margin="0,0,-0.2,0">
<Label x:Name="title" Content="Gees" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Foreground="#FFF1FAEE" FontSize="20"/>
<Button x:Name="button" Content="Quit" HorizontalAlignment="Left" Margin="258,13,0,0" VerticalAlignment="Top" Width="75" Foreground="#FFF1FAEE" Height="37" Click="button_Click" Style="{DynamicResource DarkButton}"/>
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" Margin="13,73,0,0" TextWrapping="Wrap" Text="In game landing analysis for Microsoft Flight Simulator 2020" VerticalAlignment="Top" Foreground="#FFF1FAEE" FontSize="16" Width="320">
<CheckBox x:Name="oledFirendly" Content="OLED friendly" HorizontalAlignment="Left" Margin="15,60,0,0" VerticalAlignment="Top" Foreground="#FFF1FAEE" IsChecked="{Binding OledFriendly, Mode=TwoWay, Source={x:Static properties:Settings.Default}}" Click="oled_friendly"/>
<CheckBox x:Name="autoClose" Content="Quit with Simulator" HorizontalAlignment="Left" Margin="180,60,0,0" VerticalAlignment="Top" Foreground="#FFF1FAEE" IsChecked="{Binding AutoCloseWithSim, Mode=TwoWay, Source={x:Static properties:Settings.Default}}" Checked="auto_close"/>
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" Margin="13,80,0,0" TextWrapping="Wrap" Text="In game landing analysis for Microsoft Flight Simulator 2020" VerticalAlignment="Top" Foreground="#FFF1FAEE" FontSize="16" Width="320">

</TextBlock>
<Label x:Name="versionLabel" Content="{Binding Version}" HorizontalAlignment="Left" Margin="10,121,0,0" VerticalAlignment="Top" Foreground="#FFF1FAEE" RenderTransformOrigin="0.783,1.633"/>
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /