mirror of
https://github.com/db9979/uconsole_asw_game.git
synced 2026-12-05 12:24:25 +01:00
Web active-sonar fit; depth/range pointer readout on BT and weather profiles
- Web ACTIVE page: the PPI canvas sat in a grid row without a definite height, so height:auto took the bitmap height (CSS size x device pixel ratio) and grew past its cell on every redraw, clipping the circle at the bottom. The canvas now fills a minmax(0, 1fr) row; the stacked narrow layout keeps its fixed height. - BT environment page (web and uConsole): the pointer shows a depth guide with depth, interpolated sound speed and above/below the layer; the web plot also labels the layer, the seabed and the sound-speed minimum. - Weather/sonar analysis (key 0, web and uConsole): over the profile the pointer reads depth and sound speed, over the sound-path section range, depth and sound speed plus shadow zone / convergence zone. - Display only, from the operator's own BT measurement; shared native helper src/ui/profile_cursor.py. Manual EN/DE updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
42bc571c61
commit
e57f5708a4
16 files changed
+366
-15
No files matched your search
+144
-4
@@ -228,7 +228,7 @@
|
||||
let sonarAudioGeneration = 0;
|
||||
const detachedSonarScope = new URLSearchParams(location.search).get("scope");
|
||||
const sonarScopeNames = new Set(["broadband", "lofar", "demon", "tma", "environment", "active"]);
|
||||
const sonarDisplay = {black: 0, contrast: 2.5, history: 300, palette: "green", demonCursor: null};
|
||||
const sonarDisplay = {black: 0, contrast: 2.5, history: 300, palette: "green", demonCursor: null, btCursorDepth: null};
|
||||
const sonarHistory = {context: null, broadband: new Map(), lofar: new Map(), demon: new Map()};
|
||||
const sonarStream = {socket: null, connected: false, retry: null, generation: 0,
|
||||
sequence: -1, lofarSpectrum: [], demonSpectrum: []};
|
||||
@@ -1239,14 +1239,59 @@
|
||||
drawWeatherProfile(p);
|
||||
}
|
||||
|
||||
// Sound speed at a depth, linearly interpolated from a measured profile.
|
||||
function profileSpeedAt(depths, speeds, depth) {
|
||||
if (!depths.length) return null;
|
||||
if (depth <= depths[0]) return speeds[0];
|
||||
for (let index = 1; index < depths.length; index++) {
|
||||
if (depth <= depths[index]) {
|
||||
const upper = depths[index - 1], lower = depths[index];
|
||||
const share = lower > upper ? (depth - upper) / (lower - upper) : 0;
|
||||
return speeds[index - 1] + share * (speeds[index] - speeds[index - 1]);
|
||||
}
|
||||
}
|
||||
return speeds[speeds.length - 1];
|
||||
}
|
||||
|
||||
// Pointer position over the weather profile (CSS px), or null.
|
||||
let weatherCursor = null;
|
||||
|
||||
function weatherProfileGeometry(p, width, height) {
|
||||
const depthMax = Math.max(1, p.depths_m[p.depths_m.length - 1]);
|
||||
const top = 18, bottom = height - 18, leftW = Math.max(90, width * .26);
|
||||
const sx = leftW + 6, sw = width - sx - 4;
|
||||
return {depthMax, top, bottom, leftW, sx, sw};
|
||||
}
|
||||
|
||||
function weatherCursorReading(p, width, height) {
|
||||
if (!weatherCursor || !p) return null;
|
||||
const {depthMax, top, bottom, leftW, sx, sw} = weatherProfileGeometry(p, width, height);
|
||||
const {x, y} = weatherCursor;
|
||||
if (y < top || y > bottom || x < 4 || x > width - 4) return null;
|
||||
const depth = (y - top) / (bottom - top) * depthMax;
|
||||
const speed = profileSpeedAt(p.depths_m, p.speeds_m_s, depth);
|
||||
if (x <= leftW) {
|
||||
return {x: null, y, text: t("weather_cursor_depth", {depth: number(depth, 0), speed: number(speed, 1)})};
|
||||
}
|
||||
if (x < sx) return null;
|
||||
const range = (x - sx) / sw * p.range_nm;
|
||||
const parts = [t("weather_cursor_section", {range: number(range, 1), depth: number(depth, 0), speed: number(speed, 1)})];
|
||||
const column = Math.min(p.shadow.length - 1, Math.floor(range / p.range_nm * p.shadow.length));
|
||||
let row = -1;
|
||||
for (let index = 0; index + 1 < p.depth_edges_m.length; index++)
|
||||
if (depth >= p.depth_edges_m[index] && depth < p.depth_edges_m[index + 1]) row = index;
|
||||
if (column >= 0 && row >= 0 && p.shadow[column]?.[row]) parts.push(t("weather_cursor_shadow"));
|
||||
if (p.cz_bands_nm.some(([low, high]) => range >= low && range <= high)) parts.push(t("weather_cursor_cz"));
|
||||
return {x, y, text: parts.join(" · ")};
|
||||
}
|
||||
|
||||
function drawWeatherProfile(p) {
|
||||
const plot = visualContext("weather-profile");
|
||||
if (!plot) return;
|
||||
if (p === null) { drawEmpty(plot, "weather_profile_none"); return; }
|
||||
const {context, width, height} = plot;
|
||||
const colors = palette();
|
||||
const depthMax = Math.max(1, p.depths_m[p.depths_m.length - 1]);
|
||||
const top = 18, bottom = height - 18, leftW = Math.max(90, width * .26);
|
||||
const {depthMax, top, bottom, leftW} = weatherProfileGeometry(p, width, height);
|
||||
const y = (depth) => top + Math.min(1, Math.max(0, depth / depthMax)) * (bottom - top);
|
||||
const low = Math.min(...p.speeds_m_s), high = Math.max(...p.speeds_m_s, low + 1);
|
||||
context.strokeStyle = colors.line;
|
||||
@@ -1288,6 +1333,19 @@
|
||||
context.fillText(`${number(depthMax, 0)} m · ${number(low, 0)}-${number(high, 0)} m/s`, 8, height - 4);
|
||||
context.textAlign = "right";
|
||||
context.fillText(`${number(p.range_nm, 0)} NM`, width - 6, height - 4);
|
||||
const reading = weatherCursorReading(p, width, height);
|
||||
if (reading) {
|
||||
context.strokeStyle = colors.accent; context.setLineDash([2, 3]);
|
||||
context.beginPath(); context.moveTo(4, reading.y); context.lineTo(width - 4, reading.y); context.stroke();
|
||||
if (reading.x !== null) { context.beginPath(); context.moveTo(reading.x, top); context.lineTo(reading.x, bottom); context.stroke(); }
|
||||
context.setLineDash([]);
|
||||
const label = reading.text, labelWidth = context.measureText(label).width + 10;
|
||||
const lx = Math.min(width - labelWidth - 4, Math.max(4, (reading.x ?? leftW / 2) + 8));
|
||||
const ly = reading.y > top + 22 ? reading.y - 18 : reading.y + 6;
|
||||
context.fillStyle = colors.panel || "#07151c"; context.fillRect(lx, ly, labelWidth, 16);
|
||||
context.fillStyle = colors.accent; context.textAlign = "left";
|
||||
context.fillText(label, lx + 5, ly + 12);
|
||||
}
|
||||
}
|
||||
|
||||
function plotAxes(plot, xmax, ymax, xunit, yunit, xorigin = 0, reverseY = false) {
|
||||
@@ -1771,12 +1829,45 @@
|
||||
bt.context.fillText(`${number(min, 0)}–${number(max, 0)} m/s`, bt.width / 2, -7);
|
||||
if (finite(visual.bt.thermocline_m)) { const y = visual.bt.thermocline_m / depth * bt.height; bt.context.strokeStyle = palette().amber; bt.context.setLineDash([4, 4]); bt.context.beginPath(); bt.context.moveTo(0, y); bt.context.lineTo(bt.width, y); bt.context.stroke(); bt.context.setLineDash([]); }
|
||||
bt.context.strokeStyle = palette().blue; bt.context.beginPath();
|
||||
const speedX = (speed) => 12 + (speed - min) / (max - min) * (bt.width - 24);
|
||||
visual.bt.depths_m.forEach((value, index) => {
|
||||
const x = 12 + (visual.bt.speeds_m_s[index] - min) / (max - min) * (bt.width - 24);
|
||||
const x = speedX(visual.bt.speeds_m_s[index]);
|
||||
const y = value / depth * bt.height;
|
||||
index ? bt.context.lineTo(x, y) : bt.context.moveTo(x, y);
|
||||
});
|
||||
bt.context.stroke();
|
||||
// Labelled reference depths: layer, seabed and the sound-speed minimum.
|
||||
bt.context.textAlign = "right";
|
||||
if (finite(visual.bt.thermocline_m)) {
|
||||
bt.context.fillStyle = palette().amber;
|
||||
bt.context.fillText(t("sonar_bt_layer", {depth: number(visual.bt.thermocline_m, 0)}),
|
||||
bt.width - 4, Math.max(12, visual.bt.thermocline_m / depth * bt.height - 4));
|
||||
}
|
||||
if (finite(visual.bt.water_depth_m) && visual.bt.water_depth_m <= depth) {
|
||||
const y = visual.bt.water_depth_m / depth * bt.height;
|
||||
bt.context.strokeStyle = palette().muted; bt.context.beginPath(); bt.context.moveTo(0, y); bt.context.lineTo(bt.width, y); bt.context.stroke();
|
||||
bt.context.fillStyle = palette().muted;
|
||||
bt.context.fillText(t("sonar_bt_bottom", {depth: number(visual.bt.water_depth_m, 0)}), bt.width - 4, Math.max(12, y - 4));
|
||||
}
|
||||
const slowest = visual.bt.speeds_m_s.indexOf(min);
|
||||
if (slowest >= 0) {
|
||||
const x = speedX(min), y = visual.bt.depths_m[slowest] / depth * bt.height;
|
||||
bt.context.fillStyle = palette().blue; bt.context.beginPath(); bt.context.arc(x, y, 3.5, 0, Math.PI * 2); bt.context.fill();
|
||||
bt.context.textAlign = x < bt.width / 2 ? "left" : "right";
|
||||
bt.context.fillText(t("sonar_bt_minimum", {speed: number(min, 0), depth: number(visual.bt.depths_m[slowest], 0)}),
|
||||
x + (x < bt.width / 2 ? 8 : -8), Math.min(bt.height - 4, Math.max(12, y + 4)));
|
||||
}
|
||||
if (finite(sonarDisplay.btCursorDepth) && sonarDisplay.btCursorDepth <= depth) {
|
||||
const y = sonarDisplay.btCursorDepth / depth * bt.height;
|
||||
bt.context.strokeStyle = palette().accent; bt.context.setLineDash([2, 3]);
|
||||
bt.context.beginPath(); bt.context.moveTo(0, y); bt.context.lineTo(bt.width, y); bt.context.stroke();
|
||||
bt.context.setLineDash([]);
|
||||
if (sonarDisplay.btCursorText) {
|
||||
bt.context.fillStyle = palette().accent; bt.context.textAlign = "left";
|
||||
bt.context.fillText(sonarDisplay.btCursorText, 4, y > 16 ? y - 4 : y + 13);
|
||||
}
|
||||
}
|
||||
bt.context.textAlign = "center";
|
||||
}
|
||||
}
|
||||
const active = visualContext("sonar-active");
|
||||
@@ -5658,6 +5749,55 @@
|
||||
const x = (event.clientX - bounds.left) * canvas.clientWidth / Math.max(1, bounds.width);
|
||||
return x < area.left || x > area.left + area.width ? null : (x - area.left) / area.width * maximum;
|
||||
};
|
||||
// Environment (BT): the cursor depth reads the measured profile.
|
||||
const btReadout = (event) => {
|
||||
const canvas = $("sonar-environment"), bt = v2State?.sonar?.visualization?.bt;
|
||||
if (!bt || !bt.depths_m.length) return null;
|
||||
const bounds = canvas.getBoundingClientRect();
|
||||
const area = plotArea(canvas.clientWidth, canvas.clientHeight);
|
||||
const y = (event.clientY - bounds.top) * canvas.clientHeight / Math.max(1, bounds.height);
|
||||
if (y < area.top || y > area.top + area.height) return null;
|
||||
const maximum = Math.max(1, ...bt.depths_m);
|
||||
const depth = (y - area.top) / area.height * maximum;
|
||||
const speed = profileSpeedAt(bt.depths_m, bt.speeds_m_s, depth);
|
||||
const key = !finite(bt.thermocline_m) ? "sonar_cursor_depth"
|
||||
: depth < bt.thermocline_m ? "sonar_cursor_depth_above" : "sonar_cursor_depth_below";
|
||||
return {depth, text: t(key, {depth: number(depth, 0), speed: number(speed, 1)})};
|
||||
};
|
||||
let btRedrawQueued = false;
|
||||
const redrawBt = () => {
|
||||
if (btRedrawQueued) return;
|
||||
btRedrawQueued = true;
|
||||
requestAnimationFrame(() => { btRedrawQueued = false; if (v2State?.sonar) drawSonarVisuals(); });
|
||||
};
|
||||
$("sonar-environment").addEventListener("pointermove", (event) => {
|
||||
const reading = btReadout(event);
|
||||
sonarDisplay.btCursorDepth = reading ? reading.depth : null;
|
||||
sonarDisplay.btCursorText = reading ? reading.text : "";
|
||||
if (reading) $("sonar-cursor-readout").value = reading.text;
|
||||
redrawBt();
|
||||
});
|
||||
$("sonar-environment").addEventListener("pointerleave", () => {
|
||||
sonarDisplay.btCursorDepth = null;
|
||||
redrawBt();
|
||||
});
|
||||
let weatherRedrawQueued = false;
|
||||
const redrawWeatherProfile = () => {
|
||||
if (weatherRedrawQueued) return;
|
||||
weatherRedrawQueued = true;
|
||||
requestAnimationFrame(() => {
|
||||
weatherRedrawQueued = false;
|
||||
const profile = v2State?.weather_station?.profile;
|
||||
if ($("weather-dialog").open && profile !== undefined) drawWeatherProfile(profile);
|
||||
});
|
||||
};
|
||||
$("weather-profile").addEventListener("pointermove", (event) => {
|
||||
const canvas = $("weather-profile"), bounds = canvas.getBoundingClientRect();
|
||||
weatherCursor = {x: (event.clientX - bounds.left) * canvas.clientWidth / Math.max(1, bounds.width),
|
||||
y: (event.clientY - bounds.top) * canvas.clientHeight / Math.max(1, bounds.height)};
|
||||
redrawWeatherProfile();
|
||||
});
|
||||
$("weather-profile").addEventListener("pointerleave", () => { weatherCursor = null; redrawWeatherProfile(); });
|
||||
$("sonar-lofar").addEventListener("pointermove", (event) => {
|
||||
const hz = sonarFrequencyAt($("sonar-lofar"), event, 300);
|
||||
const visual = v2State?.sonar?.visualization?.lofar;
|
||||
|
||||
@@ -103,6 +103,9 @@ body.workstation-mode .visual-heading { padding-bottom: .2rem; }
|
||||
body.workstation-mode .visual-panel:not([hidden]) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
|
||||
body.workstation-mode #map-visual:not([hidden]) { flex-grow: 2.2; }
|
||||
body.workstation-mode .role-canvas { flex: 1; height: auto; min-height: 6rem; }
|
||||
/* A canvas with height:auto in a grid takes its bitmap height (CSS size x
|
||||
devicePixelRatio) and grows past its cell on every redraw; fill the row. */
|
||||
body.workstation-mode .sonar-active-plots > canvas { height: 100%; }
|
||||
body.workstation-mode .role-map-frame { flex: 1; height: auto; min-height: 6rem; }
|
||||
body.workstation-mode .spectrum-canvas { flex: 0 0 5rem; min-height: 5rem; }
|
||||
body.workstation-mode .sonar-band-plots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 0 0 6rem; gap: .3rem; min-height: 0; }
|
||||
@@ -181,6 +184,8 @@ body[data-sonar-scope][data-remote-role="assigned"] .sonar-plots > section:not([
|
||||
body.workstation-mode #detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
body.workstation-mode .role-canvas { height: 22rem; }
|
||||
body.workstation-mode .track-workstation .role-canvas { flex: none; height: 22rem; }
|
||||
body.workstation-mode .sonar-active-plots { grid-template-rows: auto; }
|
||||
body.workstation-mode .sonar-active-plots > canvas { height: 22rem; }
|
||||
body.workstation-mode .role-map-frame, body.workstation-mode .track-workstation .role-map-frame { flex: none; height: 22rem; }
|
||||
body.workstation-mode .spectrum-canvas, body.workstation-mode .track-workstation .spectrum-canvas { flex: none; height: 8rem; min-height: 8rem; }
|
||||
body.workstation-mode .sonar-plots[data-layout="overview"] { display: flex; flex-direction: column; }
|
||||
@@ -429,7 +434,7 @@ ul.visual-equivalent { padding-left: 1.8rem; }
|
||||
.sonar-display-controls select, .sonar-display-controls button { min-height: 1.9rem; padding: .15rem .35rem; border-radius: 0; font-size: var(--font-xs); }
|
||||
.sonar-display-controls input[type="range"], .sonar-audition-controls input[type="range"] { accent-color: var(--accent); }
|
||||
.sonar-cursor-readout { overflow: hidden; text-overflow: ellipsis; }
|
||||
.sonar-active-plots { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); flex: 1; min-height: 0; gap: .35rem; }
|
||||
.sonar-active-plots { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); grid-template-rows: minmax(0, 1fr); flex: 1; min-height: 0; gap: .35rem; }
|
||||
.sonar-active-plots > canvas { min-width: 0; min-height: 6rem; }
|
||||
.sonar-plots > section { min-width: 0; }
|
||||
.sonar-band-plots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; margin-top: .35rem; }
|
||||
|
||||
@@ -937,6 +937,12 @@
|
||||
"commander.web.sonar_cursor_idle": "CURSOR --",
|
||||
"commander.web.sonar_cursor_bearing": "PLG {bearing} Grad",
|
||||
"commander.web.sonar_cursor_frequency": "F {frequency} Hz | {strength} dB | H{harmonic}",
|
||||
"commander.web.sonar_bt_layer": "Schicht {depth} m",
|
||||
"commander.web.sonar_bt_bottom": "Grund {depth} m",
|
||||
"commander.web.sonar_bt_minimum": "c min {speed} m/s bei {depth} m",
|
||||
"commander.web.sonar_cursor_depth": "Tiefe {depth} m | {speed} m/s",
|
||||
"commander.web.sonar_cursor_depth_above": "Tiefe {depth} m | {speed} m/s | über der Schicht",
|
||||
"commander.web.sonar_cursor_depth_below": "Tiefe {depth} m | {speed} m/s | unter der Schicht",
|
||||
"commander.web.sonar_demon_cursor_first": "DEMON-Cursor A {frequency} Hz; Cursor B wählen",
|
||||
"commander.web.sonar_demon_spacing": "DEMON-Abstand {spacing} Hz | Wellenhypothese {rpm} U/min",
|
||||
"commander.web.sonar_broadband_equivalent": "Breitband-Wasserfall: {rows} Verlaufszeilen, {bins} Peilsektoren in der neuesten Zeile.",
|
||||
@@ -3589,6 +3595,13 @@
|
||||
"weather.sofar.none": "kein SOFAR-Kanal",
|
||||
"weather.sofar.depth": "SOFAR {depth} m",
|
||||
"weather.profile.layer": "SCHICHT {depth} m",
|
||||
"sonar.cursor.depth_above": "Tiefe {depth} m | {speed} m/s | über der Schicht",
|
||||
"sonar.cursor.depth_below": "Tiefe {depth} m | {speed} m/s | unter der Schicht",
|
||||
"weather.cursor.depth": "{depth} m | {speed} m/s",
|
||||
"weather.cursor.section": "{range} NM | {depth} m | {speed} m/s",
|
||||
"weather.cursor.shadow": "Schattenzone",
|
||||
"weather.cursor.cz": "Konvergenzzone",
|
||||
"weather.cursor.with_note": "{text} | {note}",
|
||||
"weather.profile.sofar": "SOFAR-ACHSE {depth} m",
|
||||
"weather.depth_value": "{depth} m",
|
||||
"weather.shadow_hint": "Rot: Schattenzone unter der Schicht - dort kann sich ein U-Boot vor dem Bugsonar verstecken",
|
||||
@@ -3671,6 +3684,10 @@
|
||||
"commander.web.weather_dip_above": "Tauchsonar über der Schicht: unter die Schicht fieren, um die Schattenzone abzudecken.",
|
||||
"commander.web.weather_shadow_hint": "Rot: Schattenzone unter der Schicht - dort kann sich ein U-Boot vor dem Bugsonar verstecken.",
|
||||
"commander.web.weather_layer_label": "SCHICHT {depth} m",
|
||||
"commander.web.weather_cursor_depth": "{depth} m | {speed} m/s",
|
||||
"commander.web.weather_cursor_section": "{range} NM | {depth} m | {speed} m/s",
|
||||
"commander.web.weather_cursor_shadow": "Schattenzone",
|
||||
"commander.web.weather_cursor_cz": "Konvergenzzone",
|
||||
"commander.web.weather_sofar_label": "SOFAR {depth} m",
|
||||
"chart.hazard_depth": "{depth} m",
|
||||
"chart.wreck_title": "Wrack (kartiert)",
|
||||
|
||||
@@ -937,6 +937,12 @@
|
||||
"commander.web.sonar_cursor_idle": "CURSOR --",
|
||||
"commander.web.sonar_cursor_bearing": "BRG {bearing} deg",
|
||||
"commander.web.sonar_cursor_frequency": "F {frequency} Hz | {strength} dB | H{harmonic}",
|
||||
"commander.web.sonar_bt_layer": "Layer {depth} m",
|
||||
"commander.web.sonar_bt_bottom": "Seabed {depth} m",
|
||||
"commander.web.sonar_bt_minimum": "c min {speed} m/s at {depth} m",
|
||||
"commander.web.sonar_cursor_depth": "Depth {depth} m | {speed} m/s",
|
||||
"commander.web.sonar_cursor_depth_above": "Depth {depth} m | {speed} m/s | above the layer",
|
||||
"commander.web.sonar_cursor_depth_below": "Depth {depth} m | {speed} m/s | below the layer",
|
||||
"commander.web.sonar_demon_cursor_first": "DEMON cursor A {frequency} Hz; select cursor B",
|
||||
"commander.web.sonar_demon_spacing": "DEMON spacing {spacing} Hz | shaft hypothesis {rpm} RPM",
|
||||
"commander.web.sonar_broadband_equivalent": "Broadband waterfall: {rows} history rows, {bins} bearing bins in the newest row.",
|
||||
@@ -3589,6 +3595,13 @@
|
||||
"weather.sofar.none": "no SOFAR channel",
|
||||
"weather.sofar.depth": "SOFAR {depth} m",
|
||||
"weather.profile.layer": "LAYER {depth} m",
|
||||
"sonar.cursor.depth_above": "Depth {depth} m | {speed} m/s | above the layer",
|
||||
"sonar.cursor.depth_below": "Depth {depth} m | {speed} m/s | below the layer",
|
||||
"weather.cursor.depth": "{depth} m | {speed} m/s",
|
||||
"weather.cursor.section": "{range} NM | {depth} m | {speed} m/s",
|
||||
"weather.cursor.shadow": "shadow zone",
|
||||
"weather.cursor.cz": "convergence zone",
|
||||
"weather.cursor.with_note": "{text} | {note}",
|
||||
"weather.profile.sofar": "SOFAR AXIS {depth} m",
|
||||
"weather.depth_value": "{depth} m",
|
||||
"weather.shadow_hint": "Red: shadow zone below the layer - a submarine can hide there from the hull sonar",
|
||||
@@ -3671,6 +3684,10 @@
|
||||
"commander.web.weather_dip_above": "Dipping sonar above the layer: lower it below to cover the shadow zone.",
|
||||
"commander.web.weather_shadow_hint": "Red: shadow zone below the layer - a submarine can hide there from the hull sonar.",
|
||||
"commander.web.weather_layer_label": "LAYER {depth} m",
|
||||
"commander.web.weather_cursor_depth": "{depth} m | {speed} m/s",
|
||||
"commander.web.weather_cursor_section": "{range} NM | {depth} m | {speed} m/s",
|
||||
"commander.web.weather_cursor_shadow": "shadow zone",
|
||||
"commander.web.weather_cursor_cz": "convergence zone",
|
||||
"commander.web.weather_sofar_label": "SOFAR {depth} m",
|
||||
"chart.hazard_depth": "{depth} m",
|
||||
"chart.wreck_title": "Wreck (charted)",
|
||||
|
||||
@@ -65,7 +65,7 @@ Die Anzeige zeigt gemessene Modulation, keine Identität. Nach einer Peilungsän
|
||||
### TMA, Umwelt und Aktiv {#sonar-tma-env}
|
||||
|
||||
- **TMA** machen Sie selbst. Die Seite zeichnet die Peilungen des gewählten Kontakts über der Zeit. Stellen Sie eine Hypothese auf: `Z`/`X` Kurs (`Umschalt`: 1 Grad), `Strg+Z`/`Strg+X` Fahrt, `Q`/`Umschalt+Q` Entfernung auf der neuesten Peilung (`Strg`: 0,2 sm). Die bernsteinfarbene Kurve zeigt die Peilungen, die diese Hypothese vorhersagt, die Punkte am Fuß die Residuen (gemessen minus vorhergesagt). Gute Hypothesen lassen die Residuen um null streuen; ein falscher Kurs, eine falsche Fahrt oder Entfernung hinterlässt einen Trend. Die Spalte zeigt RMS der Residuen, den systematischen Trend nach Mittelung, die Passung und die Beobachtbarkeit. Die Entfernung ist erst nach einer eigenen Kursänderung beobachtbar (mindestens 6 Grad, besser 30-60); ohne sie verweigert `K`. `K` übernimmt die Hypothese als TMA-Fix des Kontakts; er wird auf Kurs und Fahrt mitgekoppelt und veraltet nach 120 s, also verfeinern und erneut übernehmen, wenn Peilungen hinzukommen. Verrauschte Peilungen ergeben auch bei guter Passung eine große Entfernungsunsicherheit. Tiefe schätzt TMA nicht. Mit Bedienerassistenz Training (`F10`) wird ein automatischer Solver-Vorschlag (er braucht mindestens 4 Peilungen über 180 s) als dünne Linie gezeichnet, und `Umschalt+K` kopiert ihn in die Hypothese. Sonobojen-Peilungen gehen mit der Boje als Beobachter in den Track ein.
|
||||
- **UMWELT / FUSION** zeigt den Bathythermographen (`E`, 60 s Abklingzeit): gemessene Schichttiefe, Schallgeschwindigkeitsprofil und Konvergenzzonen, dazu den Vergleich HMS/TAS. Peilungen innerhalb 5 Grad bestätigen sich; ab 9 Grad Abweichung wird ein möglicher Geisterkontakt markiert. Die Schicht ist nicht fest: Nachmittagssonne macht sie flacher (etwa 8 m), starker Wind mischt sie über Stunden tiefer, und interne Wellen verschieben sie um einige Meter. Den BT nach einigen Stunden oder einem Wetterwechsel wiederholen. Das gemessene Profil ist die echte temperaturabhängige Schallgeschwindigkeit (Mackenzie-Gleichung) und fällt deshalb unterhalb der Schicht ab.
|
||||
- **UMWELT / FUSION** zeigt den Bathythermographen (`E`, 60 s Abklingzeit): gemessene Schichttiefe, Schallgeschwindigkeitsprofil und Konvergenzzonen, dazu den Vergleich HMS/TAS. Peilungen innerhalb 5 Grad bestätigen sich; ab 9 Grad Abweichung wird ein möglicher Geisterkontakt markiert. Die Schicht ist nicht fest: Nachmittagssonne macht sie flacher (etwa 8 m), starker Wind mischt sie über Stunden tiefer, und interne Wellen verschieben sie um einige Meter. Den BT nach einigen Stunden oder einem Wetterwechsel wiederholen. Das gemessene Profil ist die echte temperaturabhängige Schallgeschwindigkeit (Mackenzie-Gleichung) und fällt deshalb unterhalb der Schicht ab. Mit der Maus über dem Profil lesen Sie die genaue Tiefe, die dortige Schallgeschwindigkeit und ob die Tiefe über oder unter der Schicht liegt (uConsole und Web). Im Web-Client beschriftet die Grafik zusätzlich Schicht, Meeresgrund und das Schallgeschwindigkeitsminimum.
|
||||
- **ACTIVE** listet die Echos der letzten 120 s: Peilung, Entfernung und Tiefe (+/-12 m). Ein Ping-Fix veraltet nach 120 s. `W` wählt den Puls: **CW** (1-s-Ton) misst die Entfernung grob (etwa 0,1-0,3 sm), trennt aber über den Doppler ein bewegtes Ziel vom Nachhall des Meeresbodens; **LFM** (100-Hz-Sweep) misst die Entfernung auf wenige Meter und gewinnt 20 dB gegen Rauschen, ein langsames oder stehendes Ziel bleibt aber im Nachhall. Die Echostärke hängt vom Aspekt (breitseits etwa 15 dB stärker als von vorn) und der Größe des Ziels ab. Felsgrund hallt viel stärker nach als Schlick; kartierte Wracks liefern echte Echos ohne zugehörigen Kontakt ("nicht zugeordnetes Echo").
|
||||
- **Das Echo hören:** Jede Rückkehr ist hörbar, sobald sie eintrifft, nach ihrer echten Laufzeit hin und zurück (etwa 2,5 s je Seemeile Entfernung), für das Schiffssonar ebenso wie für das Tauchsonar des Helikopters. Ein CW-Echo ist ein weicher Ton auf der Trägerfrequenz, ein LFM-Echo ein kurzer Sweep; maßgeblich ist der Puls, mit dem gepingt wurde. Ein starkes Echo hebt sich deutlich ab, ein schwaches steigt kaum aus dem Nachhallrauschen. Im Remote-Crew-Browser klingt das Echo über den allgemeinen Ton (laut oder leise).
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ The display shows measured modulation, not identity. After changing the bearing
|
||||
### TMA, environment and active {#sonar-tma-env}
|
||||
|
||||
- **TMA** is yours. The page plots the bearings of the selected contact over time. Build a hypothesis: `Z`/`X` course (`Shift`: 1 degree), `Ctrl+Z`/`Ctrl+X` speed, `Q`/`Shift+Q` range on the newest bearing (`Ctrl`: 0.2 NM). The amber curve shows the bearings that hypothesis predicts, the dots at the foot the residuals (measured minus predicted). Good hypotheses leave residuals scattered around zero; a wrong course, speed or range leaves a trend. The rail shows the residual RMS, the systematic trend after averaging, the fit and the observability. Range is only observable after an own course change (at least 6 degrees, better 30-60): without one, `K` refuses. `K` accepts the hypothesis as the contact's TMA fix; it is dead-reckoned on its course and speed and ages out after 120 s, so refine and re-accept as bearings come in. Noisy bearings give a large range uncertainty even when the fit is good. TMA does not estimate depth. With operator assistance set to training (`F10`) an automatic solver proposal (it needs at least 4 bearings over 180 s) is drawn as a thin line and `Shift+K` copies it into the hypothesis. Sonobuoy bearings enter the track with the buoy as observer.
|
||||
- **UMWELT / FUSION** shows the bathythermograph (`E`, 60 s cooldown): measured layer depth, sound-speed profile and convergence-zone bands, plus the HMS/TAS comparison. Bearings within 5 degrees confirm each other; 9 degrees or more apart are flagged as a possible ghost contact. The layer is not fixed: afternoon sun makes it shallower (about 8 m), strong wind mixes it deeper over hours, and internal waves move it a few metres. Repeat the BT after a few hours or a weather change. The measured profile is the real temperature-driven sound speed (Mackenzie equation), so it drops below the layer.
|
||||
- **UMWELT / FUSION** shows the bathythermograph (`E`, 60 s cooldown): measured layer depth, sound-speed profile and convergence-zone bands, plus the HMS/TAS comparison. Bearings within 5 degrees confirm each other; 9 degrees or more apart are flagged as a possible ghost contact. The layer is not fixed: afternoon sun makes it shallower (about 8 m), strong wind mixes it deeper over hours, and internal waves move it a few metres. Repeat the BT after a few hours or a weather change. The measured profile is the real temperature-driven sound speed (Mackenzie equation), so it drops below the layer. Point the mouse at the profile to read the exact depth, the sound speed there and whether that depth lies above or below the layer (uConsole and web). In the web client the plot also labels the layer, the seabed and the sound-speed minimum.
|
||||
- **ACTIVE** lists echoes of the last 120 s: bearing, range and depth (+/-12 m). A ping fix ages out after 120 s. `W` selects the pulse: **CW** (1 s tone) gives coarse range (about 0.1-0.3 NM) but its Doppler separates a moving target from seabed reverberation; **LFM** (100 Hz sweep) measures range to a few metres and gains 20 dB against noise, but a slow or stationary target stays inside the reverberation. The echo strength depends on the target's aspect (broadside about 15 dB stronger than bow-on) and size. Rocky ground reverberates far more than mud; charted wrecks return real echoes that no contact owns ("unassociated echo").
|
||||
- **Hearing the echo:** every return is audible when it arrives, after its real two-way travel time (about 2.5 s per nautical mile of range), for the ship's sonar and the helicopter's dipping sonar alike. A CW echo is a soft tone on the carrier, an LFM echo a short sweep; the pulse is the one the ping was sent with. A strong echo stands out clearly, a faint one barely rises out of the reverberation hiss. In the Remote Crew browser the echo plays with the general sound (loud or faint).
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ Alle Werte sind die Standardwerte der aktuellen Spielversion. Eigene Schwierigke
|
||||
|
||||
## Wetter- & Sonar-Analyse (Taste 0) {#ref-weather-station}
|
||||
|
||||
Taste `0` öffnet über jeder Station ein Analysepanel über den ganzen Bildschirm (`0` oder `Esc` schließt es; die Simulation läuft weiter). Im Web-Client öffnet jede Station es mit `0` oder über das Arbeitsplatz-Menü.
|
||||
Taste `0` öffnet über jeder Station ein Analysepanel über den ganzen Bildschirm (`0` oder `Esc` schließt es; die Simulation läuft weiter). Im Web-Client öffnet jede Station es mit `0` oder über das Arbeitsplatz-Menü. Über dem Meeresprofil zeigt die Maus Tiefe und Schallgeschwindigkeit, über dem Schallweg-Schnitt Entfernung, Tiefe und Schallgeschwindigkeit und ob der Punkt in einer Schattenzone oder Konvergenzzone liegt.
|
||||
|
||||
- **Umwelt:** Uhrzeit, Tageslicht (Tag, bürgerliche oder nautische Dämmerung, Nacht), Mondphase, Wetter und Niederschlag, Sicht, Wind mit Böen und Beaufort, Seegang, Barometer mit 3-Stunden-Tendenz (steigend, stabil, fallend, rasch fallend), Luft- und Wassertemperatur, Wolkenuntergrenze und Vereisung. Rasch fallender Luftdruck unter etwa 1004 hPa löst eine Sturmwarnung aus. Das Wetter ändert sich höchstens um eine Seegangsstufe pro Stunde, deshalb bewegt sich das Barometer schneller als ein echtes.
|
||||
- **Wettereinflüsse:** Sonne (starke Sprungschicht), Wind (tiefere Deckschicht) und Regen oder Schnee (süßeres Oberflächenwasser, Regenrauschen) leuchten, solange sie wirken.
|
||||
|
||||
@@ -68,7 +68,7 @@ All values are the defaults of the current game version. Custom difficulty and m
|
||||
|
||||
## Weather & sonar analysis (key 0) {#ref-weather-station}
|
||||
|
||||
Key `0` opens a full-screen analysis panel over any station (`0` or `Esc` closes it; the simulation keeps running). In the web client every station opens it with `0` or from the workstation menu.
|
||||
Key `0` opens a full-screen analysis panel over any station (`0` or `Esc` closes it; the simulation keeps running). In the web client every station opens it with `0` or from the workstation menu. Over the ocean profile the mouse reads depth and sound speed; over the sound-path section it reads range, depth and sound speed and says whether that point lies in a shadow zone or a convergence zone.
|
||||
|
||||
- **Environment:** time, daylight (day, civil or nautical twilight, night), moon phase, weather and precipitation, visibility, wind with gusts and Beaufort force, sea state, barometer with its 3-hour tendency (rising, steady, falling, falling rapidly), air and sea temperature, cloud ceiling and icing. A rapidly falling glass below about 1004 hPa gives a storm warning. The weather system changes by at most one sea state per hour, so the barometer moves faster than a real one.
|
||||
- **Weather effects:** sun (strong layer), wind (deeper mixed layer) and rain or snow (fresher surface water, rain noise) light up while they act.
|
||||
|
||||
Binary file not shown.
@@ -282,7 +282,7 @@ Die Anzeige zeigt gemessene Modulation, keine Identität. Nach einer Peilungsän
|
||||
#### TMA, Umwelt und Aktiv
|
||||
|
||||
- **TMA** machen Sie selbst. Die Seite zeichnet die Peilungen des gewählten Kontakts über der Zeit. Stellen Sie eine Hypothese auf: `Z`/`X` Kurs (`Umschalt`: 1 Grad), `Strg+Z`/`Strg+X` Fahrt, `Q`/`Umschalt+Q` Entfernung auf der neuesten Peilung (`Strg`: 0,2 sm). Die bernsteinfarbene Kurve zeigt die Peilungen, die diese Hypothese vorhersagt, die Punkte am Fuß die Residuen (gemessen minus vorhergesagt). Gute Hypothesen lassen die Residuen um null streuen; ein falscher Kurs, eine falsche Fahrt oder Entfernung hinterlässt einen Trend. Die Spalte zeigt RMS der Residuen, den systematischen Trend nach Mittelung, die Passung und die Beobachtbarkeit. Die Entfernung ist erst nach einer eigenen Kursänderung beobachtbar (mindestens 6 Grad, besser 30-60); ohne sie verweigert `K`. `K` übernimmt die Hypothese als TMA-Fix des Kontakts; er wird auf Kurs und Fahrt mitgekoppelt und veraltet nach 120 s, also verfeinern und erneut übernehmen, wenn Peilungen hinzukommen. Verrauschte Peilungen ergeben auch bei guter Passung eine große Entfernungsunsicherheit. Tiefe schätzt TMA nicht. Mit Bedienerassistenz Training (`F10`) wird ein automatischer Solver-Vorschlag (er braucht mindestens 4 Peilungen über 180 s) als dünne Linie gezeichnet, und `Umschalt+K` kopiert ihn in die Hypothese. Sonobojen-Peilungen gehen mit der Boje als Beobachter in den Track ein.
|
||||
- **UMWELT / FUSION** zeigt den Bathythermographen (`E`, 60 s Abklingzeit): gemessene Schichttiefe, Schallgeschwindigkeitsprofil und Konvergenzzonen, dazu den Vergleich HMS/TAS. Peilungen innerhalb 5 Grad bestätigen sich; ab 9 Grad Abweichung wird ein möglicher Geisterkontakt markiert. Die Schicht ist nicht fest: Nachmittagssonne macht sie flacher (etwa 8 m), starker Wind mischt sie über Stunden tiefer, und interne Wellen verschieben sie um einige Meter. Den BT nach einigen Stunden oder einem Wetterwechsel wiederholen. Das gemessene Profil ist die echte temperaturabhängige Schallgeschwindigkeit (Mackenzie-Gleichung) und fällt deshalb unterhalb der Schicht ab.
|
||||
- **UMWELT / FUSION** zeigt den Bathythermographen (`E`, 60 s Abklingzeit): gemessene Schichttiefe, Schallgeschwindigkeitsprofil und Konvergenzzonen, dazu den Vergleich HMS/TAS. Peilungen innerhalb 5 Grad bestätigen sich; ab 9 Grad Abweichung wird ein möglicher Geisterkontakt markiert. Die Schicht ist nicht fest: Nachmittagssonne macht sie flacher (etwa 8 m), starker Wind mischt sie über Stunden tiefer, und interne Wellen verschieben sie um einige Meter. Den BT nach einigen Stunden oder einem Wetterwechsel wiederholen. Das gemessene Profil ist die echte temperaturabhängige Schallgeschwindigkeit (Mackenzie-Gleichung) und fällt deshalb unterhalb der Schicht ab. Mit der Maus über dem Profil lesen Sie die genaue Tiefe, die dortige Schallgeschwindigkeit und ob die Tiefe über oder unter der Schicht liegt (uConsole und Web). Im Web-Client beschriftet die Grafik zusätzlich Schicht, Meeresgrund und das Schallgeschwindigkeitsminimum.
|
||||
- **ACTIVE** listet die Echos der letzten 120 s: Peilung, Entfernung und Tiefe (+/-12 m). Ein Ping-Fix veraltet nach 120 s. `W` wählt den Puls: **CW** (1-s-Ton) misst die Entfernung grob (etwa 0,1-0,3 sm), trennt aber über den Doppler ein bewegtes Ziel vom Nachhall des Meeresbodens; **LFM** (100-Hz-Sweep) misst die Entfernung auf wenige Meter und gewinnt 20 dB gegen Rauschen, ein langsames oder stehendes Ziel bleibt aber im Nachhall. Die Echostärke hängt vom Aspekt (breitseits etwa 15 dB stärker als von vorn) und der Größe des Ziels ab. Felsgrund hallt viel stärker nach als Schlick; kartierte Wracks liefern echte Echos ohne zugehörigen Kontakt ("nicht zugeordnetes Echo").
|
||||
- **Das Echo hören:** Jede Rückkehr ist hörbar, sobald sie eintrifft, nach ihrer echten Laufzeit hin und zurück (etwa 2,5 s je Seemeile Entfernung), für das Schiffssonar ebenso wie für das Tauchsonar des Helikopters. Ein CW-Echo ist ein weicher Ton auf der Trägerfrequenz, ein LFM-Echo ein kurzer Sweep; maßgeblich ist der Puls, mit dem gepingt wurde. Ein starkes Echo hebt sich deutlich ab, ein schwaches steigt kaum aus dem Nachhallrauschen. Im Remote-Crew-Browser klingt das Echo über den allgemeinen Ton (laut oder leise).
|
||||
|
||||
@@ -988,7 +988,7 @@ Alle Werte sind die Standardwerte der aktuellen Spielversion. Eigene Schwierigke
|
||||
|
||||
### Wetter- & Sonar-Analyse (Taste 0)
|
||||
|
||||
Taste `0` öffnet über jeder Station ein Analysepanel über den ganzen Bildschirm (`0` oder `Esc` schließt es; die Simulation läuft weiter). Im Web-Client öffnet jede Station es mit `0` oder über das Arbeitsplatz-Menü.
|
||||
Taste `0` öffnet über jeder Station ein Analysepanel über den ganzen Bildschirm (`0` oder `Esc` schließt es; die Simulation läuft weiter). Im Web-Client öffnet jede Station es mit `0` oder über das Arbeitsplatz-Menü. Über dem Meeresprofil zeigt die Maus Tiefe und Schallgeschwindigkeit, über dem Schallweg-Schnitt Entfernung, Tiefe und Schallgeschwindigkeit und ob der Punkt in einer Schattenzone oder Konvergenzzone liegt.
|
||||
|
||||
- **Umwelt:** Uhrzeit, Tageslicht (Tag, bürgerliche oder nautische Dämmerung, Nacht), Mondphase, Wetter und Niederschlag, Sicht, Wind mit Böen und Beaufort, Seegang, Barometer mit 3-Stunden-Tendenz (steigend, stabil, fallend, rasch fallend), Luft- und Wassertemperatur, Wolkenuntergrenze und Vereisung. Rasch fallender Luftdruck unter etwa 1004 hPa löst eine Sturmwarnung aus. Das Wetter ändert sich höchstens um eine Seegangsstufe pro Stunde, deshalb bewegt sich das Barometer schneller als ein echtes.
|
||||
- **Wettereinflüsse:** Sonne (starke Sprungschicht), Wind (tiefere Deckschicht) und Regen oder Schnee (süßeres Oberflächenwasser, Regenrauschen) leuchten, solange sie wirken.
|
||||
|
||||
@@ -281,7 +281,7 @@ The display shows measured modulation, not identity. After changing the bearing
|
||||
#### TMA, environment and active
|
||||
|
||||
- **TMA** is yours. The page plots the bearings of the selected contact over time. Build a hypothesis: `Z`/`X` course (`Shift`: 1 degree), `Ctrl+Z`/`Ctrl+X` speed, `Q`/`Shift+Q` range on the newest bearing (`Ctrl`: 0.2 NM). The amber curve shows the bearings that hypothesis predicts, the dots at the foot the residuals (measured minus predicted). Good hypotheses leave residuals scattered around zero; a wrong course, speed or range leaves a trend. The rail shows the residual RMS, the systematic trend after averaging, the fit and the observability. Range is only observable after an own course change (at least 6 degrees, better 30-60): without one, `K` refuses. `K` accepts the hypothesis as the contact's TMA fix; it is dead-reckoned on its course and speed and ages out after 120 s, so refine and re-accept as bearings come in. Noisy bearings give a large range uncertainty even when the fit is good. TMA does not estimate depth. With operator assistance set to training (`F10`) an automatic solver proposal (it needs at least 4 bearings over 180 s) is drawn as a thin line and `Shift+K` copies it into the hypothesis. Sonobuoy bearings enter the track with the buoy as observer.
|
||||
- **UMWELT / FUSION** shows the bathythermograph (`E`, 60 s cooldown): measured layer depth, sound-speed profile and convergence-zone bands, plus the HMS/TAS comparison. Bearings within 5 degrees confirm each other; 9 degrees or more apart are flagged as a possible ghost contact. The layer is not fixed: afternoon sun makes it shallower (about 8 m), strong wind mixes it deeper over hours, and internal waves move it a few metres. Repeat the BT after a few hours or a weather change. The measured profile is the real temperature-driven sound speed (Mackenzie equation), so it drops below the layer.
|
||||
- **UMWELT / FUSION** shows the bathythermograph (`E`, 60 s cooldown): measured layer depth, sound-speed profile and convergence-zone bands, plus the HMS/TAS comparison. Bearings within 5 degrees confirm each other; 9 degrees or more apart are flagged as a possible ghost contact. The layer is not fixed: afternoon sun makes it shallower (about 8 m), strong wind mixes it deeper over hours, and internal waves move it a few metres. Repeat the BT after a few hours or a weather change. The measured profile is the real temperature-driven sound speed (Mackenzie equation), so it drops below the layer. Point the mouse at the profile to read the exact depth, the sound speed there and whether that depth lies above or below the layer (uConsole and web). In the web client the plot also labels the layer, the seabed and the sound-speed minimum.
|
||||
- **ACTIVE** lists echoes of the last 120 s: bearing, range and depth (+/-12 m). A ping fix ages out after 120 s. `W` selects the pulse: **CW** (1 s tone) gives coarse range (about 0.1-0.3 NM) but its Doppler separates a moving target from seabed reverberation; **LFM** (100 Hz sweep) measures range to a few metres and gains 20 dB against noise, but a slow or stationary target stays inside the reverberation. The echo strength depends on the target's aspect (broadside about 15 dB stronger than bow-on) and size. Rocky ground reverberates far more than mud; charted wrecks return real echoes that no contact owns ("unassociated echo").
|
||||
- **Hearing the echo:** every return is audible when it arrives, after its real two-way travel time (about 2.5 s per nautical mile of range), for the ship's sonar and the helicopter's dipping sonar alike. A CW echo is a soft tone on the carrier, an LFM echo a short sweep; the pulse is the one the ping was sent with. A strong echo stands out clearly, a faint one barely rises out of the reverberation hiss. In the Remote Crew browser the echo plays with the general sound (loud or faint).
|
||||
|
||||
@@ -987,7 +987,7 @@ All values are the defaults of the current game version. Custom difficulty and m
|
||||
|
||||
### Weather & sonar analysis (key 0)
|
||||
|
||||
Key `0` opens a full-screen analysis panel over any station (`0` or `Esc` closes it; the simulation keeps running). In the web client every station opens it with `0` or from the workstation menu.
|
||||
Key `0` opens a full-screen analysis panel over any station (`0` or `Esc` closes it; the simulation keeps running). In the web client every station opens it with `0` or from the workstation menu. Over the ocean profile the mouse reads depth and sound speed; over the sound-path section it reads range, depth and sound speed and says whether that point lies in a shadow zone or a convergence zone.
|
||||
|
||||
- **Environment:** time, daylight (day, civil or nautical twilight, night), moon phase, weather and precipitation, visibility, wind with gusts and Beaufort force, sea state, barometer with its 3-hour tendency (rising, steady, falling, falling rapidly), air and sea temperature, cloud ceiling and icing. A rapidly falling glass below about 1004 hPa gives a storm warning. The weather system changes by at most one sea state per hour, so the barometer moves faster than a real one.
|
||||
- **Weather effects:** sun (strong layer), wind (deeper mixed layer) and rain or snow (fresher surface water, rain noise) light up while they act.
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,66 @@
|
||||
"""Pointer readout for the measured sound-speed profile and sound-path section.
|
||||
|
||||
Display only: it reads the mouse and the operator's own BT measurement and
|
||||
never touches the simulation. Shared by the Sonar environment page and the
|
||||
weather/sonar analysis panel (key 0).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pygame
|
||||
|
||||
from src.core import config
|
||||
from src.core.i18n import localize
|
||||
from src.ui import layout
|
||||
|
||||
CURSOR_COLOR = (150, 235, 255)
|
||||
|
||||
|
||||
def speed_at(depths, speeds, depth: float):
|
||||
"""Sound speed at ``depth``, linearly interpolated from a measured profile."""
|
||||
if not len(depths):
|
||||
return None
|
||||
if depth <= depths[0]:
|
||||
return float(speeds[0])
|
||||
for index in range(1, len(depths)):
|
||||
if depth <= depths[index]:
|
||||
upper, lower = float(depths[index - 1]), float(depths[index])
|
||||
share = (depth - upper) / (lower - upper) if lower > upper else 0.0
|
||||
return float(speeds[index - 1]) + share * (float(speeds[index]) - float(speeds[index - 1]))
|
||||
return float(speeds[-1])
|
||||
|
||||
|
||||
def pointer(game):
|
||||
"""Canvas position of the mouse, or None outside the canvas/window."""
|
||||
try:
|
||||
if not pygame.mouse.get_focused():
|
||||
return None
|
||||
return game._window_to_canvas(pygame.mouse.get_pos())
|
||||
except (pygame.error, AttributeError):
|
||||
return None
|
||||
|
||||
|
||||
def draw_crosshair(screen, rect: pygame.Rect, x=None, y=None) -> None:
|
||||
"""Dotted guide lines inside ``rect`` (horizontal at y, vertical at x)."""
|
||||
if y is not None:
|
||||
for dash in range(rect.x, rect.right, 6):
|
||||
pygame.draw.line(screen, CURSOR_COLOR, (dash, y), (min(dash + 2, rect.right - 1), y))
|
||||
if x is not None:
|
||||
for dash in range(rect.y, rect.bottom, 6):
|
||||
pygame.draw.line(screen, CURSOR_COLOR, (x, dash), (x, min(dash + 2, rect.bottom - 1)))
|
||||
|
||||
|
||||
def draw_label(screen, text, anchor, bounds: pygame.Rect, size: int = 13) -> None:
|
||||
"""Readout on its own dark plate beside the cursor, kept inside bounds."""
|
||||
label = localize(text)
|
||||
face = layout.font(layout.scaled_size(size))
|
||||
width, height = face.size(label)
|
||||
plate = pygame.Rect(0, 0, width + 12, height + 4)
|
||||
plate.x = min(bounds.right - plate.w - 2, max(bounds.x + 2, anchor[0] + 10))
|
||||
plate.y = anchor[1] - plate.h - 4
|
||||
if plate.y < bounds.y + 2:
|
||||
plate.y = anchor[1] + 6
|
||||
pygame.draw.rect(screen, config.COLOR_BG, plate)
|
||||
pygame.draw.rect(screen, CURSOR_COLOR, plate, 1)
|
||||
layout.blit_line(screen, text, (plate.x + 6, plate.y + 2, width + 4, height),
|
||||
CURSOR_COLOR, size=size)
|
||||
@@ -13,6 +13,7 @@ from src.core.i18n import (display_message, display_value, localized, localize,
|
||||
from src.sonar import analysis_tools, tma_operator
|
||||
from src.ui import layout
|
||||
from src.ui import observations
|
||||
from src.ui import profile_cursor
|
||||
|
||||
|
||||
NAVY = (6, 13, 25)
|
||||
@@ -1375,6 +1376,16 @@ def _draw_environment(game, panel):
|
||||
(plot.x + 8, ty - 20, 210, 18), AMBER, 12)
|
||||
_text(screen, message("sonar.line.sound_speed", low=f"{lo:.1f}", high=f"{hi:.1f}"),
|
||||
(plot.x, plot.bottom + 5, plot.w, 18), DIM, 12)
|
||||
mouse = profile_cursor.pointer(game)
|
||||
if mouse is not None and plot.collidepoint(mouse):
|
||||
depth = (mouse[1] - plot.y) / max(1, plot.h - 1) * max_depth
|
||||
speed = profile_cursor.speed_at(depths, speeds, depth)
|
||||
key = ("sonar.cursor.depth_above" if depth < thermo
|
||||
else "sonar.cursor.depth_below")
|
||||
profile_cursor.draw_crosshair(screen, plot, y=mouse[1])
|
||||
profile_cursor.draw_label(screen, message(key, depth=f"{depth:.0f}",
|
||||
speed=f"{speed:.1f}"),
|
||||
mouse, plot)
|
||||
else:
|
||||
_text(screen, "sonar.no_profile",
|
||||
(plot.x, plot.centery - 20, plot.w, 22), AMBER, 16, "center")
|
||||
|
||||
@@ -15,6 +15,7 @@ import pygame
|
||||
from src.core import config
|
||||
from src.core.i18n import localize, localized, message
|
||||
from src.ui import layout
|
||||
from src.ui import profile_cursor
|
||||
|
||||
TREND_ARROWS = {"rising": "^", "steady": "=", "falling": "v", "falling_rapidly": "vv"}
|
||||
# Theme attribute names, resolved at draw time so high contrast applies.
|
||||
@@ -121,7 +122,7 @@ def _flight(screen, rect, data) -> None:
|
||||
config.COLOR_WARN if warn.get(index) else config.COLOR_TEXT, size=TEXT)
|
||||
|
||||
|
||||
def _profile(screen, rect, data) -> None:
|
||||
def _profile(screen, rect, data, mouse=None) -> None:
|
||||
x, y, w, h = layout.box(screen, rect, "weather.box.profile")
|
||||
p = data["profile"]
|
||||
if p is None:
|
||||
@@ -202,6 +203,43 @@ def _profile(screen, rect, data) -> None:
|
||||
dip = p["dip_relative_to_layer"]
|
||||
footer = ("weather.shadow_hint" if dip is None else "weather.dip." + dip)
|
||||
_line(screen, footer, x, y + h - LINE_H, w, config.COLOR_TEXT_DIM)
|
||||
_profile_cursor(screen, p, mouse, pygame.Rect(x, top, left_w, plot_h),
|
||||
pygame.Rect(sx, top, sw, plot_h), depth_max)
|
||||
|
||||
|
||||
def _profile_cursor(screen, p, mouse, left, section, depth_max) -> None:
|
||||
"""Depth (and range) readout under the pointer; display only."""
|
||||
if mouse is None:
|
||||
return
|
||||
inside_left, inside_section = left.collidepoint(mouse), section.collidepoint(mouse)
|
||||
if not (inside_left or inside_section):
|
||||
return
|
||||
depth = (mouse[1] - left.y) / max(1, left.h) * depth_max
|
||||
speed = profile_cursor.speed_at(p["depths_m"], p["speeds_m_s"], depth)
|
||||
whole = left.union(section)
|
||||
if inside_left:
|
||||
profile_cursor.draw_crosshair(screen, whole, y=mouse[1])
|
||||
profile_cursor.draw_label(screen, message("weather.cursor.depth", depth=_fmt(depth),
|
||||
speed=_fmt(speed, 1)), mouse, whole)
|
||||
return
|
||||
range_nm = (mouse[0] - section.x) / max(1, section.w) * p["range_nm"]
|
||||
columns = len(p["shadow"])
|
||||
column = min(columns - 1, int(range_nm / p["range_nm"] * columns)) if columns else -1
|
||||
edges = p["depth_edges_m"]
|
||||
row = next((index for index in range(len(edges) - 1)
|
||||
if edges[index] <= depth < edges[index + 1]), -1)
|
||||
notes = []
|
||||
if column >= 0 and row >= 0 and p["shadow"][column][row]:
|
||||
notes.append(message("weather.cursor.shadow"))
|
||||
if any(low <= range_nm <= high for low, high in p["cz_bands_nm"]):
|
||||
notes.append(message("weather.cursor.cz"))
|
||||
text = message("weather.cursor.section", range=_fmt(range_nm, 1), depth=_fmt(depth),
|
||||
speed=_fmt(speed, 1))
|
||||
for note in notes:
|
||||
text = message("weather.cursor.with_note", text=text, note=note)
|
||||
profile_cursor.draw_crosshair(screen, whole, y=mouse[1])
|
||||
profile_cursor.draw_crosshair(screen, section, x=mouse[0])
|
||||
profile_cursor.draw_label(screen, text, mouse, whole)
|
||||
|
||||
|
||||
@localized
|
||||
@@ -219,4 +257,5 @@ def draw_weather_station(game, tr=None) -> None:
|
||||
_flight(screen, (x + left_w + 10, y, width - left_w - 10, top_h), data)
|
||||
_effects(screen, (x + 8, y + top_h + 6, width - 16, LINE_H), data)
|
||||
profile_y = y + top_h + LINE_H + 12
|
||||
_profile(screen, (x, profile_y, width, r[1] + r[3] - profile_y - 6), data)
|
||||
_profile(screen, (x, profile_y, width, r[1] + r[3] - profile_y - 6), data,
|
||||
profile_cursor.pointer(game))
|
||||
@@ -0,0 +1,56 @@
|
||||
"""Pointer readout on the BT profile and the weather sound-path section."""
|
||||
|
||||
import pygame
|
||||
import pytest
|
||||
|
||||
from src.core.game import Game
|
||||
from src.core.i18n import localize
|
||||
from src.core.station import Station
|
||||
from src.ui import profile_cursor, weather_station
|
||||
|
||||
|
||||
def labels_during_draw(game, monkeypatch, point):
|
||||
shown = []
|
||||
original = profile_cursor.draw_label
|
||||
monkeypatch.setattr(profile_cursor, "pointer", lambda _game: point)
|
||||
monkeypatch.setattr(profile_cursor, "draw_label", lambda screen, text, anchor, bounds, size=13: (
|
||||
shown.append(localize(text, game.tr)), original(screen, text, anchor, bounds, size))[1])
|
||||
game.draw()
|
||||
return shown
|
||||
|
||||
|
||||
def test_speed_interpolates_between_measured_depths():
|
||||
assert profile_cursor.speed_at([0, 100], [1500, 1480], 25) == pytest.approx(1495)
|
||||
assert profile_cursor.speed_at([0, 100], [1500, 1480], 400) == 1480
|
||||
assert profile_cursor.speed_at([], [], 10) is None
|
||||
|
||||
|
||||
def test_sonar_environment_reads_depth_speed_and_layer_side(monkeypatch):
|
||||
game = Game(seed=913, start_menu=False, audio_enabled=False, language="en")
|
||||
assert game.measure_sonar_bt() is True
|
||||
game.station, game.sonar_page = Station.SONAR, 4
|
||||
assert labels_during_draw(game, monkeypatch, None) == []
|
||||
shown = labels_during_draw(game, monkeypatch, (640, 420))
|
||||
assert len(shown) == 1 and shown[0].startswith("Depth ")
|
||||
assert shown[0].endswith("below the layer")
|
||||
|
||||
|
||||
def test_weather_section_reads_range_and_marks_shadow_and_cz(monkeypatch):
|
||||
shown = []
|
||||
monkeypatch.setattr(profile_cursor, "draw_label",
|
||||
lambda screen, text, anchor, bounds, size=13: shown.append(text))
|
||||
profile = dict(depths_m=[0, 100, 400], speeds_m_s=[1500, 1490, 1480],
|
||||
shadow=[[False, False], [False, True]], depth_edges_m=[0, 200, 400],
|
||||
cz_bands_nm=[[25, 35]], range_nm=40)
|
||||
screen = pygame.Surface((400, 200))
|
||||
left, section = pygame.Rect(0, 0, 100, 200), pygame.Rect(110, 0, 200, 200)
|
||||
# Right half of the section, lower half of the depth: shadow cell and CZ.
|
||||
weather_station._profile_cursor(screen, profile, (110 + 150, 150), left, section, 400)
|
||||
text = localize(shown[-1], Game(seed=1, start_menu=False, audio_enabled=False,
|
||||
language="en").tr)
|
||||
assert text.startswith("30.0 NM | 300 m")
|
||||
assert "shadow zone" in text and "convergence zone" in text
|
||||
weather_station._profile_cursor(screen, profile, (50, 50), left, section, 400)
|
||||
assert len(shown) == 2
|
||||
weather_station._profile_cursor(screen, profile, None, left, section, 400)
|
||||
assert len(shown) == 2
|
||||
Reference in new issue
Block a user