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

Allow greater diff between baro and IRS ROCD #46

Merged
merged 1 commit into from
Oct 9, 2022
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
Allow greater diff between baro and IRS ROCD
  • Loading branch information
Douglasdc3 committed Oct 9, 2022
commit 08a42c8d8524912ee5c72d2c6057e90685d712c3
2 changes: 1 addition & 1 deletion src/main/java/aero/t2s/modes/decoder/df/bds/Bds60.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Bds60(short[] data) {
}

if (statusBaroRocd && statusIrsRocd) {
if (Math.abs(irsRocd - baroRocd) > 700) {
if (Math.abs(irsRocd - baroRocd) > 1500) {
invalidate();
return;
}
Expand Down
31 changes: 29 additions & 2 deletions src/test/java/aero/t2s/modes/decoder/df/DfRealMessageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public void test_bds60() throws UnknownDownlinkFormatException {
}

@Test
public void test() throws UnknownDownlinkFormatException {
// DownlinkFormat df = testMessage("5D4CA64");
public void test_df_20_bds_40_a48e35() throws UnknownDownlinkFormatException {
DownlinkFormat df = testMessage("A00006A1E3A71D30AA014672C8DF");

assertInstanceOf(DF20.class, df);
Expand All @@ -66,6 +65,34 @@ public void test() throws UnknownDownlinkFormatException {
assertTrue(bds.isAutopilotAltitudeHold());
}


@Test
public void test_df20_bds60_800736() throws UnknownDownlinkFormatException {
DownlinkFormat df = testMessage("A0001A1FA439F534BF07FFDE1ECC");

assertInstanceOf(DF20.class, df);
DF20 df20 = (DF20) df;
assertEquals("A48E35", df.getIcao());
assertEquals(51000, df20.getAltitude().getAltitude());

assertTrue(df20.isValid());
assertInstanceOf(Bds40.class, df20.getBds());

Bds40 bds = (Bds40) df20.getBds();
assertTrue(bds.isStatusTargetSource());
assertEquals(SelectedAltitudeSource.MCP, bds.getSelectedAltitudeSource());
assertTrue(bds.isStatusMcp());
assertEquals(51008, bds.getSelectedAltitude());
assertTrue(bds.isStatusFms());
assertEquals(51008, bds.getFmsAltitude());
assertTrue(bds.isStatusBaro());
assertEquals(1013.3, bds.getBaro(), 0.1);
assertTrue(bds.isStatusMcpMode());
assertFalse(bds.isAutopilotApproach());
assertFalse(bds.isAutopilotVnav());
assertTrue(bds.isAutopilotAltitudeHold());
}

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

Expand Down