Skip to content
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

Jdahlblom radios use output commands #514

Merged
merged 16 commits into from
Apr 3, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand All @@ -44,7 +44,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v3
# uses: github/codeql-action/autobuild@v4

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand Down
2 changes: 1 addition & 1 deletion src/DCSFPCommon
1 change: 1 addition & 0 deletions src/DCSFlightpanels.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Farenheit/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Flightpanels/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=FRAC/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=FREQEMER/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Fugly/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=HFRADIO/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=INTERCOMM/@EntryIndexedValue">True</s:Boolean>
Expand Down
531 changes: 266 additions & 265 deletions src/NonVisuals.Tests/Radios/RadioPanelPZ69A10CTests.cs

Large diffs are not rendered by default.

181 changes: 91 additions & 90 deletions src/NonVisuals.Tests/Radios/RadioPanelPZ69Ka50Tests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using NonVisuals.Radios;
using System;
using DCS_BIOS.misc;
using Xunit;

namespace NonVisuals.Tests.Radios
Expand All @@ -9,113 +10,113 @@ public class RadioPanelPZ69Ka50Tests

[Theory]
[InlineData(0, 0, null)]
[InlineData(0, 1, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(0, 2, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(0, 3, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(0, 4, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(0, 5, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(0, 6, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(0, 7, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(0, 8, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(0, 9, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(0, 1, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(0, 2, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(0, 3, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(0, 4, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(0, 5, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(0, 6, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(0, 7, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(0, 8, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(0, 9, DCSBIOSCommand.DCSBIOS_INCREMENT)]

[InlineData(1, 0, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(1, 0, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(1, 1, null)]
[InlineData(1, 2, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(1, 3, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(1, 4, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(1, 5, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(1, 6, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(1, 7, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(1, 8, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(1, 9, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(1, 2, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(1, 3, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(1, 4, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(1, 5, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(1, 6, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(1, 7, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(1, 8, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(1, 9, DCSBIOSCommand.DCSBIOS_INCREMENT)]

[InlineData(2, 0, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(2, 1, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(2, 0, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(2, 1, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(2, 2, null)]
[InlineData(2, 3, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(2, 4, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(2, 5, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(2, 6, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(2, 7, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(2, 8, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(2, 9, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(2, 3, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(2, 4, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(2, 5, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(2, 6, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(2, 7, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(2, 8, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(2, 9, DCSBIOSCommand.DCSBIOS_INCREMENT)]

[InlineData(3, 0, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(3, 1, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(3, 2, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(3, 0, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(3, 1, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(3, 2, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(3, 3, null)]
[InlineData(3, 4, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(3, 5, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(3, 6, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(3, 7, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(3, 8, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(3, 9, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(3, 4, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(3, 5, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(3, 6, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(3, 7, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(3, 8, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(3, 9, DCSBIOSCommand.DCSBIOS_INCREMENT)]

[InlineData(4, 0, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(4, 1, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(4, 2, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(4, 3, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(4, 0, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(4, 1, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(4, 2, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(4, 3, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(4, 4, null)]
[InlineData(4, 5, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(4, 6, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(4, 7, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(4, 8, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(4, 9, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(4, 5, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(4, 6, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(4, 7, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(4, 8, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(4, 9, DCSBIOSCommand.DCSBIOS_INCREMENT)]

[InlineData(5, 0, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(5, 1, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(5, 2, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(5, 3, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(5, 4, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(5, 0, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(5, 1, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(5, 2, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(5, 3, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(5, 4, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(5, 5, null)]
[InlineData(5, 6, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(5, 7, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(5, 8, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(5, 9, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(5, 6, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(5, 7, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(5, 8, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(5, 9, DCSBIOSCommand.DCSBIOS_DECREMENT)]

[InlineData(6, 0, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(6, 1, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(6, 2, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(6, 3, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(6, 4, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(6, 5, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(6, 0, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(6, 1, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(6, 2, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(6, 3, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(6, 4, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(6, 5, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(6, 6, null)]
[InlineData(6, 7, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(6, 8, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(6, 9, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(6, 7, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(6, 8, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(6, 9, DCSBIOSCommand.DCSBIOS_DECREMENT)]

[InlineData(7, 0, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(7, 1, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(7, 2, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(7, 3, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(7, 4, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(7, 5, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(7, 6, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(7, 0, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(7, 1, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(7, 2, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(7, 3, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(7, 4, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(7, 5, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(7, 6, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(7, 7, null)]
[InlineData(7, 8, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(7, 9, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(7, 8, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(7, 9, DCSBIOSCommand.DCSBIOS_DECREMENT)]

[InlineData(8, 0, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(8, 1, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(8, 2, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(8, 3, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(8, 4, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(8, 5, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(8, 6, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(8, 7, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(8, 0, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(8, 1, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(8, 2, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(8, 3, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(8, 4, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(8, 5, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(8, 6, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(8, 7, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(8, 8, null)]
[InlineData(8, 9, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(8, 9, DCSBIOSCommand.DCSBIOS_DECREMENT)]

[InlineData(9, 0, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(9, 1, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(9, 2, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(9, 3, RadioPanelPZ69Base.DCSBIOS_DECREASE_COMMAND)]
[InlineData(9, 4, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(9, 5, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(9, 6, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(9, 7, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(9, 8, RadioPanelPZ69Base.DCSBIOS_INCREASE_COMMAND)]
[InlineData(9, 0, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(9, 1, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(9, 2, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(9, 3, DCSBIOSCommand.DCSBIOS_DECREMENT)]
[InlineData(9, 4, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(9, 5, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(9, 6, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(9, 7, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(9, 8, DCSBIOSCommand.DCSBIOS_INCREMENT)]
[InlineData(9, 9, null)]

public void GetCommandDirectionFor0To9Dials_ShouldReturn_ExpectedValues(int desiredDialPosition, uint actualDialPosition, string expectedValue)
Expand Down
Loading