sync repo
authorKate Alhola <kate.alhola@gmail.com>
Wed, 11 Apr 2012 12:01:28 +0000 (15:01 +0300)
committerKate Alhola <kate.alhola@gmail.com>
Wed, 11 Apr 2012 12:01:28 +0000 (15:01 +0300)
mardrone/ConfigDialog.qml
mardrone/ConfigDialogDesktop.qml
mardrone/ConfigDialogSymbian.qml
mardrone/JoyStickCalibratorDesktop.qml
mardrone/ardrone_desktop.qml
mardrone/ardrone_harmattan.qml

index 655cc0f..81c94fe 100644 (file)
@@ -14,6 +14,33 @@ Page {
                 MenuItem { text:"Desktop";  onClicked: { drone.confActiveUI="ardrone_desktop.qml"}}
            }
         }
                 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
         Flickable {
           id: dialogscrolarea
           anchors.fill: parent
@@ -35,7 +62,11 @@ Page {
               Button {
                   text:drone.confActiveUI
                   anchors.right:parent.right
               Button {
                   text:drone.confActiveUI
                   anchors.right:parent.right
-                  onClicked:uiMenu.open()
+                  onClicked: {
+                  //    activeUIDialog.setSelectedIndex(text);
+                      activeUIDialog.open();
+                  }
+             //     onClicked:uiMenu.open()
               }
           Text {
               width:350
               }
           Text {
               width:350
@@ -205,13 +236,13 @@ Page {
                 property int textSize:30
                 id:calibrateDialog
                 tools:commonTools
                 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
                 JoyStickCalibrator {
                     id:jc
-                //    jStick:js
-                    Component.onCompleted: {
-                        if (jc.status != Component.Ready)
-                                    console.log("Error loading component:", jc.errorString());
-                    }
+
                 }
 
         }
                 }
 
         }
index 3c84204..3a4dbaf 100644 (file)
@@ -11,39 +11,57 @@ Rectangle {
 
         anchors.fill: parent
         TabFrame {
 
         anchors.fill: parent
         TabFrame {
+            anchors.fill:parent
         Tab {
              title: "Display"
         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.leftMargin:50;anchors.rightMargin:50
 
           Grid {
               columns:2
               id: dialogcontent
+              anchors.fill:parent
+              anchors.topMargin: 50
               anchors.leftMargin:50;anchors.rightMargin:50
               spacing: 20
 
               anchors.leftMargin:50;anchors.rightMargin:50
               spacing: 20
 
-/*           Text {
+           Text {
                   font.pixelSize  :textSize
                   text:"UI Style"
 
           }
                   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;
         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: {
               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"
           Text {
               width:200
               text: "Drone IP"
@@ -116,6 +134,8 @@ Rectangle {
               title: "Control"
               Grid {
                   columns:2
               title: "Control"
               Grid {
                   columns:2
+                  anchors.fill:parent
+                  anchors.topMargin: 50
                   anchors.leftMargin:50;anchors.rightMargin:50
                   spacing: 20
            Text {
                   anchors.leftMargin:50;anchors.rightMargin:50
                   spacing: 20
            Text {
@@ -144,13 +164,13 @@ Rectangle {
            }
 
            Text {
            }
 
            Text {
-               visible:drone.confUseJoyStick
+               visible:drone.confUseJoyStick & js.haveJoyStick
                font.pixelSize  :textSize
                text:"\"" + js.joyStickName + "\""
 
            }
            Button {
                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;
                text:"Calibrate"
                anchors.right:parent.right
               onClicked:{   joyStickCalibrator.visible = true;
index d76f723..e96d848 100644 (file)
@@ -14,6 +14,36 @@ Page {
                 MenuItem { text:"Desktop";  onClicked: { drone.confActiveUI="ardrone_desktop.qml"}}
            }
         }
                 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
         Flickable {
           id: dialogscrolarea
           anchors.fill: parent
@@ -33,9 +63,11 @@ Page {
 
               }
               Button {
 
               }
               Button {
+                  width:200
                   text:drone.confActiveUI
                   anchors.right:parent.right
                   text:drone.confActiveUI
                   anchors.right:parent.right
-                  onClicked:uiMenu.open()
+                  onClicked:activeUIDialog.open()
+                //  onClicked:uiMenu.open()
               }
           Text {
               width:350
               }
           Text {
               width:350
@@ -68,7 +100,7 @@ Page {
            }
            Text {
               text: "Acceleration Sensor controll"
            }
            Text {
               text: "Acceleration Sensor controll"
-             color:textColor
+              color:textColor
               font.pixelSize  :textSize
            }
            Switch {
               font.pixelSize  :textSize
            }
            Switch {
index deb435e..5893d42 100644 (file)
@@ -9,7 +9,7 @@ Item {
     property int ctrlSize:40
     ListModel {
           id: axisMapModel
     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 }
           ListElement { text:"Elevator"; mapAxis:2 }
           ListElement { text:"Throtle";  mapAxis:3 }
           ListElement { text:"Rudder";   mapAxis:4 }
@@ -235,12 +235,13 @@ Item {
             }
             ComboBox {
                 id: axisMap1UICombo;
             }
             ComboBox {
                 id: axisMap1UICombo;
-                model:  axisMapModel
+                width:200;
+                model: axisMapModel
                 onSelectedIndexChanged: {
                 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
              }
 /*            Button{
                 width:200;height:ctrlSize
index ce4f799..407d5b9 100644 (file)
@@ -2,7 +2,7 @@
 import Drone 1.0
 import QtQuick 1.0
 import QtDesktop 0.1
 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 {
 import JoyStick 1.0
 
 Window {
@@ -68,7 +68,7 @@ Window {
         DroneVideo {
             id:droneVideo
             y:0
         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;
         }
          //   anchors.horizontalCenter:parent.horizontalCenter
             width:drone.confFullScreen? parent.width:640 ;height:width<=640 ?480*width/640:480;
         }
@@ -76,7 +76,7 @@ Window {
         EfisPFD {
             id:hudPDF
             y:0
         EfisPFD {
             id:hudPDF
             y:0
-            anchors.horizontalCenter: parent
+   //         anchors.horizontalCenter: parent.horizontalCenter
             visible:drone.confShowHorizon
             roll:drone.droneRoll
             pitch:drone.dronePitch
             visible:drone.confShowHorizon
             roll:drone.droneRoll
             pitch:drone.dronePitch
@@ -203,8 +203,9 @@ Window {
 
             EfisPFD {
                 id:pDF
 
             EfisPFD {
                 id:pDF
-                width:320
-                height:240
+                width:300
+                height:320
+                showHSI:true
                 roll:drone.droneRoll
                 pitch:drone.dronePitch
                 ias:drone.droneSpeed
                 roll:drone.droneRoll
                 pitch:drone.dronePitch
                 ias:drone.droneSpeed
@@ -212,31 +213,66 @@ Window {
            //     bezel:"glareshield1.png"
             }
         Grid {
            //     bezel:"glareshield1.png"
             }
         Grid {
-            columns: 4
+            columns: 3
 
 
         AltGauge {
 
 
         AltGauge {
-            width:150
-            height:150
+            width:120
+            height:120
             id:altGauge
             value:drone.droneAltitude/10
             bezel:"bezel.png"
         }
         AttitudeGauge {
             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 {
             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"
         }
             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
         Row {
             spacing: 5
             anchors.rightMargin: 10
index 84490ce..35cf4d3 100644 (file)
@@ -221,10 +221,10 @@ PageStackWindow {
             }
         }
         Button {
             }
         }
         Button {
-            x:400;y:100
-            width:120
+            x:500
+            width:140
             id:emergencyButton
             id:emergencyButton
-            anchors.top:parent.top
+            anchors.bottom:parent.bottom
 
             anchors.margins:15
             text:"Energency";
 
             anchors.margins:15
             text:"Energency";
@@ -252,8 +252,6 @@ PageStackWindow {
 
      Component.onCompleted: {
          if (mainpageComponent.status != Component.Ready)
 
      Component.onCompleted: {
          if (mainpageComponent.status != Component.Ready)
-             //        pageStack.push(mainpageComponent);
-             //  else
                      console.log("Error loading component:", mainpageComponent.errorString());
          dialogComponent = Qt.createComponent("ConfigDialog.qml");
 
                      console.log("Error loading component:", mainpageComponent.errorString());
          dialogComponent = Qt.createComponent("ConfigDialog.qml");