[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:
@@ -64,8 +64,7 @@ impl QpskDemod {
|
|||||||
|
|
||||||
for &s in samples {
|
for &s in samples {
|
||||||
// Mix with NCO to remove carrier offset
|
// Mix with NCO to remove carrier offset
|
||||||
let lo =
|
let lo = Complex::new(self.nco_phase.cos() as f32, (-self.nco_phase.sin()) as f32);
|
||||||
Complex::new(self.nco_phase.cos() as f32, (-self.nco_phase.sin()) as f32);
|
|
||||||
let mixed = Complex::new(s, 0.0) * lo;
|
let mixed = Complex::new(s, 0.0) * lo;
|
||||||
|
|
||||||
// Symbol timing via Gardner TED
|
// Symbol timing via Gardner TED
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ impl ChannelBuffer {
|
|||||||
self.cursor += data.len();
|
self.cursor += data.len();
|
||||||
self.lines = (self.cursor / LINE_WIDTH as usize) as u32;
|
self.lines = (self.cursor / LINE_WIDTH as usize) as u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Assembles decoded MCU blocks from multiple APIDs into a composite image.
|
/// 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
|
// Determine the maximum number of complete lines across channels
|
||||||
let max_lines = self
|
let max_lines = self.channels.values().map(|ch| ch.lines).max().unwrap_or(0);
|
||||||
.channels
|
|
||||||
.values()
|
|
||||||
.map(|ch| ch.lines)
|
|
||||||
.max()
|
|
||||||
.unwrap_or(0);
|
|
||||||
|
|
||||||
if max_lines == 0 {
|
if max_lines == 0 {
|
||||||
return None;
|
return None;
|
||||||
|
|||||||
@@ -117,12 +117,22 @@ impl AptDecoder {
|
|||||||
}
|
}
|
||||||
(tf.satellite, tf.sensor_a, tf.sensor_b)
|
(tf.satellite, tf.sensor_a, tf.sensor_b)
|
||||||
} else {
|
} else {
|
||||||
(Satellite::Unknown, SensorChannel::Unknown, SensorChannel::Unknown)
|
(
|
||||||
|
Satellite::Unknown,
|
||||||
|
SensorChannel::Unknown,
|
||||||
|
SensorChannel::Unknown,
|
||||||
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Apply histogram equalisation per-channel for contrast enhancement
|
// 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_a: Vec<u8> = lines
|
||||||
let mut all_b: Vec<u8> = lines.iter().flat_map(|l| l.pixels_b.iter().copied()).collect();
|
.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_a);
|
||||||
telemetry::histogram_equalize(&mut all_b);
|
telemetry::histogram_equalize(&mut all_b);
|
||||||
|
|
||||||
@@ -130,8 +140,10 @@ impl AptDecoder {
|
|||||||
let width_a = apt::IMAGE_A_LEN;
|
let width_a = apt::IMAGE_A_LEN;
|
||||||
let width_b = apt::IMAGE_B_LEN;
|
let width_b = apt::IMAGE_B_LEN;
|
||||||
for (i, line) in lines.iter_mut().enumerate() {
|
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_a
|
||||||
line.pixels_b.copy_from_slice(&all_b[i * width_b..(i + 1) * width_b]);
|
.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)?;
|
let png = image_enc::encode_png(&lines)?;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
//! carries the channel ID, and wedges 10-15 carry thermal calibration data.
|
//! carries the channel ID, and wedges 10-15 carry thermal calibration data.
|
||||||
//! Wedge 16 is the "zero modulation" reference (black body equivalent).
|
//! 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).
|
/// Lines per telemetry frame (128 lines = 16 wedges x 8 lines each).
|
||||||
pub const FRAME_LINES: usize = 128;
|
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).
|
/// 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.
|
/// These represent known modulation levels from 1/8 to 8/8 of full scale.
|
||||||
pub const WEDGE_STEPS: [f32; 8] = [
|
pub const WEDGE_STEPS: [f32; 8] = [0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0];
|
||||||
0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0,
|
|
||||||
];
|
|
||||||
|
|
||||||
/// NOAA AVHRR sensor channel assignments.
|
/// NOAA AVHRR sensor channel assignments.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -26,11 +26,10 @@ use trx_core::audio::{
|
|||||||
write_vchan_uuid_msg, AudioStreamInfo, AUDIO_MSG_AIS_DECODE, AUDIO_MSG_APRS_DECODE,
|
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_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_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_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_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_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::{
|
use trx_core::decode::{
|
||||||
AisMessage, AprsPacket, CwEvent, DecodedMessage, Ft8Message, LrptImage, VdesMessage,
|
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_core::vchan::SharedVChanManager;
|
||||||
use trx_cw::CwDecoder;
|
use trx_cw::CwDecoder;
|
||||||
use trx_ftx::Ft8Decoder;
|
use trx_ftx::Ft8Decoder;
|
||||||
use trx_wxsat::noaa::AptDecoder;
|
|
||||||
use trx_vdes::VdesDecoder;
|
use trx_vdes::VdesDecoder;
|
||||||
use trx_wspr::WsprDecoder;
|
use trx_wspr::WsprDecoder;
|
||||||
|
use trx_wxsat::noaa::AptDecoder;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::config::AudioConfig;
|
use crate::config::AudioConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user