ESP8266ComponentSummary.qml 2.31 KB
Newer Older
1 2
import QtQuick 2.3
import QtQuick.Controls 1.2
dogmaphobic's avatar
dogmaphobic committed
3 4 5 6 7 8 9

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

10
Item {
dogmaphobic's avatar
dogmaphobic committed
11 12 13
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark

14
    FactPanelController { id: controller; }
dogmaphobic's avatar
dogmaphobic committed
15 16

    ESP8266ComponentController {
Don Gagne's avatar
Don Gagne committed
17
        id:         esp8266
dogmaphobic's avatar
dogmaphobic committed
18 19 20 21 22 23 24
    }

    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")
25
    property Fact wifiMode:         controller.getParameterFact(esp8266.componentID, "WIFI_MODE", false) //-- Don't bitch if missing
dogmaphobic's avatar
dogmaphobic committed
26 27 28

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