UIname added
[mardrone] / mardrone / ardrone_desktop.qml
index bcfcfa4..66f835a 100644 (file)
@@ -1,21 +1,22 @@
-
+// uiName:Desktop
 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 {
     title: "MArdrone"
-
+    id:mainWindow
     width: 1024
-    height: 480
+    height: 800
     maximumHeight: mainWindow.height
-    minimumHeight: 480
+    minimumHeight: 800
     maximumWidth: 1280
     minimumWidth: 800
     visible: true
 
+
     MenuBar {
         Menu {
             text: "File"
@@ -54,9 +55,12 @@ Window {
 
   }
 
+    Column {
+        width:parent.width
+        spacing:5
       Rectangle {
-        id:mainWindow
-        width:640
+        id:mainWiew
+        width:parent.width
         height:480
         //onEntered:(mainWindow.fullscreen=true)
 
@@ -64,20 +68,20 @@ Window {
         DroneVideo {
             id:droneVideo
             y:0
-            x:0
+         //       anchors.horizontalCenter: parent.horizontalCenter
          //   anchors.horizontalCenter:parent.horizontalCenter
-            width:drone.confFullScreen? parent.width:640 ;height:480*width/640;
+            width:drone.confFullScreen? parent.width:640 ;height:width<=640 ?480*width/640:480;
         }
 
         EfisPFD {
             id:hudPDF
             y:0
-            x:0
+   //         anchors.horizontalCenter: parent.horizontalCenter
             visible:drone.confShowHorizon
             roll:drone.droneRoll
             pitch:drone.dronePitch
             ias:drone.droneSpeed
-            alt:drone.droneAltitude
+            alt:drone.droneAltitude/10
             indicatorColor:"green"
             skyColor:"#00000000"
             groundColor:"#00000000"
@@ -87,6 +91,7 @@ Window {
 
         Text {
             y:100
+
  //           visible:drone.confUseAccel
             color: "#00FF00"
             id: droneCtrlValues
@@ -111,17 +116,20 @@ Window {
             font.pixelSize:20
             text: drone.decodedStatus
         }
-        Button {
+   /*     Button {
             y:150;x:0
             height: 50
             width: 50
             iconSource: "gear32x32.png"
             onClicked:{   configDialog.visible = true }
         }
-
+*/
         JoyStickIndicator {
-            x:200;y:350
-            visible:drone.showJSIndivators
+
+            anchors.left:parent.left
+            anchors.bottom:parent.bottom
+            anchors.margins:10
+            visible:drone.confShowJSIndicators&js.haveJoyStick&drone.confUseJoyStick
             border.width:1
             color:"transparent"
             width:100;height:100
@@ -142,8 +150,11 @@ Window {
 
 
         JoyStickIndicator {
-            x:500;y:350
-            visible:drone.showJSIndivators
+
+            anchors.right:parent.right
+            anchors.bottom:parent.bottom
+            anchors.margins:10
+            visible:drone.confShowJSIndicators&js.haveJoyStick&drone.confUseJoyStick
             border.width:1
             color:"transparent"
             width:100;height:100
@@ -186,23 +197,85 @@ Window {
                 onXvChanged:{drone.yaw=xv/200.0;}
                 onPressedChanged: { drone.ctrlActive=pressed;}
             }
-        Column {
-            anchors.left: droneVideo.right
+      }
+        Row {
+            spacing:5
+
             EfisPFD {
                 id:pDF
-                width:320
-                height:240
-    //            visible:drone.confShowHorizon
+                width:300
+                height:320
+                showHSI:true
                 roll:drone.droneRoll
                 pitch:drone.dronePitch
                 ias:drone.droneSpeed
-                alt:drone.droneAltitude
+                alt:drone.droneAltitude/10
+           //     bezel:"glareshield1.png"
             }
+        Grid {
+            columns: 3
+
+
+        AltGauge {
+            width:120
+            height:120
+            id:altGauge
+            value:drone.droneAltitude/10
+            bezel:"bezel.png"
+        }
+        AttitudeGauge {
+            width:120
+            height:120
+            id:attGauge
+            roll:drone.droneRoll
+            pitch:drone.dronePitch
+            bezel:"bezel.png"
+        }
+        HeadingGauge {
+            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.right:parent.right
             anchors.rightMargin: 10
-            y:100
             height:100
         BarGauge {
            val:drone.pwm_motor1;
@@ -230,26 +303,16 @@ Window {
             height:100
         }
         }
-        AltGauge {
-            width:150
-            height:150
-            id:altGauge
-        //    value:drone.altitude
-            value:testAlt.value
-        }
-        Slider {
-           id: testAlt
-           maximumValue:1000
-        }
+            } // Grid if instruments
+        } // Column ( Main window content )
 
-        }
         Dialog {
             id:configDialog
             width:800
             height:600
             data:ConfigDialogDesktop {}
         }
-
-        } // Main page
     }
+  } // Main page
+