ESP8266ComponentSummary.qml 2.27 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
    anchors.fill:   parent

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

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

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

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