Joinig to video broadcast group on OSX improved
[mardrone] / mardrone / ardrone_desktop.qml
index ce4f799..8fe14df 100644 (file)
@@ -1,19 +1,19 @@
-
+// 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
+    width: 700
     height: 800
     maximumHeight: mainWindow.height
     minimumHeight: 800
     maximumWidth: 1280
-    minimumWidth: 800
+    minimumWidth: 700
     visible: true
 
 
@@ -30,6 +30,11 @@ Window {
                 shortcut: "Ctrl+Q"
                 onTriggered: Qt.quit()
             }
+            MenuItem {
+                text: "Record"
+                shortcut: "Ctrl+R"
+                onTriggered: Qt.quit()
+            }
         }
         Menu {
             text: "Edit"
@@ -57,10 +62,11 @@ Window {
 
     Column {
         width:parent.width
-        spacing:5
+     //   spacing:5
       Rectangle {
         id:mainWiew
         width:parent.width
+        color:"black"
         height:480
         //onEntered:(mainWindow.fullscreen=true)
 
@@ -68,54 +74,31 @@ 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;
         }
-
+        Binding {
+          target:drone
+          property:"logSeq"
+          value: droneVideo.frameSeq;
+        }
         EfisPFD {
             id:hudPDF
             y:0
-            anchors.horizontalCenter: parent
+   //         anchors.horizontalCenter: parent.horizontalCenter
             visible:drone.confShowHorizon
             roll:drone.droneRoll
             pitch:drone.dronePitch
             ias:drone.droneSpeed
             alt:drone.droneAltitude/10
+            heading:drone.droneYaw
             indicatorColor:"green"
             skyColor:"#00000000"
             groundColor:"#00000000"
             width:640;height:480;
         }
 
-
-        Text {
-            y:100
-
- //           visible:drone.confUseAccel
-            color: "#00FF00"
-            id: droneCtrlValues
-            font.pixelSize:20
-            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
-            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)
-        }
-
-        Text {
-            y:130
-            visible:drone.confShowDebug
-            color: "#00FF00"
-            id: droneStatus
-            font.pixelSize:20
-            text: drone.decodedStatus
-        }
    /*     Button {
             y:150;x:0
             height: 50
@@ -172,11 +155,51 @@ Window {
                 text:"Elevator"
             }
         }
+        Text {
+           x:0
+              anchors.top:parent.top
+            visible:drone.confShowDebug
+            color: "#00FF00"
+            id: droneCtrlValues
+            font.pixelSize:10
+            text: "cmd:pitch=" + drone.pitch.toFixed(2) + " roll= " +  drone.roll.toFixed(2) + " yaw=" + drone.yaw.toFixed(2) + " vv= " + drone.vVelocity.toFixed(2)
+        }
+
+        Text {
+            x:400
+            anchors.top:parent.top
+            visible:drone.confShowDebug
+            color: "#00FF00"
+            id: droneNavData
+            font.pixelSize:10
+            text: "pitch=" + Math.round(drone.dronePitch) + " roll= " +  Math.round(drone.droneRoll) + "yaw=" + Math.round(drone.droneYaw) + " alt= " +  Math.round(drone.droneAltitude)
+        }
+
+        Text {
+            x:400
+            anchors.bottom:parent.bottom
+            visible:drone.confShowDebug
+            color: "#00FF00"
+            id: droneStatus
+            font.pixelSize:10
+            text: drone.decodedStatus
+        }
+        Text {
+            x:00
+            anchors.bottom:parent.bottom
+            visible:drone.confShowDebug
+       //     visible:droneVideo.recVideo
+            color: "#00FF00"
+            id: droneFrameSeq
+            font.pixelSize:10
+            text: droneVideo.videoFileName+ " "+droneVideo.frameSeq
+        }
 
             JoyStickTouch {
                 id:lj
                 width:280;height:280;
                 y:200
+                joyBackground: ""
                 visible: !drone.confUseAccel & !drone.confUseJoyStick
                 anchors.left:parent.left
                 anchors.margins:50
@@ -190,6 +213,7 @@ Window {
                  visible: !drone.confUseJoyStick
                 id:rj
                 y:200
+                joyBackground: ""
                 anchors.right:parent.right
                 width:280;height:280;
                 anchors.margins:50
@@ -198,85 +222,223 @@ Window {
                 onPressedChanged: { drone.ctrlActive=pressed;}
             }
       }
+
+      Rectangle {
+          width:parent.width
+     //     width:chlidrenRect.width
+     //     height:childrenRect.height
+          height:320
+          color: "black"
+
+
+
         Row {
+            id:instrumentPanel
             spacing:5
+            anchors.fill:parent
+            anchors.margins:5
 
             EfisPFD {
                 id:pDF
-                width:320
-                height:240
+                width:300
+                height:320
+                showHSI:true
                 roll:drone.droneRoll
                 pitch:drone.dronePitch
                 ias:drone.droneSpeed
                 alt:drone.droneAltitude/10
+                heading:drone.droneYaw
            //     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
-            id:hdgGauge
-            value:drone.droneYaw
-            bezel:"bezel.png"
+        Item {
+            width:120
+            height:120
+
+
+        GaugeArc {
+            anchors.fill:parent
+            id:speedGauge
+ //           anchors.margins:10
+            displayScale:0.95
+            font.pixelSize:10
+            tickIncrement:20
+            tickSpacing:24
+            tickMinor:5
+            lowPosition:220
+            highPosition:120
+            low:0
+            high:200
+            gaugeStyle:2
+            color:"white"
+            value:drone.droneSpeed
+            lineWidth:2
+            backColor:"black"
+        }
+        Image {
+            anchors.fill:parent
+            source:"bezel.png"
+        }
+        }
+
+        Item {
+            width:120
+            height:120
+
+
+        GaugeArc {
+            anchors.fill:parent
+            id:fuelGauge
+ //           anchors.margins:10
+            displayScale:0.95
+            font.pixelSize:10
+            tickIncrement:10
+            tickSpacing:22
+            tickMinor:5
+            lowPosition:240
+            highPosition:120
+            low:0
+            high:100
+            gaugeStyle:2
+            color:"white"
+            value:drone.droneVBat
+            lineWidth:2
+            backColor:"black"
+        }
+        Image {
+            anchors.fill:parent
+            source:"bezel.png"
+        }
+        }
+        Item {
+            width:120
+            height:120
+
+            HeadingGauge {
+                width:120
+                height:120
+                id:hdgGauge
+                value:drone.droneYaw
+                bezel:"bezel.png"
+            }
         }
+        Item {
+            width:120
+            height:120
+        Rectangle {
+            anchors.fill:parent
+            anchors.margins:5
+            color:"gray"
+            }
         Row {
+            anchors.centerIn:parent
             spacing: 5
-            anchors.rightMargin: 10
-            height:100
+            anchors.margins: 30
+            height:90
         BarGauge {
            val:drone.pwm_motor1;
            max: 255
-           height:100
+           height:parent.height
+           width:10
         }
         BarGauge {
             val:drone.pwm_motor2;
             max: 255
-            height:100
+           height:parent.height
+                     width:10
         }
         BarGauge {
             val:drone.pwm_motor3;
             max: 255
-            height:100
+            height:parent.height
+            width:10
         }
         BarGauge {
             val:drone.pwm_motor4;
             max: 255
-            height:100
+            height:parent.height
+             width:10
         }
+        /*
         BarGauge {
             val:drone.droneVBat
             max: 100
-            height:100
+            height:parent.height
+                      width:10
+        }
+        */
+        }
+        Image {
+            anchors.fill:parent
+            source:"bezel.png"
+        }
+        }
+        Button {
+
+            width:80
+            height:50
+            id:flyButton
+     //       anchors.bottom:parent.bottom
+            anchors.margins:15
+            text:"Fly";
+            checkable:true
+            onClicked:{drone.fly=checked;
+            // mainWindow.fullsecreen=checked;
+            }
+        }
+        Button {
+
+            width:90
+            height:50
+            id:emergencyButton
+         //   anchors.bottom:parent.bottom
+            anchors.margins:15
+            text:"Emrg";
+            checkable:true
+            onClicked:{drone.emergency=checked;}
         }
+
+        Button {
+
+            width:100
+            height:50
+            id:recordButton
+       //     anchors.bottom:parent.bottom
+            anchors.margins:15
+            text:"Rec";
+            checkable:true
+            onClicked:{droneVideo.recVideo=checked; drone.logFileName=droneVideo.videoFileName; drone.recordLog=checked;}
         }
             } // Grid if instruments
-        } // Column ( Main window content )
+        }
 
+        } // Column ( Main window content )
+       }
         Dialog {
             id:configDialog
             width:800
             height:600
             data:ConfigDialogDesktop {}
         }
-    }
+
   } // Main page