2013-11-21 12:10:06 +01:00
|
|
|
import QtQuick 2.1
|
2013-11-20 12:24:34 +01:00
|
|
|
import QtQuick.Controls 1.0
|
2013-11-20 16:24:57 +01:00
|
|
|
import QtQuick.Layouts 1.0
|
|
|
|
|
|
|
|
import org.openpilot 1.0
|
2013-11-20 12:24:34 +01:00
|
|
|
|
|
|
|
Rectangle {
|
2013-11-20 16:24:57 +01:00
|
|
|
width: 600
|
|
|
|
height: 400
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.fill: parent
|
2013-11-20 21:08:26 +01:00
|
|
|
anchors.margins: 10
|
2013-11-20 16:24:57 +01:00
|
|
|
spacing: 10
|
2013-11-21 12:10:06 +01:00
|
|
|
|
2013-11-21 18:07:48 +01:00
|
|
|
Rectangle {
|
2013-11-21 12:10:06 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2013-11-21 18:07:48 +01:00
|
|
|
border.width: 1
|
|
|
|
radius: 4
|
2013-11-20 16:56:43 +01:00
|
|
|
ColumnLayout {
|
2013-11-21 18:07:48 +01:00
|
|
|
anchors.margins: 10
|
|
|
|
anchors.fill: parent
|
2013-11-20 16:56:43 +01:00
|
|
|
Text {
|
2013-11-21 18:07:48 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "<b>" + qsTr("Log entries") + "</b>"
|
2013-11-20 21:08:26 +01:00
|
|
|
font.pixelSize: 12
|
2013-11-20 16:56:43 +01:00
|
|
|
}
|
2013-11-21 18:07:48 +01:00
|
|
|
TableView {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
model: logManager.logEntries
|
2013-11-25 14:59:23 +01:00
|
|
|
|
|
|
|
itemDelegate: Text {
|
|
|
|
anchors.margins: 3
|
|
|
|
font.pixelSize: 12
|
|
|
|
text: styleData.value
|
|
|
|
}
|
|
|
|
|
|
|
|
TableViewColumn {
|
|
|
|
role: "Flight"; title: qsTr("Flight"); width: 50;
|
|
|
|
delegate:
|
|
|
|
Text {
|
|
|
|
anchors.margins: 3
|
|
|
|
font.pixelSize: 12
|
|
|
|
text: styleData.value + 1
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
TableViewColumn { role: "FlightTime"; title: qsTr("Time"); width: 50}
|
|
|
|
TableViewColumn { role: "Entry"; title: qsTr("#"); width: 50}
|
|
|
|
TableViewColumn {
|
|
|
|
role: "Type"; title: "Type"; width: 100;
|
|
|
|
delegate:
|
|
|
|
Text {
|
|
|
|
anchors.margins: 3
|
|
|
|
font.pixelSize: 12
|
|
|
|
text: {
|
|
|
|
switch(styleData.value) {
|
|
|
|
case 0 : text: qsTr("Empty"); break;
|
|
|
|
case 1 : text: qsTr("Text"); break;
|
|
|
|
case 2 : text: qsTr("UAVO"); break;
|
|
|
|
default: text: qsTr("Unknown"); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
TableViewColumn { role: "LogString"; title: qsTr("Data"); width: 280}
|
2013-11-20 16:56:43 +01:00
|
|
|
}
|
2013-11-21 18:07:48 +01:00
|
|
|
|
2013-11-21 12:10:06 +01:00
|
|
|
RowLayout {
|
2013-11-21 18:07:48 +01:00
|
|
|
anchors.margins: 10
|
|
|
|
spacing: 10
|
|
|
|
ColumnLayout {
|
|
|
|
spacing: 10
|
|
|
|
Text {
|
|
|
|
id: totalFlights
|
|
|
|
font.pixelSize: 12
|
|
|
|
text: "<b>" + qsTr("Flights recorded: ") + "</b>" + (logStatus.Flight + 1)
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
id: totalEntries
|
|
|
|
font.pixelSize: 12
|
|
|
|
text: "<b>" + qsTr("Entries logged (free): ") + "</b>" +
|
|
|
|
logStatus.UsedSlots + " (" + logStatus.FreeSlots + ")"
|
|
|
|
}
|
|
|
|
}
|
2013-11-21 12:10:06 +01:00
|
|
|
Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2013-11-21 18:07:48 +01:00
|
|
|
ColumnLayout {
|
|
|
|
spacing: 10
|
|
|
|
RowLayout {
|
|
|
|
Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
font.pixelSize: 12
|
|
|
|
text: "<b>" + qsTr("Flight to download:") + "</b>"
|
|
|
|
}
|
2013-11-20 16:24:57 +01:00
|
|
|
|
2013-11-21 18:07:48 +01:00
|
|
|
ComboBox {
|
|
|
|
id: flightCombo
|
|
|
|
property ListModel dataModel: ListModel {}
|
|
|
|
model: dataModel
|
|
|
|
Component.onCompleted: {
|
|
|
|
dataModel.append({"value": "All"})
|
|
|
|
for (var a = 0; a <= logStatus.Flight ; a++) {
|
|
|
|
dataModel.append({"value": (a + 1).toString()})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
Button {
|
|
|
|
text: qsTr("Download logs")
|
|
|
|
activeFocusOnPress: true
|
|
|
|
onClicked: logManager.retrieveLogs(flightCombo.currentIndex - 1)
|
2013-11-21 12:10:06 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-11-20 16:24:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-20 21:08:26 +01:00
|
|
|
RowLayout {
|
2013-11-20 16:24:57 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
height: 40
|
|
|
|
Button {
|
2013-11-20 21:08:26 +01:00
|
|
|
id: exportButton
|
|
|
|
text: qsTr("Export...")
|
|
|
|
activeFocusOnPress: true
|
|
|
|
onClicked: logManager.exportLogs()
|
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
Button {
|
|
|
|
id: okButton
|
2013-11-20 16:24:57 +01:00
|
|
|
text: qsTr("OK")
|
2013-11-20 21:08:26 +01:00
|
|
|
activeFocusOnPress: true
|
2013-11-20 16:24:57 +01:00
|
|
|
onClicked: dialog.close()
|
|
|
|
}
|
|
|
|
}
|
2013-11-20 12:24:34 +01:00
|
|
|
}
|
|
|
|
}
|