GUI5: Automate Execute Button - 3C-SCSU/Avatar GitHub Wiki

  • LiveData Stream

    • LiveData class runs on a separate thread, continuously generating predictions.
    • Signals (data) are emitted to notify the backend of new predictions every 2 seconds.
  • Prediction Handling (handleAction Slot)

    • Receives predictions from LiveData and updates current_prediction_label)
    • Validates predictions against a predefined VALIDPREDICTIONS set (i.e. 'takeoff', 'right', 'left', 'landing', 'forward', 'backward').
    • Appends predictions to predictions_log for tracking.
    • Triggers the executeAction method for valid predictions.
  • Action Execution (executeAction Slot)

    • Executes valid predictions automatically.
    • Adds an entry to the flight_log with the action taken.
    • Emits flightLogUpdated signal to notify the GUI of changes.
  • Button label update (currentPredictionChanged Signal)

    • Triggered whenever current_prediction_label changes in the backend.
    • Ensures the "Not What I Was Thinking" button reflects the most recent prediction or user input.

Demo of the code changes:
Watch the video