[feat](trx-rs): remove NOAA APT decoder

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-28 23:21:32 +01:00
parent 804b0d8846
commit 0a60684e28
29 changed files with 33 additions and 1457 deletions
-1
View File
@@ -520,7 +520,6 @@ async fn async_init() -> DynResult<AppState> {
history.push_back((now, None, message));
}
}
DecodedMessage::WxsatImage(_) => {}
DecodedMessage::LrptImage(_) => {}
}
});
-1
View File
@@ -1235,7 +1235,6 @@ mod tests {
cw_auto: true,
cw_wpm: 15,
cw_tone_hz: 700,
wxsat_decode_enabled: false,
lrpt_decode_enabled: false,
filter: None,
spectrum: None,
@@ -420,6 +420,7 @@ mod tests {
ft4_decode_enabled: false,
ft2_decode_enabled: false,
wspr_decode_enabled: false,
lrpt_decode_enabled: false,
cw_auto: true,
cw_wpm: 15,
cw_tone_hz: 700,
@@ -215,7 +215,6 @@ function applyAuthRestrictions() {
"ft4-decode-toggle-btn",
"ft2-decode-toggle-btn",
"wspr-decode-toggle-btn",
"sat-decode-toggle-btn",
"lrpt-decode-toggle-btn",
"hf-aprs-decode-toggle-btn",
"cw-auto",
@@ -371,7 +370,6 @@ const _decoderToggles = {
ft2: { el: document.getElementById("ft2-decode-toggle-btn"), last: null },
wspr: { el: document.getElementById("wspr-decode-toggle-btn"), last: null },
hfAprs: { el: document.getElementById("hf-aprs-decode-toggle-btn"), last: null },
sat: { el: document.getElementById("sat-decode-toggle-btn"), last: null },
lrpt: { el: document.getElementById("lrpt-decode-toggle-btn"), last: null },
};
@@ -387,7 +385,7 @@ function syncDecoderToggle(entry, enabled, label) {
// Cached About-tab decoder status elements — avoids 8× getElementById per render().
const _aboutDecEls = [
"about-dec-ft8", "about-dec-ft4", "about-dec-ft2", "about-dec-wspr",
"about-dec-cw", "about-dec-aprs", "about-dec-sat", "about-dec-lrpt",
"about-dec-cw", "about-dec-aprs", "about-dec-lrpt",
].map((id) => ({ el: document.getElementById(id), last: null }));
function syncAboutDecoder(idx, enabled) {
@@ -3270,7 +3268,6 @@ function render(update) {
syncDecoderToggle(_decoderToggles.ft2, !!update.ft2_decode_enabled, "FT2");
syncDecoderToggle(_decoderToggles.wspr, !!update.wspr_decode_enabled, "WSPR");
syncDecoderToggle(_decoderToggles.hfAprs, !!update.hf_aprs_decode_enabled, "HF APRS");
syncDecoderToggle(_decoderToggles.sat, !!update.wxsat_decode_enabled, "NOAA APT");
syncDecoderToggle(_decoderToggles.lrpt, !!update.lrpt_decode_enabled, "Meteor LRPT");
if (window.updateSatLiveState) window.updateSatLiveState(update);
const cwAutoEl = document.getElementById("cw-auto");
@@ -3447,8 +3444,7 @@ function render(update) {
syncAboutDecoder(3, !!update.wspr_decode_enabled);
syncAboutDecoder(4, !!update.cw_decode_enabled);
syncAboutDecoder(5, !!(update.aprs_decode_enabled || update.hf_aprs_decode_enabled));
syncAboutDecoder(6, !!update.wxsat_decode_enabled);
syncAboutDecoder(7, !!update.lrpt_decode_enabled);
syncAboutDecoder(6, !!update.lrpt_decode_enabled);
// About — Integrations card
if (update.pskreporter_status) {
@@ -5717,7 +5713,7 @@ window.addSatMapOverlay = function(msg) {
mapMarkers.add(overlay);
// Build a popup for the overlay
const decoder = msg.mcu_count != null ? "Meteor LRPT" : "NOAA APT";
const decoder = "Meteor LRPT";
const satellite = msg.satellite || "Unknown";
const ts = msg.ts_ms ? new Date(msg.ts_ms).toLocaleString() : "";
overlay.bindPopup(
@@ -8632,7 +8628,6 @@ function dispatchDecodeMessage(msg) {
if (msg.type === "ft4" && window.onServerFt4) window.onServerFt4(msg);
if (msg.type === "ft2" && window.onServerFt2) window.onServerFt2(msg);
if (msg.type === "wspr" && window.onServerWspr) window.onServerWspr(msg);
if (msg.type === "wxsat_image" && window.onServerSatImage) window.onServerSatImage(msg);
if (msg.type === "lrpt_image" && window.onServerLrptImage) window.onServerLrptImage(msg);
}
@@ -577,7 +577,7 @@
<div class="plugin-item">
<strong>Weather Satellite Decoder</strong>
<div style="color:var(--text-muted); font-size:0.85rem; margin-top:0.2rem;">
Decodes NOAA APT (137 MHz FM) and Meteor-M LRPT (137 MHz QPSK) weather satellite imagery.
Decodes Meteor-M LRPT (137 MHz QPSK) weather satellite imagery.
</div>
</div>
</div>
@@ -805,7 +805,6 @@
</div>
<div id="subtab-sat" class="sub-tab-panel" style="display:none;">
<div class="ft8-controls">
<button id="sat-decode-toggle-btn" type="button">Enable NOAA APT</button>
<button id="lrpt-decode-toggle-btn" type="button">Enable Meteor LRPT</button>
<small id="sat-status" style="color:var(--text-muted);">Waiting for satellite pass</small>
</div>
@@ -818,10 +817,6 @@
<!-- Live view -->
<div id="sat-live-view">
<div class="sat-live-grid">
<div class="sat-live-card">
<span class="sat-live-label">NOAA APT</span>
<span id="sat-apt-state" class="sat-live-value sat-state-idle">Idle</span>
</div>
<div class="sat-live-card">
<span class="sat-live-label">Meteor LRPT</span>
<span id="sat-lrpt-state" class="sat-live-value sat-state-idle">Idle</span>
@@ -829,10 +824,6 @@
</div>
<div style="margin:0.5rem 0;">
<div style="color:var(--text-muted); font-size:0.82rem; line-height:1.5;">
<strong>NOAA APT</strong> &mdash; Automatic Picture Transmission from NOAA-15/18/19 (137 MHz FM).
Dual-channel visible + infrared imagery at 4160 samples/sec with telemetry-based radiometric calibration.
</div>
<div style="color:var(--text-muted); font-size:0.82rem; line-height:1.5; margin-top:0.3rem;">
<strong>Meteor-M LRPT</strong> &mdash; Low Rate Picture Transmission from Meteor-M N2-3/N2-4 (137 MHz QPSK at 72 kbps).
Multi-channel CCSDS-framed imagery (APIDs 64&ndash;69) with RGB composite output.
</div>
@@ -842,14 +833,13 @@
<!-- History view -->
<div id="sat-history-view" style="display:none;">
<div class="sat-history-controls">
<input id="sat-filter" class="ft8-filter" type="text" placeholder="Filter (e.g. NOAA-18, Meteor, APT)" />
<input id="sat-filter" class="ft8-filter" type="text" placeholder="Filter (e.g. Meteor, LRPT)" />
<select id="sat-sort" class="sat-sort-select">
<option value="newest">Newest first</option>
<option value="oldest">Oldest first</option>
</select>
<select id="sat-type-filter" class="sat-sort-select">
<option value="all">All types</option>
<option value="apt">NOAA APT only</option>
<option value="lrpt">Meteor LRPT only</option>
</select>
</div>
@@ -1091,9 +1081,6 @@
<label class="bm-label">Satellite preset
<select id="scheduler-sat-preset" class="status-input" aria-label="Satellite preset">
<option value="">— custom —</option>
<option value="NOAA 15|25338">NOAA 15 (137.620 MHz APT)</option>
<option value="NOAA 18|28654">NOAA 18 (137.9125 MHz APT)</option>
<option value="NOAA 19|33591">NOAA 19 (137.100 MHz APT)</option>
<option value="METEOR-M2 3|57166">Meteor-M2 3 (137.900 MHz LRPT)</option>
<option value="METEOR-M2-4|59051">Meteor-M2-4 (137.900 MHz LRPT)</option>
</select>
@@ -1299,7 +1286,6 @@
<tr><td>WSPR</td><td id="about-dec-wspr" class="about-status-off">Off</td></tr>
<tr><td>CW</td><td id="about-dec-cw" class="about-status-off">Off</td></tr>
<tr><td>APRS</td><td id="about-dec-aprs" class="about-status-off">Off</td></tr>
<tr><td>NOAA APT</td><td id="about-dec-sat" class="about-status-off">Off</td></tr>
<tr><td>Meteor LRPT</td><td id="about-dec-lrpt" class="about-status-off">Off</td></tr>
</table>
</div>
@@ -15,7 +15,6 @@ const satDom = {
filterInput: document.getElementById("sat-filter"),
sortSelect: document.getElementById("sat-sort"),
typeFilter: document.getElementById("sat-type-filter"),
aptState: document.getElementById("sat-apt-state"),
lrptState: document.getElementById("sat-lrpt-state"),
viewLiveBtn: document.getElementById("sat-view-live"),
viewHistoryBtn: document.getElementById("sat-view-history"),
@@ -84,16 +83,10 @@ satDom.viewHistoryBtn?.addEventListener("click", () => switchSatView("history"))
satDom.viewPredBtn?.addEventListener("click", () => switchSatView("predictions"));
// ── Live view: decoder state ────────────────────────────────────────
let _lastSatAptOn = null, _lastSatLrptOn = null;
let _lastSatLrptOn = null;
window.updateSatLiveState = function (update) {
if (!satDom.aptState || !satDom.lrptState) return;
const aptOn = !!update.wxsat_decode_enabled;
if (!satDom.lrptState) return;
const lrptOn = !!update.lrpt_decode_enabled;
if (aptOn !== _lastSatAptOn) {
_lastSatAptOn = aptOn;
satDom.aptState.textContent = aptOn ? "Listening" : "Idle";
satDom.aptState.className = "sat-live-value " + (aptOn ? "sat-state-listening" : "sat-state-idle");
}
if (lrptOn !== _lastSatLrptOn) {
_lastSatLrptOn = lrptOn;
satDom.lrptState.textContent = lrptOn ? "Listening" : "Idle";
@@ -111,11 +104,11 @@ function renderSatLatestCard() {
const img = satImageHistory[0];
const decoder = img._decoder || "unknown";
const typeName = decoder === "lrpt" ? "Meteor LRPT" : "NOAA APT";
const typeName = "Meteor LRPT";
const satellite = img.satellite || "";
const channels = img.channels || img.channel_a || "";
const lines = img.line_count || img.mcu_count || 0;
const unit = decoder === "lrpt" ? "MCU rows" : "lines";
const lines = img.mcu_count || img.line_count || 0;
const unit = "MCU rows";
const ts = img._ts || "--";
const date = img._tsMs ? new Date(img._tsMs).toLocaleDateString() : "";
@@ -143,13 +136,12 @@ function getSatFilteredHistory() {
let items = satImageHistory;
const typeVal = satDom.typeFilter ? satDom.typeFilter.value : "all";
if (typeVal === "apt") items = items.filter((i) => i._decoder === "apt");
else if (typeVal === "lrpt") items = items.filter((i) => i._decoder === "lrpt");
if (typeVal === "lrpt") items = items.filter((i) => i._decoder === "lrpt");
if (satFilterText) {
items = items.filter((i) => {
const haystack = [
i._decoder === "lrpt" ? "meteor lrpt" : "noaa apt",
"meteor lrpt",
i.satellite || "",
i.channels || "",
i.channel_a || "",
@@ -170,14 +162,14 @@ function renderSatHistoryRow(img) {
row.className = "sat-history-row";
const decoder = img._decoder || "unknown";
const typeName = decoder === "lrpt" ? "Meteor LRPT" : "NOAA APT";
const typeClass = decoder === "lrpt" ? "sat-type-lrpt" : "sat-type-apt";
const typeName = "Meteor LRPT";
const typeClass = "sat-type-lrpt";
const ts = img._ts || "--";
const date = img._tsMs ? new Date(img._tsMs).toLocaleDateString([], { month: "short", day: "numeric" }) : "";
const satellite = img.satellite || "--";
const channels = decoder === "lrpt" ? (img.channels || "--") : (img.channel_a && img.channel_b ? `A:${img.channel_a} B:${img.channel_b}` : img.channel_a || "--");
const lines = img.line_count || img.mcu_count || 0;
const unit = decoder === "lrpt" ? "MCU" : "ln";
const channels = img.channels || "--";
const lines = img.mcu_count || img.line_count || 0;
const unit = "MCU";
let link = img.path
? `<a href="${img.path}" target="_blank" style="color:var(--accent);">PNG</a>`
: "--";
@@ -241,14 +233,6 @@ function addSatImage(img, decoder) {
}
// ── Server callbacks ────────────────────────────────────────────────
window.onServerSatImage = function (msg) {
if (satDom.status) satDom.status.textContent = "Image received (NOAA APT)";
addSatImage(msg, "apt");
if (msg.geo_bounds && msg.path && window.addSatMapOverlay) {
window.addSatMapOverlay(msg);
}
};
window.onServerLrptImage = function (msg) {
if (satDom.status) satDom.status.textContent = "Image received (Meteor LRPT)";
addSatImage(msg, "lrpt");
@@ -271,16 +255,6 @@ window.pruneSatHistoryView = function () {
};
// ── Toggle buttons ──────────────────────────────────────────────────
const satDecodeToggleBtn = document.getElementById("sat-decode-toggle-btn");
satDecodeToggleBtn?.addEventListener("click", async () => {
try {
await window.takeSchedulerControlForDecoderDisable?.(satDecodeToggleBtn);
await postPath("/toggle_wxsat_decode");
} catch (e) {
console.error("SAT toggle failed", e);
}
});
const lrptDecodeToggleBtn = document.getElementById("lrpt-decode-toggle-btn");
lrptDecodeToggleBtn?.addEventListener("click", async () => {
try {
@@ -305,7 +279,6 @@ document
.getElementById("settings-clear-sat-history")
?.addEventListener("click", async () => {
try {
await postPath("/clear_wxsat_decode");
await postPath("/clear_lrpt_decode");
window.resetSatHistoryView();
} catch (e) {
@@ -4606,7 +4606,6 @@ button:focus-visible, input:focus-visible, select:focus-visible {
.sat-history-row { display: grid; grid-template-columns: 7rem 5.5rem 9rem 6rem 4.5rem 1fr; gap: 0.25rem; padding: 0.35rem 0.4rem; font-size: 0.82rem; border-bottom: 1px solid var(--border-faint, rgba(255,255,255,0.04)); }
.sat-history-row:hover { background: var(--bg-hover, rgba(255,255,255,0.02)); }
.sat-col-type { font-weight: 500; }
.sat-type-apt { color: #6ec6ff; }
.sat-type-lrpt { color: #b39ddb; }
.sat-latest-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 0.4rem; padding: 0.6rem 0.75rem; }
.sat-latest-card .sat-latest-title { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.25rem; }
@@ -1305,21 +1305,6 @@ pub async fn toggle_wspr_decode(
.await
}
#[post("/toggle_wxsat_decode")]
pub async fn toggle_wxsat_decode(
query: web::Query<RemoteQuery>,
state: web::Data<watch::Receiver<RigState>>,
rig_tx: web::Data<mpsc::Sender<RigRequest>>,
) -> Result<HttpResponse, Error> {
let enabled = state.get_ref().borrow().wxsat_decode_enabled;
send_command(
&rig_tx,
RigCommand::SetWxsatDecodeEnabled(!enabled),
query.into_inner().remote,
)
.await
}
#[post("/toggle_lrpt_decode")]
pub async fn toggle_lrpt_decode(
query: web::Query<RemoteQuery>,
@@ -1335,19 +1320,6 @@ pub async fn toggle_lrpt_decode(
.await
}
#[post("/clear_wxsat_decode")]
pub async fn clear_wxsat_decode(
query: web::Query<RemoteQuery>,
rig_tx: web::Data<mpsc::Sender<RigRequest>>,
) -> Result<HttpResponse, Error> {
send_command(
&rig_tx,
RigCommand::ResetWxsatDecoder,
query.into_inner().remote,
)
.await
}
#[post("/clear_lrpt_decode")]
pub async fn clear_lrpt_decode(
query: web::Query<RemoteQuery>,
@@ -2195,7 +2167,6 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
.service(toggle_ft4_decode)
.service(toggle_ft2_decode)
.service(toggle_wspr_decode)
.service(toggle_wxsat_decode)
.service(toggle_lrpt_decode)
.service(sat_passes)
.service(clear_ais_decode)
@@ -2207,7 +2178,6 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
.service(clear_ft4_decode)
.service(clear_ft2_decode)
.service(clear_wspr_decode)
.service(clear_wxsat_decode)
.service(clear_lrpt_decode)
.service(select_rig)
// Bookmark CRUD
@@ -2523,14 +2493,13 @@ async fn send_command_to_rig(
fn bookmark_decoder_state(
bookmark: &crate::server::bookmarks::Bookmark,
) -> (bool, bool, bool, bool, bool, bool, bool, bool) {
) -> (bool, bool, bool, bool, bool, bool, bool) {
let mut want_aprs = bookmark.mode.trim().eq_ignore_ascii_case("PKT");
let mut want_hf_aprs = false;
let mut want_ft8 = false;
let mut want_ft4 = false;
let mut want_ft2 = false;
let mut want_wspr = false;
let mut want_wxsat = false;
let mut want_lrpt = false;
for decoder in bookmark
@@ -2545,7 +2514,6 @@ fn bookmark_decoder_state(
"ft4" => want_ft4 = true,
"ft2" => want_ft2 = true,
"wspr" => want_wspr = true,
"wxsat" => want_wxsat = true,
"lrpt" => want_lrpt = true,
_ => {}
}
@@ -2558,7 +2526,6 @@ fn bookmark_decoder_state(
want_ft4,
want_ft2,
want_wspr,
want_wxsat,
want_lrpt,
)
}
@@ -2627,7 +2594,7 @@ async fn apply_selected_channel(
let Some(bookmark) = bookmark_store_map.get_for_rig(remote, bookmark_id) else {
return Ok(());
};
let (want_aprs, want_hf_aprs, want_ft8, want_ft4, want_ft2, want_wspr, want_wxsat, want_lrpt) =
let (want_aprs, want_hf_aprs, want_ft8, want_ft4, want_ft2, want_wspr, want_lrpt) =
bookmark_decoder_state(&bookmark);
let desired = [
RigCommand::SetAprsDecodeEnabled(want_aprs),
@@ -2636,7 +2603,6 @@ async fn apply_selected_channel(
RigCommand::SetFt4DecodeEnabled(want_ft4),
RigCommand::SetFt2DecodeEnabled(want_ft2),
RigCommand::SetWsprDecodeEnabled(want_wspr),
RigCommand::SetWxsatDecodeEnabled(want_wxsat),
RigCommand::SetLrptDecodeEnabled(want_lrpt),
];
for cmd in desired {
@@ -2688,7 +2654,6 @@ async fn wait_for_view(mut rx: watch::Receiver<RigState>) -> Result<RigSnapshot,
ft4_decode_enabled: state.ft4_decode_enabled,
ft2_decode_enabled: state.ft2_decode_enabled,
wspr_decode_enabled: state.wspr_decode_enabled,
wxsat_decode_enabled: state.wxsat_decode_enabled,
lrpt_decode_enabled: state.lrpt_decode_enabled,
filter: state.filter.clone(),
spectrum: None,
@@ -554,7 +554,6 @@ pub fn start_decode_history_collector(context: Arc<FrontendRuntimeContext>) {
DecodedMessage::Ft4(msg) => record_ft4(&context, msg),
DecodedMessage::Ft2(msg) => record_ft2(&context, msg),
DecodedMessage::Wspr(msg) => record_wspr(&context, msg),
DecodedMessage::WxsatImage(_) => {}
DecodedMessage::LrptImage(_) => {}
},
Err(broadcast::error::RecvError::Lagged(_)) => continue,
@@ -803,7 +803,6 @@ async fn apply_scheduler_decoders(
let mut want_ft4 = false;
let mut want_ft2 = false;
let mut want_wspr = false;
let mut want_wxsat = false;
let mut want_lrpt = false;
let mut update_from = |bm: &crate::server::bookmarks::Bookmark| {
@@ -819,7 +818,6 @@ async fn apply_scheduler_decoders(
"ft4" => want_ft4 = true,
"ft2" => want_ft2 = true,
"wspr" => want_wspr = true,
"wxsat" => want_wxsat = true,
"lrpt" => want_lrpt = true,
_ => {}
}
@@ -838,7 +836,6 @@ async fn apply_scheduler_decoders(
("FT4", RigCommand::SetFt4DecodeEnabled(want_ft4)),
("FT2", RigCommand::SetFt2DecodeEnabled(want_ft2)),
("WSPR", RigCommand::SetWsprDecodeEnabled(want_wspr)),
("WXSAT", RigCommand::SetWxsatDecodeEnabled(want_wxsat)),
("LRPT", RigCommand::SetLrptDecodeEnabled(want_lrpt)),
];
@@ -663,6 +663,7 @@ mod tests {
ft4_decode_enabled: false,
ft2_decode_enabled: false,
wspr_decode_enabled: false,
lrpt_decode_enabled: false,
cw_auto: false,
cw_wpm: 0,
cw_tone_hz: 0,