tmp file removed
[mardrone] / mardrone / JoyStickCalibrator.qml
1 import QtQuick 1.0
2 import JoyStick 1.0
3 import com.nokia.meego 1.0
4
5 Item {
6     width: 600
7     height: 800
8     property int textSize:22
9     property int ctrlSize:40
10    // JoyStick:js
11     Menu {
12         id:js1map
13         visualParent:pageStack
14         MenuLayout {
15             MenuItem { text:"Aileron";  onClicked: { js.mapAxis1=1 }}
16             MenuItem { text:"Elevator"; onClicked: { js.mapAxis1=2 }}
17             MenuItem { text:"Throtle";  onClicked: { js.mapAxis1=3 }}
18             MenuItem { text:"Rudder";   onClicked: { js.mapAxis1=4 }}
19             MenuItem { text:"none";     onClicked: { js.mapAxis1=0 }}
20
21        }
22     }
23     Menu {
24         id:js2map
25         visualParent:pageStack
26         MenuLayout {
27             MenuItem { text:"Aileron";  onClicked: { js.mapAxis2=1 }}
28             MenuItem { text:"Elevator"; onClicked: { js.mapAxis2=2 }}
29             MenuItem { text:"Throtle";  onClicked: { js.mapAxis2=3 }}
30             MenuItem { text:"Rudder";   onClicked: { js.mapAxis2=4 }}
31             MenuItem { text:"none";     onClicked: { js.mapAxis2=0 }}
32
33        }
34     }
35     Menu {
36         id:js3map
37         visualParent:pageStack
38         MenuLayout {
39             MenuItem { text:"Aileron";  onClicked: { js.mapAxis3=1 }}
40             MenuItem { text:"Elevator"; onClicked: { js.mapAxis3=2 }}
41             MenuItem { text:"Throtle";  onClicked: { js.mapAxis3=3 }}
42             MenuItem { text:"Rudder";   onClicked: { js.mapAxis3=4 }}
43             MenuItem { text:"none";     onClicked: { js.mapAxis3=0 }}
44
45        }
46     }
47     Menu {
48         id:js4map
49         visualParent:pageStack
50         MenuLayout {
51             MenuItem { text:"Aileron";  onClicked: { js.mapAxis4=1 }}
52             MenuItem { text:"Elevator"; onClicked: { js.mapAxis4=2 }}
53             MenuItem { text:"Throtle";  onClicked: { js.mapAxis4=3 }}
54             MenuItem { text:"Rudder";   onClicked: { js.mapAxis4=4 }}
55             MenuItem { text:"none";     onClicked: { js.mapAxis4=0 }}
56
57        }
58     }
59     Menu {
60         id:js5map
61         visualParent:pageStack
62         MenuLayout {
63             MenuItem { text:"Aileron";  onClicked: { js.mapAxis5=1 }}
64             MenuItem { text:"Elevator"; onClicked: { js.mapAxis5=2 }}
65             MenuItem { text:"Throtle";  onClicked: { js.mapAxis5=3 }}
66             MenuItem { text:"Rudder";   onClicked: { js.mapAxis5=4 }}
67             MenuItem { text:"none";     onClicked: { js.mapAxis5=0 }}
68
69        }
70     }
71     Menu {
72         id:js6map
73         visualParent:pageStack
74         MenuLayout {
75             MenuItem { text:"Aileron";  onClicked: { js.mapAxis6=1 }}
76             MenuItem { text:"Elevator"; onClicked: { js.mapAxis6=2 }}
77             MenuItem { text:"Throtle";  onClicked: { js.mapAxis6=3 }}
78             MenuItem { text:"Rudder";   onClicked: { js.mapAxis6=4 }}
79             MenuItem { text:"none";     onClicked: { js.mapAxis6=0 }}
80
81        }
82     }
83
84  //   property Item jStick:
85     Column {
86         Text {
87             text:" "
88         }
89
90         Row {
91             Text {
92                 text:"                  "
93             }
94             JoyStickIndicator {
95                 border.width:1
96                 width:100;height:100
97                 xvalue:js.axis4
98                 yvalue:js.axis3
99                 Text {
100                     anchors.bottom: parent.bottom
101                     font.pixelSize: 10
102                     text:"       rudder"
103                 }
104                 Text {
105                     x:-10;y:50
106                     rotation:90
107                     font.pixelSize: 10
108                     text:"Throtle"
109                 }
110             }
111
112             spacing:50
113             JoyStickIndicator {
114                 border.width:1
115                 width:100;height:100
116                 xvalue:js.axis1
117                 yvalue:js.axis2
118                 Text {
119                     anchors.bottom: parent.bottom
120                     font.pixelSize: 10
121                     text:"      Aileron"
122                 }
123                 Text {
124                     x:-15;y:50
125                     rotation:90
126                     font.pixelSize: 10
127                     text:"Elevator"
128                 }
129             }
130             Column {
131                 Button{
132                     text:"Reset"
133                     onClicked:{
134                         js.calibrate=false
135                         pageStack.pop();
136                     }
137                 }
138                 Button{
139                     text:"Save"
140                     onClicked:{
141                         js.calibrate=false
142                         pageStack.pop();
143                     }
144                 }
145         }
146         }
147         Grid {
148             spacing:10
149             columns:7
150             Text {
151                 font.pixelSize  :textSize
152                 text:"     Raw"
153             }
154             Text {
155                 font.pixelSize  :textSize
156                 text:"     Max"
157             }
158             Text {
159                 font.pixelSize  :textSize
160                 text:"     Min"
161             }
162             Text {
163                 font.pixelSize  :textSize
164                 text:"Calib"
165             }
166             Text {
167                 font.pixelSize  :textSize
168                 text:"value"
169             }
170             Text {
171                 font.pixelSize  :textSize
172                 text:"reverse"
173             }
174             Text {
175                 font.pixelSize  :textSize
176                 text:"mapping" + js.mapAxis1 + js.mapAxis2 + js.mapAxis3 + js.mapAxis4 +js.mapAxis5 +js.mapAxis6
177             }
178
179
180             Text {
181                 font.pixelSize  :textSize
182                 text:js.rawAxis1
183             }
184             Text {
185                 font.pixelSize  :textSize
186                 text:js.maxAxis1
187             }
188             Text {
189                 font.pixelSize  :textSize
190                 text:js.minAxis1
191             }
192             Text {
193                 font.pixelSize  :textSize
194                 text:js.calAxis1.toFixed(2)
195             }
196             BarGauge {
197                 width:100
198                 height:20
199                 val:js.calAxis1+1.0
200                 max:2.0
201                 horiz:true
202             }
203             CheckBox {
204                 width:60
205        //         scale:0.8
206                 checked:js.invertAxis1
207                 onCheckedChanged:{js.invertAxis1=checked;}
208             }
209             Button{
210                 width:200;height:ctrlSize
211                 text:js.mapAxis1==1?"Aileron":js.mapAxis1==2?"Elevator":js.mapAxis1==3?"Throtle":js.mapAxis1==4?"Rudder":"none"
212                 onClicked:js1map.open()
213             }
214
215
216
217             Text {
218                 font.pixelSize  :textSize
219                 text:js.rawAxis2
220             }
221             Text {
222                 font.pixelSize  :textSize
223                 text:js.maxAxis2
224             }
225             Text {
226                 font.pixelSize  :textSize
227                 text:js.minAxis2
228             }
229             Text {
230                 font.pixelSize  :textSize
231                 text:js.calAxis2.toFixed(2)
232             }
233             BarGauge {
234                 width:100
235                 height:20
236                 val:js.calAxis2+1.0
237                 max:2.0
238                 horiz:true
239             }
240             CheckBox {
241                 checked:js.invertAxis2
242                 onCheckedChanged:{js.invertAxis2=checked;}
243             }
244             Button{
245                 width:200;height:ctrlSize
246                 text:js.mapAxis2==1?"Aileron":js.mapAxis2==2?"Elevator":js.mapAxis2==3?"Throtle":js.mapAxis2==4?"Rudder":"none"
247                 onClicked:js2map.open()
248             }
249
250
251
252             Text {
253                 font.pixelSize  :textSize
254                 text:js.rawAxis3
255             }
256             Text {
257                 font.pixelSize  :textSize
258                 text:js.maxAxis3
259             }
260             Text {
261                 font.pixelSize  :textSize
262                 text:js.minAxis3
263             }
264             Text {
265                 font.pixelSize  :textSize
266                 text:js.calAxis3.toFixed(2)
267             }
268             BarGauge {
269                 width:100
270                 height:20
271                 val:js.calAxis3+1.0
272                 max:2.0               
273                 horiz:true
274             }
275             CheckBox {
276                 checked:js.invertAxis3
277                 onCheckedChanged:{js.invertAxis3=checked;}
278             }
279             Button{
280                 width:200;height:ctrlSize
281                 text:js.mapAxis3==1?"Aileron":js.mapAxis3==2?"Elevator":js.mapAxis3==3?"Throtle":js.mapAxis3==4?"Rudder":"none"
282                 onClicked:js3map.open()
283             }
284
285             Text {
286                 font.pixelSize  :textSize
287                 text:js.rawAxis4
288             }
289             Text {
290                 font.pixelSize  :textSize
291                 text:js.maxAxis4
292             }
293             Text {
294                 font.pixelSize  :textSize
295                 text:js.minAxis4
296             }
297             Text {
298                 font.pixelSize  :textSize
299                 text:js.calAxis4.toFixed(2)
300             }
301             BarGauge {
302                 width:100
303                 height:20
304                 val:js.calAxis4+1.0
305                 max:2.0
306                 horiz:true
307             }
308             CheckBox {
309                 checked:js.invertAxis4
310                 onCheckedChanged:{js.invertAxis4=checked;}
311             }
312             Button{
313                 width:200;height:ctrlSize
314                 text:js.mapAxis4==1?"Aileron":js.mapAxis4==2?"Elevator":js.mapAxis4==3?"Throtle":js.mapAxis4==4?"Rudder":"none"
315                 onClicked:js4map.open()
316             }
317
318             Text {
319                 font.pixelSize  :textSize
320                 text:js.rawAxis5
321             }
322             Text {
323                 font.pixelSize  :textSize
324                 text:js.maxAxis5
325             }
326             Text {
327                 font.pixelSize  :textSize
328                 text:js.minAxis5
329             }
330             Text {
331                 font.pixelSize  :textSize
332                 text:js.calAxis5.toFixed(2)
333             }
334             BarGauge {
335                 width:100
336                 height:20
337                 val:js.calAxis5+1.0
338                 max:2.0
339                 horiz:true
340             }
341             CheckBox {
342                 checked:js.invertAxis5
343                 onCheckedChanged:{js.invertAxis5=checked;}
344             }
345             Button{
346                 width:200;height:ctrlSize
347                 text:js.mapAxis5==1?"Aileron":js.mapAxis5==2?"Elevator":js.mapAxis5==3?"Throtle":js.mapAxis5==4?"Rudder":"none"
348                 onClicked:js5map.open()
349             }
350
351             Text {
352                 font.pixelSize  :textSize
353                 text:js.rawAxis6
354             }
355             Text {
356                 font.pixelSize  :textSize
357                 text:js.maxAxis6
358             }
359             Text {
360                 font.pixelSize  :textSize
361                 text:js.minAxis6
362             }
363             Text {
364                 font.pixelSize  :textSize
365                 text:js.calAxis6.toFixed(2)
366             }
367             BarGauge {
368                 width:100
369                 height:20
370                 val:js.calAxis6+1.0
371                 max:2.0
372                 horiz:true
373             }
374             CheckBox {
375                 checked:js.invertAxis6
376                 onCheckedChanged:{js.invertAxis6=checked;}
377             }
378             Button{
379                 width:200;height:ctrlSize
380                 text:js.mapAxis6==1?"Aileron":js.mapAxis6==2?"Elevator":js.mapAxis6==3?"Throtle":js.mapAxis6==4?"Rudder":"none"
381                 onClicked:js6map.open()
382             }
383         }
384
385     }
386 }
387
388