Skip to content

Commit

Permalink
FEATURE: template overview window
Browse files Browse the repository at this point in the history
  • Loading branch information
amilcarlucas committed Jun 2, 2024
1 parent 80a3892 commit 637df1a
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
39 changes: 39 additions & 0 deletions MethodicConfigurator/frontend_tkinter_template_overview_window.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env python3

'''
This file is part of Ardupilot methodic configurator. https://github.com/ArduPilot/MethodicConfigurator
(C) 2024 Amilcar do Carmo Lucas
SPDX-License-Identifier: GPL-3
'''

import tkinter as tk
from tkinter import ttk

from middleware_template_overview import TemplateOverview

class TemplateOverviewWindow:
def __init__(self):
self.window = tk.Tk()
self.window.title("ArduPilot methodic configurator - Template Overview")
self.window.geometry("600x400")

self.template_overview = TemplateOverview()

# Define the columns for the Treeview
columns = ("FC Manufacturer", "FC Model", "TOW Min [KG]", "TOW Max [KG]", "RC Protocol", "Telemetry Model", "ESC Protocol", "Prop Diameter [inches]", "GNSS Model")
self.tree = ttk.Treeview(self.window, columns=columns, show='headings')
for col in columns:
self.tree.heading(col, text=col)

# Populate the Treeview with data from the template overview
for item in self.template_overview.__dict__.values():
self.tree.insert('', 'end', values=(item))

self.tree.pack(fill=tk.BOTH, expand=True)

self.window.mainloop()

if __name__ == "__main__":
app = TemplateOverviewWindow()
22 changes: 22 additions & 0 deletions MethodicConfigurator/middleware_template_overview.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3

'''
This file is part of Ardupilot methodic configurator. https://github.com/ArduPilot/MethodicConfigurator
(C) 2024 Amilcar do Carmo Lucas
SPDX-License-Identifier: GPL-3
'''

class TemplateOverview:
def __init__(self):
self.fc_manufacturer = None
self.fc_model = None
self.tow_min_kg = None
self.tow_max_kg = None
self.rc_protocol = None
self.telemetry_model = None
self.esc_protocol = None
self.prop_diameter_inches = None
self.gnss_model = None

0 comments on commit 637df1a

Please sign in to comment.