mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-22 20:36:06 +08:00
[SHA] Store the SHA of a successful airframe test (#1921)
This commit is contained in:
committed by
GitHub
parent
dd9b81df78
commit
fcf972fd44
@@ -163,6 +163,7 @@
|
||||
settings="settings/rotorcraft_basic.xml"
|
||||
settings_modules="modules/gps_ubx_ucenter.xml modules/logger_sd_spi_direct.xml modules/temp_adc.xml modules/air_data.xml modules/geo_mag.xml modules/opa_controller.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_rate.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffffdffac31f"
|
||||
release="dc8a90d35290784bcc817edff08d8da2df64bcef"
|
||||
/>
|
||||
<aircraft
|
||||
name="Disco"
|
||||
@@ -174,6 +175,7 @@
|
||||
settings="settings/fixedwing_basic.xml"
|
||||
settings_modules="modules/nav_basic_fw.xml modules/guidance_full_pid_fw.xml modules/stabilization_adaptive_fw.xml modules/air_data.xml modules/airspeed_ms45xx_i2c.xml modules/gps_ubx_ucenter.xml modules/gps.xml modules/ahrs_float_dcm.xml modules/imu_common.xml"
|
||||
gui_color="blue"
|
||||
release="dfba3220f5b3500611231d02fca8799f9f045cb8"
|
||||
/>
|
||||
<aircraft
|
||||
name="Flappy"
|
||||
@@ -185,6 +187,7 @@
|
||||
settings=""
|
||||
settings_modules="modules/air_data.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="white"
|
||||
release="65aa9a711dc4a66ed2d7cf73c0f5872bbeeb821d"
|
||||
/>
|
||||
<aircraft
|
||||
name="GeniusDD"
|
||||
@@ -240,6 +243,7 @@
|
||||
settings="settings/rotorcraft_basic.xml"
|
||||
settings_modules="[modules/air_data.xml] modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps_ubx_ucenter.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffffcccaccca"
|
||||
release="433c2150022275f26fb4619e536903676d7e2c9e"
|
||||
/>
|
||||
<aircraft
|
||||
name="LadybirdMXS"
|
||||
@@ -262,6 +266,7 @@
|
||||
settings="settings/rotorcraft_basic.xml"
|
||||
settings_modules="modules/air_data.xml modules/geo_mag.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps_ubx_ucenter.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffffdffac31f"
|
||||
release="0fba1ce80a46d8dce23c570e6547595c89988fad"
|
||||
/>
|
||||
<aircraft
|
||||
name="MAVTec1_Kirk"
|
||||
@@ -273,6 +278,7 @@
|
||||
settings="settings/rotorcraft_basic.xml"
|
||||
settings_modules="modules/air_data.xml modules/geo_mag.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffff00000000"
|
||||
release="e688107d8a1f9c933cb0931eebb0e7b009ccc445"
|
||||
/>
|
||||
<aircraft
|
||||
name="MAVTec3_Chris"
|
||||
@@ -282,8 +288,9 @@
|
||||
telemetry="telemetry/default_rotorcraft.xml"
|
||||
flight_plan="flight_plans/TUDELFT/tudelft_rotorcraft_survey_imav2015_competition.xml"
|
||||
settings="settings/rotorcraft_basic.xml settings/modules/config_asctec_v2.xml"
|
||||
settings_modules="[modules/geo_mag.xml] [modules/nav_survey_poly_rotorcraft.xml] [modules/nav_survey_rectangle_rotorcraft.xml] modules/gps_ubx_ucenter.xml modules/switch_servo.xml modules/ahrs_float_mlkf.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffffd5c5aead"
|
||||
settings_modules="modules/geo_mag.xml modules/nav_survey_poly_rotorcraft.xml modules/nav_survey_rectangle_rotorcraft.xml modules/gps_ubx_ucenter.xml modules/switch_servo.xml modules/ahrs_float_mlkf.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="blue"
|
||||
release="2a6ad556f183875fa9fb8072d774beec7ba55701"
|
||||
/>
|
||||
<aircraft
|
||||
name="MAVTec4_Bart"
|
||||
@@ -328,6 +335,7 @@
|
||||
settings="settings/fixedwing_basic.xml settings/estimation/ac_char.xml"
|
||||
settings_modules="modules/digital_cam.xml modules/light.xml modules/gps_ubx_ucenter.xml modules/geo_mag.xml modules/air_data.xml modules/gps.xml modules/nav_basic_fw.xml modules/guidance_energy.xml modules/stabilization_attitude_fw.xml modules/ahrs_int_cmpl_quat.xml modules/imu_common.xml"
|
||||
gui_color="white"
|
||||
release="997fa535902c4d8f73bc34c02c862652cd47cae5"
|
||||
/>
|
||||
<aircraft
|
||||
name="Quad_Navstik"
|
||||
@@ -373,6 +381,7 @@
|
||||
settings="settings/rotorcraft_basic.xml ../conf/modules/px4_flash.xml ../conf/modules/glide_wing_lock.xml"
|
||||
settings_modules="[modules/air_data.xml] modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps_ubx_ucenter.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffffcccaccca"
|
||||
release="677c4c77398cfbabffae3efdcafdacfd04a0b9ab"
|
||||
/>
|
||||
<aircraft
|
||||
name="SkyWalker"
|
||||
@@ -384,6 +393,7 @@
|
||||
settings="settings/fixedwing_basic.xml settings/estimation/ins_neutrals.xml settings/control/tune_agr_climb.xml"
|
||||
settings_modules="modules/digital_cam.xml modules/light.xml modules/gps.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml"
|
||||
gui_color="#b748fe64fe64"
|
||||
release="7cf84458f9e2c7273215dfab122792d5e5813304"
|
||||
/>
|
||||
<aircraft
|
||||
name="Splash"
|
||||
@@ -439,6 +449,7 @@
|
||||
settings="settings/rotorcraft_basic.xml settings/control/rotorcraft_speed.xml"
|
||||
settings_modules="modules/video_rtp_stream.xml modules/cv_opticflow.xml modules/air_data.xml modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_float_mlkf.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
|
||||
gui_color="#ffffbc3bce5b"
|
||||
release="3fc18944dc13632f0ace7c7035dfc8286be88668"
|
||||
/>
|
||||
<aircraft
|
||||
name="bebop2_22"
|
||||
@@ -538,6 +549,7 @@
|
||||
settings="settings/rotorcraft_basic.xml"
|
||||
settings_modules="modules/ahrs_int_cmpl_quat.xml modules/guidance_hybrid.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml modules/gps_ubx_ucenter.xml"
|
||||
gui_color="blue"
|
||||
release="93a9608c3bc34eca6a0dcde4123d55dac7d7b448"
|
||||
/>
|
||||
<aircraft
|
||||
name="quadshot_pylons"
|
||||
@@ -560,5 +572,6 @@
|
||||
settings="settings/rotorcraft_basic.xml"
|
||||
settings_modules="modules/gps.xml modules/ahrs_float_cmpl_quat.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/imu_common.xml modules/air_data.xml modules/gps_ubx_ucenter.xml modules/guidance_hybrid.xml"
|
||||
gui_color="#ffffcccaccca"
|
||||
release="2a6ad556f183875fa9fb8072d774beec7ba55701"
|
||||
/>
|
||||
</conf>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
settings="settings/fixedwing_basic.xml [settings/estimation/ac_char.xml] [settings/control/ctl_energy.xml] settings/rc_settings_ins.xml settings/control/tune_agr_climb.xml [settings/control/ctl_energyadaptive.xml] [settings/OPENUAS/openuas_tuning_rc.xml]"
|
||||
settings_modules="modules/nav_smooth.xml modules/nav_survey_poly_osam.xml modules/gps_ubx_ucenter.xml modules/geo_mag.xml modules/air_data.xml modules/gps.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml modules/ahrs_int_cmpl_quat.xml modules/imu_common.xml"
|
||||
gui_color="#ffffffffffff"
|
||||
release="0f08b3acd3b4c08c91d3597e357735682d70cb47"
|
||||
/>
|
||||
<aircraft
|
||||
name="Itsy-Bitsy"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
import pygtk
|
||||
import gtk
|
||||
pygtk.require('2.0')
|
||||
@@ -16,8 +17,11 @@ import sys
|
||||
|
||||
lib_path = os.path.abspath(os.path.join( 'sw', 'lib', 'python'))
|
||||
sys.path.append(lib_path)
|
||||
import paparazzi
|
||||
|
||||
import paparazzi
|
||||
from paparazzi_health import PaparazziOverview
|
||||
|
||||
import xml.etree.ElementTree
|
||||
|
||||
class ConfChooser(object):
|
||||
|
||||
@@ -72,6 +76,29 @@ class ConfChooser(object):
|
||||
controlpanel_files = paparazzi.get_list_of_controlpanel_files(self.exclude_backups)
|
||||
self.update_combo(self.controlpanel_file_combo, controlpanel_files, self.controlpanel_xml)
|
||||
|
||||
def count_airframes_in_conf(self):
|
||||
airframes = 0
|
||||
releases = 0
|
||||
if self.conf_file_combo.get_active_text() is None:
|
||||
return
|
||||
desc = ""
|
||||
afile = os.path.join(paparazzi.conf_dir, self.conf_file_combo.get_active_text())
|
||||
if os.path.exists(afile):
|
||||
e = xml.etree.ElementTree.parse(afile).getroot()
|
||||
for atype in e.findall('aircraft'):
|
||||
if airframes > 0:
|
||||
desc += ", "
|
||||
#print(atype.get('name'))
|
||||
airframes += 1
|
||||
if (not atype.get('release') is None) & (not atype.get('release') == ""):
|
||||
releases += 1
|
||||
desc += '<a href="https://github.com/paparazzi/paparazzi/commit/' + atype.get('release') + '">' + atype.get('name') + "</a>"
|
||||
else:
|
||||
desc += atype.get('name')
|
||||
desc = "<b>" + str(airframes) + " airframes:</b> " + desc
|
||||
self.conf_airframes.set_markup(desc)
|
||||
return
|
||||
|
||||
def about(self, widget):
|
||||
about_d = gtk.AboutDialog()
|
||||
about_d.set_program_name("Paparazzi Configuration Selector")
|
||||
@@ -98,6 +125,11 @@ class ConfChooser(object):
|
||||
self.find_conf_files()
|
||||
self.find_controlpanel_files()
|
||||
|
||||
def more_info(self, widget):
|
||||
obj = PaparazziOverview(0)
|
||||
obj.run()
|
||||
|
||||
|
||||
def launch(self, widget):
|
||||
self.accept(widget)
|
||||
|
||||
@@ -154,6 +186,7 @@ class ConfChooser(object):
|
||||
if os.path.exists(filename):
|
||||
os.remove(filename)
|
||||
self.update_conf_label()
|
||||
self.count_airframes_in_conf()
|
||||
self.find_conf_files()
|
||||
self.print_status("Deleted: " + filename)
|
||||
|
||||
@@ -177,6 +210,7 @@ class ConfChooser(object):
|
||||
os.remove(self.conf_xml)
|
||||
os.symlink(selected, self.conf_xml)
|
||||
self.update_conf_label()
|
||||
self.count_airframes_in_conf()
|
||||
self.find_conf_files()
|
||||
|
||||
selected = self.controlpanel_file_combo.get_active_text()
|
||||
@@ -200,6 +234,7 @@ class ConfChooser(object):
|
||||
os.remove(self.conf_xml)
|
||||
os.symlink(self.conf_personal_name, self.conf_xml)
|
||||
self.update_conf_label()
|
||||
self.count_airframes_in_conf()
|
||||
self.find_conf_files()
|
||||
|
||||
def personal_controlpanel(self, widget):
|
||||
@@ -217,6 +252,9 @@ class ConfChooser(object):
|
||||
def print_status(self, text):
|
||||
self.statusbar.push(self.context_id, text)
|
||||
|
||||
def changed_cb(self, entry):
|
||||
self.count_airframes_in_conf()
|
||||
|
||||
# Constructor Functions
|
||||
def __init__(self):
|
||||
# paparazzi process
|
||||
@@ -276,7 +314,7 @@ class ConfChooser(object):
|
||||
|
||||
self.conf_file_combo = gtk.combo_box_new_text()
|
||||
self.find_conf_files()
|
||||
# self.firmwares_combo.connect("changed", self.parse_list_of_airframes)
|
||||
self.conf_file_combo.connect("changed", self.changed_cb)
|
||||
self.conf_file_combo.set_size_request(550, 30)
|
||||
|
||||
self.btnDeleteConf = gtk.Button(None, gtk.STOCK_DELETE)
|
||||
@@ -294,6 +332,7 @@ class ConfChooser(object):
|
||||
self.confbar.pack_start(self.btnPersonalConf)
|
||||
self.my_vbox.pack_start(self.confbar, False)
|
||||
|
||||
|
||||
# Explain current conf config
|
||||
|
||||
self.conf_explain = gtk.Label("")
|
||||
@@ -305,6 +344,22 @@ class ConfChooser(object):
|
||||
|
||||
self.my_vbox.pack_start(self.cfexbar, False)
|
||||
|
||||
# Count Airframes
|
||||
self.conf_airframes = gtk.Label("")
|
||||
self.count_airframes_in_conf()
|
||||
self.conf_airframes.set_size_request(650,180)
|
||||
self.conf_airframes.set_line_wrap(True)
|
||||
|
||||
self.btnInfo = gtk.Button(None, "More\nInfo")
|
||||
self.btnInfo.connect("clicked", self.more_info)
|
||||
self.btnInfo.set_tooltip_text("More information on airframe files")
|
||||
|
||||
self.caexbar = gtk.HBox()
|
||||
self.caexbar.pack_start(self.conf_airframes)
|
||||
self.caexbar.pack_start(self.btnInfo)
|
||||
|
||||
self.my_vbox.pack_start(self.caexbar, False)
|
||||
|
||||
# Controlpanel
|
||||
self.controlpanel_label = gtk.Label("Controlpanel:")
|
||||
self.controlpanel_label.set_size_request(100, 30)
|
||||
|
||||
@@ -12,8 +12,6 @@ import commands
|
||||
|
||||
import lxml.etree as ET
|
||||
|
||||
test = 1
|
||||
|
||||
# if PAPARAZZI_HOME not set, then assume the tree containing this
|
||||
# file is a reasonable substitute
|
||||
PAPARAZZI_HOME = getenv("PAPARAZZI_HOME", path.normpath(path.join(path.dirname(path.abspath(__file__)), '../../../')))
|
||||
@@ -95,6 +93,11 @@ def get_list_of_subsystems(firmware):
|
||||
#subsys_dir = path.join( firmwares_dir, "subsystems/shared/" )
|
||||
return get_list_of_files(subsys_dir, ".makefile")
|
||||
|
||||
def get_list_of_flight_plan_files():
|
||||
mylist = glob.glob(path.join(flight_plan_dir, "*.xml"))
|
||||
mylist.sort()
|
||||
return mylist
|
||||
|
||||
def get_list_of_servo_drivers():
|
||||
# \todo where do we know this?
|
||||
return ["Ppm", "Asctec", "Scilab"]
|
||||
|
||||
Executable
+239
@@ -0,0 +1,239 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import webbrowser
|
||||
import os
|
||||
import datetime
|
||||
from fnmatch import fnmatch
|
||||
import subprocess
|
||||
PIPE = subprocess.PIPE
|
||||
|
||||
import paparazzi
|
||||
|
||||
import xml.etree.ElementTree
|
||||
|
||||
class Airframe:
|
||||
name = ""
|
||||
id = ""
|
||||
xml = ""
|
||||
flight_plan = ""
|
||||
release = ""
|
||||
def __init__(self):
|
||||
name = ""
|
||||
ac_id = ""
|
||||
xml = ""
|
||||
flight_plan = ""
|
||||
release = ""
|
||||
|
||||
class AirframeFile:
|
||||
name = ""
|
||||
description = ""
|
||||
firmware = []
|
||||
boards = []
|
||||
xml = ""
|
||||
includes = []
|
||||
def __init__(self):
|
||||
name = ""
|
||||
description = ""
|
||||
firmware = []
|
||||
boards = []
|
||||
xml = ""
|
||||
includes = []
|
||||
|
||||
class PaparazziOverview(object):
|
||||
|
||||
def RepresentsInt(self, s):
|
||||
try:
|
||||
v=int(s)
|
||||
return v
|
||||
except ValueError:
|
||||
return -1
|
||||
|
||||
def maximize_text_size(self, txt):
|
||||
if len(txt) > 500:
|
||||
return txt[:500] + '...'
|
||||
else:
|
||||
return txt
|
||||
|
||||
def git_behind(self, sha):
|
||||
process = subprocess.Popen(['git', 'rev-list', sha+"..HEAD", '--count'], stdout=PIPE, stderr=PIPE)
|
||||
stdoutput, stderroutput = process.communicate()
|
||||
return self.RepresentsInt(stdoutput)
|
||||
|
||||
def git_ahead(self, sha):
|
||||
process = subprocess.Popen(['git', 'rev-list', "HEAD.."+sha, '--count'], stdout=PIPE, stderr=PIPE)
|
||||
stdoutput, stderroutput = process.communicate()
|
||||
return self.RepresentsInt(stdoutput)
|
||||
|
||||
def get_last_commit_sha(self, file):
|
||||
process = subprocess.Popen(['git', 'log', '-n', 1, '--pretty=format:%H', '--', sha+"..HEAD"], stdout=PIPE, stderr=PIPE)
|
||||
stdoutput, stderroutput = process.communicate()
|
||||
return stdoutput
|
||||
|
||||
|
||||
def find_xml_files(self, folder):
|
||||
airframe_files = []
|
||||
pattern = "*.xml"
|
||||
confn = "*conf[._-]*xml"
|
||||
controlpanel = "*control_panel[._-]*xml"
|
||||
|
||||
for path, subdirs, files in os.walk(os.path.join(paparazzi.conf_dir,folder)):
|
||||
for name in files:
|
||||
if fnmatch(name, confn):
|
||||
continue
|
||||
if fnmatch(name, controlpanel):
|
||||
continue
|
||||
if fnmatch(name, pattern):
|
||||
filepath = os.path.join(path, name)
|
||||
entry = os.path.relpath(filepath, paparazzi.conf_dir)
|
||||
airframe_files.append(entry)
|
||||
airframe_files.sort()
|
||||
return airframe_files
|
||||
|
||||
def find_airframe_files(self):
|
||||
return self.find_xml_files('airframes/')
|
||||
|
||||
def find_flightplan_files(self):
|
||||
return self.find_xml_files('flight_plans/')
|
||||
|
||||
def list_airframes_in_conf(self, conf):
|
||||
if conf is None:
|
||||
return []
|
||||
list_of_airframes = []
|
||||
|
||||
afile = os.path.join(paparazzi.conf_dir, conf)
|
||||
if os.path.exists(afile):
|
||||
e = xml.etree.ElementTree.parse(afile).getroot()
|
||||
for atype in e.findall('aircraft'):
|
||||
release = ""
|
||||
if (not atype.get('release') is None) & (not atype.get('release') == ""):
|
||||
release = atype.get('release')
|
||||
af = Airframe()
|
||||
af.name = atype.get('name')
|
||||
af.ac_id = atype.get('ac_id')
|
||||
af.xml = atype.get('airframe')
|
||||
af.flight_plan = atype.get('flight_plan')
|
||||
af.release = release
|
||||
list_of_airframes.append(af)
|
||||
return list_of_airframes
|
||||
|
||||
def airframe_details(self, xmlname):
|
||||
airframe = AirframeFile()
|
||||
airframe.xml = xmlname
|
||||
airframe.firmware = []
|
||||
airframe.includes = []
|
||||
airframe.board = []
|
||||
if xml is None:
|
||||
return airframe
|
||||
afile = os.path.join(paparazzi.conf_dir, xmlname)
|
||||
if os.path.exists(afile):
|
||||
e = xml.etree.ElementTree.parse(afile).getroot()
|
||||
for atype in e.findall('firmware'):
|
||||
if (not atype.get('name') is None) & (not atype.get('name') == "") & (not atype.get('name') in airframe.firmware):
|
||||
airframe.firmware.append(atype.get('name'))
|
||||
for btype in atype.findall('target'):
|
||||
if (not btype.get('board') is None) & (not btype.get('board') == "") & (not btype.get('board') in airframe.board):
|
||||
airframe.board.append( btype.get('board') )
|
||||
for atype in e.findall('include'):
|
||||
if (not atype.get('href') is None) & (not atype.get('href') == ""):
|
||||
airframe.includes.append( atype.get('href') )
|
||||
for atype in e.findall('description'):
|
||||
airframe.description = atype.text
|
||||
|
||||
return airframe
|
||||
|
||||
def flightplan_includes(self, xmlname):
|
||||
includes = []
|
||||
print(xmlname)
|
||||
if xml is None:
|
||||
return includes
|
||||
afile = os.path.join(paparazzi.conf_dir, xmlname)
|
||||
if os.path.exists(afile):
|
||||
e = xml.etree.ElementTree.parse(afile).getroot()
|
||||
for atype in e.findall('include'):
|
||||
if (not atype.get('procedure') is None) & (not atype.get('procedure') == ""):
|
||||
includes.append( atype.get('procedure') )
|
||||
return includes
|
||||
|
||||
|
||||
# Constructor Functions
|
||||
def __init__(self, verbose):
|
||||
self.exclude_backups = 1
|
||||
self.verbose = verbose
|
||||
|
||||
def run(self):
|
||||
# find all airframe XML's
|
||||
afs = self.find_airframe_files()
|
||||
fps = self.find_flightplan_files()
|
||||
#brds = self.find_boards()
|
||||
# write all confs
|
||||
with open('var/paparazzi.html','w') as f:
|
||||
f.write('<!DOCTYPE html>\n<html lang="en">\n<head>\n<title>Paparazzi</title>\n<meta charset="utf-8"/>\n<meta http-equiv="Cache-Control" content="no-cache" />\n')
|
||||
f.write('<style>\n.conf {\n\tfloat: left;\n\tmargin: 10px;\n\tpadding: 5px;\n}\n\n.uav {\n\tfloat: left;\n\tmargin: 10px;\n\tpadding: 5px;\n\twidth: 250px;\n\tborder: 1px solid black;\n\tbackground-color:#fef9e7;\n}\n</style>\n\n</head>\n')
|
||||
f.write('<body>\n')
|
||||
conf_files = paparazzi.get_list_of_conf_files()
|
||||
for conf in conf_files:
|
||||
airframes = self.list_airframes_in_conf(conf)
|
||||
f.write('<div class="conf"><h2>' + conf + '</h2>')
|
||||
for ac in airframes:
|
||||
f.write('<div class="uav" title="'+ ac.name + ': ' + ac.xml +'"><h4>' + ac.name + ' (' + ac.ac_id + ')</h4 >')
|
||||
sha = ac.release
|
||||
xml = ac.xml
|
||||
name = ac.name
|
||||
# remove airframe xml from list
|
||||
if xml in afs:
|
||||
afs.remove(xml)
|
||||
if ac.flight_plan in fps:
|
||||
fps.remove(ac.flight_plan)
|
||||
if (not sha is None) and (not sha == ""):
|
||||
f.write('<p>Last flown with <a href="https://github.com/paparazzi/paparazzi/commit/' + sha + '">' + sha[:6] + '...</a></p>')
|
||||
behind = self.git_behind(sha)
|
||||
color = 'orange'
|
||||
if behind < 200:
|
||||
color = 'green'
|
||||
if behind > 2000:
|
||||
color = 'red'
|
||||
if behind > 0:
|
||||
f.write( '<p><font color="' + color + '">Is <b>' + str(behind) + '</b> commits behind</font></p>')
|
||||
else:
|
||||
f.write( '<p><font color="red">Is <b>not available</b> on this machine</font></p>')
|
||||
outside = self.git_ahead(sha)
|
||||
if outside > 0:
|
||||
f.write( '<p><font color="red">Using <b>' + str(outside) + '</b> commits not in master</font></p>')
|
||||
af = self.airframe_details(xml)
|
||||
f.write('<p>' + ", ".join(af.firmware) + ' on ' + ", ".join(af.board) + ' <a href="file:////' + os.path.realpath('./conf/'+ac.xml) + '">[E]</a></p>')
|
||||
f.write('<p><font color="gray"><i>' + self.maximize_text_size(af.description) + '</i></font></p>')
|
||||
if self.verbose:
|
||||
f.write('<p><a href="https://github.com/paparazzi/paparazzi/blob/master/conf/' + ac.xml + '"/>' + ac.xml + '</a></p>')
|
||||
if self.verbose:
|
||||
f.write('<p><a href="https://github.com/paparazzi/paparazzi/blob/master/conf/' + ac.flight_plan + '"/>' + ac.flight_plan + '</a></p>')
|
||||
#fp_inc = self.flightplan_includes(ac.flight_plan)
|
||||
if len(af.includes) > 0:
|
||||
for i in af.includes:
|
||||
inc_name = i[5:].replace('$AC_ID',ac.ac_id)
|
||||
if inc_name in afs:
|
||||
afs.remove(inc_name)
|
||||
if self.verbose:
|
||||
f.write('<p>Includes: ' + ", ".join(af.includes) + '</p>')
|
||||
f.write('</div>\n\n')
|
||||
f.write('</div>\n')
|
||||
f.write('<hr><div class="conf"><h1>Airframe xml that are not tested by any conf:</h1>')
|
||||
for af in afs:
|
||||
f.write('<li>' + af)
|
||||
f.write('</div><div class="conf"><h1>Flight_plan xml that are not tested by any conf:</h1>')
|
||||
for af in fps:
|
||||
f.write('<li>' + af)
|
||||
|
||||
f.write('</div></body>\n</html>\n')
|
||||
webbrowser.open('file://' + os.path.realpath('./var/paparazzi.html'))
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
brief = 0
|
||||
if len(sys.argv) > 1:
|
||||
brief = 1
|
||||
|
||||
obj = PaparazziOverview(brief)
|
||||
obj.run()
|
||||
|
||||
@@ -1037,6 +1037,104 @@
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame919">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment958">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox960">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label_release">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">_________________</property>
|
||||
<property name="ellipsize">start</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_compare_release">
|
||||
<property name="label" translatable="yes">Compare</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_gitk">
|
||||
<property name="label" translatable="yes">Gitk</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_store_release">
|
||||
<property name="label">Tag</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label998">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Release</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
@@ -45,7 +45,8 @@ let aircraft_sample = fun name ac_id ->
|
||||
"flight_plan", "flight_plans/basic.xml";
|
||||
"settings", "settings/fixedwing_basic.xml";
|
||||
"settings_modules", "";
|
||||
"gui_color", "blue" ],
|
||||
"gui_color", "blue";
|
||||
"release", "" ],
|
||||
[])
|
||||
|
||||
|
||||
@@ -104,6 +105,32 @@ let gcs_or_edit = fun file ->
|
||||
| 2 -> ignore (Sys.command (sprintf "%s -edit '%s'&" gcs file))
|
||||
| _ -> failwith "Internal error: gcs_or_edit"
|
||||
|
||||
let gitk_version = fun sha ->
|
||||
(Sys.command (sprintf "gitk '%s'&" sha));
|
||||
()
|
||||
|
||||
|
||||
let execute_cmd_and_return_text = fun cmd ->
|
||||
let tmp_file = Filename.temp_file "" ".txt" in
|
||||
let _ = Sys.command @@ cmd ^ " > " ^ tmp_file in
|
||||
let chan = open_in tmp_file in
|
||||
let s = input_line chan in
|
||||
close_in chan;
|
||||
s
|
||||
|
||||
let tag_this_version = fun _ ->
|
||||
(execute_cmd_and_return_text "git rev-parse HEAD")
|
||||
|
||||
let get_commits_after_version = fun sha ->
|
||||
(execute_cmd_and_return_text (sprintf "git rev-list %s..HEAD --count" sha))
|
||||
|
||||
let get_commits_outside_version = fun sha ->
|
||||
(execute_cmd_and_return_text (sprintf "git rev-list HEAD..%s --count" sha))
|
||||
|
||||
let show_gitk_of_version = fun sha ->
|
||||
GToolbox.message_box ~title:"Compare" ("There have been " ^ (get_commits_after_version sha ) ^ " commits since the last reported test.\n The last reported test used " ^ (get_commits_outside_version sha ) ^ " commits that are not in this branch.");
|
||||
(execute_cmd_and_return_text (sprintf "gitk %s..HEAD & gitk HEAD..%s &" sha sha))
|
||||
|
||||
type ac_data =
|
||||
Label of GMisc.label
|
||||
| Tree of Gtk_tools.tree
|
||||
@@ -154,7 +181,8 @@ let save_callback = fun ?user_save gui ac_combo tree tree_modules () ->
|
||||
"flight_plan", gui#label_flight_plan#text;
|
||||
"settings", Gtk_tools.tree_values ~only_checked:false tree;
|
||||
"settings_modules", Gtk_tools.tree_values ~only_checked:false tree_modules;
|
||||
"gui_color", color ],
|
||||
"gui_color", color;
|
||||
"release", gui#label_release#text ],
|
||||
[]) in
|
||||
begin try Hashtbl.remove Utils.aircrafts ac_name with _ -> () end;
|
||||
Hashtbl.add Utils.aircrafts ac_name aircraft
|
||||
@@ -295,7 +323,8 @@ let ac_combo_handler = fun gui (ac_combo:Gtk_tools.combo) target_combo flash_com
|
||||
"settings", "settings", Tree tree_set, Some gui#button_browse_settings, Some gui#button_edit_settings, edit, Some gui#button_remove_settings;
|
||||
"settings_modules", "settings", Tree tree_set_mod, None, None, (fun _ -> ()), None;
|
||||
"radio", "radios", Label gui#label_radio, Some gui#button_browse_radio, Some gui#button_edit_radio, edit, None;
|
||||
"telemetry", "telemetry", Label gui#label_telemetry, Some gui#button_browse_telemetry, Some gui#button_edit_telemetry, edit, None]
|
||||
"telemetry", "telemetry", Label gui#label_telemetry, Some gui#button_browse_telemetry, Some gui#button_edit_telemetry, edit, None;
|
||||
"release", "release", Label gui#label_release, None, None, edit, None]
|
||||
in
|
||||
|
||||
(* Update_params callback *)
|
||||
@@ -532,6 +561,36 @@ let ac_combo_handler = fun gui (ac_combo:Gtk_tools.combo) target_combo flash_com
|
||||
)
|
||||
ac_files;
|
||||
|
||||
(* Tag Current Commit-Aircraft *)
|
||||
let callback = fun _ ->
|
||||
match GToolbox.question_box ~title:"Mark Test-flight Successfull" ~default:2 ~buttons:["Yes"; "Cancel"] "Are you sure you tested this airframe in all its modes (e.g. GPS) and confirm all works well." with
|
||||
| 1 ->
|
||||
begin
|
||||
gui#label_release#set_text (tag_this_version () );
|
||||
save_callback gui ac_combo tree_set tree_set_mod ();
|
||||
let ac_name = Gtk_tools.combo_value ac_combo in
|
||||
update_params ac_name
|
||||
|
||||
end
|
||||
| _ -> ()
|
||||
in
|
||||
ignore (gui#button_store_release#connect#clicked ~callback);
|
||||
|
||||
(* Compare *)
|
||||
let callback = fun _ ->
|
||||
show_gitk_of_version gui#label_release#text;
|
||||
()
|
||||
in
|
||||
ignore (gui#button_compare_release#connect#clicked ~callback);
|
||||
|
||||
(* Browse Version *)
|
||||
let callback = fun _ ->
|
||||
gitk_version gui#label_release#text
|
||||
in
|
||||
ignore (gui#button_gitk#connect#clicked ~callback);
|
||||
|
||||
|
||||
|
||||
(* Save button *)
|
||||
ignore(gui#menu_item_save_ac#connect#activate ~callback:(save_callback ~user_save:true gui ac_combo tree_set tree_set_mod))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user