Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7d79163
Templates: narrowband where the FCC requires it; drop marine channel 70
TheAbider Oct 28, 2026
4c63623
CHIRP: keep both tones, narrowband, skip and TX off; Uniden takes the…
TheAbider Oct 28, 2026
8ae949c
RadioReference conventional channels: read DPL and NAC, honor the mode
TheAbider Oct 28, 2026
1625356
compare: report changes inside sets, systems and options
TheAbider Oct 28, 2026
475568e
JSON: export everything, import the same personality back
TheAbider Oct 28, 2026
a7809b1
compare: name the personality fields that differ
TheAbider Oct 28, 2026
528b35b
Refuse duplicate set names; merge copies systems exactly
TheAbider Oct 28, 2026
3800f34
wizard --modify adds to the file; ask before replacing an output
TheAbider Oct 28, 2026
3fbc26f
Wizard test: check the replace question was asked
TheAbider Oct 28, 2026
e9d3f89
Changelog: unreleased fixes
TheAbider Oct 28, 2026
de8ba4f
RadioReference cache: keep conventional channels, categories, color c…
TheAbider Oct 28, 2026
ecda307
Set the personality name and user in both places they are stored
TheAbider Oct 28, 2026
212829b
CSV templates: readers skip the templates' comment lines
TheAbider Oct 28, 2026
4217432
Validation: check frequencies against the XG-100P's bands
TheAbider Oct 28, 2026
5b67e69
Test: the channels template's example text changed
TheAbider Oct 28, 2026
511fb5c
INI export: keep channel flags; templates only when they match exactly
TheAbider Oct 28, 2026
2a28428
New analog channels get the values RPM gives every channel
TheAbider Oct 28, 2026
ce51e3d
Validation: no warnings for what RPM itself writes; docs
TheAbider Oct 28, 2026
acc8f2a
GUI: trunk channel edits find the channel by its index, not its row
TheAbider Oct 28, 2026
00c9b44
Renaming a set renames its references; GUI P25 and IDEN fixes
TheAbider Oct 28, 2026
3284519
GUI: the RadioReference fetch thread no longer calls Tk
TheAbider Oct 28, 2026
0c54933
QuickPRS 1.2.0
TheAbider Oct 28, 2026
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
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

All notable changes to QuickPRS will be documented in this file.

## [1.2.0] - 2026-10-28

### Fixed
- Templates: FRS, GMRS 8-14, MURS 1-3 and the public safety simplex channels were 25 kHz channels where the FCC allows 12.5 kHz or less (47 CFR 95.573, 95.1773, 95.2773, 90.209(b)(5)); they are narrowband now. Marine channel 70 carries DSC only (no voice) and is no longer in the marine template
- CHIRP export lost the TX tone of a channel whose TX and RX tones differ, turned an RX-only tone into TX and RX, ignored the RX side of DCS, always wrote FM and dropped scan-off and TX-off. It now uses CHIRP's Cross mode, NFM, Skip and Duplex off, and CHIRP import reads them all back
- The Uniden export gave the scanner the tone the radio transmits; it now gives the one the radio expects on the receive frequency
- RadioReference conventional channels: DPL codes and P25 NACs were read as CTCSS tones, and every channel went into an analog set as wide FM. FMN channels are now narrowband, P25 channels go to a P25 conventional set with their NAC, and DMR, NXDN, AM and other modes are left out and counted
- `compare` said "Files are identical" (exit code 0) when a channel's frequency, tone, name or flags, a talkgroup, a trunk TX frequency, an IDEN element, a P25 conventional channel, a system setting or a radio option had changed. It now names the changed items and their fields, and reports anything else that differs
- JSON import duplicated the default conventional set, lost P25 conventional sets and systems, the radio options, system IDs and every field without a readable key, and moved IDEN elements to other slots. An unedited export now imports to the same bytes (all 36 RPM-saved test files do)
- `merge` named every system after the first one of its class, rebuilt P25 systems from defaults (system ID 0, no home unit ID, a guessed IDEN set), left P25 conventional systems out and could add a second set under a name already in use. It now copies systems and the sets they use exactly and reports name clashes
- Adding a set under a name already used by a set of the same type is refused: systems find their sets by name
- `wizard --modify FILE` ignored FILE and built a new personality; it now adds to FILE. The wizard replaced an existing output file without asking or keeping a backup
- Renaming a set (`edit --rename-set`, the GUI) left the systems that use it naming a set that no longer existed; their references now follow the rename, as does a P25 conventional set's talkgroup set reference. A name already in use is refused
- The personality name and user name are stored twice in a file (RPM writes both copies the same); `edit --name/--author`, `fleet` and `clone-personality --name` changed only one
- `export-config` dropped narrowband, TX-off and scan-off from conventional channels (PAWSOVERMAWS's FURRY NB set came back from `build` as 25 kHz channels) and wrote `template = X` for any set with a template's frequencies, so a MURS set programmed wide would build narrowband
- The CSV files `template-csv` writes did not work: inject and fleet read their `#` comment lines as data
- The RadioReference cache dropped conventional channels, categories (the GUI's category filter) and color codes
- Validation checked frequencies against 30-960 MHz, so 220 or 900 MHz passed; it now checks the XG-100P's bands (136-174, 380-520, 762-870 MHz). It no longer warns about a trunk set and talkgroup set sharing a name, or about PTCT, RPM's default 2-position switch function: RPM writes both
- New analog channels get the values RPM writes in every channel it creates (85 in both tone address fields, the tone mode flag set); QuickPRS wrote 0, 0 and off
- GUI: with the search filtering rows, editing or moving a trunk channel changed another channel; Export to CSV on a P25 conventional set wrote an empty file; the NAC editor and IDEN set delete spliced raw sections (IDEN delete left a stale count); the RadioReference fetch thread called Tk; deleting a set now names the systems that use it

### Added
- `edit --rename-set` takes `iden` and `p25conv` sets
- Config file channel lines take an optional seventh field of flags: `nb`, `rxonly`, `noscan`
- `merge` merges P25 conventional systems

### Changed
- JSON exports carry every field of each set, channel and talkgroup (bytes as hex) and an `archive` block with the rest of the file; IDEN elements carry their slot (`index`)
- `compare` matches items by key and names the fields that changed

## [1.1.0] - 2026-10-28

### Fixed
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The GUI includes a dedicated RadioReference import wizard (File > Import Wizard)
- Comprehensive validation against XG-100P hardware limits
- File repair and data salvage for damaged PRS files
- Lossless binary roundtrip (parse and rewrite produces byte-identical output)
- 5,400+ automated tests
- 5,600+ automated tests

## Quick Start

Expand Down Expand Up @@ -252,9 +252,12 @@ template = noaa
template = interop

[channels.LOCAL]
; short_name, tx_freq, rx_freq, tx_tone, rx_tone, long_name
; short_name, tx_freq, rx_freq, tx_tone, rx_tone, long_name[, flags]
; flags: any of nb (narrowband), rxonly, noscan
1 = RPT 147,147.600,147.000,100.0,100.0,147.00+ Repeater
2 = SIMPLEX,146.520,146.520,,,2m Calling
3 = MURS 1,151.820,151.820,,,MURS 1,nb
4 = NOAA WX,162.550,162.550,,,NOAA Seattle,rxonly noscan

[options]
gps.gpsMode = ON
Expand All @@ -264,6 +267,13 @@ misc.password = 1234

Build with: `quickprs build patrol.ini -o patrol.PRS`

A config file is a recipe, not a copy: `export-config` writes what `build`
can make (systems with their IDs, frequencies and talkgroups, channels with
their tones and flags, radio options). `build` makes IDEN tables from the
frequencies and gives each system its own sets, and other settings take
their defaults. For a complete copy that imports back byte for byte, use
`export-json` and `import-json`.

## Built-in Templates

| Template | Channels | Description |
Expand Down
6 changes: 6 additions & 0 deletions docs/prs-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ been checked against RPM:
IDEN value changed would settle it.
- **Enhanced control channel (ECC) entries:** four numbers per entry; how
they map to RFSS, site and channel has not been confirmed.
- **Analog channel fields RPM always sets:** every analog channel RPM
creates, with or without tones, holds 85 in both 2-byte fields after the
tone strings (QuickPRS calls them `tx_addr` and `rx_addr`) and 1 in flag
byte 22 (`tone_mode`). QuickPRS 1.2 and later write the same in new
channels; earlier versions wrote 0, 0 and 0, and what difference that
makes on the radio is not known.

A good way to settle either: change one value in RPM, save, and compare the
two files with `quickprs compare --detail` or `quickprs dump`.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "quickprs"
version = "1.1.0"
version = "1.2.0"
description = "Generate Harris XG-100P personality files without Harris RPM"
requires-python = ">=3.8"
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion quickprs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""QuickPRS - Harris RPM Personality File Tool"""

__version__ = "1.1.0"
__version__ = "1.2.0"
10 changes: 10 additions & 0 deletions quickprs/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,16 @@ def read_cstring(data, pos):
return body.decode("latin-1"), w.pos


def write_cstring(text):
"""Encode an MFC CString (1-byte length, or 0xFF + 16-bit length)."""
raw = text.encode("latin-1", errors="replace")
if len(raw) < 0xFF:
return struct.pack("<B", len(raw)) + raw
if len(raw) < 0xFFFE:
return b"\xff" + struct.pack("<H", len(raw)) + raw
return b"\xff\xff\xff" + struct.pack("<I", len(raw)) + raw


def read_document(data, lenient=True):
"""Read PRS bytes into ``(Document, WalkReport)``.

Expand Down
121 changes: 26 additions & 95 deletions quickprs/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
local user data only.
"""

import dataclasses
import json
import logging
from pathlib import Path
from datetime import datetime

logger = logging.getLogger("quickprs")

from .radioreference import RRSystem, RRTalkgroup, RRSite, RRSiteFreq
from .radioreference import (RRSystem, RRTalkgroup, RRSite, RRSiteFreq,
ConvChannelData)


CACHE_DIR = Path.home() / '.quickprs' / 'cache'
Expand All @@ -40,52 +42,10 @@ def save_system(system, source="paste"):
filename = f"{safe_name}.json"
filepath = cache_dir / filename

data = {
'cached_at': datetime.now().isoformat(),
'source': source,
'sid': system.sid,
'name': system.name,
'system_type': system.system_type,
'sysid': system.sysid,
'wacn': system.wacn,
'nac': system.nac,
'voice': system.voice,
'city': system.city,
'state': system.state,
'county': system.county,
'talkgroups': [
{
'dec_id': tg.dec_id,
'hex_id': tg.hex_id,
'alpha_tag': tg.alpha_tag,
'description': tg.description,
'mode': tg.mode,
'encrypted': tg.encrypted,
'tag': tg.tag,
'category': tg.category,
'category_id': tg.category_id,
}
for tg in system.talkgroups
],
'sites': [
{
'site_id': site.site_id,
'site_number': site.site_number,
'name': site.name,
'rfss': site.rfss,
'nac': site.nac,
'county': getattr(site, 'county', ''),
'lat': getattr(site, 'lat', 0.0),
'lon': getattr(site, 'lon', 0.0),
'range_miles': getattr(site, 'range_miles', 0.0),
'freqs': [
{'freq': sf.freq, 'lcn': sf.lcn, 'use': sf.use}
for sf in site.freqs
],
}
for site in system.sites
],
}
# Every field of the system and the records in it (talkgroups, sites
# and their frequencies, conventional channels, categories)
data = {'cached_at': datetime.now().isoformat(), 'source': source}
data.update(dataclasses.asdict(system))

with open(filepath, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2)
Expand All @@ -98,60 +58,31 @@ def load_system(filepath):
with open(filepath, 'r', encoding='utf-8') as f:
data = json.load(f)

system = RRSystem(
sid=data.get('sid', 0),
name=data.get('name', ''),
system_type=data.get('system_type', ''),
sysid=data.get('sysid', ''),
wacn=data.get('wacn', ''),
nac=data.get('nac', ''),
voice=data.get('voice', ''),
city=data.get('city', ''),
state=data.get('state', ''),
county=data.get('county', ''),
)

system.talkgroups = [
RRTalkgroup(
dec_id=tg['dec_id'],
hex_id=tg.get('hex_id', ''),
alpha_tag=tg.get('alpha_tag', ''),
description=tg.get('description', ''),
mode=tg.get('mode', ''),
encrypted=tg.get('encrypted', 0),
tag=tg.get('tag', ''),
category=tg.get('category', ''),
category_id=tg.get('category_id', 0),
)
for tg in data.get('talkgroups', [])
]

system = _record(RRSystem, data, sid=data.get('sid', 0))
system.categories = {int(k): v
for k, v in data.get('categories', {}).items()}
system.talkgroups = [_record(RRTalkgroup, tg)
for tg in data.get('talkgroups', [])]
system.sites = [
RRSite(
site_id=site['site_id'],
site_number=site.get('site_number', ''),
name=site.get('name', ''),
rfss=site.get('rfss', 0),
nac=site.get('nac', ''),
county=site.get('county', ''),
lat=float(site.get('lat', 0.0)),
lon=float(site.get('lon', 0.0)),
range_miles=float(site.get('range_miles', 0.0)),
freqs=[
RRSiteFreq(
freq=sf['freq'],
lcn=sf.get('lcn', 0),
use=sf.get('use', ''),
)
for sf in site.get('freqs', [])
],
)
_record(RRSite, site, freqs=[_record(RRSiteFreq, sf)
for sf in site.get('freqs', [])])
for site in data.get('sites', [])
]

system.conv_channels = [_record(ConvChannelData, ch)
for ch in data.get('conv_channels', [])]
return system


def _record(cls, d, **fixed):
"""A data class from a cached dict: its own keys (others ignored,
missing ones default) plus ``fixed``."""
names = {f.name for f in dataclasses.fields(cls)}
kwargs = {k: v for k, v in d.items()
if k in names and not isinstance(v, (list, dict))}
kwargs.update(fixed)
return cls(**kwargs)


def list_cached_systems():
"""List all cached systems.

Expand Down
50 changes: 29 additions & 21 deletions quickprs/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1117,8 +1117,9 @@ def _read_csv_file(filepath):
path = Path(filepath)
if not path.exists():
raise FileNotFoundError(f"CSV file not found: {filepath}")
from .csv_import import data_lines
with open(path, 'r', encoding='utf-8-sig') as f:
reader = csv.DictReader(f)
reader = csv.DictReader(data_lines(f))
return list(reader)


Expand Down Expand Up @@ -1557,8 +1558,10 @@ def cmd_merge(target_path, source_path, include_systems=True,
"""Merge systems and channels from source PRS into target PRS.

Copies P25 trunked systems (with their trunk sets, group sets, IDEN sets)
and conventional systems (with their conv sets) from source into target.
Skips systems that already exist in target (by short name).
and conventional and P25 conventional systems (with their channel
sets) from source into target, as the source has them. Skips systems
that already exist in target (by short name) and systems naming a set
the target holds with other contents.

Args:
target_path: target PRS file path
Expand Down Expand Up @@ -1600,6 +1603,8 @@ def cmd_merge(target_path, source_path, include_systems=True,
f"{stats['conv_skipped']} skipped")
if total_added == 0 and total_skipped == 0:
print(" No systems found in source to merge.")
for line in stats['conflicts']:
print(f" Not merged: {line}")

if errors:
print(f" Validation: {len(errors)} errors", file=sys.stderr)
Expand Down Expand Up @@ -2312,17 +2317,16 @@ def cmd_edit(filepath, name=None, author=None,
filepath: input PRS file
name: new personality filename (None = don't change)
author: new saved-by field (None = don't change)
rename_set_type: set type to rename ("trunk", "group", "conv")
rename_set_type: set type to rename ("trunk", "group", "conv",
"iden", "p25conv"); systems naming the set follow the rename
rename_old: current set name
rename_new: new set name
output: output file path (default: overwrite input)

Returns:
0 on success, 1 on error.
"""
from .injector import (
edit_personality, rename_trunk_set, rename_group_set, rename_conv_set,
)
from .injector import edit_personality
from .prs_writer import write_prs

prs = parse_prs(filepath)
Expand All @@ -2337,18 +2341,19 @@ def cmd_edit(filepath, name=None, author=None,
if author is not None:
changes.append(f"author='{author}'")

# Rename set
# Rename set (and the systems' references to it)
if rename_set_type and rename_old and rename_new:
from .injector import rename_set, _SET_LISTS
rename_new = rename_new[:8]
if rename_set_type == "trunk":
renamed = rename_trunk_set(prs, rename_old, rename_new)
elif rename_set_type == "group":
renamed = rename_group_set(prs, rename_old, rename_new)
elif rename_set_type == "conv":
renamed = rename_conv_set(prs, rename_old, rename_new)
else:
print(f"Error: unknown set type '{rename_set_type}'",
file=sys.stderr)
if rename_set_type not in _SET_LISTS:
print(f"Error: unknown set type '{rename_set_type}' (use "
f"{', '.join(_SET_LISTS)})", file=sys.stderr)
return 1
try:
renamed = rename_set(prs, rename_set_type, rename_old,
rename_new)
except ValueError as e:
print(f"Error: {e}", file=sys.stderr)
return 1

if not renamed:
Expand Down Expand Up @@ -3930,8 +3935,10 @@ def cmd_template_csv(template_type, output=None):
'default_name': 'channels.csv',
'content': (
"short_name,tx_freq,rx_freq,tx_tone,rx_tone,long_name\n"
"# Example: RPT IN,147.000,147.600,100.0,100.0,"
"Repeater Input\n"
"# Example: RPT 147,147.600,147.000,100.0,100.0,"
"Repeater 147.00\n"
"# The radio transmits on the repeater's input (tx_freq)\n"
"# and receives its output (rx_freq).\n"
),
},
'units': {
Expand Down Expand Up @@ -4651,8 +4658,9 @@ def run_cli(args=None):
help="New saved-by field")
p_edit.add_argument("--rename-set", nargs=3,
metavar=("TYPE", "OLD", "NEW"),
help="Rename a set: TYPE OLD NEW "
"(TYPE: trunk, group, conv)")
help="Rename a set and the references to it: "
"TYPE OLD NEW (TYPE: trunk, group, conv, "
"iden, p25conv)")
p_edit.add_argument("-o", "--output", default=None,
help="Output file (default: overwrite input)")

Expand Down
5 changes: 3 additions & 2 deletions quickprs/cloner.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ def _set_tx_on_set(prs, set_name, enable=True):


def _set_personality_name(prs, name):
"""Set the personality name stored in the CPersonality header (the
options XML has no name attribute)."""
"""Set the personality name (stored in the CPersonality header and
again among the document fields; the options XML has no name
attribute)."""
from .injector import edit_personality
if not name.upper().endswith(".PRS"):
name = f"{name}.PRS"
Expand Down
Loading