diff --git a/MAVProxy/tools/mavpicviewer/mosaic_window2.py b/MAVProxy/tools/mavpicviewer/mosaic_window2.py index 10d21a2c04..8240edc96f 100644 --- a/MAVProxy/tools/mavpicviewer/mosaic_window2.py +++ b/MAVProxy/tools/mavpicviewer/mosaic_window2.py @@ -66,17 +66,17 @@ def __init__(self, filelist, image_select_cb): #self.frame.Bind(wx.EVT_MENU, self.menu_set_api_key_show, id=1) # add settings input window - self.settings_frame = wx.Frame(None, title="Input Settings", size=(560, 50)) - self.settings_text_input = wx.TextCtrl(self.settings_frame, id=-1, pos=(10, 10), size=(450, -1), - style=wx.TE_PROCESS_ENTER, value="hello") - self.settings_set_button = wx.Button(self.settings_frame, id=-1, label="Set", pos=(470, 10), size=(75, 25)) + #self.settings_frame = wx.Frame(None, title="Input Settings", size=(560, 50)) + #self.settings_text_input = wx.TextCtrl(self.settings_frame, id=-1, pos=(10, 10), size=(450, -1), + # style=wx.TE_PROCESS_ENTER, value="hello") + #self.settings_set_button = wx.Button(self.settings_frame, id=-1, label="Set", pos=(470, 10), size=(75, 25)) #self.settings_frame.Bind(wx.EVT_BUTTON, self.settings_set_button_click, self.settings_set_button) #self.settings_frame.Bind(wx.EVT_TEXT_ENTER, self.settings_set_button_click, self.settings_text_input) #self.settings_frame.Bind(wx.EVT_CLOSE, self.apikey_close_button_click) # add a read-only status text box self.text_status = wx.TextCtrl(self.frame, id=-1, size=(600, 60), style=wx.TE_READONLY | wx.TE_MULTILINE | wx.TE_RICH) - self.text_status.value = "POI lat: 0.0 lon: 0.0" + self.text_status.SetValue("POI lat: 0.0 lon: 0.0") # add a scrolled panel self.scrolled_panel = scrolled.ScrolledPanel(self.frame, -1, size=(600, 600), style=wx.TAB_TRAVERSAL) @@ -133,6 +133,11 @@ def update_title(self): title_str = f"PicViewer Mosaic ({self.filenumber+1} of {len(self.filelist)})" self.set_title(title_str) + # set status text + def set_status_text(self, status_text): + """set status text""" + self.text_status.SetValue(status_text) + # process window events def on_image_click(self, event): """process image click event""" diff --git a/MAVProxy/tools/mavpicviewer/picviewer_window.py b/MAVProxy/tools/mavpicviewer/picviewer_window.py index 92e75a4684..b4db6e30b3 100644 --- a/MAVProxy/tools/mavpicviewer/picviewer_window.py +++ b/MAVProxy/tools/mavpicviewer/picviewer_window.py @@ -19,6 +19,7 @@ from MAVProxy.modules.lib import mp_elevation if mp_util.has_wxpython: + from MAVProxy.modules.lib.wx_loader import wx from MAVProxy.modules.lib.mp_menu import MPMenuTop from MAVProxy.modules.lib.mp_menu import MPMenuItem from MAVProxy.modules.lib.mp_menu import MPMenuSubMenu @@ -211,7 +212,10 @@ def poi_capture_done(self, X, Y): lat_avg = (lat1 + lat2) / 2.0 lon_avg = (lon1 + lon2) / 2.0 alt_avg = (alt1 + alt2) / 2.0 - print("POI capture lat:%f lon:%f alt:%f" % (lat_avg, lon_avg, alt_avg)) + filename = os.path.basename(self.filelist[self.filenumber]) + poi_str = "POI image:%d %s lat:%.7f lon:%.7f alt:%.2f" % (self.filenumber+1, filename, lat_avg, lon_avg, alt_avg) + print(poi_str) + wx.CallAfter(self.mosaic.set_status_text, poi_str) self.poi_start_pos = None # update image self.update_image()