Commit d3ccd004 authored by Bill Bonney's avatar Bill Bonney

Updated layout of APM Toolbar Status Display for ARM/DISARM

parent b57635c0
...@@ -801,7 +801,8 @@ unix:!macx:!symbian: LIBS += -losg ...@@ -801,7 +801,8 @@ unix:!macx:!symbian: LIBS += -losg
OTHER_FILES += \ OTHER_FILES += \
dongfang_notes.txt \ dongfang_notes.txt \
src/ui/dongfang-scrapyard.txt \ src/ui/dongfang-scrapyard.txt \
qml/components/DigitalDisplay.qml qml/components/DigitalDisplay.qml \
qml/components/StatusDisplay.qml
OTHER_FILES += \ OTHER_FILES += \
qml/ApmToolBar.qml \ qml/ApmToolBar.qml \
......
...@@ -10,7 +10,7 @@ Rectangle { ...@@ -10,7 +10,7 @@ Rectangle {
property alias baudrateLabel: baudrate.label property alias baudrateLabel: baudrate.label
property bool connected: false property bool connected: false
property bool armed: false property bool armed: false
property string armedstr: "Disarmed" property string armedstr: "DISARMED"
width: toolbar.width width: toolbar.width
height: 72 height: 72
...@@ -19,12 +19,14 @@ Rectangle { ...@@ -19,12 +19,14 @@ Rectangle {
onArmedChanged: { onArmedChanged: {
if (armed) { if (armed) {
armedText.text = "Armed" statusDisplay.statusText = "ARMED"
armedText.color = "Red" statusDisplay.statusTextColor = "red"
statusDisplay.statusBackgroundColor = "#FF880000"
} }
else { else {
armedText.text = "Disarmed" statusDisplay.statusText = "DISARMED"
armedText.color = "Green" statusDisplay.statusTextColor = "yellow"
statusDisplay.statusBackgroundColor = "black"
} }
} }
...@@ -110,19 +112,19 @@ Rectangle { ...@@ -110,19 +112,19 @@ Rectangle {
image: "./resources/apmplanner/toolbar/terminal.png" image: "./resources/apmplanner/toolbar/terminal.png"
onClicked: globalObj.triggerTerminalView() onClicked: globalObj.triggerTerminalView()
} }
Rectangle {
width:150 Rectangle { // Spacer
width: 5
height: parent.height height: parent.height
Text { color: "black"
id: armedText; }
anchors.fill: parent
verticalAlignment: Text.AlignVCenter StatusDisplay {
horizontalAlignment: Text.AlignHCenter id: statusDisplay
font.pixelSize: 20 width: 110
color: "green" statusText: "DISARMED"
text: "Disarmed" statusTextColor: "yellow"
} statusBackgroundColor: "black"
color:"black"
} }
Rectangle { // Spacer Rectangle { // Spacer
......
...@@ -5,7 +5,7 @@ Rectangle { ...@@ -5,7 +5,7 @@ Rectangle {
property alias title: displayTitle.text property alias title: displayTitle.text
property string textValue: "none" property string textValue: "none"
width: 100 width: 110
height: parent.height/3 height: parent.height/3
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
border.color: "white" border.color: "white"
......
import QtQuick 1.1
Rectangle {
id: statusDisplay
property alias statusText: armedText.text
property alias statusTextColor: armedText.color
property alias statusBackgroundColor: statusDisplay.color
width: 100
height: parent.height/3
anchors.verticalCenter: parent.verticalCenter
radius: 3
border.color: "white"
border.width: 1
Text {
id: armedText
anchors.centerIn: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 20
}
}
...@@ -33,15 +33,27 @@ void APMToolBar::activeUasSet(UASInterface *uas) ...@@ -33,15 +33,27 @@ void APMToolBar::activeUasSet(UASInterface *uas)
} }
if (m_uas) if (m_uas)
{ {
disconnect(m_uas,SIGNAL(armingChanged(bool)),this,SLOT(armingChanged(bool))); disconnect(m_uas,SIGNAL(armingChanged(bool)),
this,SLOT(armingChanged(bool)));
disconnect(uas,SIGNAL(armingChanged(int, QString)),
this,SLOT(armingChanged(int, QString)));
} }
connect(uas,SIGNAL(armingChanged(bool)),this,SLOT(armingChanged(bool))); connect(uas,SIGNAL(armingChanged(bool)),
this,SLOT(armingChanged(bool)));
connect(uas,SIGNAL(armingChanged(int, QString)),
this,SLOT(armingChanged(int, QString)));
} }
void APMToolBar::armingChanged(bool armed) void APMToolBar::armingChanged(bool armed)
{ {
this->rootObject()->setProperty("armed",armed); this->rootObject()->setProperty("armed",armed);
} }
void APMToolBar::armingChanged(int sysId, QString armingState)
{
qDebug() << "APMToolBar: sysid " << sysId << " armState" << armingState;
}
void APMToolBar::setFlightViewAction(QAction *action) void APMToolBar::setFlightViewAction(QAction *action)
{ {
connect(this, SIGNAL(triggerFlightView()), action, SIGNAL(triggered())); connect(this, SIGNAL(triggerFlightView()), action, SIGNAL(triggered()));
......
...@@ -33,8 +33,6 @@ signals: ...@@ -33,8 +33,6 @@ signals:
void MAVConnected(bool connected); void MAVConnected(bool connected);
public slots: public slots:
void armingChanged(bool armed);
void activeUasSet(UASInterface *uas);
void selectFlightView(); void selectFlightView();
void selectFlightPlanView(); void selectFlightPlanView();
void selectHardwareView(); void selectHardwareView();
...@@ -46,6 +44,10 @@ public slots: ...@@ -46,6 +44,10 @@ public slots:
void showConnectionDialog(); void showConnectionDialog();
void setConnection(bool connection); void setConnection(bool connection);
void activeUasSet(UASInterface *uas);
void armingChanged(int sysId, QString armingState);
void armingChanged(bool armed);
void updateLinkDisplay(LinkInterface *newLink); void updateLinkDisplay(LinkInterface *newLink);
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment