示例#1
0
	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()
示例#2
0
	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
示例#3
0
	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)
示例#4
0
	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))
示例#5
0
    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))
示例#6
0
    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
示例#7
0
    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)