Skip to content

Add source filtering (RF vs APRS-IS) to map, station list, and packet log#9

Open
fromalexx wants to merge 15 commits into
na7q:masterfrom
fromalexx:filter-map-by-source
Open

Add source filtering (RF vs APRS-IS) to map, station list, and packet log#9
fromalexx wants to merge 15 commits into
na7q:masterfrom
fromalexx:filter-map-by-source

Conversation

@fromalexx
Copy link
Copy Markdown

@fromalexx fromalexx commented Apr 3, 2026

Add source filtering (RF vs APRS-IS) to map, station list, and packet log

Adds the ability to filter stations and packets by their source — RF (radio) or APRS-IS (internet) — across three views in the app.

Changes

Map overlay filter
Two new checkboxes in the map overlays menu (eye icon) under "APRS objects":

  • ☑ Show RF stations
  • ☑ Show APRS-IS stations

Both are checked by default. Stations received via APRS-IS are tagged with a new FLAG_IGATE bit (value 8) in the station flags column at receive time.

Station list filter
"Filter source..." option added to the ⋮ menu on the hub station list. Single-choice dialog with three options: All (default), RF only, APRS-IS only. Setting is persisted independently per view.

Packet log filter
Same "Filter source..." option added to the ⋮ menu on the packet log. When filtering to RF only, APRS-IS connection info messages are also hidden to keep the view clean. Uses a separate preference key from the station list so each view can be filtered independently.

AI Disclosure
This code change was written by AI. Again, if its low quality, feel free to reject the PR or make any edits needed.

fromalexx added 15 commits April 1, 2026 21:33
AudioBufferProcessor.java and PacketCallback.java were stored as
plain-text path pointers (Unix symlinks) which break on Windows.
Replaced with actual file contents from PacketDroid submodule.
Packets arriving via igate (TYPE_IG) were only parsed and added to the
map if the unrelated 'send my position to APRS-IS' (p.positiontois)
preference was also enabled. This meant stations heard over igate showed
in the log but never on the map unless that option was on.

Fix: parse all TYPE_IG packets unconditionally, same as TYPE_POST and
TYPE_INCMG packets.
- New checkbox in IGate settings: 'Auto-prepend GPS range filter'
- New field: GPS filter radius in km (default 100)
- When enabled, prepends r/lat/lon/radius to the custom filter string
  on login, so APRS-IS starts sending nearby traffic immediately
- While connected, re-sends #filter command over the live socket
  whenever position changes by more than 5km (no reconnect needed)
- Custom filter field still works normally; GPS filter is prepended
- Falls back gracefully if no GPS fix is available
APRS-IS protocol requires the #filter command to be sent AFTER the
server confirms login with '# logresp'. Sending it before (as part
of sendLogin()) caused the server to silently ignore it, resulting
in '# filter active' never appearing in the log and no range-based
traffic being delivered.

Fix: sendLogin() now only sends the 'user' line. A new sendFilterCommand()
is called from the message loop when '# logresp' is detected.
sendFilterUpdate() was firing on the very first incoming packet because
lastFilterLat/Lon were still 0,0. After sendFilterCommand() sends the
filter on logresp, immediately sync lastFilterLat/Lon from GPS so
shouldUpdateGpsFilter() won't trigger again until we actually move 5km.
- Add filterJustSent flag to skip shouldUpdateGpsFilter() on the same
  loop iteration that sendFilterCommand() ran, eliminating the duplicate
  '# filter active' line in the log
- Replace fixed 5km threshold with 5% of the user's configured radius
  (e.g. 200km radius -> update every 10km, 50km -> every 2.5km)
- Uses getLastKnownLocation() only, no additional GPS polling/battery use
Added check: if lastFilterLat/Lon are still 0.0/0.0, return false.
This prevents sendFilterUpdate() firing on the first server message
(aprsc banner) before sendFilterCommand() has run and set the baseline
coordinates, which was causing the duplicate filter send.
…contents"

This reverts commit 78b5dc10212813b6b059c947a25194bc0b9f49d6.
- Store FLAG_IGATE (bit 3) in station flags when packet comes from APRS-IS
- addPosition() accepts source type and sets flag accordingly
- Two new checkable menu items under the overlays (eye) menu:
  'Show RF stations' and 'Show APRS-IS stations', both default checked
- load_stations() filters by flags based on current selection
- Prefs keys: show_rf, show_is (both default true)
New 'Filter by source' menu item in the hub station list (same menu
as Sort by). Shows a single-choice dialog with All / RF only / APRS-IS
only. Uses FLAG_IGATE (bit 3) in station flags to filter. Pref key:
station_source_filter (default: all).
Reuses station_source_filter pref (shared with station list filter)
so changing the filter on one screen affects both. 'Filter source...'
menu item now visible on both hub and log screens. Log hides RF or
APRS-IS packet types while always showing info/status entries.
Station list uses 'station_source_filter', packet log uses
'log_source_filter'. Each view maintains its own independent setting.
@fromalexx fromalexx marked this pull request as ready for review April 3, 2026 14:42
@fromalexx
Copy link
Copy Markdown
Author

fromalexx commented Apr 3, 2026

And I am sorry for the confusion.. This PR includes changes from PR #8 as well. I did the first PR on my master branch without creating a new branch. So when I created this branch off my version of master it included those changes too.

@fromalexx fromalexx changed the title Add map source filtering, station list source filtering, and "My Location" button Add source filtering (RF vs APRS-IS) to map, station list, and packet log Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant