Skip to content

GUI Documentation

Winter edited this page Jun 4, 2026 · 18 revisions

GUI Application:

The GUI is used for user interface to control the drone. GUI includes the following features:

  • Taking off and landing
  • Controlling to different places
  • Real time data collections

def is_valid_port(port: str) -> bool

  • Checks if user is entering the correct format port string and blocks incorrect ones.

class HistoryLineEdit(QComboBox)

  • Changes the history of the port using the methods shown below.
    • def set_empty_state(self): Empty previous port histories
    • def update_items(self, items): Updates the port and uses set_empty_state(self) to clear previous history the current port changes
    • def load_history(self): Pull the data and updates it using update_items(self, items)
    • def save_history(self):
    • def text(self):

class TC_Drone_App(QMainWindow)

  • def init(self): Creates a window that allows user tocontrol the drone & battery status
    • e.g. connect & disconnect the drone
    • move the drone in all directions
    • presents battery status

class StreamToTextBox:

  • redirects the print to GUI console

async def update_battery(self):

  • updates the battery status

async def takeoff_land_toggle(self):

  • enables or disables taking off or landing based on drone status

async def run_checks_on_connect(self):

  • Checking battery status and takeoff_toggle in the background when connect successfully with the drone

closeEvent(self, event):

  • close the GUI ( side note: need to disconnect the drone before closing the GUI)

on_connect(self):

  • using the port from the user and connects it to the drone

on_disconnect(self):

  • disconnect the drone

on_takeoff(self):

  • take off the drone

on_land(self):

  • land the drone

execute_movement(self, direction, method):

  • Give a commend to the drone to move somewhere and the drone executes it

Clone this wiki locally