def mouse_event_view(self, event): '''called on mouse events in View window''' x = event.X y = event.Y if self.current_view >= len(self.images): return image = self.images[self.current_view] latlon = cuav_util.gps_position_from_xy(x, y, image.pos, C=self.c_params, shape=image.shape, altitude=image.pos.altitude) if self.last_view_latlon is None or latlon is None: dist = '' else: distance = cuav_util.gps_distance(self.last_view_latlon[0], self.last_view_latlon[1], latlon[0], latlon[1]) bearing = cuav_util.gps_bearing(self.last_view_latlon[0], self.last_view_latlon[1], latlon[0], latlon[1]) dist = "dist %.1f bearing %.1f alt=%.1f shape=%s" % ( distance, bearing, image.pos.altitude, image.shape) print("-> %s %s %s" % (latlon, image.filename, dist)) self.last_view_latlon = latlon
def mouse_event_view(self, event): '''called on mouse events in View window''' x = event.X y = event.Y if self.current_view >= len(self.images): return image = self.images[self.current_view] latlon = cuav_util.gps_position_from_xy(x, y, image.pos, C=self.c_params) print("-> %s %s" % (latlon, image.filename))
def mouse_event_view(self, event): '''called on mouse events in View window''' x = event.X y = event.Y if self.current_view >= len(self.images): return image = self.images[self.current_view] latlon = cuav_util.gps_position_from_xy(x, y, image.pos, C=self.c_params) if self.last_view_latlon is None: dist = '' else: dist = "dist %.1f" % cuav_util.gps_distance(latlon[0], latlon[1], self.last_view_latlon[0], self.last_view_latlon[1]) print("-> %s %s %s" % (latlon, image.filename, dist)) self.last_view_latlon = latlon
def mouse_event_view(self, event): '''called on mouse events in View window''' x = event.X y = event.Y if self.current_view >= len(self.images): return image = self.images[self.current_view] latlon = cuav_util.gps_position_from_xy(x, y, image.pos, C=self.c_params, shape=image.shape) if self.last_view_latlon is None or latlon is None: dist = '' else: distance = cuav_util.gps_distance(self.last_view_latlon[0], self.last_view_latlon[1], latlon[0], latlon[1]) bearing = cuav_util.gps_bearing(self.last_view_latlon[0], self.last_view_latlon[1], latlon[0], latlon[1]) dist = "dist %.1f bearing %.1f alt=%.1f shape=%s" % (distance, bearing, image.pos.altitude, image.shape) print("-> %s %s %s" % (latlon, image.filename, dist)) self.last_view_latlon = latlon
def mouse_event_view(self, event): '''called on mouse events in View window''' x = event.X y = event.Y if self.current_view >= len(self.images): return image = self.images[self.current_view] latlon = cuav_util.gps_position_from_xy(x, y, image.pos, C=self.c_params) if self.last_view_latlon is None: dist = '' else: dist = "dist %.1f" % cuav_util.gps_distance( latlon[0], latlon[1], self.last_view_latlon[0], self.last_view_latlon[1]) print("-> %s %s %s" % (latlon, image.filename, dist)) self.last_view_latlon = latlon