[feat](trx-rs): refine overview strip and logging
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -625,14 +625,24 @@ function drawOverviewSignalHistory(ctx, w, h, isLight) {
|
|||||||
const toX = (t) => ((t - windowStart) / HEADER_SIG_WINDOW_MS) * w;
|
const toX = (t) => ((t - windowStart) / HEADER_SIG_WINDOW_MS) * w;
|
||||||
const toY = (v) => h - (Math.max(0, Math.min(maxVal, v)) / maxVal) * (h - 3) - 1.5;
|
const toY = (v) => h - (Math.max(0, Math.min(maxVal, v)) / maxVal) * (h - 3) - 1.5;
|
||||||
|
|
||||||
|
const gridMarkers = [
|
||||||
|
{ val: 0, label: "S0" },
|
||||||
|
{ val: 9, label: "S9" },
|
||||||
|
{ val: 18, label: "S9+" },
|
||||||
|
];
|
||||||
ctx.strokeStyle = isLight ? "rgba(71, 85, 105, 0.14)" : "rgba(148, 163, 184, 0.12)";
|
ctx.strokeStyle = isLight ? "rgba(71, 85, 105, 0.14)" : "rgba(148, 163, 184, 0.12)";
|
||||||
ctx.lineWidth = 1;
|
ctx.lineWidth = 1;
|
||||||
for (const val of [0, 9, 18]) {
|
ctx.font = "11px sans-serif";
|
||||||
const y = toY(val);
|
ctx.fillStyle = isLight ? "rgba(51, 65, 85, 0.72)" : "rgba(203, 213, 225, 0.72)";
|
||||||
|
ctx.textAlign = "left";
|
||||||
|
ctx.textBaseline = "middle";
|
||||||
|
for (const marker of gridMarkers) {
|
||||||
|
const y = toY(marker.val);
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(0, y);
|
ctx.moveTo(0, y);
|
||||||
ctx.lineTo(w, y);
|
ctx.lineTo(w, y);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
ctx.fillText(marker.label, 6, Math.max(8, Math.min(h - 8, y)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|||||||
@@ -62,12 +62,13 @@
|
|||||||
body {
|
body {
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100vh;
|
min-height: 100vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: block;
|
display: block;
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
overflow: hidden;
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
width: min(100%, 1280px);
|
width: min(100%, 1280px);
|
||||||
@@ -75,10 +76,10 @@ body {
|
|||||||
padding: 0.85rem 1.25rem 1.5rem;
|
padding: 0.85rem 1.25rem 1.5rem;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: hidden;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
.label { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 6px; display: block; }
|
.label { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 6px; display: block; }
|
||||||
#tab-main .label > span {
|
#tab-main .label > span {
|
||||||
@@ -389,6 +390,12 @@ small { color: var(--text-muted); }
|
|||||||
width: auto;
|
width: auto;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
|
padding: 0.35rem 0.65rem 0.4rem;
|
||||||
|
border-radius: 0.8rem;
|
||||||
|
background: color-mix(in srgb, var(--card-bg) 56%, transparent);
|
||||||
|
backdrop-filter: blur(12px) saturate(125%);
|
||||||
|
-webkit-backdrop-filter: blur(12px) saturate(125%);
|
||||||
|
box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 10%, transparent);
|
||||||
}
|
}
|
||||||
.title { font-size: 1.4rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; }
|
.title { font-size: 1.4rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; }
|
||||||
.overview-strip {
|
.overview-strip {
|
||||||
@@ -433,7 +440,7 @@ small { color: var(--text-muted); }
|
|||||||
}
|
}
|
||||||
#overview-canvas {
|
#overview-canvas {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: clamp(4.2rem, 11vh, 6.25rem);
|
height: calc(clamp(4.2rem, 11vh, 6.25rem) + var(--header-waterfall-overlap));
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.header-left {
|
.header-left {
|
||||||
@@ -490,8 +497,8 @@ small { color: var(--text-muted); }
|
|||||||
.meter-bar { flex: 1 1 auto; height: 12px; border-radius: 999px; background: var(--btn-bg); border: 1px solid var(--border-light); overflow: hidden; }
|
.meter-bar { flex: 1 1 auto; height: 12px; border-radius: 999px; background: var(--btn-bg); border: 1px solid var(--border-light); overflow: hidden; }
|
||||||
.meter-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-green), var(--accent-yellow), var(--accent-red)); transition: width 150ms ease; }
|
.meter-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-green), var(--accent-yellow), var(--accent-red)); transition: width 150ms ease; }
|
||||||
.meter-value { font-size: 0.95rem; color: var(--text-heading); min-width: 64px; text-align: right; }
|
.meter-value { font-size: 0.95rem; color: var(--text-heading); min-width: 64px; text-align: right; }
|
||||||
#content { display: flex; flex-direction: column; gap: 1.1rem; min-height: 0; overflow: hidden; }
|
#content { display: flex; flex-direction: column; gap: 1.1rem; min-height: 0; overflow: visible; }
|
||||||
.tab-panel { flex: 1 1 auto; min-height: 0; overflow: hidden; }
|
.tab-panel { flex: 1 1 auto; min-height: 0; overflow: visible; }
|
||||||
.tab-bar {
|
.tab-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -318,6 +318,7 @@ pub async fn run_rig_task(
|
|||||||
// Process each request
|
// Process each request
|
||||||
while let Some(RigRequest { cmd, respond_to }) = batch.pop() {
|
while let Some(RigRequest { cmd, respond_to }) = batch.pop() {
|
||||||
let cmd_label = format!("{:?}", cmd);
|
let cmd_label = format!("{:?}", cmd);
|
||||||
|
let log_command = !matches!(&cmd, RigCommand::GetSpectrum);
|
||||||
let started = Instant::now();
|
let started = Instant::now();
|
||||||
|
|
||||||
let mut cmd_ctx = CommandExecContext {
|
let mut cmd_ctx = CommandExecContext {
|
||||||
@@ -335,11 +336,13 @@ pub async fn run_rig_task(
|
|||||||
|
|
||||||
let _ = respond_to.send(result);
|
let _ = respond_to.send(result);
|
||||||
|
|
||||||
let elapsed = started.elapsed();
|
if log_command {
|
||||||
if elapsed > Duration::from_millis(500) {
|
let elapsed = started.elapsed();
|
||||||
warn!("Rig command {} took {:?}", cmd_label, elapsed);
|
if elapsed > Duration::from_millis(500) {
|
||||||
} else {
|
warn!("Rig command {} took {:?}", cmd_label, elapsed);
|
||||||
debug!("Rig command {} completed in {:?}", cmd_label, elapsed);
|
} else {
|
||||||
|
debug!("Rig command {} completed in {:?}", cmd_label, elapsed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user