Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIC PicViewer #1437

Merged
merged 3 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions MAVProxy/modules/lib/mp_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,22 @@ def call(self):
return None
return "\"" + dlg.GetPath() + "\""


class MPMenuCallDirDialog(object):
rmackay9 marked this conversation as resolved.
Show resolved Hide resolved
'''used to create a file folder dialog callback'''
def __init__(self, flags=None, title='Directory'):
self.title = title

def call(self):
'''show a directory chooser dialog'''
from MAVProxy.modules.lib.wx_loader import wx

dlg = wx.DirDialog(None, self.title, '')
if dlg.ShowModal() != wx.ID_OK:
return None
return "\"" + dlg.GetPath() + "\""


class MPMenuCallTextDialog(object):
'''used to create a value dialog callback'''
def __init__(self, title='Enter Value', default='', settings=None):
Expand Down
4 changes: 4 additions & 0 deletions MAVProxy/tools/mavpicviewer/mavpicviewer.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd ..\..\
python setup.py build install --user
python .\MAVProxy\tools\mavpicviewer\mavpicviewer.py
pause
38 changes: 38 additions & 0 deletions MAVProxy/tools/mavpicviewer/mavpicviewer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python3

'''
MAV Picture Viewer

Quick and efficient reviewing of images taken from a drone

AP_FLAKE8_CLEAN
'''

import os
from argparse import ArgumentParser
from MAVProxy.modules.lib import multiproc
import mavpicviewer_image
import mavpicviewer_mosaic

prefix_str = "mavpicviewer: "


# main function
if __name__ == "__main__":
multiproc.freeze_support()
parser = ArgumentParser(description=__doc__)
parser.add_argument("filepath", nargs='?', default=".", help="filename or directory holding images")
args = parser.parse_args()

# check destination directory exists
if not os.path.exists(args.filepath):
exit(prefix_str + "invalid destination directory")

# create queue for interprocess communication
mosaic_to_image_comm, image_to_mosaic_comm = multiproc.Pipe()

# create image viewer
mavpicviewer_image.mavpicviewer_image(args.filepath, image_to_mosaic_comm)

# create mosaic
mavpicviewer_mosaic.mavpicviewer_mosaic(args.filepath, mosaic_to_image_comm)
Loading