mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-06 16:56:41 +10:00
@@ -55,6 +55,7 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
int? _directRx;
|
||||
int? _dupFlood;
|
||||
int? _dupDirect;
|
||||
double? _chanUtil;
|
||||
PathSelection? _pendingStatusSelection;
|
||||
|
||||
@override
|
||||
@@ -195,6 +196,7 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
_lastSnr = lastSnrRaw / 4.0;
|
||||
_dupDirect = directDups;
|
||||
_dupFlood = floodDups;
|
||||
_chanUtil = ((txAirSecs + rxAirSecs) / uptimeSecs) * 100;
|
||||
});
|
||||
final connector = Provider.of<MeshCoreConnector>(context, listen: false);
|
||||
connector.updateRepeaterBatterySnapshot(
|
||||
@@ -285,6 +287,7 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
_directRx = null;
|
||||
_dupFlood = null;
|
||||
_dupDirect = null;
|
||||
_chanUtil = null;
|
||||
});
|
||||
|
||||
try {
|
||||
@@ -572,6 +575,7 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
_buildInfoRow(l10n.repeater_sent, _packetTxText()),
|
||||
_buildInfoRow(l10n.repeater_received, _packetRxText()),
|
||||
_buildInfoRow(l10n.repeater_duplicates, _duplicateText()),
|
||||
_buildInfoRow(l10n.repeater_chanUtil, _chanUtilText()),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -677,6 +681,11 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
return l10n.repeater_packetRxTotal(_packetsRecv!, flood, direct);
|
||||
}
|
||||
|
||||
String _chanUtilText() {
|
||||
if (_chanUtil == null) return '—';
|
||||
return _formatPercent(_chanUtil);
|
||||
}
|
||||
|
||||
String _duplicateText() {
|
||||
final l10n = context.l10n;
|
||||
if (_dupFlood != null || _dupDirect != null) {
|
||||
@@ -697,6 +706,11 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
return suffix == null ? value.toString() : '$value$suffix';
|
||||
}
|
||||
|
||||
String _formatPercent(double? p) {
|
||||
if (p == null) return '—';
|
||||
return '${p.toStringAsFixed(2)}%';
|
||||
}
|
||||
|
||||
String _formatSnr(double? snr) {
|
||||
if (snr == null) return '—';
|
||||
return snr.toStringAsFixed(2);
|
||||
|
||||
Reference in New Issue
Block a user