Skip to content

Commit

Permalink
mavpicviewer: send poi from image viewer to mosaic
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Oct 4, 2024
1 parent 3356a8f commit 508635b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
6 changes: 3 additions & 3 deletions MAVProxy/tools/mavpicviewer/mavpicviewer_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import time
import os
import piexif
from mavpicviewer_shared import mavpicviewer_loc, mavpicviewer_pos, mavpicviewer_poi, SetFilenumber, SetFOV, Close
from mavpicviewer_shared import mavpicviewer_loc, mavpicviewer_pos, mavpicviewer_poi, SetFilenumber, SetFOV, Close, SetPOI, ClearPOI

from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import mp_elevation
Expand Down Expand Up @@ -195,7 +195,7 @@ def poi_capture_done(self, X, Y):
mavpicviewer_loc(lat1, lon1, alt1),
mavpicviewer_loc(lat2, lon2, alt2))
self.poi_dict[self.filenumber] = poi
#wx.CallAfter(self.mosaic.set_image_poi, self.filenumber, poi)
self.send_comm_object(SetPOI(self.filenumber, poi))
self.poi_start_pos = None
# update image
self.update_image()
Expand All @@ -213,7 +213,7 @@ def cmd_clear_poi(self):
self.poi_dict.pop(self.filenumber)
self.update_image()
self.remove_rectangle_from_map(self.filename)
#self.mosaic.clear_image_poi(self.filenumber)
self.send_comm_object(ClearPOI(self.filenumber))

# update current image to next image
def cmd_nextimage(self):
Expand Down
6 changes: 5 additions & 1 deletion MAVProxy/tools/mavpicviewer/mavpicviewer_mosaic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import wx.lib.scrolledpanel as scrolled
from MAVProxy.modules.lib import multiproc
from MAVProxy.modules.lib import mp_util
from mavpicviewer_shared import mavpicviewer_loc, get_file_list, SetFilenumber, SetFOV, Close
from mavpicviewer_shared import mavpicviewer_loc, get_file_list, SetFilenumber, SetFOV, Close, SetPOI, ClearPOI
from mavpicviewer_settings import mavpicviewer_settings
import mavpicviewer_image
if mp_util.has_wxpython:
Expand Down Expand Up @@ -180,6 +180,10 @@ def handle_comm_object(self, obj):
self.set_filenunmber(obj.filenumber, False)
elif isinstance(obj, Close):
self.menu_quit(None)
elif isinstance(obj, SetPOI):
self.set_image_poi(obj.filenumber, obj.poi)
elif isinstance(obj, ClearPOI):
self.clear_image_poi(obj.filenumber)

# send a communication object to the image viewer
def send_comm_object(self, obj):
Expand Down
11 changes: 11 additions & 0 deletions MAVProxy/tools/mavpicviewer/mavpicviewer_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,14 @@ def __init__(self, fov):
class Close:
def __init__(self):
pass

# set POI for the given filenumber
class SetPOI:
def __init__(self, filenumber, poi):
self.filenumber = filenumber
self.poi = poi

# clear POI for the given filenumber
class ClearPOI:
def __init__(self, filenumber):
self.filenumber = filenumber

0 comments on commit 508635b

Please sign in to comment.