def on_alt_changed(self, *args): # Altitude Changed altStr = self.altVar.get() valid, alt = tools.validateFloat(altStr) if not valid: tkMessageBox.showerror(message="Altitude must be a float.") self.altVar.set(0)
def on_lowAlt_change(self,*args): if (not self.firstLoad) and (not self.moving): # Check if low alt valid valid, lowAlt = tools.validateFloat(self.lowAltVar.get()) if not valid: tkMessageBox.showerror(message="Low Altitude (m) must be a float.") self.lowAltVar.set(0) # Low Alt Entry changes self.polygonLine.polygon.pointList[self.num].lowHeight = float(lowAlt)
def on_highAlt_change(self,*args): if (not self.firstLoad) and (not self.moving): # Check if high alt valid valid, highAlt = tools.validateFloat(self.highAltVar.get()) if not valid: tkMessageBox.showerror(message="High Altitude (m) must be a float.") self.highAltVar.set(float(self.lowAltVar.get())+1) # High Alt Entry changes self.polygonLine.polygon.pointList[self.num].highHeight = float(highAlt) # Redraw self.polygonLine.polygon.reDrawPolyPoints()
def on_lon_changed(self, *args): # Longitude Changed lonStr = self.lonVar.get() valid, lon = tools.validateFloat(lonStr) if not valid: tkMessageBox.showerror( message="Longitude must be between -180 and 180.") self.lonVar.set(0) else: if (lon < -180) or (lon > 180): tkMessageBox.showerror( message="Longitude must be between -180 and 180.") self.lonVar.set(cmp(lon, 0) * 180)
def on_lat_changed(self, *args): # Latitude Changed latStr = self.latVar.get() valid, lat = tools.validateFloat(latStr) if not valid: tkMessageBox.showerror( message="Latitude must be between -90 and 90.") self.latVar.set(0) else: if (lat < -90) or (lat > 90): tkMessageBox.showerror( message="Latitude must be between -90 and 90.") self.latVar.set(cmp(lat, 0) * 90) else: # Update Map Region self.updateMapOnOriginMove()
def on_head_changed(self, *args): # Heading Changed headStr = self.headVar.get() valid, head = tools.validateFloat(headStr) if not valid: tkMessageBox.showerror( message="Heading must be between 0 and 360.") self.headVar.set(0) else: if (head < 0): tkMessageBox.showerror( message="Heading must be between 0 and 360.") self.headVar.set('0') elif (head > 360): tkMessageBox.showerror( message="Heading must be between 0 and 360.") self.headVar.set('360')
def on_lon_change(self,*args): if (not self.firstLoad) and (not self.moving): # Check if longitude valid valid, lon = tools.validateFloat(self.lonVar.get()) if not valid: tkMessageBox.showerror(message="Longitude must be between -180 and 180.") self.lonVar.set(0) else: if (lon<-180) or (lon>180): tkMessageBox.showerror(message="Longitude must be between -180 and 180.") self.lonVar.set(cmp(lon,0)*180) # Lon Entry changes point = self.polygonLine.polygon.pointList[self.num] lat = float(self.latVar.get()) # Set values point.x = lon point.center = lon, lat point.ptAnn.set_position((lon,lat)) # Redraw self.polygonLine.polygon.reDrawPolyPoints()