-
-
Notifications
You must be signed in to change notification settings - Fork 15
Label 16 (2 (Z parsing #307
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
base: master
Are you sure you want to change the base?
Label 16 (2 (Z parsing #307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for parsing Honeywell Label 16 position reports with the "(2" preamble and "(Z" suffix. The decoder extracts session IDs, coordinates, and routing information (either waypoint-based or airport-based).
Changes:
- Adds a new decoder plugin for Honeywell Label 16 messages
- Registers the new plugin in the MessageDecoder
- Exports the new plugin from the official plugins module
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/plugins/official.ts | Exports the new Label_16_Honeywell plugin |
| lib/plugins/Label_16_Honeywell.ts | Implements the Honeywell Label 16 decoder with position and routing extraction |
| lib/plugins/Label_16_Honeywell.test.ts | Provides test coverage for the three message variants and invalid input handling |
| lib/MessageDecoder.ts | Registers the Label_16_Honeywell plugin in the decoder |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WalkthroughRegisters and exports a new decoder plugin, Label_16_Honeywell, and adds its implementation and unit tests. The plugin parses Honeywell Label 16 position reports, extracting coordinates and either waypoints or departure/arrival airports. Changes
Sequence Diagram(s)(No sequence diagram generated — change is a new plugin implementation without multi-component sequential flow requiring visualization.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@lib/plugins/Label_16_Honeywell.ts`:
- Around line 18-76: In decode (method decode in Label_16_Honeywell.ts) add
strict length and format guards before slicing the payload: validate
message.text has the expected minimal length and that between (the substring
between "(2" and "(Z") is long enough for each planned substring index (e.g.,
session id, coordinate slice between.substring(4,17), indices 17-28, and the
trailing 2 chars); catch and handle exceptions from
CoordinateUtils.decodeStringCoordinatesDecimalMinutes and treat any parse error
as a failed decode by setting decodeResult.decoded = false and
decodeResult.decoder.decodeLevel = "none" (and log when options.debug), and
ensure ResultFormatter.* calls only run when the guards pass so malformed/short
payloads do not throw or leave the result marked as decoded.
🧹 Nitpick comments (1)
lib/plugins/Label_16_Honeywell.test.ts (1)
22-66: Consider passinglabel: "16"in test messages for realism.
This keeps tests aligned with MessageDecoder usage and future-proofs ifMessagebecomes stricter.♻️ Proposed refactor
describe("Label_16_Honeywell", () => { let plugin: Label_16_Honeywell; + const decode = (text: string) => plugin.decode({ label: "16", text }); beforeEach(() => { const decoder = new MessageDecoder(); plugin = new Label_16_Honeywell(decoder); }); @@ test("decodes variant 1", () => { const text = "(2AAABN39211W 77144KTEBMMTO-/A(Z"; - const decodeResult = plugin.decode({ text: text }); + const decodeResult = decode(text); @@ test("decodes variant 2", () => { const text = "(2AAAAN37265W 78334-SSI /O(Z"; - const decodeResult = plugin.decode({ text: text }); + const decodeResult = decode(text); @@ test("decodes variant 3", () => { const text = "(2AAABN37197W 78404-SLOJOGRONK/O(Z"; - const decodeResult = plugin.decode({ text: text }); + const decodeResult = decode(text); @@ test("does not decode <invalid>", () => { const text = "(2 Bogus message"; - const decodeResult = plugin.decode({ text: text }); + const decodeResult = decode(text);
Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.