Cleanup
This commit is contained in:
1 parent
e7409ac26b
commit
70fb6dd5ef
2 files changed
+72
-49
No files matched your search
@@ -163,38 +163,9 @@ Future<List<Widget>> _createListEntries() async {
|
||||
return entries;
|
||||
}
|
||||
|
||||
/*
|
||||
private void SendAnswer(int item)
|
||||
{
|
||||
JObject payloadObject;
|
||||
|
||||
var location = App.CurrentLocation;
|
||||
if (location != null)
|
||||
payloadObject = new JObject(
|
||||
new JProperty("reaction", new JObject(
|
||||
new JProperty("id", _jobViewModel.IdString),
|
||||
new JProperty("ver", _jobViewModel.Version),
|
||||
new JProperty("item", item),
|
||||
new JProperty("track", new JObject(
|
||||
new JProperty("time", DateTime.Now.ToString("o")),
|
||||
new JProperty("pos", new JObject(
|
||||
new JProperty("lat", location.Latitude),
|
||||
new JProperty("long", location.Longitude),
|
||||
new JProperty("acc", location.Accuracy))))))));
|
||||
else
|
||||
payloadObject = new JObject(
|
||||
new JProperty("reaction", new JObject(
|
||||
new JProperty("id", _jobViewModel.IdString),
|
||||
new JProperty("ver", _jobViewModel.Version),
|
||||
new JProperty("item", item),
|
||||
new JProperty("track", new JObject(
|
||||
new JProperty("time", DateTime.Now.ToString("o")))))));
|
||||
|
||||
App.Core.SendJsonMessageAsync("job", payloadObject);
|
||||
}
|
||||
*/
|
||||
|
||||
_sendAnswer(Job job, int item) {
|
||||
var currentPosition = MyApp.currentPosition;
|
||||
|
||||
var message = AcceptJobMessage();
|
||||
message.reaction = Reaction();
|
||||
message.reaction.id = job.id.toString();
|
||||
@@ -203,9 +174,9 @@ _sendAnswer(Job job, int item) {
|
||||
message.reaction.track = Track();
|
||||
message.reaction.track.time = DateTime.now().toUtc().toIso8601String();
|
||||
message.reaction.track.pos = Pos();
|
||||
message.reaction.track.pos.lat = 0;
|
||||
message.reaction.track.pos.long = 0;
|
||||
message.reaction.track.pos.acc = 1;
|
||||
message.reaction.track.pos.lat = currentPosition != null ? currentPosition.latitude : 0.0;
|
||||
message.reaction.track.pos.long = currentPosition != null ? currentPosition.longitude : 0.0;
|
||||
message.reaction.track.pos.acc = currentPosition != null ? currentPosition.accuracy : 0.0;
|
||||
|
||||
MqttCore.instance.publishPayloadMessage("job", message.toJson());
|
||||
}
|
||||
Reference in new issue
Block a user