diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index c968bfd9a09b2fae60fa7a24844b22370a74ddca..80d0414c31208cf1a904c9f7e66db576725549cb 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -773,7 +773,8 @@ unix:!macx:!symbian: LIBS += -losg OTHER_FILES += \ dongfang_notes.txt \ - src/ui/dongfang-scrapyard.txt + src/ui/dongfang-scrapyard.txt \ + qml/components/DigitalDisplay.qml OTHER_FILES += \ qml/ApmToolBar.qml \ diff --git a/qml/ApmToolBar.qml b/qml/ApmToolBar.qml index fed71697aab8304505ba38a9820a2ec275d408c9..393e4c3bf980ee98759bbb970f9b67ddac5eec5d 100644 --- a/qml/ApmToolBar.qml +++ b/qml/ApmToolBar.qml @@ -25,6 +25,7 @@ Rectangle { } } +// [BB] The code below should work, not sure why. replaced with code above // Connections { // target: globalObj // onMAVConnected: { @@ -43,7 +44,7 @@ Rectangle { anchors.left: parent.left spacing: 2 - Rectangle { + Rectangle { // Spacer width: 5 height: parent.height color: "black" @@ -94,6 +95,44 @@ Rectangle { image: "./resources/apmplanner/toolbar/terminal.png" onClicked: globalObj.triggerTerminalView() } + + Rectangle { // Spacer + width: 5 + height: parent.height + color: "black" + } + +// DigitalDisplay { // Information Pane +// title:"Mode" +// textValue: "Stabilize" +// color: "black" +// } +// DigitalDisplay { // Information Pane +// title: "Speed" +// textValue: "11.0m/s" +// color: "black" +// } +// DigitalDisplay { // Information Pane +// title: "Alt" +// textValue: "20.0m" +// color: "black" +// } +// DigitalDisplay { // Information Pane +// title: "Volts" +// textValue: "14.8V" +// color: "black" +// } +// DigitalDisplay { // Information Pane +// title: "Current" +// textValue: "12.0A" +// color: "black" +// } +// DigitalDisplay { // Information Pane +// title: "Level" +// textValue: "77%" +// color: "black" +// } + } Row { @@ -129,7 +168,7 @@ Rectangle { onClicked: globalObj.connectMAV() } - Rectangle { + Rectangle { // Spacer anchors.right: parent.right width: 5 height: parent.height diff --git a/qml/components/DigitalDisplay.qml b/qml/components/DigitalDisplay.qml new file mode 100644 index 0000000000000000000000000000000000000000..be69b6712bdf2033e376100ae256e059ffd8756b --- /dev/null +++ b/qml/components/DigitalDisplay.qml @@ -0,0 +1,30 @@ +import QtQuick 1.1 + +Rectangle { + + property alias title: displayTitle.text + property string textValue: "none" + + width: 100 + height: parent.height/3 + anchors.verticalCenter: parent.verticalCenter + border.color: "white" + + Text { + id:displayTitle + anchors.left: parent.left + anchors.leftMargin: 3 + anchors.verticalCenter: parent.verticalCenter + text: "blank" + color: "white" + } + + Text { + id:displayValue + anchors.right: parent.right + anchors.rightMargin: 3 + anchors.verticalCenter: parent.verticalCenter + text: textValue + color: "white" + } +} diff --git a/src/comm/SerialLink.cc b/src/comm/SerialLink.cc index bd456d93b4d0928a538563295e0d2926e8588dc7..0091e434af9950d432f38f64cfa310c78548092a 100644 --- a/src/comm/SerialLink.cc +++ b/src/comm/SerialLink.cc @@ -96,6 +96,7 @@ QVector* SerialLink::getCurrentPorts() Q_ASSERT_X(m_ports != NULL, "getCurrentPorts", "m_ports is NULL"); m_ports->clear(); // Example use QSerialPortInfo + // [TODO] make this thread safe foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) { // qDebug() << "PortName : " << info.portName() diff --git a/src/ui/apmtoolbar.cpp b/src/ui/apmtoolbar.cpp index ff9a944199903e97585bf5c4b875d49797e3023e..f3253160bf768bf330080786d038a7e3a55ac753 100644 --- a/src/ui/apmtoolbar.cpp +++ b/src/ui/apmtoolbar.cpp @@ -21,7 +21,8 @@ APMToolBar::APMToolBar(QWidget *parent): } QObject *object = rootObject(); - object->setProperty("connected", false); + if (object) + object->setProperty("connected", false); } void APMToolBar::setFlightViewAction(QAction *action)