import QtQuick 1.0
import com.nokia.meego 1.0
import Drone 1.0
-import gauges 1.0
+//import gauges 1.0
import JoyStick 1.0
PageStackWindow {
DroneControl {
id:drone
-
}
JoyStick {
id:js
onElevatorChanged:{if(drone.confUseJoyStick) drone.pitch=elevator;}
- onAileronChanged: {if(drone.confUseJoyStick) drone.roll=aileron;}
+ onAileronChanged: {if(drone.confUseJoyStick) drone.roll=-1.0*aileron;}
onThrotleChanged: {if(drone.confUseJoyStick) drone.vVelocity=throtle;}
onRudderChanged: {if(drone.confUseJoyStick) drone.yaw=rudder;}
Component {
id: mainpageComponent
+
Page {
id:mainPage
+ property bool connectingBoxVisible:true
//onEntered:(mainWindow.fullscreen=true)
state:"Landscape"
// anchors.horizontalCenter:parent.horizontalCenter
width:drone.confFullScreen? parent.width:640 ;height:480*width/640;
}
+
EfisPFD {
id:hudPDF
y:0
Text {
- y:100
+ y:50
// visible:drone.confUseAccel
color: "#00FF00"
id: droneCtrlValues
- font.pixelSize:20
+ font.pixelSize:25
text: "cmd:pitch=" + drone.pitch.toFixed(2) + " roll= " + drone.roll.toFixed(2) + " yaw=" + drone.yaw.toFixed(2) + " vv= " + drone.vVelocity.toFixed(2)
}
Text {
- y:115
+ y:70
visible:drone.confShowDebug
color: "#00FF00"
id: droneNavData
- font.pixelSize:20
- text: "pitch=" + Math.round(drone.dronePitch) + " roll= " + Math.round(drone.droneRoll) + "yaw=" + Math.round(drone.droneYaw) + " alt= " + Math.round(drone.droneAltitude)
+ font.pixelSize:25
+ text: "pitch=" + drone.dronePitch.toFixed(2) + " roll= " + drone.droneRoll.toFixed(2) + "yaw=" + drone.droneYaw.toFixed(2) + " alt= " + drone.droneAltitude.toFixed(2)
}
Text {
- y:130
+ y:100
visible:drone.confShowDebug
color: "#00FF00"
id: droneStatus
y:150;x:0
height: 50
width: 50
+ z:2 // This is visible even connecting to drone
iconSource: "gear32x32.png"
onClicked:{ //mainWindow.fullscreen = false ;
pageStack.push(dialogComponent);
JoyStickTouch {
id:lj
- width:280;height:280;
- y:200
+ width:200;height:200;
+
visible: !drone.confUseAccel & !drone.confUseJoyStick
anchors.left:parent.left
- anchors.margins:50
- onYvChanged:{drone.pitch=yv/200.0;}
- onXvChanged:{drone.roll=xv/200.0;}
-
-
+ anchors.bottom:parent.bottom
+ anchors.margins:10
+ // joyBackground: ""
+ onYvChanged:{drone.vVelocity=-1*yv/200.0;}
+ onXvChanged:{drone.yaw=xv/200.0;}
+ onPressedChanged: { drone.ctrlActive=pressed;}
}
JoyStickTouch {
visible: !drone.confUseJoyStick
id:rj
- y:200
+
+ // joyBackground: ""
anchors.right:parent.right
- width:280;height:280;
+ anchors.bottom:parent.bottom
+ width:200;height:200;
anchors.margins:10
- onYvChanged:{drone.vVelocity=-1*yv/200.0;}
- onXvChanged:{drone.yaw=xv/200.0;}
- onPressedChanged: { drone.ctrlActive=pressed;}
+ onYvChanged:{drone.pitch=yv/200.0;}
+ onXvChanged:{drone.roll=xv/200.0;}
}
Row {
}
}
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";
checkable:true
onClicked:{drone.emergency=checked;}
}
+
+ Connections {
+ target:drone
+ onConnectedChanged:{
+ console.log("Connected to drone");
+ connectingDialog.accept();}
+ }
+ QueryDialog {
+ id:connectingDialog
+ message:"Connecting to Drone "+ drone.confDroneIp
+ acceptButtonText:"OK"
+ Component.onCompleted: {
+ console.log("ConectionDialog Opened");
+ if(!drone.connected) open(); }
+ }
} // Main page
}
Component.onCompleted: {
if (mainpageComponent.status != Component.Ready)
- // pageStack.push(mainpageComponent);
- // else
console.log("Error loading component:", mainpageComponent.errorString());
dialogComponent = Qt.createComponent("ConfigDialog.qml");
}
-// Component.onCompleted: {
-// mainWindow.fullscreen = true ;
-// dialogComponent = Qt.createComponent("ConfigDialog.qml");
-// mainWindow.nextPage(mainpageComponent)
-// }
}