[fix](trx-client): default spectrum guard ratio to 0.92

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-02 20:05:59 +01:00
parent 50f8c12487
commit 49f0de75f0
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -257,7 +257,7 @@ impl Default for HttpFrontendConfig {
default_rig_id: None,
initial_map_zoom: 10,
spectrum_coverage_margin_hz: 50_000,
spectrum_usable_span_ratio: 1.0,
spectrum_usable_span_ratio: 0.92,
show_sdr_gain_control: true,
auth: HttpAuthConfig::default(),
}
@@ -477,7 +477,7 @@ impl ClientConfig {
default_rig_id: Some("hf".to_string()),
initial_map_zoom: 10,
spectrum_coverage_margin_hz: 50_000,
spectrum_usable_span_ratio: 1.0,
spectrum_usable_span_ratio: 0.92,
show_sdr_gain_control: true,
auth: HttpAuthConfig {
enabled: false,
@@ -579,7 +579,7 @@ mod tests {
assert_eq!(config.frontends.http.port, 8080);
assert_eq!(config.frontends.http.initial_map_zoom, 10);
assert_eq!(config.frontends.http.spectrum_coverage_margin_hz, 50_000);
assert_eq!(config.frontends.http.spectrum_usable_span_ratio, 1.0);
assert_eq!(config.frontends.http.spectrum_usable_span_ratio, 0.92);
assert_eq!(config.frontends.rigctl.port, 4532);
assert!(config.frontends.http_json.enabled);
assert_eq!(config.frontends.http_json.port, 0);
+1 -1
View File
@@ -214,7 +214,7 @@ impl FrontendRuntimeContext {
http_show_sdr_gain_control: true,
http_initial_map_zoom: 10,
http_spectrum_coverage_margin_hz: 50_000,
http_spectrum_usable_span_ratio: 1.0,
http_spectrum_usable_span_ratio: 0.92,
remote_active_rig_id: Arc::new(Mutex::new(None)),
remote_rigs: Arc::new(Mutex::new(Vec::new())),
owner_callsign: None,
@@ -1167,7 +1167,7 @@ function effectiveSpectrumCoverageSpanHz(sampleRateHz) {
const sampleRate = Number(sampleRateHz);
if (!Number.isFinite(sampleRate) || sampleRate <= 0) return 0;
// Keep a guard band at the spectrum edges; practical usable span is slightly smaller.
const ratio = Number.isFinite(spectrumUsableSpanRatio) ? spectrumUsableSpanRatio : 1.0;
const ratio = Number.isFinite(spectrumUsableSpanRatio) ? spectrumUsableSpanRatio : 0.92;
return sampleRate * Math.max(0.01, Math.min(1.0, ratio));
}
@@ -1652,7 +1652,7 @@ let serverLat = null;
let serverLon = null;
let initialMapZoom = 10;
let spectrumCoverageMarginHz = 50_000;
let spectrumUsableSpanRatio = 1.0;
let spectrumUsableSpanRatio = 0.92;
function updateFooterBuildInfo() {
const serverEl = document.getElementById("footer-server-build");