X-Git-Url: http://git.maemo.org/git/?p=mardrone;a=blobdiff_plain;f=mardrone%2FConfigDialog.qml;h=655cc0f6ec0e6dcedd375739ceb8bf3648a9a1eb;hp=31690fc1f5700e8e3d4c3cca96827bb9e0c81fef;hb=b083fe0448071b1fec2198b2a15eeb4ebed23b68;hpb=34003bf968627b6ddf7cc279eb5a26423340cc1c diff --git a/mardrone/ConfigDialog.qml b/mardrone/ConfigDialog.qml index 31690fc..655cc0f 100644 --- a/mardrone/ConfigDialog.qml +++ b/mardrone/ConfigDialog.qml @@ -1,165 +1,219 @@ -import Qt 4.7 -import com.meego 1.0 +import QtQuick 1.0 +import com.nokia.meego 1.0 +import JoyStick 1.0 Page { + property color textColor:"black" + property int textSize:30 id:dialog + tools:commonTools + Menu { + id:uiMenu + visualParent:pageStack + MenuLayout { + MenuItem { text:"MeeGo/Harmattan 854x480"; onClicked: { drone.confActiveUI="ardrone_harmattan.qml" }} + MenuItem { text:"Desktop"; onClicked: { drone.confActiveUI="ardrone_desktop.qml"}} + } + } Flickable { id: dialogscrolarea - anchors.top: parent.top - anchors.bottom: parent.bottom - width: parent.width - anchors.leftMargin:50;anchors.rightMargin:50 - - /* anchors.horizontalCenter:parent.horizontalCenter */ - + anchors.fill: parent + // anchors.leftMargin:50;anchors.rightMargin:50 contentHeight: dialogcontent.height contentWidth: parent.width Grid { columns:2 id: dialogcontent - // width: parent.width - anchors.left:parent.left;anchors.right:parent.right - anchors.leftMargin:50;anchors.rightMargin:50 - - spacing: 40 - Text { - width:400 + anchors.leftMargin:50;anchors.rightMargin:150 + spacing: 20 + + Text { + font.pixelSize :textSize + text:"UI Style" + + } + Button { + text:drone.confActiveUI + anchors.right:parent.right + onClicked:uiMenu.open() + } + Text { + width:350 text: "Drone IP" - + color:textColor + font.pixelSize :textSize } - LineEdit { + + TextField { id: droneip - width:300 + width: 300 + height: 40 + anchors.right: parent.right text: drone.confDroneIp onTextChanged:{drone.confDroneIp=text;} } +// } + Text { - text: "Video 640x480 / Full Screen" + text: "Video 640x480/Full Screen" + color:textColor + font.pixelSize :textSize } Switch { id: fullScreen - // enabled:drone.confFullScreen checked:drone.confFullScreen anchors.right:parent.right - // onEnabledChanged:{drone.confFullScreen=enabled;} onCheckedChanged:{drone.confFullScreen=checked;} } Text { - text: "Acceleration Sensor for controll" + text: "Acceleration Sensor controll" + color:textColor + font.pixelSize :textSize } Switch { id: useAccelSw - // enabled:drone.confUseAccel checked:drone.confUseAccel anchors.right:parent.right -// onEnabledChanged:{drone.confUseAccel=enabled;} onCheckedChanged:{drone.confUseAccel=checked;} } Text { + text: "Joystick" + color:textColor + font.pixelSize :textSize + } + Switch { + id: useJoySw + checked:drone.confUseJoyStick + anchors.right:parent.right + enabled:js.haveJoyStick + onCheckedChanged:{drone.confUseJoyStick=checked;} + } + + Text { + visible:drone.confUseJoyStick + font.pixelSize :textSize + text:"\"" + js.joyStickName + "\"" + + } + Button { + visible:drone.confUseJoyStick + text:"Calibrate" + anchors.right:parent.right + onClicked:{ + js.calibrate=true + pageStack.push(calibrateDialog); + } + } + Text { + visible:drone.confUseJoyStick + font.pixelSize :textSize + text:"Show JoyStick Indicators" + + } + Switch { + visible:drone.confUseJoyStick + checked:drone.confShowJSIndicators + anchors.right:parent.right + enabled:js.haveJoyStick + onCheckedChanged:{drone.confShowJSIndicators=checked;} + + } + Text { + color:textColor text: "Show debug" + font.pixelSize :textSize } Switch { id: showDebug - // enabled:drone.confShowDebug checked:drone.confShowDebug anchors.right:parent.right -// onEnabledChanged:{drone.confShowDebug=enabled;} onCheckedChanged:{drone.confShowDebug=checked;} } Text { text: "Show engine gauges" + color:textColor + font.pixelSize :textSize } Switch { id: showGauges -// enabled:drone.confShowGauges checked:drone.confShowGauges anchors.right:parent.right -// onEnabledChanged:{drone.confShowGauges=enabled;} onCheckedChanged:{drone.confShowGauges=checked;} } Text { text: "Show horizon" + color:textColor + font.pixelSize :textSize } Switch { id: showHorizon checked:drone.confShowHorizon anchors.right:parent.right - onCheckedChanged:{drone.onfconfShowHorizon=enabled;} + onCheckedChanged:{drone.confShowHorizon=checked;} } Text { text: "Forward/backward gain" + color:textColor + font.pixelSize :textSize } Slider { id: forwardGain anchors.right:parent.right maximumValue:1.0 - // stepSize:0.01 - steps:0.01 + stepSize:0.01 value:drone.confForwardGain onValueChanged:{drone.confForwardGain=value;} } - /* - Text { - text: "Backward gain" - } - - Slider { - id: backwardGain - anchors.right:parent.right - maximumValue:1.0 - // stepSize:0.01 - steps:0.01 - value:drone.confBackwardGain - onValueChanged:{drone.confBackwardGain=value;} - } - - Text { - text: "Left gain" - } - - Slider { - id: leftGain - anchors.right:parent.right - maximumValue:1.0 - // stepSize:0.01 - steps:0.01 - value:drone.confLeftGain - onValueChanged:{drone.confLeftGain=value;} - } -*/ Text { text: "Right/Left gain" + color:textColor + font.pixelSize :textSize } Slider { id: rightGain anchors.right:parent.right maximumValue:1.0 - // stepSize:0.01 - steps:0.01 + stepSize:0.01 value:drone.confRightGain onValueChanged:{drone.confRightGain=value;} } Text { text: "accel ctrl treshold" + color:textColor + font.pixelSize :textSize } Slider { id: ctrlTreshold anchors.right:parent.right - // maximumValue:25.0 - // stepSize:0.01 - // steps:1 + maximumValue:25.0 value:drone.confCtrlTrsh onValueChanged:{drone.confCtrlTrsh=value;} } } } + Page { + property color textColor:"black" + property int textSize:30 + id:calibrateDialog + tools:commonTools + JoyStickCalibrator { + id:jc + // jStick:js + Component.onCompleted: { + if (jc.status != Component.Ready) + console.log("Error loading component:", jc.errorString()); + } + } + + } } +