Skip to content

Commit

Permalink
[FEATURE] Add gps file stream
Browse files Browse the repository at this point in the history
'gpsfile' in roam.config
  • Loading branch information
NathanW2 committed Sep 18, 2017
1 parent 56521dc commit 577c654
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Binary file added src/roam.tests/data/GPSLog.txt
Binary file not shown.
4 changes: 1 addition & 3 deletions src/roam/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
__author__ = 'Nathan.Woodrow'

import gps
GPS = gps.GPSService()

import roam.config
import os
Expand All @@ -10,8 +8,8 @@
# print "Setting fake GPS"
# GPS = gps.FileGPSService(portname)

from roam.api.gps import GPS
from roam.api.events import RoamEvents
from roam.api.featureform import FeatureForm
from roam.api.interface import RoamInterface

from roam.api.featureforms import inspectionform
16 changes: 13 additions & 3 deletions src/roam/api/gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from qgis.core import (QgsGPSDetector, QgsGPSConnectionRegistry, QgsPoint, \
QgsCoordinateTransform, QgsCoordinateReferenceSystem, \
QgsGPSInformation, QgsCsException)
from roam.utils import log, info
import roam.config

from roam.utils import log, info, logger
from roam.config import settings as config

NMEA_FIX_BAD = 1
NMEA_FIX_2D = 2
Expand Down Expand Up @@ -237,5 +238,14 @@ def disconnectGPS(self):
self.gpsdisconnected.emit()


GPS = GPSService()
try:
filename = config["gpsfile"]
print filename
if os.path.exists(filename):
print "Using file name"
GPS = FileGPSService(filename=filename)
else:
GPS = GPSService()
except KeyError:
GPS = GPSService()

0 comments on commit 577c654

Please sign in to comment.