Panel cleanup: chip padding up a step and a tighter chip line gap, corrected/SNR numbers neutral until amber or red, dB margin casing, compound elapsed units (1m39s) ending the minutes/metres m collision, noise chip shows presence only

This commit is contained in:
flamingcow
2026-08-14 23:47:45 -07:00
parent 9f2b074c4a
commit 6a1a860548
3 changed files with 32 additions and 33 deletions
+7 -6
View File
@@ -101,15 +101,16 @@ func scaleCount(v uint64) string {
// The same shape for time, whose magnitudes are sixties and twenty-fours.
func scaleTime(d time.Duration) string {
s := int(d.Seconds())
switch {
case d < time.Minute:
return fmt.Sprintf("%.2f s", d.Seconds())
return fmt.Sprintf("%ds", s)
case d < time.Hour:
return fmt.Sprintf("%.2f m", d.Minutes())
return fmt.Sprintf("%dm%02ds", s/60, s%60)
case d < 24*time.Hour:
return fmt.Sprintf("%.2f h", d.Hours())
return fmt.Sprintf("%dh%02dm", s/3600, (s/60)%60)
}
return fmt.Sprintf("%.2f d", d.Hours()/24)
return fmt.Sprintf("%dd%02dh", s/86400, (s/3600)%24)
}
type colSpec struct {
@@ -282,7 +283,7 @@ func snrCell(phy phyDisplay) string {
s := fmt.Sprintf("%+.1f", phy.worstMargin)
switch snrClass(phy.worstMargin) {
case clsGood:
return paint(s, cGreen)
return s
case clsWarn:
return paint(s, cYellow)
default:
@@ -292,7 +293,7 @@ func snrCell(phy phyDisplay) string {
func correctedCell(v uint64) string {
if v == 0 {
return paint("0", cGreen)
return "0"
}
return paint(commas(v), cYellow)
}