X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=mardrone%2Fardrone_harmattan.qml;h=84490ce391fcdc6b5f23fecb5d589d43bb021694;hb=9ec9bc13b75d30bc45535c54a652934debfcea92;hp=a00245acfe599b51fbe9bb16e4a8cfb53c6a9287;hpb=196f6d56fb98af5849cc98d389de421822d3d5e0;p=mardrone diff --git a/mardrone/ardrone_harmattan.qml b/mardrone/ardrone_harmattan.qml index a00245a..84490ce 100644 --- a/mardrone/ardrone_harmattan.qml +++ b/mardrone/ardrone_harmattan.qml @@ -1,7 +1,7 @@ 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 { @@ -24,12 +24,11 @@ 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;} @@ -37,8 +36,10 @@ PageStackWindow { Component { id: mainpageComponent + Page { id:mainPage + property bool connectingBoxVisible:true //onEntered:(mainWindow.fullscreen=true) state:"Landscape" @@ -48,6 +49,7 @@ PageStackWindow { // anchors.horizontalCenter:parent.horizontalCenter width:drone.confFullScreen? parent.width:640 ;height:480*width/640; } + EfisPFD { id:hudPDF y:0 @@ -67,25 +69,25 @@ PageStackWindow { 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 @@ -96,6 +98,7 @@ PageStackWindow { 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); @@ -147,27 +150,29 @@ PageStackWindow { 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 { @@ -220,12 +225,28 @@ PageStackWindow { width:120 id:emergencyButton anchors.top:parent.top + 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 } @@ -237,9 +258,4 @@ PageStackWindow { dialogComponent = Qt.createComponent("ConfigDialog.qml"); } -// Component.onCompleted: { -// mainWindow.fullscreen = true ; -// dialogComponent = Qt.createComponent("ConfigDialog.qml"); -// mainWindow.nextPage(mainpageComponent) -// } }