Skip to content

GUI import fixes from an audit; File > Open in RPM - #10

Merged
TheAbider merged 12 commits into
masterfrom
gui-import-fixes
Nov 2, 2026
Merged

TheAbider merged 12 commits into
masterfrom
gui-import-fixes

Conversation

@TheAbider

@TheAbider TheAbider commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Fixes from a bug audit of the GUI parts that hadn't had one: the RadioReference paste and API panel, the Import Wizard, the System Wizard, the P25 System Database dialog, the hex viewer and the calculator. Every finding was reproduced against the code before it was fixed. It also adds File > Open in RPM.

What was wrong

  • A failed import left half a system. add_p25_trunked_system and add_conv_system appended the system before adding its sets. A set name already taken, for example a WACN-named IDEN set, left the system without its sets. The GUI showed the error but kept the partial system, unmarked, for Save to write.
    • Adding a system is now all or nothing (all_or_nothing, also used by add_rr_conv_channels).
    • Every GUI import rolls back to the state before it on failure (app.roll_back()) and says nothing was added.
  • WACN 0, WAN entry named after the WACN (paste and API tab). A second system on the same WACN got no WAN entry. RPM's files name each entry after its system and store the WACN; PAWSOVERMAWS has five systems on BEE00. The panel now does the same.
  • Talkgroup rows became conventional channels. Any line whose first column read as 25–1300 counted as a frequency, so talkgroups 800 and 801 became channels at 800 and 801 MHz, inside the radio's band. They were pre-ticked and injected with TX on.
    • A frequency now needs its decimal point.
    • A pasted page's conventional channels come only from its conventional tables.
  • A second system on the same band failed in the System Wizard and P25 System Database ("IDEN set '8TDMA' already exists"). A new iden_set_for_template shares a matching IDEN set or numbers the name; the Import Wizard's database tab uses it too.
  • Settings ignored: home unit ID 0 and all system flags off in the System Wizard and P25 System Database, and unit 0 in the Import Wizard's database tab. The System Wizard also skipped the unverified-ID warning.
  • Import Wizard:
    • templates dropped their TX, scan and narrowband flags: NOAA came in transmitting, FRS and MURS wide
    • a QuickPRS talkgroup CSV's sets were merged into one, with TX off and scan on for every group
    • trunk and P25 conventional CSVs couldn't be imported at all
    • the clipboard tab's Import used the last preview, not the text box
  • CONV_SET.csv dropped TX, RX, scan and narrowband (export-csv, import-csv, the wizard): a receive-only channel came back transmitting. It has Y/N columns now, after the old ones. Old files import as before, and in a file without TxFreq/RxFreq columns, "TX" and "RX" are still read as the frequencies.
  • System Wizard: Back lost typed text. Lines it couldn't read were dropped silently: 851.0125c, 851.5125,c, MHz, tab-separated pairs and talkgroups. They now read, and the review lists any line left out.
  • Two from the audit's "suspected" list, confirmed:
    • An 800 MHz system's band limits were 767–858 MHz, leaving out its channels above 858 MHz (800 MHz downlinks run to 869.9875 MHz). In RPM's own file, 8 of 9 systems carry 136–870 MHz, including PSERN with channels to 860.7 MHz; QuickPRS now does the same. The old unit test asserted the wrong limits.
    • The System Wizard read System ID and WACN as decimal. RadioReference's "Sysid: 3AB" was refused, and an all-digit hex ID like 892 silently became decimal 892. Both are hex now, labeled, and checked to 12 and 20 bits.
  • Smaller fixes:
    • the API tab counted untagged talkgroups as selected but dropped them
    • imports with only talkgroups or only frequencies named a set they never made, which validation then flagged
    • hex viewer: the ASCII click picked the byte before, the last line was misaligned, and Next highlighted the wrong length
    • the calculator kept a stale pair after bad input and offered 1.25 m and 33 cm pairs, which the XG-100P can't tune (a hardware limit)

Added

  • File > Open in RPM. Finds RPM through Windows' .PRS association or RPM's default folder. It saves changes first, asks before handing over a file that fails validation, and starts RPM with the file.

Tests

  • 5,784 passed, 5 skipped.
  • New: tests/test_all_or_nothing.py, tests/test_gui_imports.py, tests/test_csv_conv_flags.py, tests/test_gui_tools.py, tests/test_rpm.py, plus additions to test_gui_smoke.py and test_radioreference.py.
  • Each fix was checked against deliberately broken versions of its code (75 in all); every one fails a test.
  • A redundant check (talkgroup/site table tracking, which the decimal-point rule already covers) was removed rather than kept untested.

Open question, written down rather than guessed

RPM's IDEN sets for 700/800 networks hold both bands in four slots: 800 FDMA, 700 FDMA, 800 TDMA, 700 TDMA. QuickPRS's templates cover only the band of the first frequency. The right fix depends on whether the radio uses the programmed slot numbers, so docs/prs-format.md now lists it with a check to do in RPM.

add_p25_trunked_system and add_conv_system appended the system before
adding its sets, so a set name already taken left the system behind
without them; add_rr_conv_channels could leave the analog system when
the P25 set failed. They now put the personality back when any part
fails. The GUI's import paths (paste and API panel, Import Wizard, P25
System Database, System Wizard) showed the error but kept whatever had
gone in, unmarked, for Save to write; they now roll back to the state
before the import and say nothing was added.
…untagged TGs

- The WAN entry was named after the WACN and held WACN 0, so a second
  system on the same WACN got no WAN entry at all. Like RPM's files, the
  entry is now named after the system and holds the WACN (hex, as
  RadioReference gives it), for the paste and the API tab alike.
- A talkgroup-only or frequency-only import named a trunk or talkgroup
  set it never made, which validation then reported as missing.
- The API tab counted talkgroups without a service tag as selected but
  left them out of the import; they have no box to uncheck and are kept.
Any line whose first column read as a number from 25 to 1300 became a
conventional channel, so talkgroups 800 and 801 turned into channels at
800 and 801 MHz (inside the radio's band, so validation said nothing)
and the paste panel injected them, ticked, with TX on. Bare frequency
lines on a trunked page went in both as trunk frequencies and as
channels. A frequency now needs its decimal point, and a pasted page's
conventional channels come only from its conventional tables (the
"Frequency  License  Type  Tone ..." header).
- A second system on the same band and phase (PSERN, then WSP) failed:
  the System Wizard and the database dialog always made the standard
  IDEN set under its default name. They now share a set already in the
  personality with the template's entries, as RPM's files do, and number
  the name when a set with other entries has it (iden_set_for_template,
  also used by the Import Wizard's database tab).
- Both wrote home unit ID 0 and all system flags off whatever Settings
  said; the Import Wizard's database tab wrote unit 0. They now apply
  the home unit ID and the system flags from Settings.
- The System Wizard did not warn before adding a database system whose
  IDs are unverified, as the other paths do.
- Back on the frequency or talkgroup step lost what was typed.
- Lines the wizard could not read were dropped without a word: control
  channel marks (851.0125c, "851.5125,c"), "MHz", tab-separated pairs and
  tab-separated talkgroups now read, and the review lists the lines left
  out. It no longer lists empty trunk and talkgroup sets it never makes.
- Templates went in with only names, frequencies and tones: NOAA came
  in transmitting and FRS and MURS wide. Every field a template gives is
  passed on now.
- A QuickPRS talkgroup CSV's sets were merged into one, with TX off and
  scan on for every talkgroup, and trunk and P25 conventional CSVs could
  not be imported ("No importable data"). Each set now goes in as it is,
  under its own name (a lone set can be renamed); when one cannot, none
  do.
- Import on the clipboard tab imported the last preview, not the text in
  the box.
- CONV_SET.csv (export-csv, import-csv, the wizard) had no TX, RX, scan
  or narrowband column, so a receive-only channel came back transmitting
  and a narrowband one wide. The columns (Y/N) now follow the old ones;
  files without them import as before, and where a file has no TxFreq or
  RxFreq column, TX and RX are still read as the frequencies.
- Hex viewer: a click on the ASCII column picked the byte before (and
  the first character did nothing); the last, short line's ASCII column
  started one or two characters later than the others; Next highlighted
  a length worked out again from the search box ("0x41 0x42" as four
  bytes, or whatever had been typed since).
- Repeater calculator: after an invalid entry, Add still added the pair
  from before; and it offered to add 1.25 m and 33 cm pairs, which the
  XG-100P cannot tune (136-174, 380-520, 762-870 MHz). The form's edited
  frequencies are checked too.
QuickPRS cannot write a radio yet; RPM does. Open in RPM hands the
personality to Harris RPM, ready to write: it finds RPM through
Windows' .PRS association (when that is RPM's) or RPM's install folder,
saves changes first (RPM reads the file on disk), asks before handing
over a file that fails validation, and starts RPM with the file as
Explorer would.
detect_band_limits narrowed any 700/800 MHz system to 767-858 MHz, so a
system with channels above 858 MHz (800 MHz downlinks run to 869.9875)
got band limits that left them out; its test asserted exactly that. RPM
writes 136-870 MHz for nearly every system, 800 MHz ones among them
(PSERN, with channels up to 860.7 MHz), and so does QuickPRS now.
The boxes were read as decimal: RadioReference's "Sysid: 3AB" was
refused, and an all-digit hex ID such as 892 went in as 892 instead of
0x892, silently. They are hex now (labeled, database systems shown in
hex, the review shows hex and decimal), limited to 12 and 20 bits.
RPM's IDEN sets for 700/800 MHz networks hold both bands (the same four
slots in both RPM-saved examples); QuickPRS's templates cover the band of
a system's first frequency. How the radio uses the slots decides the fix,
so it is written down with an RPM check rather than guessed.
The preview said 6.25 kHz for a Phase II system while the IDEN set it
writes (like every TDMA entry RPM saves) uses 12.5 kHz carriers.
@TheAbider
TheAbider merged commit 92e3aab into master Nov 2, 2026
4 checks passed
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