Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit e2f77ee

Browse files
committed
Update to .net framework 4.8
Add scroll acceleration (see readme.md and panelsettings.config)
1 parent 463a543 commit e2f77ee

20 files changed

+307
-140
lines changed

.gitignore

+33-4
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,25 @@
1313
# User-specific files (MonoDevelop/Xamarin Studio)
1414
*.userprefs
1515

16+
# Mono auto generated files
17+
mono_crash.*
18+
1619
# Build results
1720
[Dd]ebug/
1821
[Dd]ebugPublic/
1922
[Rr]elease/
2023
[Rr]eleases/
2124
x64/
2225
x86/
26+
[Ww][Ii][Nn]32/
2327
[Aa][Rr][Mm]/
2428
[Aa][Rr][Mm]64/
2529
bld/
2630
[Bb]in/
2731
[Oo]bj/
32+
[Oo]ut/
2833
[Ll]og/
34+
[Ll]ogs/
2935

3036
# Visual Studio 2015/2017 cache/options directory
3137
.vs/
@@ -39,9 +45,10 @@ Generated\ Files/
3945
[Tt]est[Rr]esult*/
4046
[Bb]uild[Ll]og.*
4147

42-
# NUNIT
48+
# NUnit
4349
*.VisualState.xml
4450
TestResult.xml
51+
nunit-*.xml
4552

4653
# Build Results of an ATL Project
4754
[Dd]ebugPS/
@@ -56,6 +63,9 @@ project.lock.json
5663
project.fragment.lock.json
5764
artifacts/
5865

66+
# ASP.NET Scaffolding
67+
ScaffoldingReadMe.txt
68+
5969
# StyleCop
6070
StyleCopReport.xml
6171

@@ -135,6 +145,11 @@ _TeamCity*
135145
.axoCover/*
136146
!.axoCover/settings.json
137147

148+
# Coverlet is a free, cross platform Code Coverage Tool
149+
coverage*.json
150+
coverage*.xml
151+
coverage*.info
152+
138153
# Visual Studio code coverage results
139154
*.coverage
140155
*.coveragexml
@@ -182,6 +197,8 @@ PublishScripts/
182197

183198
# NuGet Packages
184199
*.nupkg
200+
# NuGet Symbol Packages
201+
*.snupkg
185202
# The packages folder can be ignored because of Package Restore
186203
**/[Pp]ackages/*
187204
# except build/, which is used as an MSBuild target.
@@ -206,6 +223,8 @@ BundleArtifacts/
206223
Package.StoreAssociation.xml
207224
_pkginfo.txt
208225
*.appx
226+
*.appxbundle
227+
*.appxupload
209228

210229
# Visual Studio cache files
211230
# files ending in .cache can be ignored
@@ -255,7 +274,9 @@ ServiceFabricBackup/
255274
*.bim.layout
256275
*.bim_*.settings
257276
*.rptproj.rsuser
258-
*- Backup*.rdl
277+
*- [Bb]ackup.rdl
278+
*- [Bb]ackup ([0-9]).rdl
279+
*- [Bb]ackup ([0-9][0-9]).rdl
259280

260281
# Microsoft Fakes
261282
FakesAssemblies/
@@ -338,6 +359,14 @@ ASALocalRun/
338359

339360
# BeatPulse healthcheck temp database
340361
healthchecksdb
341-
/Elite/HWiNFOSharedMemoryViewer.exe
342362

343-
mqtt.config
363+
# Backup folder for Package Reference Convert tool in Visual Studio 2017
364+
MigrationBackup/
365+
366+
# Ionide (cross platform F# VS Code tools) working folder
367+
.ionide/
368+
369+
# Fody - auto-generated XML schema
370+
FodyWeavers.xsd
371+
/Elite/HWiNFOSharedMemoryViewer.exe
372+
/Elite/mqtt.config

EDEngineer/App.config

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
55
</startup>
6-
</configuration>
6+
</configuration>

EDEngineer/EDEngineer.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
<OutputType>Library</OutputType>
99
<RootNamespace>EDEngineer</RootNamespace>
1010
<AssemblyName>EDEngineer</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
1516
</PropertyGroup>
1617
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1718
<PlatformTarget>AnyCPU</PlatformTarget>

Elite/App.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ protected override void OnStartup(StartupEventArgs evtArgs)
622622
}
623623
}*/
624624

625-
await Task.Delay(50, _jsonTokenSource.Token);
625+
await Task.Delay(50, _joystickTokenSource.Token);
626626
}
627627

628628
}, joystickToken);

Elite/Elite.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
<OutputType>WinExe</OutputType>
99
<RootNamespace>Elite</RootNamespace>
1010
<AssemblyName>Elite</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<Deterministic>true</Deterministic>
1515
<NuGetPackageImportStamp>
1616
</NuGetPackageImportStamp>
17+
<TargetFrameworkProfile />
1718
</PropertyGroup>
1819
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1920
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -237,7 +238,6 @@
237238
<ItemGroup>
238239
<None Include="app.config" />
239240
<None Include="app.manifest" />
240-
<None Include="mqtt.config" />
241241
<None Include="appsettings.config">
242242
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
243243
</None>

Elite/FipPanel.cs

+100-2
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,17 @@ internal class FipPanel
411411
private int[] _currentZoomLevel = new int[100];
412412

413413

414+
private DateTime _lastClockwiseScroll = DateTime.Now;
415+
private DateTime _lastCounterClockwiseScroll = DateTime.Now;
416+
private int _ClockwiseScrollCount;
417+
private int _CounterClockwiseScrollCount;
418+
419+
private int _fastScrollClickDelay = 250;
420+
private int _fastScrollClickCount = 4;
421+
private int _scrollIncrement = 50;
422+
private int _fastScrollIncrement = 200;
423+
424+
414425
private int _currentLcdYOffset;
415426
private int _currentLcdHeight;
416427

@@ -560,6 +571,44 @@ private void InitFipPanelSerialNumber()
560571
}
561572
}
562573

574+
private void InitScrollConstants()
575+
{
576+
GetExePath();
577+
578+
if (File.Exists(Path.Combine(_exePath, "panelSettings.config")) &&
579+
ConfigurationManager.GetSection("panelSettings") is NameValueCollection panelSection)
580+
{
581+
var fastScrollClickDelayString = panelSection["FastScrollClickDelay"];
582+
583+
int.TryParse(fastScrollClickDelayString, out _fastScrollClickDelay);
584+
585+
App.Log.Info("FipPanel FastScrollClickDelay : " + _fastScrollClickDelay);
586+
587+
var fastScrollClickCountString = panelSection["FastScrollClickCount"];
588+
589+
int.TryParse(fastScrollClickCountString, out _fastScrollClickCount);
590+
591+
App.Log.Info("FipPanel FastScrollClickCount : " + _fastScrollClickCount);
592+
593+
var scrollIncrementString = panelSection["ScrollIncrement"];
594+
595+
int.TryParse(scrollIncrementString, out _scrollIncrement);
596+
597+
App.Log.Info("FipPanel ScrollIncrement : " + _scrollIncrement);
598+
599+
var fastScrollIncrementString = panelSection["FastScrollIncrement"];
600+
601+
int.TryParse(fastScrollIncrementString, out _fastScrollIncrement);
602+
603+
App.Log.Info("FipPanel FastScrollIncrement : " + _fastScrollIncrement);
604+
605+
606+
607+
608+
}
609+
}
610+
611+
563612
public void Initalize()
564613
{
565614
// FIP = 3e083cd8-6a37-4a58-80a8-3d6a2c07513e
@@ -592,11 +641,15 @@ public void Initalize()
592641

593642
InitFipPanelSerialNumber();
594643

644+
InitScrollConstants();
645+
595646
_initOk = true;
596647

597648
AddPage(DEFAULT_PAGE, true);
598649

599650
RefreshDevicePage();
651+
652+
600653
}
601654

602655
}
@@ -611,6 +664,8 @@ public void InitalizeWindow(string serialNumber, int windowWidth, int windowHeig
611664

612665
InitFipPanelSerialNumber();
613666

667+
InitScrollConstants();
668+
614669
RefreshDevicePage();
615670

616671
}
@@ -1226,7 +1281,28 @@ private void SoftButtonCallback(IntPtr device, IntPtr buttons, IntPtr context)
12261281
case 2: // scroll clockwise
12271282
if (state && CurrentTab != LcdTab.Galaxy)
12281283
{
1229-
_currentLcdYOffset += 50;
1284+
_lastCounterClockwiseScroll = DateTime.Now;
1285+
_CounterClockwiseScrollCount = 0;
1286+
1287+
if ((DateTime.Now - _lastClockwiseScroll).Milliseconds > _fastScrollClickDelay)
1288+
{
1289+
_ClockwiseScrollCount = 0;
1290+
}
1291+
else
1292+
{
1293+
_ClockwiseScrollCount ++;
1294+
}
1295+
1296+
_lastClockwiseScroll = DateTime.Now;
1297+
1298+
if (_ClockwiseScrollCount > _fastScrollClickCount)
1299+
{
1300+
_currentLcdYOffset += _fastScrollIncrement;
1301+
}
1302+
else
1303+
{
1304+
_currentLcdYOffset += _scrollIncrement;
1305+
}
12301306

12311307
mustRender = false;
12321308

@@ -1240,7 +1316,29 @@ private void SoftButtonCallback(IntPtr device, IntPtr buttons, IntPtr context)
12401316

12411317
if (state && CurrentTab != LcdTab.Galaxy)
12421318
{
1243-
_currentLcdYOffset -= 50;
1319+
_lastClockwiseScroll = DateTime.Now;
1320+
_ClockwiseScrollCount = 0;
1321+
1322+
if ((DateTime.Now - _lastCounterClockwiseScroll).Milliseconds > _fastScrollClickDelay)
1323+
{
1324+
_CounterClockwiseScrollCount = 0;
1325+
}
1326+
else
1327+
{
1328+
_CounterClockwiseScrollCount++;
1329+
}
1330+
1331+
_lastCounterClockwiseScroll = DateTime.Now;
1332+
1333+
if (_CounterClockwiseScrollCount > _fastScrollClickCount)
1334+
{
1335+
_currentLcdYOffset -= _fastScrollIncrement;
1336+
}
1337+
else
1338+
{
1339+
_currentLcdYOffset -= _scrollIncrement;
1340+
}
1341+
12441342
if (_currentLcdYOffset < 0)
12451343
{
12461344
_currentLcdYOffset = 0;

Elite/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("")]
1111
[assembly: AssemblyProduct("FIP Elite")]
12-
[assembly: AssemblyCopyright("Copyright © 2021")]
12+
[assembly: AssemblyCopyright("Copyright © 2022")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

@@ -31,7 +31,7 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.9.3.0")]
35-
[assembly: AssemblyFileVersion("1.9.3.0")]
34+
[assembly: AssemblyVersion("1.9.4.0")]
35+
[assembly: AssemblyFileVersion("1.9.4.0")]
3636

3737
[assembly: log4net.Config.XmlConfigurator(Watch = true)]

Elite/Properties/Settings.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Elite/Templates/navigation.cshtml

+20-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
<td>
406406
<table style="border-spacing: 0px;">
407407
<tbody>
408-
<tr>
408+
@* <tr>
409409
<td class="caption" colspan="2">
410410
@m.subType
411411
@(m.isScoopable == true ? ", Fuel Star":"")
@@ -422,6 +422,25 @@
422422
}
423423
</td>
424424
</tr>
425+
*@
426+
<tr>
427+
<td class="caption">@m.subType</td>
428+
<td class="data right">
429+
@(m.isScoopable == true ? "Fuel Star":"")
430+
@if (m.isLandable == true)
431+
{
432+
if (!string.IsNullOrEmpty(m.atmosphereType) && m.atmosphereType.ToLower().Contains("thin"))
433+
{
434+
@Html.Raw("<span class=\"alarm2\">&nbsp;Landable&nbsp;</span>")
435+
}
436+
else
437+
{
438+
@Html.Raw("<span class=\"alarm\">&nbsp;Landable&nbsp;</span>")
439+
}
440+
}
441+
</td>
442+
</tr>
443+
425444
<tr>
426445
<td class="caption">Distance</td>
427446
<td class="data right">@m.distanceToArrival.ToString("N0") Ls</td>

0 commit comments

Comments
 (0)