示例#1
0
 def add_point_avg(self):
     # if turned on
     if roam.config.settings.get('gps_averaging', True):
         # if currently happening
         if roam.config.settings.get('gps_averaging_in_action', True):
             # start -> stop
             # time to do some averaging
             average_point = GPS.average_func(GPS.gpspoints)
             point = QgsPoint(average_point[0], average_point[1],
                              average_point[2])
             self.geometryComplete.emit(QgsGeometry(point))
             # default settings
             vertex_or_point = ''
             in_action = False
             start_time = '0:00:00'
             roam.config.settings['gps_averaging_measurements'] = 0
         else:
             # stop -> start
             vertex_or_point = 'point'
             in_action = True
             start_time = datetime.now()
         roam.config.settings['gps_vertex_or_point'] = vertex_or_point
         roam.config.settings['gps_averaging_in_action'] = in_action
         roam.config.settings['gps_averaging_start_time'] = start_time
         roam.config.save()
     else:
         self.addatgps()
示例#2
0
 def add_vertex_avg(self):
     # if turned on
     if roam.config.settings.get('gps_averaging', True):
         # if currently happening
         if roam.config.settings.get('gps_averaging_in_action', True):
             # start -> stop
             # averaging
             average_point = GPS.average_func(GPS.gpspoints)
             point = QgsPoint(average_point[0], average_point[1],
                              average_point[2])
             self.add_point(point)
             self.band.addPoint(QgsPointXY(point))
             # default settings
             vertex_or_point = ''
             in_action = False
             start_time = '0:00:00'
             roam.config.settings['gps_averaging_measurements'] = 0
             self.set_buttons_avg(True)
         else:
             # stop -> start
             # avg settings
             vertex_or_point = 'vertex'
             in_action = True
             start_time = datetime.now()
             self.set_buttons_avg(False)
         roam.config.settings['gps_vertex_or_point'] = vertex_or_point
         roam.config.settings['gps_averaging_in_action'] = in_action
         roam.config.settings['gps_averaging_start_time'] = start_time
         roam.config.save()
     else:
         self.add_vertex()