Skip to content

Commit

Permalink
Remove IRS/INS vs Baro ROCD check improves detection changes
Browse files Browse the repository at this point in the history
At the cost of multi match. Since these are valid packets we should aim at reducing flase postives instead of rejecting correct messages
  • Loading branch information
Douglasdc3 committed Oct 10, 2022
1 parent 53f1aaf commit 88c1c56
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/main/java/aero/t2s/modes/decoder/df/bds/Bds60.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ public Bds60(short[] data) {
}
}
}

if (statusBaroRocd && statusIrsRocd) {
if (Math.abs(irsRocd - baroRocd) > 1500) {
invalidate();
return;
}
}
}

private double machToCas(double altitude) {
Expand Down
25 changes: 25 additions & 0 deletions src/test/java/aero/t2s/modes/decoder/df/DfRealMessageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,31 @@ public void test_df21_bds60_00000() throws UnknownDownlinkFormatException {
assertEquals(300.0, bds.getMagneticHeading(), 0.1);
}

@Test
public void test_df21_bds60_406ECD() throws UnknownDownlinkFormatException {
DownlinkFormat df = testMessage("A8000C98A549F33461E40552947D");

assertInstanceOf(DF21.class, df);
DF21 df21 = (DF21) df;
assertEquals("406ECD", df.getIcao()); // Military / corrupt transponder
assertEquals(5221, df21.getModeA());

assertTrue(df21.isValid());
assertInstanceOf(Bds60.class, df21.getBds());

Bds60 bds = (Bds60) df21.getBds();
assertTrue(bds.isStatusIrsRocd());
assertEquals(160, bds.getIrsRocd(), 0.1);
assertTrue(bds.isStatusBaroRocd());
assertEquals(1920, bds.getBaroRocd(), 0.1);
assertTrue(bds.isStatusIas());
assertEquals(249, bds.getIas());
assertTrue(bds.isStatusMach());
assertEquals(0.77, bds.getMach(), 0.1);
assertTrue(bds.isStatusMagneticHeading());
assertEquals(104.7, bds.getMagneticHeading(), 0.1);
}

private DownlinkFormat testMessage(String message) throws UnknownDownlinkFormatException {
Decoder decoder = new Decoder(new HashMap<>(), 50, 2, ModeSDatabase.createDatabase());

Expand Down

0 comments on commit 88c1c56

Please sign in to comment.