def removePathPreviews(self): """Remove recorded path previews from the map canvas""" for rb in self.previousPaths: self.canvas.scene().removeItem(rb) SourcePlugins.callMethodOnEach("clearMapCanvasItems", ()) self.previousPaths=[] self.canvas.refresh()
def terminateAndCleanup(self): """Stop gathering process.""" self.msleep(500) #fixes video crashing when stopped immediately after start; TODO: do it better SourcePlugins.callMethodOnEach("stopRecording", ()) self.controller.gpsDaemon.stopRecording() self.disconnect(self.controller.gpsDaemon, SIGNAL("newTrackPoint(PyQt_PyObject)"), self.onNewTrackPoint) self.alive=False
def initialize(self): """Initializes data gathering.""" self.outputDirectory=self.getDataDirectory() SourcePlugins.callMethodOnEach("startRecording", (self.outputDirectory,)) self.controller.gpsDaemon.startRecording(self.outputDirectory+"nmea.log", self.outputDirectory+"path.gpx") self.connect(self.controller.gpsDaemon, SIGNAL("newTrackPoint(PyQt_PyObject)"), self.onNewTrackPoint)
def run(self): """Main execution method, that periodically polls for data.""" self.stopMe=0 while (self.stopMe==0) and self.controller.gpsDaemon.ok(): QThread.msleep(50) SourcePlugins.callMethodOnEach("pollRecording", ()) #let the caller know we finished self.emit(SIGNAL("gathererEvent(PyQt_PyObject)"), ("recordingTerminated", self.stopMe))
def run(self): """Main execution method, that periodically polls for data.""" self.stopMe = 0 while (self.stopMe == 0) and self.controller.gpsDaemon.ok(): QThread.msleep(50) SourcePlugins.callMethodOnEach("pollRecording", ()) #let the caller know we finished self.emit(SIGNAL("gathererEvent(PyQt_PyObject)"), ("recordingTerminated", self.stopMe))
def terminateAndCleanup(self): """Stop gathering process.""" self.msleep( 500 ) #fixes video crashing when stopped immediately after start; TODO: do it better SourcePlugins.callMethodOnEach("stopRecording", ()) self.controller.gpsDaemon.stopRecording() self.disconnect(self.controller.gpsDaemon, SIGNAL("newTrackPoint(PyQt_PyObject)"), self.onNewTrackPoint) self.alive = False
def initialize(self): """Initializes data gathering.""" self.outputDirectory = self.getDataDirectory() SourcePlugins.callMethodOnEach("startRecording", (self.outputDirectory, )) self.controller.gpsDaemon.startRecording( self.outputDirectory + "nmea.log", self.outputDirectory + "path.gpx") self.connect(self.controller.gpsDaemon, SIGNAL("newTrackPoint(PyQt_PyObject)"), self.onNewTrackPoint)