Skip to content

Commit

Permalink
FlightData: handle bad squawk code from ping
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Nov 22, 2023
1 parent d5a12c5 commit 96be678
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6180,7 +6180,14 @@ private void updateTransponder()
if (!Squawk_nud.Focused)
{
Squawk_nud.ValueChanged -= new EventHandler(Squawk_nud_ValueChanged);
Squawk_nud.Value = (decimal)MainV2.comPort.MAV.cs.xpdr_mode_A_squawk_code;
try
{
Squawk_nud.Value = (decimal)MainV2.comPort.MAV.cs.xpdr_mode_A_squawk_code;
// if the value is bad, we need to be able to reset it, so silent fail
}
catch
{
}
Squawk_nud.ValueChanged += new EventHandler(Squawk_nud_ValueChanged);
}

Expand Down

0 comments on commit 96be678

Please sign in to comment.