'messages' : (cmd_messages, 'show messages'), 'devid' : (cmd_devid, 'show device IDs'), 'map' : (cmd_map, 'show map view'), 'fft' : (cmd_fft, 'show a FFT (if available)'), 'loadLog' : (cmd_loadfile, 'load a log file'), 'stats' : (cmd_stats, 'show statistics on the log'), 'magfit' : (cmd_magfit, 'fit mag parameters to WMM'), 'dump' : (cmd_dump, 'dump messages from log'), } def progress_bar(pct): if pct % 2 == 0: mestate.console.write('#') if __name__ == "__main__": multiproc.freeze_support() from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--version", action='store_true', help="show version") parser.add_argument("files", metavar="<FILE>", nargs="?") args = parser.parse_args() if args.version: #pkg_resources doesn't work in the windows exe build, so read the version file try: version = pkg_resources.require("mavproxy")[0].version except Exception as e: start_script = mp_util.dot_mavproxy("version.txt") f = open(start_script, 'r') version = f.readline() print("MAVExplorer Version: " + version)
while True: setting = self.child_pipe.recv() if not isinstance(setting, MPSetting): break try: self.settings.set(setting.name, setting.value) except Exception: print("Unable to set %s to %s" % (setting.name, setting.value)) def is_alive(self): '''check if child is still going''' return self.child.is_alive() if __name__ == "__main__": multiproc.freeze_support() def test_callback(setting): '''callback on apply''' print("Changing %s to %s" % (setting.name, setting.value)) # test the settings from MAVProxy.modules.lib import mp_settings, time from MAVProxy.modules.lib.mp_settings import MPSetting settings = mp_settings.MPSettings( [ MPSetting('link', int, 1, tab='TabOne'), MPSetting('altreadout', int, 10, range=(-30,1017), increment=1), MPSetting('pvalue', float, 0.3, range=(-3.0,1e6), increment=0.1, digits=2), MPSetting('enable', bool, True, tab='TabTwo'), MPSetting('colour', str, 'Blue', choice=['Red', 'Green', 'Blue']), MPSetting('foostr', str, 'blah', label='Foo String') ])