MenuItem { text:"Desktop"; onClicked: { drone.confActiveUI="ardrone_desktop.qml"}}
}
}
+ Component.onCompleted: {
+ console.debug("Appending items to choices",uiList.count())
+ for(var j = 0; j < uiList.count();++j ) {
+ var data = {'name':uiList.get(j).name,'file':uiList.get(j).file };
+ // var data = {'name':uiList.get(j).name };
+ console.debug("appending ",uiList.get(j).name,uiList.get(j).file);
+ choices.append(data);
+ if(uiList.get(j).file==drone.confActiveUI) activeUIDialog.selectedIndex=j;
+ }
+ }
+
+ ListModel {
+ id: choices
+ ListElement {
+ name:"none";
+ file:"none.qml"
+ }
+ }
+ SelectionDialog {
+ id: activeUIDialog;
+ model:choices
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
+ drone.confActiveUI=choices.get(selectedIndex).file
+ }
+
+ }
Flickable {
id: dialogscrolarea
anchors.fill: parent
Button {
text:drone.confActiveUI
anchors.right:parent.right
- onClicked:uiMenu.open()
+ onClicked: {
+ // activeUIDialog.setSelectedIndex(text);
+ activeUIDialog.open();
+ }
+ // onClicked:uiMenu.open()
}
Text {
width:350
property int textSize:30
id:calibrateDialog
tools:commonTools
+ Component.onCompleted: {
+ if (calibrateDialog.status != Component.Ready)
+ console.log("Error loading component:", calibrateDialog.errorString());
+ }
JoyStickCalibrator {
id:jc
- // jStick:js
- Component.onCompleted: {
- if (jc.status != Component.Ready)
- console.log("Error loading component:", jc.errorString());
- }
+
}
}
anchors.fill: parent
TabFrame {
+ anchors.fill:parent
Tab {
title: "Display"
- id: displayTab
- anchors.fill: parent
+ id: displayTab
+ anchors.fill: parent
// anchors.leftMargin:50;anchors.rightMargin:50
Grid {
columns:2
id: dialogcontent
+ anchors.fill:parent
+ anchors.topMargin: 50
anchors.leftMargin:50;anchors.rightMargin:50
spacing: 20
-/* Text {
+ Text {
font.pixelSize :textSize
text:"UI Style"
}
+
+ Component.onCompleted: {
+ for(var j = 0; j < uiList.count();++j ) {
+ var data = {'name':uiList.get(j).name,'file':uiList.get(j).file };
+ // var data = {'name':uiList.get(j).name };
+ console.debug("appending ",uiList.get(j).name,uiList.get(j).file);
+ choices.append(data);
+ if(uiList.get(j).file==drone.confActiveUI) activeUICombo.selectedIndex=j;
+ }
+ }
+
+ ListModel {
+ id: choices
+ ListElement { text: "MeeGo/Harmattan";file:"ardrone_harmattan.qml" }
+ ListElement { text: "Symbian";file:"ardrone_symbian.qml" }
+ ListElement { text: "Desktop";file:"ardrone_desktop.qml" }
+ }
ComboBox {
id: activeUICombo;
- model: ListModel {
- id: choices
- ListElement { text: "MeeGo/Harmattan";file:"ardrone_harmattan.qml" }
- ListElement { text: "Desktop";file:"ardrone_desktop.qml" }
- }
+ width:200
+ model:uiList
onSelectedIndexChanged: {
- console.debug("onSelectedIndexChanged " + selectedText + ", " + choices.get(selectedIndex).file);
- drone.confActiveUI=choices.get(selectedIndex).file
+ console.debug("onSelectedIndexChanged " + selectedText + ", " + model.get(selectedIndex).file);
+ drone.confActiveUI=model.get(selectedIndex).file
}
- selectedText:drone.confActiveUI
- KeyNavigation.tab: t1
- KeyNavigation.backtab: button2
+
+
+ // KeyNavigation.tab: t1
+ //KeyNavigation.backtab: button2
}
-*/
+
Text {
width:200
text: "Drone IP"
title: "Control"
Grid {
columns:2
+ anchors.fill:parent
+ anchors.topMargin: 50
anchors.leftMargin:50;anchors.rightMargin:50
spacing: 20
Text {
}
Text {
- visible:drone.confUseJoyStick
+ visible:drone.confUseJoyStick & js.haveJoyStick
font.pixelSize :textSize
text:"\"" + js.joyStickName + "\""
}
Button {
- visible:drone.confUseJoyStick
+ visible:drone.confUseJoyStick & js.haveJoyStick
text:"Calibrate"
anchors.right:parent.right
onClicked:{ joyStickCalibrator.visible = true;
MenuItem { text:"Desktop"; onClicked: { drone.confActiveUI="ardrone_desktop.qml"}}
}
}
+
+ Component.onCompleted: {
+ for(var j = 0; j < uiList.length;++j ) {
+ var data = {'name':uiList[j].name,'modelData':uiList[j].name,'file':uiList[j].file };
+ console.debug("appending ",uiList.get(j).name,uiList.get(j).file)
+ choices.append(data);
+ if(uIList[j].file==drone.confActiveUI) activeUIDialog.selectedIndex=j;
+ }
+ }
+
+ ListModel {
+ id: choices
+ ListElement {
+ name:"none";
+ modelData:"none"
+ file:"none"
+ }
+ }
+ SelectionDialog {
+ id: activeUIDialog;
+ model:uiList
+
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " +selectedIndex);
+ console.debug("onSelectedIndexChanged " +uiList.get(selectedIndex).name);
+ console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
+ drone.confActiveUI=choices.get(selectedIndex).file
+ }
+
+ }
Flickable {
id: dialogscrolarea
anchors.fill: parent
}
Button {
+ width:200
text:drone.confActiveUI
anchors.right:parent.right
- onClicked:uiMenu.open()
+ onClicked:activeUIDialog.open()
+ // onClicked:uiMenu.open()
}
Text {
width:350
}
Text {
text: "Acceleration Sensor controll"
- color:textColor
+ color:textColor
font.pixelSize :textSize
}
Switch {
property int ctrlSize:40
ListModel {
id: axisMapModel
- ListElement{ text:"Aileron"; mapAxis:1 }
+ ListElement { text:"Aileron"; mapAxis:1 }
ListElement { text:"Elevator"; mapAxis:2 }
ListElement { text:"Throtle"; mapAxis:3 }
ListElement { text:"Rudder"; mapAxis:4 }
}
ComboBox {
id: axisMap1UICombo;
- model: axisMapModel
+ width:200;
+ model: axisMapModel
onSelectedIndexChanged: {
- console.debug("onSelectedIndexChanged " + selectedText + ", " + axisMap1UICombo.get(selectedIndex).mapAxis);
- js.mapAxis1=caxisMap1UICombo.get(selectedIndex).mapAxis
+ console.debug("onSelectedIndexChanged " + selectedText + ", " + selectedIndex);
+ js.mapAxis1=selectedIndex+1;
}
- selectedText:js.mapAxis1
+ selectedIndex:js.mapAxis1-1
}
/* Button{
width:200;height:ctrlSize
import Drone 1.0
import QtQuick 1.0
import QtDesktop 0.1
-//import gauges 1.0
+import Gauges 1.0
import JoyStick 1.0
Window {
DroneVideo {
id:droneVideo
y:0
- anchors.horizontalCenter: parent
+ // anchors.horizontalCenter: parent.horizontalCenter
// anchors.horizontalCenter:parent.horizontalCenter
width:drone.confFullScreen? parent.width:640 ;height:width<=640 ?480*width/640:480;
}
EfisPFD {
id:hudPDF
y:0
- anchors.horizontalCenter: parent
+ // anchors.horizontalCenter: parent.horizontalCenter
visible:drone.confShowHorizon
roll:drone.droneRoll
pitch:drone.dronePitch
EfisPFD {
id:pDF
- width:320
- height:240
+ width:300
+ height:320
+ showHSI:true
roll:drone.droneRoll
pitch:drone.dronePitch
ias:drone.droneSpeed
// bezel:"glareshield1.png"
}
Grid {
- columns: 4
+ columns: 3
AltGauge {
- width:150
- height:150
+ width:120
+ height:120
id:altGauge
value:drone.droneAltitude/10
bezel:"bezel.png"
}
AttitudeGauge {
- width:150
- height:150
+ width:120
+ height:120
id:attGauge
roll:drone.droneRoll
pitch:drone.dronePitch
bezel:"bezel.png"
}
HeadingGauge {
- width:150
- height:150
+ width:120
+ height:120
id:hdgGauge
value:drone.droneYaw
bezel:"bezel.png"
}
+ GaugeArc {
+ width:120
+ height:120
+ id:fuelGauge
+ anchors.margins:10
+ displayScale:0.85
+ font.pixelSize:10
+ tickIncrement:10
+ tickSpacing:20
+ tickMinor:5
+ lowPosition:220
+ highPosition:120
+ low:0
+ high:100
+ gaugeStyle:2
+ color:"white"
+ value:drone.droneVBat
+ lineWidth:2
+ backColor:"black"
+ }
+ GaugeHSI{
+ anchors.margins:10
+ displayScale:0.7
+ width:120
+ height:120
+ font.pixelSize:10
+ tickIncrement:30
+ tickSpacing:10
+ tickMinor:5
+ gaugeStyle:2
+ color:"white"
+ backColor:"black"
+ id:hsi
+ }
+
Row {
spacing: 5
anchors.rightMargin: 10
}
}
Button {
- x:400;y:100
- width:120
+ x:500
+ width:140
id:emergencyButton
- anchors.top:parent.top
+ anchors.bottom:parent.bottom
anchors.margins:15
text:"Energency";
Component.onCompleted: {
if (mainpageComponent.status != Component.Ready)
- // pageStack.push(mainpageComponent);
- // else
console.log("Error loading component:", mainpageComponent.errorString());
dialogComponent = Qt.createComponent("ConfigDialog.qml");