mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-06 16:56:41 +10:00
Change debug messages that I left and forgot
This commit is contained in:
@@ -36,6 +36,7 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
|
|||||||
|
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
bool _isLoaded = false;
|
bool _isLoaded = false;
|
||||||
|
bool _hasData = false;
|
||||||
Timer? _statusTimeout;
|
Timer? _statusTimeout;
|
||||||
StreamSubscription<Uint8List>? _frameSubscription;
|
StreamSubscription<Uint8List>? _frameSubscription;
|
||||||
RepeaterCommandService? _commandService;
|
RepeaterCommandService? _commandService;
|
||||||
@@ -49,6 +50,7 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
|
|||||||
_commandService = RepeaterCommandService(connector);
|
_commandService = RepeaterCommandService(connector);
|
||||||
_setupMessageListener();
|
_setupMessageListener();
|
||||||
_loadTelemetry();
|
_loadTelemetry();
|
||||||
|
_hasData = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _setupMessageListener() {
|
void _setupMessageListener() {
|
||||||
@@ -77,7 +79,7 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
|
|||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(
|
const SnackBar(
|
||||||
content: Text('Received status response (not implemented).'),
|
content: Text('Received Telemetry Data'),
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -86,6 +88,7 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
_isLoaded = true;
|
_isLoaded = true;
|
||||||
|
_hasData = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +131,7 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
|
|||||||
});
|
});
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(
|
const SnackBar(
|
||||||
content: Text('Status request timed out.'),
|
content: Text('Telemetry request timed out.'),
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -143,16 +146,11 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
|
|||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text('Error loading status: $e'),
|
content: Text('Error loading telemetry: $e'),
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
setState(() {
|
|
||||||
_isLoading = false;
|
|
||||||
_isLoaded = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,16 +260,16 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
children: [
|
children: [
|
||||||
if (_isLoaded && !(_parsedTelemetry == null || _parsedTelemetry!.isEmpty))
|
if (!_isLoaded && !_hasData && (_parsedTelemetry == null || _parsedTelemetry!.isEmpty))
|
||||||
for (final entry in _parsedTelemetry ?? [])
|
|
||||||
_buildChannelInfoCard(entry['values'], 'Channel ${entry['channel']}', entry['channel']),
|
|
||||||
if (!_isLoaded && (_parsedTelemetry == null || _parsedTelemetry!.isEmpty))
|
|
||||||
const Center(
|
const Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'No telemetry data available.',
|
'No telemetry data available.',
|
||||||
style: TextStyle(fontSize: 16, color: Colors.grey),
|
style: TextStyle(fontSize: 16, color: Colors.grey),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (_isLoaded || _hasData&& !(_parsedTelemetry == null || _parsedTelemetry!.isEmpty))
|
||||||
|
for (final entry in _parsedTelemetry ?? [])
|
||||||
|
_buildChannelInfoCard(entry['values'], 'Channel ${entry['channel']}', entry['channel']),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user