Browse Source

APM ToolBar chnages

QGC4.4
Bill Bonney 12 years ago
parent
commit
75def93bc3
  1. 3
      qgroundcontrol.pro
  2. 43
      qml/ApmToolBar.qml
  3. 30
      qml/components/DigitalDisplay.qml
  4. 1
      src/comm/SerialLink.cc
  5. 3
      src/ui/apmtoolbar.cpp

3
qgroundcontrol.pro

@ -773,7 +773,8 @@ unix:!macx:!symbian: LIBS += -losg @@ -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 \

43
qml/ApmToolBar.qml

@ -25,6 +25,7 @@ Rectangle { @@ -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 { @@ -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 { @@ -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 { @@ -129,7 +168,7 @@ Rectangle {
onClicked: globalObj.connectMAV()
}
Rectangle {
Rectangle { // Spacer
anchors.right: parent.right
width: 5
height: parent.height

30
qml/components/DigitalDisplay.qml

@ -0,0 +1,30 @@ @@ -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"
}
}

1
src/comm/SerialLink.cc

@ -96,6 +96,7 @@ QVector<QString>* SerialLink::getCurrentPorts() @@ -96,6 +96,7 @@ QVector<QString>* 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()

3
src/ui/apmtoolbar.cpp

@ -21,7 +21,8 @@ APMToolBar::APMToolBar(QWidget *parent): @@ -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)

Loading…
Cancel
Save