Improve phase trail and correlation controls

This commit is contained in:
Mikei386
2026-07-27 18:13:07 +02:00
parent 00fb59f643
commit a4fa0ceb47
13 changed files with 268 additions and 41 deletions
+9 -1
View File
@@ -1,5 +1,13 @@
// core/config.js — zentrale CONFIG + Presets + Persistenz
export function normalizeCorrelationResponseSeconds(value) {
const seconds = Number(value);
if (!Number.isFinite(seconds) || seconds <= 0) return 1.0;
if (seconds < 0.75) return 0.5;
if (seconds < 1.75) return 1.0;
return 2.5;
}
function isLoopbackHost(host) {
const h = String(host || '').trim().toLowerCase();
return h === 'localhost' || h === '127.0.0.1' || h === '::1' || h === '[::1]';
@@ -971,7 +979,7 @@ function loadConfig(opts = {}) {
const fallback = Number.isFinite(CONFIG.GONIO_DISPLAY_GAIN_DB) ? CONFIG.GONIO_DISPLAY_GAIN_DB : 0;
CONFIG.GONIO_MANUAL_GAIN_DB = Math.max(-35, Math.min(35, Math.round(fallback / 5) * 5));
}
CONFIG.CORR_RESPONSE_S = Number(CONFIG.CORR_RESPONSE_S) >= 1.75 ? 2.5 : 1.0;
CONFIG.CORR_RESPONSE_S = normalizeCorrelationResponseSeconds(CONFIG.CORR_RESPONSE_S);
const corrNegativeMarkerMode = String(CONFIG.CORR_NEGATIVE_MARKER_MODE || 'memory').toLowerCase();
CONFIG.CORR_NEGATIVE_MARKER_MODE = ['memory', 'hold', 'off'].includes(corrNegativeMarkerMode)
? corrNegativeMarkerMode