Explorar o código

fix(channels): stretch the floor to the weakest signal; explain an empty heat strip (#1257)

Floor to min(signal)-4 (cap -105); empty-state note for the heat strip. #1214
Nacho hai 2 meses
pai
achega
0566260744

+ 1 - 0
app/public/locales/en/translation.json

@@ -2064,6 +2064,7 @@
     "heatNote": "neighbors drawn at 20 MHz (width unknown)",
     "heatClean": "Clean",
     "heatBusy": "Busy",
+    "heatNoNeighbors": "no neighbor networks in this band: zero occupancy",
     "scoresTitle": "Channel score",
     "scoresBlocks": "{{w}} MHz blocks",
     "scoresChannels": "20 MHz channels",

+ 1 - 0
app/public/locales/es/translation.json

@@ -2064,6 +2064,7 @@
     "heatNote": "los vecinos se dibujan a 20 MHz (ancho desconocido)",
     "heatClean": "Limpio",
     "heatBusy": "Saturado",
+    "heatNoNeighbors": "sin redes vecinas en esta banda: ocupación nula",
     "scoresTitle": "Puntuación por canal",
     "scoresBlocks": "Bloques de {{w}} MHz",
     "scoresChannels": "Canales de 20 MHz",

+ 5 - 2
app/src/components/channels/ChannelSpectrum.tsx

@@ -186,8 +186,11 @@ export function ChannelSpectrum({
       let botDbm = DBM_BOTTOM
       if (signals.length > 0) {
         topDbm = Math.min(DBM_TOP, Math.max(...signals) + 5)
-        botDbm = Math.max(DBM_BOTTOM, Math.min(...signals) - 4)
-        if (botDbm - topDbm < 30) botDbm = Math.min(topDbm + 30, DBM_BOTTOM)
+        // El suelo se estira hasta la señal más débil real (hasta -105):
+        // con el piso clavado en -95, una red a -97 se aplastaba contra la
+        // línea base y se veia como una linea recta (Hobbiton, #1214).
+        botDbm = Math.max(-105, Math.min(...signals) - 4)
+        if (topDbm - botDbm < 30) botDbm = Math.max(-105, topDbm - 30)
       }
       const y = (dbm: number) => PAD.t + ((topDbm - dbm) / (topDbm - botDbm)) * plotH
       geomRef.current = { x: xch, y }

+ 5 - 3
app/src/pages/ChannelPlan.tsx

@@ -754,9 +754,11 @@ export default function ChannelPlan() {
                     <div className="mb-1.5 flex items-center gap-2">
                       <span className="text-label uppercase text-text-muted">{t('channelPlan.heatTitle')}</span>
                       <span className="ml-auto text-caption font-normal normal-case tracking-normal text-text-muted">
-                        {bandScans.some((s) => !s.own && !(s.widthMhz && s.widthMhz > 0))
-                          ? t('channelPlan.heatNote')
-                          : t('channelPlan.heatNoteKnown')}
+                        {!bandScans.some((s) => !s.own)
+                          ? t('channelPlan.heatNoNeighbors')
+                          : bandScans.some((s) => !s.own && !(s.widthMhz && s.widthMhz > 0))
+                            ? t('channelPlan.heatNote')
+                            : t('channelPlan.heatNoteKnown')}
                       </span>
                     </div>
                     <div className="flex justify-between text-[10.5px] text-text-muted">