Skip to content

Commit

Permalink
Serious bugfix in ctrlref, controls got wrong values. (#378)
Browse files Browse the repository at this point in the history
* Serious bugfix in ctrlref, controls got wrong values.

* Update DCSFlightpanels.csproj
  • Loading branch information
jdahlblom authored Oct 7, 2023
1 parent 9e8645c commit bd67e06
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Source/ControlReference/CTRLMainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void DcsBiosDataReceived(object sender, DCSBIOSDataEventArgs e)
{
if (dcsbiosOutput.Address == e.Address)
{
REFEventHandler.NewDCSBIOSUIntData(this, e.Address, dcsbiosOutput.GetUIntValue(e.Data));
REFEventHandler.NewDCSBIOSUIntData(this, e.Address, e.Data);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ControlReference/Events/CategoryEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class DCSBIOSDataCombinedEventArgs : System.EventArgs
public uint Address { get; set; }
public bool IsUIntValue { get; set; }
public string StringValue { get; set; }
public uint UIntValue { get; set; }
public uint Data { get; set; }
}
}
5 changes: 3 additions & 2 deletions Source/ControlReference/Events/REFEventHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ControlReference.Interfaces;
using System.Diagnostics;

namespace ControlReference.Events
{
Expand Down Expand Up @@ -40,9 +41,9 @@ public static void DetachDCSBIOSDataListener(INewDCSBIOSData newDCSBIOSData)
OnNewDCSBIOSData -= newDCSBIOSData.NewDCSBIOSData;
}

public static void NewDCSBIOSUIntData(object sender, uint address, uint uintValue)
public static void NewDCSBIOSUIntData(object sender, uint address, uint data)
{
OnNewDCSBIOSData?.Invoke(sender, new DCSBIOSDataCombinedEventArgs { Sender = sender, Address = address, IsUIntValue = true, UIntValue = uintValue});
OnNewDCSBIOSData?.Invoke(sender, new DCSBIOSDataCombinedEventArgs { Sender = sender, Address = address, IsUIntValue = true, Data = data});
}

public static void NewDCSBIOSStringData(object sender, uint address, string stringValue)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Media;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -82,7 +83,7 @@ public void NewDCSBIOSData(object sender, DCSBIOSDataCombinedEventArgs args)
{
if (_dcsbiosOutput.Address == args.Address && args.IsUIntValue)
{
SetUintValue(args.UIntValue);
SetUintValue(_dcsbiosOutput.GetUIntValue(args.Data));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/DCSFlightpanels/DCSFlightpanels.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</Authors>
<PackageId>DCSFlightpanels (DCSFP)</PackageId>
<Version>1.0.0</Version>
<AssemblyVersion>4.8.0</AssemblyVersion>
<AssemblyVersion>4.9.0</AssemblyVersion>
<FileVersion>
</FileVersion>
<ApplicationIcon>flightpanels02_8Rc_icon.ico</ApplicationIcon>
Expand Down

0 comments on commit bd67e06

Please sign in to comment.