Skip to content

Commit

Permalink
start routing from boat position
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Jan 15, 2021
1 parent b4f20cb commit cdf0db0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions gweatherrouting/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class BoatInfo:
speed = 0.0
heading = 0.0

def isValid(self):
return latitude != 0.0 and longitude != 0.0


class Core(EventDispatcher):
def __init__(self, conn):
Expand Down
6 changes: 4 additions & 2 deletions gweatherrouting/ui/gtk/routingwizarddialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ def getSelectedStartPoint (self):
if s == 0:
return None
elif s == 1:
# TODO: return boat position
return None
if self.core.boatInfo.isValid():
return [self.core.boatInfo.latitude, self.core.boatInfo.longitude]
else:
return None
else:
s -= 2
return self.core.poiManager.pois[s].position

0 comments on commit cdf0db0

Please sign in to comment.