Skip to content

Commit

Permalink
NONE -> KEYEMULATOR
Browse files Browse the repository at this point in the history
  • Loading branch information
jdahlblom committed Sep 28, 2017
1 parent 6f7e10d commit 9a65f9f
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 26 deletions.
14 changes: 7 additions & 7 deletions Source/DCS-BIOS/DCSBIOSControlLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public enum DCSAirframe
{
[Description("NoFrameLoadedYet")]
NOFRAMELOADEDYET,
[Description("None")]
NONE,
[Description("KeyEmulator")]
KEYEMULATOR,
[Description("A-10C")]
A10C,
[Description("UH-1H")]
Expand Down Expand Up @@ -45,7 +45,7 @@ public static DCSBIOSControl GetControl(string controlId)
{
lock (_lockObject)
{
if (_airframe == DCSAirframe.NONE)
if (_airframe == DCSAirframe.KEYEMULATOR)
{
return null;
}
Expand All @@ -65,7 +65,7 @@ public static DCSBIOSOutput GetDCSBIOSOutput(string controlId)
{
lock (_lockObject)
{
if (_airframe == DCSAirframe.NONE)
if (_airframe == DCSAirframe.KEYEMULATOR)
{
return null;
}
Expand All @@ -85,7 +85,7 @@ public static DCSBIOSOutput GetDCSBIOSOutput(string controlId)

public static void LoadControls()
{
if (_airframe == DCSAirframe.NONE || _airframe == DCSAirframe.NOFRAMELOADEDYET)
if (_airframe == DCSAirframe.KEYEMULATOR || _airframe == DCSAirframe.NOFRAMELOADEDYET)
{
return;
}
Expand Down Expand Up @@ -202,7 +202,7 @@ public static IEnumerable<DCSBIOSControl> GetControls()

public static IEnumerable<DCSBIOSControl> GetIntegerOutputControls()
{
if (_airframe == DCSAirframe.NONE)
if (_airframe == DCSAirframe.KEYEMULATOR)
{
return null;
}
Expand All @@ -212,7 +212,7 @@ public static IEnumerable<DCSBIOSControl> GetIntegerOutputControls()

public static IEnumerable<DCSBIOSControl> GetInputControls()
{
if (_airframe == DCSAirframe.NONE)
if (_airframe == DCSAirframe.KEYEMULATOR)
{
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/DCS-BIOS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// 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("2.1.296.4457")]
[assembly: AssemblyFileVersion("2.1.296.4457")]
[assembly: AssemblyVersion("2.1.298.4549")]
[assembly: AssemblyFileVersion("2.1.298.4549")]
2 changes: 1 addition & 1 deletion Source/DCSFlightpanels/ChooseProfileModuleWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ComboBox>
<Label Margin="0,15,0,0">
<TextBlock TextWrapping="Wrap">
For keyboard emulation only (PZ55, PZ70) choose "None".
For keyboard emulation only (Switchpanel PZ55, Multipanel PZ70, TPM) choose "KeyEmulator".
</TextBlock>

</Label>
Expand Down
8 changes: 4 additions & 4 deletions Source/DCSFlightpanels/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private void SetApplicationMode(DCSAirframe dcsAirframe)

var closedItemCount = CloseTabItems();

if (dcsAirframe == DCSAirframe.NONE)
if (dcsAirframe == DCSAirframe.KEYEMULATOR)
{
Common.DebugP("Shutting down DCSBIOS");
_dcsBios.Shutdown();
Expand Down Expand Up @@ -297,7 +297,7 @@ private void SearchForPanels()
}
case SaitekPanelsEnum.PZ69RadioPanel:
{
if (_panelProfileHandler.Airframe == DCSAirframe.NONE)
if (_panelProfileHandler.Airframe == DCSAirframe.KEYEMULATOR)
{
break;
}
Expand Down Expand Up @@ -382,7 +382,7 @@ private void SearchForPanels()
}
case SaitekPanelsEnum.BackLitPanel:
{
if (_panelProfileHandler.Airframe == DCSAirframe.NONE)
if (_panelProfileHandler.Airframe == DCSAirframe.KEYEMULATOR)
{
break;
}
Expand Down Expand Up @@ -1263,7 +1263,7 @@ private void SendEventRegardingForwardingOfKeys()
var forwardKeys = !bool.Parse(ButtonImageDisable.Tag.ToString());
var checkForDCS = Settings.Default.CheckForDCSBeforeSendingCommands;

if (_panelProfileHandler.Airframe == DCSAirframe.NONE)
if (_panelProfileHandler.Airframe == DCSAirframe.KEYEMULATOR)
{
//DCS exists or not does not matter, keyboard emulation only
checkForDCS = false;
Expand Down
8 changes: 4 additions & 4 deletions Source/DCSFlightpanels/MultiPanelUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public void SelectedAirframe(DCSAirframe dcsAirframe)

private void SetApplicationMode(DCSAirframe dcsAirframe)
{
ButtonKnobAltLcdUpper.IsEnabled = dcsAirframe != DCSAirframe.NONE;
ButtonKnobAltLcdLower.IsEnabled = dcsAirframe != DCSAirframe.NONE;
ButtonKnobVsLcdUpper.IsEnabled = dcsAirframe != DCSAirframe.NONE;
ButtonKnobVsLcdLower.IsEnabled = dcsAirframe != DCSAirframe.NONE;
ButtonKnobAltLcdUpper.IsEnabled = dcsAirframe != DCSAirframe.KEYEMULATOR;
ButtonKnobAltLcdLower.IsEnabled = dcsAirframe != DCSAirframe.KEYEMULATOR;
ButtonKnobVsLcdUpper.IsEnabled = dcsAirframe != DCSAirframe.KEYEMULATOR;
ButtonKnobVsLcdLower.IsEnabled = dcsAirframe != DCSAirframe.KEYEMULATOR;
}

public void SwitchesChanged(string uniqueId, SaitekPanelsEnum saitekPanelsEnum, HashSet<object> hashSet)
Expand Down
4 changes: 2 additions & 2 deletions Source/DCSFlightpanels/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
// 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("2.1.740.4457")]
[assembly: AssemblyFileVersion("2.1.740.4457")]
[assembly: AssemblyVersion("2.1.742.4549")]
[assembly: AssemblyFileVersion("2.1.742.4549")]
4 changes: 2 additions & 2 deletions Source/DCSFlightpanels/SwitchPanelPZ55UserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public void SelectedAirframe(DCSAirframe dcsAirframe)
{
foreach (var image in Common.FindVisualChildren<Image>(this))
{
if (image.Name.StartsWith("ImagePZ55LED") && dcsAirframe == DCSAirframe.NONE)
if (image.Name.StartsWith("ImagePZ55LED") && dcsAirframe == DCSAirframe.KEYEMULATOR)
{
image.ContextMenu = null;
}
else
if (image.Name.StartsWith("ImagePZ55LED") && image.ContextMenu == null && dcsAirframe != DCSAirframe.NONE)
if (image.Name.StartsWith("ImagePZ55LED") && image.ContextMenu == null && dcsAirframe != DCSAirframe.KEYEMULATOR)
{
image.ContextMenu = (ContextMenu)Resources["PZ55LEDContextMenu"];
image.ContextMenu.Tag = image.Name;
Expand Down
10 changes: 9 additions & 1 deletion Source/NonVisuals/ProfileHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,15 @@ public bool LoadProfile(string filename)
{
if (fileLine.StartsWith("Airframe="))
{
_airframe = (DCSAirframe)Enum.Parse(typeof(DCSAirframe), fileLine.Replace("Airframe=", "").Trim());
if (fileLine.StartsWith("Airframe=NONE"))
{
//Backward compat
_airframe = DCSAirframe.KEYEMULATOR;
}
else
{
_airframe = (DCSAirframe) Enum.Parse(typeof(DCSAirframe), fileLine.Replace("Airframe=", "").Trim());
}
DCSBIOSControlLocator.Airframe = _airframe;
DCSBIOSControlLocator.JSONDirectory = _jsonDirectory;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/NonVisuals/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// 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("2.1.623.4457")]
[assembly: AssemblyFileVersion("2.1.623.4457")]
[assembly: AssemblyVersion("2.1.625.4549")]
[assembly: AssemblyFileVersion("2.1.625.4549")]
2 changes: 1 addition & 1 deletion Source/NonVisuals/SaitekPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ protected void UpdateCounter(uint address, uint data)

public void SelectedAirframe(DCSAirframe dcsAirframe)
{
_keyboardEmulation = dcsAirframe == DCSAirframe.NONE;
_keyboardEmulation = dcsAirframe == DCSAirframe.KEYEMULATOR;
}

//User can choose not to in case switches needs to be reset but not affect the airframe. E.g. after crashing.
Expand Down

0 comments on commit 9a65f9f

Please sign in to comment.