def posToStr(self, pos): if self.format == 0: return (cf.formatX(pos.x(), cf.FormatDecimalDegrees, 6, cf.FormatFlag(0)), cf.formatY(pos.y(), cf.FormatDecimalDegrees, 6, cf.FormatFlag(0))) if self.format == 1: return (cf.formatX(pos.x(), cf.FormatDegreesMinutes, 4, cf.FlagDegreesUseStringSuffix), cf.formatY(pos.y(), cf.FormatDegreesMinutes, 4, cf.FlagDegreesUseStringSuffix)) if self.format == 2: return (cf.formatX(pos.x(), cf.FormatDegreesMinutesSeconds, 2, cf.FlagDegreesUseStringSuffix), cf.formatY(pos.y(), cf.FormatDegreesMinutesSeconds, 2, cf.FlagDegreesUseStringSuffix))
def posToStr(self, pos): flg = cf.FlagDegreesUseStringSuffix if self.format == 1: f, pr = cf.FormatDegreesMinutes, 4 elif self.format == 2: f, pr = cf.FormatDegreesMinutesSeconds, 2 else: f, pr, flg = cf.FormatDecimalDegrees, 6, cf.FormatFlag(0) return self.sep.join( (cf.formatY(pos.y(), f, pr, flg), cf.formatX(pos.x(), f, pr, flg)))
def __init__(self, mobile, parent=None): super(TrackingDisplay, self).__init__(parent) self.setMovable(True) self.setFloatable(True) self.mobile = mobile self.upToDate = False self.lastFix = 0.0 s = QSettings() self.defFormat = s.value('PosiView/Misc/DefaultFormat', defaultValue=0, type=int) self.format = self.defFormat & 3 self.withSuff = QgsCoordinateFormatter.FlagDegreesUseStringSuffix if bool( self.defFormat & 4) else QgsCoordinateFormatter.FormatFlag(0) self.createActions() self.mobile.newPosition.connect(self.onNewPosition) self.mobile.timeout.connect(self.onTimeout)
def __init__(self, mobile, parent=None): super(TrackingDisplay, self).__init__(parent) self.setMovable(True) self.setFloatable(True) self.mobile = mobile self.timedOut = True self.lastFix = 0.0 s = QSettings() self.defFormat = s.value('PosiView/Misc/DefaultFormat', defaultValue=0, type=int) self.format = self.defFormat & 3 self.withSuff = cf.FlagDegreesUseStringSuffix if bool( self.defFormat & 4) else cf.FormatFlag(0) try: self.sep = cf.separator() + ' ' except AttributeError: self.sep = ', ' self.createActions() self.mobile.newPosition.connect(self.onNewPosition) self.mobile.timeout.connect(self.onTimeout) self.posText = '0.000000, 0.000000'