Item {
width: 600
- height: 800
+ height: 600
property int textSize:22
property int ctrlSize:40
ListModel {
id: axisMapModel
+ ListElement { text:"none"; mapAxis:0 }
ListElement { text:"Aileron"; mapAxis:1 }
ListElement { text:"Elevator"; mapAxis:2 }
ListElement { text:"Throtle"; mapAxis:3 }
}
Column {
Button{
- text:"Reset"
+ width:160
+ text:"Calibrate"
onClicked:{
- js.calibrate=false
- pageStack.pop();
+ js.calibrate=true
}
}
Button{
+ width:160
text:"Save"
onClicked:{
js.calibrate=false
- pageStack.pop();
}
}
}
columns:7
Text {
font.pixelSize :textSize
- text:" Raw"
+ text:" Raw"
}
Text {
font.pixelSize :textSize
width:200;
model: axisMapModel
onSelectedIndexChanged: {
- console.debug("onSelectedIndexChanged " + selectedText + ", " + selectedIndex);
- js.mapAxis1=selectedIndex+1;
+ console.debug("onSelectedIndexChanged axis1:" + selectedText + ", " + selectedIndex);
+ // js.mapAxis1=selectedIndex;
}
- selectedIndex:js.mapAxis1-1
+
+ selectedIndex:js.mapAxis1
}
-/* Button{
- width:200;height:ctrlSize
- text:js.mapAxis1==1?"Aileron":js.mapAxis1==2?"Elevator":js.mapAxis1==3?"Throtle":js.mapAxis1==4?"Rudder":"none"
- onClicked:js1map.open()
+ Binding {
+ target:js
+ property:"mapAxis1"
+ value:axisMap1UICombo.selectedIndex
}
-*/
-
Text {
font.pixelSize :textSize
checked:js.invertAxis2
onCheckedChanged:{js.invertAxis2=checked;}
}
- Button{
- width:200;height:ctrlSize
- text:js.mapAxis2==1?"Aileron":js.mapAxis2==2?"Elevator":js.mapAxis2==3?"Throtle":js.mapAxis2==4?"Rudder":"none"
- onClicked:js2map.open()
- }
-
+ ComboBox {
+ id: axisMap2UICombo;
+ width:200;
+ model: axisMapModel
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " + selectedText + ", " + selectedIndex);
+ // js.mapAxis2=selectedIndex+1;
+ }
+ selectedIndex:js.mapAxis2
+ }
Text {
checked:js.invertAxis3
onCheckedChanged:{js.invertAxis3=checked;}
}
- Button{
- width:200;height:ctrlSize
- text:js.mapAxis3==1?"Aileron":js.mapAxis3==2?"Elevator":js.mapAxis3==3?"Throtle":js.mapAxis3==4?"Rudder":"none"
- onClicked:js3map.open()
- }
-
+ ComboBox {
+ id: axisMap3UICombo;
+ width:200;
+ model: axisMapModel
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " + selectedText + ", " + selectedIndex);
+ // js.mapAxis3=selectedIndex+1;
+ }
+ selectedIndex:js.mapAxis3
+ }
Text {
font.pixelSize :textSize
text:js.rawAxis4
checked:js.invertAxis4
onCheckedChanged:{js.invertAxis4=checked;}
}
- Button{
- width:200;height:ctrlSize
- text:js.mapAxis4==1?"Aileron":js.mapAxis4==2?"Elevator":js.mapAxis4==3?"Throtle":js.mapAxis4==4?"Rudder":"none"
- onClicked:js4map.open()
- }
-
+ ComboBox {
+ id: axisMap4UICombo;
+ width:200;
+ model: axisMapModel
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " + selectedText + ", " + selectedIndex);
+ // js.mapAxis4=selectedIndex+1;
+ }
+ selectedIndex:js.mapAxis4
+ }
Text {
font.pixelSize :textSize
text:js.rawAxis5
checked:js.invertAxis5
onCheckedChanged:{js.invertAxis5=checked;}
}
- Button{
- width:200;height:ctrlSize
- text:js.mapAxis5==1?"Aileron":js.mapAxis5==2?"Elevator":js.mapAxis5==3?"Throtle":js.mapAxis5==4?"Rudder":"none"
- onClicked:js5map.open()
- }
-
+ ComboBox {
+ id: axisMap5UICombo;
+ width:200;
+ model: axisMapModel
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " + selectedText + ", " + selectedIndex);
+ // js.mapAxis5=selectedIndex+1;
+ }
+ selectedIndex:js.mapAxis5
+ }
Text {
font.pixelSize :textSize
text:js.rawAxis6
checked:js.invertAxis6
onCheckedChanged:{js.invertAxis6=checked;}
}
- Button{
- width:200;height:ctrlSize
- text:js.mapAxis6==1?"Aileron":js.mapAxis6==2?"Elevator":js.mapAxis6==3?"Throtle":js.mapAxis6==4?"Rudder":"none"
- onClicked:js6map.open()
- }
+ ComboBox {
+ id: axisMap6UICombo;
+ width:200;
+ model: axisMapModel
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " + selectedText + ", " + selectedIndex);
+ // js.mapAxis6=selectedIndex+1;
+ }
+ selectedIndex:js.mapAxis6
+ }
}
}