diff --git a/src/decoders/trx-wxsat/src/lrpt/demod.rs b/src/decoders/trx-wxsat/src/lrpt/demod.rs index a90c8dd..3e0888f 100644 --- a/src/decoders/trx-wxsat/src/lrpt/demod.rs +++ b/src/decoders/trx-wxsat/src/lrpt/demod.rs @@ -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 diff --git a/src/decoders/trx-wxsat/src/lrpt/mcu.rs b/src/decoders/trx-wxsat/src/lrpt/mcu.rs index 70ba19a..eb58cd6 100644 --- a/src/decoders/trx-wxsat/src/lrpt/mcu.rs +++ b/src/decoders/trx-wxsat/src/lrpt/mcu.rs @@ -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; diff --git a/src/decoders/trx-wxsat/src/noaa/mod.rs b/src/decoders/trx-wxsat/src/noaa/mod.rs index 7663091..b1908f4 100644 --- a/src/decoders/trx-wxsat/src/noaa/mod.rs +++ b/src/decoders/trx-wxsat/src/noaa/mod.rs @@ -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 = lines.iter().flat_map(|l| l.pixels_a.iter().copied()).collect(); - let mut all_b: Vec = lines.iter().flat_map(|l| l.pixels_b.iter().copied()).collect(); + let mut all_a: Vec = lines + .iter() + .flat_map(|l| l.pixels_a.iter().copied()) + .collect(); + let mut all_b: Vec = 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)?; diff --git a/src/decoders/trx-wxsat/src/noaa/telemetry.rs b/src/decoders/trx-wxsat/src/noaa/telemetry.rs index 247e4e6..316f9a6 100644 --- a/src/decoders/trx-wxsat/src/noaa/telemetry.rs +++ b/src/decoders/trx-wxsat/src/noaa/telemetry.rs @@ -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. /// diff --git a/src/trx-server/src/audio.rs b/src/trx-server/src/audio.rs index 036ae01..7e2b06c 100644 --- a/src/trx-server/src/audio.rs +++ b/src/trx-server/src/audio.rs @@ -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;