Fehlerkorrekturen und Erweiterungen

This commit is contained in:
Sven committed 2025-08-28 12:24:11 +02:00
1 parent 47b4c85133
commit 19b5b255ef
5 files changed
+53 -58

No files matched your search

+5 -10
View File
@@ -345,13 +345,10 @@ class MqttCore with ProducerMixin, ConsumerMixin {
await MyApp.isarInstance.status.put(statusMessage);
});
// TODO MESSAGING
sendMessage(
routingKey: Constants.messageTopicStatusInfoUpdated,
payload: StatusInfoUpdate(status: statusMessage),
);
//await MessageService().publish<StatusInfoUpdate>(Constants.messageTopicStatusInfoUpdated, arguments: StatusInfoUpdate(status: statusMessage));
}
void _locationStatusMessageReceived(payloadData) async {
@@ -362,13 +359,10 @@ class MqttCore with ProducerMixin, ConsumerMixin {
await MyApp.isarInstance.locationStatus.put(locationStatus);
});
// TODO MESSAGING
sendMessage(
routingKey: Constants.messageTopicLocationStatusUpdated,
payload: LocationStatusUpdate(status: locationStatus),
);
// await MessageService().publish<LocationStatusUpdate>(Constants.messageTopicLocationStatusUpdated, arguments: LocationStatusUpdate(status: locationStatus));
}
void _rankingMessageReceived(payloadData) async {
@@ -379,13 +373,10 @@ class MqttCore with ProducerMixin, ConsumerMixin {
await MyApp.isarInstance.rankings.put(ranking);
});
// TODO MESSAGING
sendMessage(
routingKey: Constants.messageTopicRankingUpdated,
payload: RankingUpdated(),
);
//await MessageService().publish<RankingUpdated>(Constants.messageTopicRankingUpdated, arguments: RankingUpdated());
}
void _jobMessageReceived(payloadData) async {
@@ -622,15 +613,19 @@ class MqttCore with ProducerMixin, ConsumerMixin {
_trackTimer ??= Timer.periodic(const Duration(seconds: 120), (Timer t) async {
try {
var position = await MyApp.getCurrentPosition();
var trackMessage = TrackPosition();
if (position != null) {
var trackMessage = TrackPosition();
trackMessage.time = position.timestamp.toIso8601String();
trackMessage.lat = position.latitude;
trackMessage.long = position.longitude;
trackMessage.acc = position.accuracy.toInt();
_publishMessage("track", trackMessage.toJson(), false);
} else {
_publishMessage("track", <String, dynamic>{}, false);
}
} catch (ex) {
Util.logException("Error in periodic track timer: {$ex}");
}