[fix](trx-rs): fix LRPT pass detection status never updating during active decoding
The #sat-status element was stuck on "Waiting for satellite pass" because: 1. The client audio handler (audio_client.rs) did not include AUDIO_MSG_LRPT_IMAGE in its message type match, so LRPT image messages from the server were silently dropped and never reached the frontend. 2. No progress was reported during active LRPT decoding — the only status update happened when a complete image was finalized, which could take the entire pass. 3. The sat-status text was never updated when the decoder was enabled/disabled, leaving it permanently at the HTML default text. Changes: - Add DecodedMessage::LrptProgress variant for live MCU progress reporting - Send LRPT progress updates from the decoder task when new MCUs are decoded - Add AUDIO_MSG_LRPT_IMAGE and AUDIO_MSG_LRPT_PROGRESS to client audio handler - Update sat-status text when decoder state changes (enabled/disabled) - Handle lrpt_progress messages in the frontend to show "Receiving — N MCU rows" https://claude.ai/code/session_017knbD7dr6hJGAWR6pModL7 Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9134,7 +9134,8 @@ function dispatchDecodeMessage(msg, skipStats) {
|
||||
if (msg.type === "ft2" && window.onServerFt2) window.onServerFt2(msg);
|
||||
if (msg.type === "wspr" && window.onServerWspr) window.onServerWspr(msg);
|
||||
if (msg.type === "lrpt_image" && window.onServerLrptImage) window.onServerLrptImage(msg);
|
||||
if (!skipStats && msg.type && msg.type !== "lrpt_image") {
|
||||
if (msg.type === "lrpt_progress" && window.onServerLrptProgress) window.onServerLrptProgress(msg);
|
||||
if (!skipStats && msg.type && msg.type !== "lrpt_image" && msg.type !== "lrpt_progress") {
|
||||
statsRecordDecode(msg.type, msg.rig_id || msg.remote || null);
|
||||
scheduleStatsRender();
|
||||
}
|
||||
@@ -9144,7 +9145,7 @@ function dispatchDecodeBatch(batch) {
|
||||
if (!Array.isArray(batch) || batch.length === 0) return;
|
||||
// Record statistics for every message in the batch regardless of dispatch path.
|
||||
for (const msg of batch) {
|
||||
if (msg.type && msg.type !== "lrpt_image") {
|
||||
if (msg.type && msg.type !== "lrpt_image" && msg.type !== "lrpt_progress") {
|
||||
statsRecordDecode(msg.type, msg.rig_id || msg.remote || null);
|
||||
}
|
||||
}
|
||||
@@ -9231,7 +9232,7 @@ function loadDecodeHistoryOnMainThread(onReady, onError) {
|
||||
function restoreDecodeHistoryGroup(kind, messages) {
|
||||
if (!Array.isArray(messages) || messages.length === 0) return;
|
||||
// Record statistics for restored history messages.
|
||||
if (kind !== "lrpt_image") {
|
||||
if (kind !== "lrpt_image" && kind !== "lrpt_progress") {
|
||||
for (const msg of messages) {
|
||||
statsRecordDecode(kind, msg.rig_id || msg.remote || null, msg.ts_ms || undefined);
|
||||
}
|
||||
|
||||
@@ -91,6 +91,13 @@ window.updateSatLiveState = function (update) {
|
||||
_lastSatLrptOn = lrptOn;
|
||||
satDom.lrptState.textContent = lrptOn ? "Listening" : "Idle";
|
||||
satDom.lrptState.className = "sat-live-value " + (lrptOn ? "sat-state-listening" : "sat-state-idle");
|
||||
if (satDom.status) {
|
||||
if (lrptOn) {
|
||||
satDom.status.textContent = "Decoder active \u2014 waiting for signal";
|
||||
} else {
|
||||
satDom.status.textContent = "Decoder idle";
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -233,6 +240,12 @@ function addSatImage(img, decoder) {
|
||||
}
|
||||
|
||||
// ── Server callbacks ────────────────────────────────────────────────
|
||||
window.onServerLrptProgress = function (msg) {
|
||||
if (satDom.status && msg.mcu_count > 0) {
|
||||
satDom.status.textContent = "Receiving \u2014 " + msg.mcu_count + " MCU rows decoded";
|
||||
}
|
||||
};
|
||||
|
||||
window.onServerLrptImage = function (msg) {
|
||||
if (satDom.status) satDom.status.textContent = "Image received (Meteor LRPT)";
|
||||
addSatImage(msg, "lrpt");
|
||||
|
||||
@@ -585,6 +585,7 @@ pub fn start_decode_history_collector(context: Arc<FrontendRuntimeContext>) {
|
||||
DecodedMessage::Ft2(msg) => record_ft2(&context, msg),
|
||||
DecodedMessage::Wspr(msg) => record_wspr(&context, msg),
|
||||
DecodedMessage::LrptImage(_) => {}
|
||||
DecodedMessage::LrptProgress(_) => {}
|
||||
},
|
||||
Err(broadcast::error::RecvError::Lagged(_)) => continue,
|
||||
Err(broadcast::error::RecvError::Closed) => break,
|
||||
|
||||
Reference in New Issue
Block a user