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
OTHER_FILES += \
dongfang_notes.txt \
src/ui/dongfang-scrapyard.txt \
qml/components/DigitalDisplay.qml
qml/components/DigitalDisplay.qml \
qml/components/StatusDisplay.qml
OTHER_FILES += \
qml/ApmToolBar.qml \
......
......@@ -10,7 +10,7 @@ Rectangle {
property alias baudrateLabel: baudrate.label
property bool connected: false
property bool armed: false
property string armedstr: "Disarmed"
property string armedstr: "DISARMED"
width: toolbar.width
height: 72
......@@ -19,12 +19,14 @@ Rectangle {
onArmedChanged: {
if (armed) {
armedText.text = "Armed"
armedText.color = "Red"
statusDisplay.statusText = "ARMED"
statusDisplay.statusTextColor = "red"
statusDisplay.statusBackgroundColor = "#FF880000"
}
else {
armedText.text = "Disarmed"
armedText.color = "Green"
statusDisplay.statusText = "DISARMED"
statusDisplay.statusTextColor = "yellow"
statusDisplay.statusBackgroundColor = "black"
}
}
......@@ -110,19 +112,19 @@ Rectangle {
image: "./resources/apmplanner/toolbar/terminal.png"
onClicked: globalObj.triggerTerminalView()
}
Rectangle {
width:150
Rectangle { // Spacer
width: 5
height: parent.height
Text {
id: armedText;
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 20
color: "green"
text: "Disarmed"
}
color:"black"
color: "black"
}
StatusDisplay {
id: statusDisplay
width: 110
statusText: "DISARMED"
statusTextColor: "yellow"
statusBackgroundColor: "black"
}
Rectangle { // Spacer
......
......@@ -5,7 +5,7 @@ Rectangle {
property alias title: displayTitle.text
property string textValue: "none"
width: 100
width: 110
height: parent.height/3
anchors.verticalCenter: parent.verticalCenter
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)
}
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)
{
this->rootObject()->setProperty("armed",armed);
}
void APMToolBar::armingChanged(int sysId, QString armingState)
{
qDebug() << "APMToolBar: sysid " << sysId << " armState" << armingState;
}
void APMToolBar::setFlightViewAction(QAction *action)
{
connect(this, SIGNAL(triggerFlightView()), action, SIGNAL(triggered()));
......
......@@ -33,8 +33,6 @@ signals:
void MAVConnected(bool connected);
public slots:
void armingChanged(bool armed);
void activeUasSet(UASInterface *uas);
void selectFlightView();
void selectFlightPlanView();
void selectHardwareView();
......@@ -46,6 +44,10 @@ public slots:
void showConnectionDialog();
void setConnection(bool connection);
void activeUasSet(UASInterface *uas);
void armingChanged(int sysId, QString armingState);
void armingChanged(bool armed);
void updateLinkDisplay(LinkInterface *newLink);
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