[style](trx-wxsat): apply cargo fmt formatting

https://claude.ai/code/session_01JA13DHuzuHUL4nSBBRU83f
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-28 09:35:57 +00:00
committed by Stan Grams
parent 6d0c01c6c4
commit 384e1597f6
5 changed files with 23 additions and 21 deletions
+1 -2
View File
@@ -64,8 +64,7 @@ impl QpskDemod {
for &s in samples {
// Mix with NCO to remove carrier offset
let lo =
Complex::new(self.nco_phase.cos() as f32, (-self.nco_phase.sin()) as f32);
let lo = Complex::new(self.nco_phase.cos() as f32, (-self.nco_phase.sin()) as f32);
let mixed = Complex::new(s, 0.0) * lo;
// Symbol timing via Gardner TED
+1 -7
View File
@@ -55,7 +55,6 @@ impl ChannelBuffer {
self.cursor += data.len();
self.lines = (self.cursor / LINE_WIDTH as usize) as u32;
}
}
/// Assembles decoded MCU blocks from multiple APIDs into a composite image.
@@ -145,12 +144,7 @@ impl ChannelAssembler {
}
// Determine the maximum number of complete lines across channels
let max_lines = self
.channels
.values()
.map(|ch| ch.lines)
.max()
.unwrap_or(0);
let max_lines = self.channels.values().map(|ch| ch.lines).max().unwrap_or(0);
if max_lines == 0 {
return None;
+17 -5
View File
@@ -117,12 +117,22 @@ impl AptDecoder {
}
(tf.satellite, tf.sensor_a, tf.sensor_b)
} else {
(Satellite::Unknown, SensorChannel::Unknown, SensorChannel::Unknown)
(
Satellite::Unknown,
SensorChannel::Unknown,
SensorChannel::Unknown,
)
};
// Apply histogram equalisation per-channel for contrast enhancement
let mut all_a: Vec<u8> = lines.iter().flat_map(|l| l.pixels_a.iter().copied()).collect();
let mut all_b: Vec<u8> = lines.iter().flat_map(|l| l.pixels_b.iter().copied()).collect();
let mut all_a: Vec<u8> = lines
.iter()
.flat_map(|l| l.pixels_a.iter().copied())
.collect();
let mut all_b: Vec<u8> = lines
.iter()
.flat_map(|l| l.pixels_b.iter().copied())
.collect();
telemetry::histogram_equalize(&mut all_a);
telemetry::histogram_equalize(&mut all_b);
@@ -130,8 +140,10 @@ impl AptDecoder {
let width_a = apt::IMAGE_A_LEN;
let width_b = apt::IMAGE_B_LEN;
for (i, line) in lines.iter_mut().enumerate() {
line.pixels_a.copy_from_slice(&all_a[i * width_a..(i + 1) * width_a]);
line.pixels_b.copy_from_slice(&all_b[i * width_b..(i + 1) * width_b]);
line.pixels_a
.copy_from_slice(&all_a[i * width_a..(i + 1) * width_a]);
line.pixels_b
.copy_from_slice(&all_b[i * width_b..(i + 1) * width_b]);
}
let png = image_enc::encode_png(&lines)?;
+2 -4
View File
@@ -10,7 +10,7 @@
//! carries the channel ID, and wedges 10-15 carry thermal calibration data.
//! Wedge 16 is the "zero modulation" reference (black body equivalent).
use super::apt::{IMAGE_A_LEN, IMAGE_B_LEN, RawLine};
use super::apt::{RawLine, IMAGE_A_LEN, IMAGE_B_LEN};
/// Lines per telemetry frame (128 lines = 16 wedges x 8 lines each).
pub const FRAME_LINES: usize = 128;
@@ -23,9 +23,7 @@ pub const NUM_WEDGES: usize = 16;
/// The 8 calibration step values defined by the APT spec (wedges 1-8).
/// These represent known modulation levels from 1/8 to 8/8 of full scale.
pub const WEDGE_STEPS: [f32; 8] = [
0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0,
];
pub const WEDGE_STEPS: [f32; 8] = [0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0];
/// NOAA AVHRR sensor channel assignments.
///
+2 -3
View File
@@ -26,11 +26,10 @@ use trx_core::audio::{
write_vchan_uuid_msg, AudioStreamInfo, AUDIO_MSG_AIS_DECODE, AUDIO_MSG_APRS_DECODE,
AUDIO_MSG_CW_DECODE, AUDIO_MSG_FT2_DECODE, AUDIO_MSG_FT4_DECODE, AUDIO_MSG_FT8_DECODE,
AUDIO_MSG_HF_APRS_DECODE, AUDIO_MSG_HISTORY_COMPRESSED, AUDIO_MSG_LRPT_IMAGE,
AUDIO_MSG_WXSAT_IMAGE,
AUDIO_MSG_RX_FRAME, AUDIO_MSG_STREAM_INFO, AUDIO_MSG_TX_FRAME, AUDIO_MSG_VCHAN_ALLOCATED,
AUDIO_MSG_VCHAN_BW, AUDIO_MSG_VCHAN_DESTROYED, AUDIO_MSG_VCHAN_FREQ, AUDIO_MSG_VCHAN_MODE,
AUDIO_MSG_VCHAN_REMOVE, AUDIO_MSG_VCHAN_SUB, AUDIO_MSG_VCHAN_UNSUB, AUDIO_MSG_VDES_DECODE,
AUDIO_MSG_WSPR_DECODE,
AUDIO_MSG_WSPR_DECODE, AUDIO_MSG_WXSAT_IMAGE,
};
use trx_core::decode::{
AisMessage, AprsPacket, CwEvent, DecodedMessage, Ft8Message, LrptImage, VdesMessage,
@@ -40,9 +39,9 @@ use trx_core::rig::state::{RigMode, RigState};
use trx_core::vchan::SharedVChanManager;
use trx_cw::CwDecoder;
use trx_ftx::Ft8Decoder;
use trx_wxsat::noaa::AptDecoder;
use trx_vdes::VdesDecoder;
use trx_wspr::WsprDecoder;
use trx_wxsat::noaa::AptDecoder;
use uuid::Uuid;
use crate::config::AudioConfig;