Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter committed Mar 5, 2013
1 parent e576429 commit ff5d374
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
15 changes: 8 additions & 7 deletions sw/tools/airframe_editor/airframe_editor.py
Expand Up @@ -53,6 +53,7 @@ def find_subsystems(self, widget):
def find_module_defines(self, widget):
mod = paparazzi.get_module_information(self.combo.get_active_text())
print(mod.description)
self.text_box.set_text(mod.description)
for d in mod.defines:
print("define: " + d[0])
for c in mod.configures:
Expand All @@ -67,7 +68,7 @@ def combo_changed(self, widget):
self.textbox.set_text(widget.get_active_text())

def textchanged(self, widget):
self.label1.set_text(self.textbox.get_text())
self.text_box.set_text(self.textbox.get_text())

def about(self, widget):
gui_dialogs.about(paparazzi_home)
Expand Down Expand Up @@ -147,9 +148,9 @@ def fill_datagrid_from_section(self):
self.datagrid.append_column(self.unit_column)

self.cell2 = gtk.CellRendererText()
self.cell2.Editable = True
self.cell2.Editable = True
self.cell3 = gtk.CellRendererText()
self.cell3.Editable = True
self.cell3.Editable = True

self.name_column.pack_start(self.cell2, True)
self.name_column.add_attribute(self.cell2, 'text', 0)
Expand All @@ -158,8 +159,8 @@ def fill_datagrid_from_section(self):
self.value_column.add_attribute(self.cell3, 'text', 1)

self.datagrid.set_search_column(0)
self.name_column.set_sort_column_id(0)
self.datagrid.set_reorderable(True)
self.name_column.set_sort_column_id(0)
self.datagrid.set_reorderable(True)


def destroy(self, widget, data=None):
Expand Down Expand Up @@ -227,12 +228,12 @@ def __init__(self):
self.combo.connect("changed", self.combo_changed)
self.toolbar.pack_start(self.combo)

self.label1 = gtk.Label("")
self.text_box = gtk.Label("")

self.textbox = gtk.Entry()
self.textbox.connect("changed",self.textchanged)

self.box1.pack_start(self.label1)
self.editor.pack_start(self.text_box)
self.box1.pack_start(self.textbox)

self.window.add(self.box1)
Expand Down
8 changes: 8 additions & 0 deletions sw/tools/airframe_editor/airframe_xml.py
Expand Up @@ -30,6 +30,14 @@ def organize_airframe_xml():
ET.ElementTree(airframe).write('test.xml', pretty_print=True)










if __name__ == '__main__':
print(paparazzi.home_dir)
organize_airframe_xml()
Expand Down
4 changes: 3 additions & 1 deletion sw/tools/airframe_editor/paparazzi.py
Expand Up @@ -23,14 +23,14 @@
# Structures
PprzModule = namedtuple("PprzModule", "description defines configures")

# List Of Stuff
def get_list_of_files(directory, extension):
mylist = glob.glob( path.join( directory, "*" + extension) )
mylist.sort()
ret = []
for it in mylist:
ret.append( it.replace(directory,"").replace(extension, "") )
return ret


def get_list_of_modules():
return get_list_of_files( modules_dir, ".xml" )
Expand All @@ -40,10 +40,12 @@ def get_list_of_firmwares():

def get_list_of_subsystems(firmware):
subsys_dir = path.join( firmwares_dir, "subsystems/" + firmware + "/" )
# \todo how about shared
#subsys_dir = path.join( firmwares_dir, "subsystems/shared/" )
return get_list_of_files( subsys_dir, ".makefile" )

def get_list_of_servo_drivers():
# \todo where do we know this?
return ["Ppm", "Asctec", "Scilab"]

def get_module_information(module_name):
Expand Down

0 comments on commit ff5d374

Please sign in to comment.