Fix GSM Spy dashboard: stats, signal display, CID=0 filter, tower details

Backend:
- Filter out CID=0 and MCC=0 entries (ARFCNs with no decoded cell identity)

Frontend:
- Move stats update before coordinate check so towers always counted
- Fix signal_strength display using null check instead of || (0 is falsy)
- Show operator name, frequency, and status in tower detail panel
- Show "Located" indicator in tower list for geocoded towers
- Fix selectTower crash when tower has no coordinates
- Update placeholder text to "Select a tower from the list"
- Add try/catch to selectTower for error resilience

Tests:
- Add tests for CID=0 and MCC=0 filtering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-08 17:04:04 +00:00
parent 7cb2efca30
commit 451eff83a8
3 changed files with 110 additions and 65 deletions

View File

@@ -1128,6 +1128,14 @@ def parse_grgsm_scanner_output(line: str) -> dict[str, Any] | None:
fields[key.strip()] = value.strip()
if 'ARFCN' in fields and 'CID' in fields:
cid = int(fields.get('CID', 0))
mcc = int(fields.get('MCC', 0))
# Skip entries with no decoded cell identity (CID=0 means no cell info)
if cid == 0 or mcc == 0:
logger.debug(f"Skipping unresolved ARFCN (CID={cid}, MCC={mcc}): {line}")
return None
# Freq may have 'M' suffix (e.g. "925.2M")
freq_str = fields.get('Freq', '0').rstrip('Mm')
@@ -1135,9 +1143,9 @@ def parse_grgsm_scanner_output(line: str) -> dict[str, Any] | None:
'type': 'tower',
'arfcn': int(fields['ARFCN']),
'frequency': float(freq_str),
'cid': int(fields.get('CID', 0)),
'cid': cid,
'lac': int(fields.get('LAC', 0)),
'mcc': int(fields.get('MCC', 0)),
'mcc': mcc,
'mnc': int(fields.get('MNC', 0)),
'signal_strength': float(fields.get('Pwr', -999)),
'timestamp': datetime.now().isoformat()