ESP8266ComponentSummary.qml 2.4 KB
Newer Older
dogmaphobic's avatar
dogmaphobic committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import QtQuick 2.2
import QtQuick.Controls 1.2

import QGroundControl.FactSystem    1.0
import QGroundControl.FactControls  1.0
import QGroundControl.Controls      1.0
import QGroundControl.Palette       1.0
import QGroundControl.Controllers   1.0

FactPanel {
    id:             panel
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark

    QGCPalette          { id: qgcPal; colorGroupEnabled: enabled }
    FactPanelController { id: controller; factPanel: panel }

    ESP8266ComponentController {
Don Gagne's avatar
Don Gagne committed
19 20
        id:         esp8266
        factPanel:  panel
dogmaphobic's avatar
dogmaphobic committed
21 22 23 24 25 26 27
    }

    property Fact debugEnabled:     controller.getParameterFact(esp8266.componentID, "DEBUG_ENABLED")
    property Fact wifiChannel:      controller.getParameterFact(esp8266.componentID, "WIFI_CHANNEL")
    property Fact wifiHostPort:     controller.getParameterFact(esp8266.componentID, "WIFI_UDP_HPORT")
    property Fact wifiClientPort:   controller.getParameterFact(esp8266.componentID, "WIFI_UDP_CPORT")
    property Fact uartBaud:         controller.getParameterFact(esp8266.componentID, "UART_BAUDRATE")
28
    property Fact wifiMode:         controller.getParameterFact(esp8266.componentID, "WIFI_MODE", false) //-- Don't bitch if missing
dogmaphobic's avatar
dogmaphobic committed
29 30 31

    Column {
        anchors.fill:       parent
32
        VehicleSummaryRow {
33
            labelText: qsTr("Firmware Version:")
34 35
            valueText: esp8266.version
        }
36 37 38 39
        VehicleSummaryRow {
            labelText: qsTr("WiFi Mode:")
            valueText: wifiMode ? (wifiMode.value === 0 ? "AP Mode" : "Station Mode") : "AP Mode"
        }
dogmaphobic's avatar
dogmaphobic committed
40
        VehicleSummaryRow {
41
            labelText: qsTr("WiFi Channel:")
dogmaphobic's avatar
dogmaphobic committed
42
            valueText: wifiChannel ? wifiChannel.valueString : ""
dogmaphobic's avatar
dogmaphobic committed
43 44
        }
        VehicleSummaryRow {
45
            labelText: qsTr("WiFi AP SSID:")
dogmaphobic's avatar
dogmaphobic committed
46 47 48
            valueText: esp8266.wifiSSID
        }
        VehicleSummaryRow {
49
            labelText: qsTr("WiFi AP Password:")
dogmaphobic's avatar
dogmaphobic committed
50 51
            valueText: esp8266.wifiPassword
        }
52
        /* Too much info makes it all crammed
53 54 55 56 57 58 59 60
        VehicleSummaryRow {
            labelText: qsTr("WiFi STA SSID:")
            valueText: esp8266.wifiSSIDSta
        }
        VehicleSummaryRow {
            labelText: qsTr("WiFi STA Password:")
            valueText: esp8266.wifiPasswordSta
        }
61
        */
dogmaphobic's avatar
dogmaphobic committed
62
        VehicleSummaryRow {
63
            labelText: qsTr("UART Baud Rate:")
dogmaphobic's avatar
dogmaphobic committed
64
            valueText: uartBaud ? uartBaud.valueString : ""
dogmaphobic's avatar
dogmaphobic committed
65 66 67
        }
    }
}