Kstars

mountbox.qml
1import QtQuick 2.5
2import QtQuick.Controls 1.4
3import QtQuick.Layouts 1.1
4import QtQuick.Controls.Styles 1.4
5
6Rectangle {
7 id: rectangle
8 objectName: "mountControlObject"
9
10 color: "#000000"
11
12 property color buttonColor: "silver"
13 property color coordsColor: "gold"
14
15 FontMetrics {
16 id: fontMetrics
17 font.family: "Arial"
18 font.bold: false
19 font.italic: false
20 font.underline:false
21 font.pointSize: 12
22 }
23
24 width: (Qt.platform.os === "osx") ? fontMetrics.height * 13.5 /.75 : fontMetrics.height * 13.5
25 height: (Qt.platform.os === "osx") ? fontMetrics.height * 29.5 /.75 : fontMetrics.height * 29.5
26
27 MouseArea {
28 anchors.fill: parent
29 onClicked: mountMotionLayout.focus = true
30
31 ColumnLayout {
32 id: mainVerticalLayout
33 anchors.fill: parent
34 anchors.margins: fontMetrics.height * 0.25
35
36 GridLayout {
37 id: mountMotionLayout
38 rowSpacing: fontMetrics.height * 0.05
39 columnSpacing: fontMetrics.height * 0.05
40 Layout.minimumHeight: fontMetrics.height * 8
41 Layout.maximumHeight: fontMetrics.height * 8
42 Layout.minimumWidth: fontMetrics.height * 10
43 Layout.maximumWidth: fontMetrics.height * 10
45 columns: 3
46
47 focus: true
48 Keys.onPressed: {
49 event.accepted = true;
50 if (!event.isAutoRepeat)
51 onPressedChanged(event, true);
52 }
53
54 Keys.onReleased: {
55 event.accepted = true;
56 if (!event.isAutoRepeat)
57 onPressedChanged(event, false);
58 }
59
60 function setTimeout(delay_ms, cb) {
61 var component = Qt.createComponent("timer.qml");
62 var timer = component.createObject(rectangle, {x: 0, y: 0});
63
64 if (timer === null) {
65 console.error("Error creating timer object");
66 }
67
68 timer.callback = function() {
69 cb();
70 this.destroy();
71 };
72 timer.interval = delay_ms;
73 timer.running = true;
74 }
75
76 property var keyState: ({})
77 // -1 means not moving
78 property var motionState: ({ns: -1, we: -1})
79 // It appears [Qt.Key_Up] is not a valid subsituion in QML like Javascript in older versions?
80 //property var filteredKeyState: ({[Qt.Key_Up]: false, [Qt.Key_Down]: false, [Qt.Key_Left]: false, [Qt.Key_Right]: false})
81 // Replacing it with direct values and confirmed works with older Qt versions:
82 // true means pressed
83 property var filteredKeyState: {0x13: false, 0x15: false, 0x12: false, 0x14: false}
84 function moveMount() {
85 var up = filteredKeyState[Qt.Key_Up];
86 var down = filteredKeyState[Qt.Key_Down];
87 var left = filteredKeyState[Qt.Key_Left];
88 var right = filteredKeyState[Qt.Key_Right];
89
90 var ns = -1;
91 var we = -1;
92 if (up !== down) {
93 if (up){
94 ns = 0;
95 } else if (down) {
96 ns = 1;
97 }
98 mount.motionCommand(0, ns, -1);
99 motionState.ns = ns;
100 } else if (motionState.ns !== -1) {
101 mount.motionCommand(1, motionState.ns, -1);
102 motionState.ns = -1;
103 }
104 if (left !== right) {
105 if (left){
106 we = 0;
107 } else if (right) {
108 we = 1;
109 }
110 mount.motionCommand(0, -1, we);
111 motionState.we = we;
112 } else if (motionState.we !== -1) {
113 mount.motionCommand(1, -1, motionState.we);
114 motionState.we = -1;
115 }
116
117 if (ns === 0) {
118 northRect.opacity = 1;
119 } else if (ns === 1) {
120 southRect.opacity = 1;
121 } else {
122 northRect.opacity = 0;
123 southRect.opacity = 0;
124 }
125 if (we === 0) {
126 westRect.opacity = 1;
127 } else if (we === 1) {
128 eastRect.opacity = 1;
129 } else {
130 westRect.opacity = 0;
131 eastRect.opacity = 0;
132 }
133 }
134
135 function deflicker(key, pressed) {
136 keyState[key] = pressed;
137 setTimeout(5, function() {
138 if (pressed === keyState[key] && pressed !== filteredKeyState[key]) {
139 filteredKeyState[key] = pressed;
140 moveMount();
141 }
142 });
143 }
144
145 function onPressedChanged(event, pressed) {
146 deflicker(event.key, pressed);
147 }
148
149 Button
150 {
151 id: northWest
152 Layout.fillHeight: true
153 Layout.fillWidth: true
154
155 Rectangle
156 {
157 anchors.fill: parent
158 color: northWest.pressed ? "red" : rectangle.buttonColor
159 }
160
161 onPressedChanged:
162 {
163 northWest.pressed ? mount.motionCommand(0, 0, 0) : mount.motionCommand(1, 0, 0);
164 }
165
166 onClicked:
167 {
168 mountMotionLayout.focus = true;
169 }
170
171 Image {
172 anchors.fill: parent
173 source: "go-northwest.png"
174 }
175 }
176
177 Button {
178 id: north
179 Layout.fillHeight: true
180 Layout.fillWidth: true
181
182 Rectangle
183 {
184 anchors.fill: parent
185 color: north.pressed ? "red" : rectangle.buttonColor
186 }
187
188 Rectangle
189 {
190 id: northRect
191 opacity: 0
192 anchors.fill: parent
193 color: "red"
194 }
195
196 onPressedChanged:
197 {
198 north.pressed ? mount.motionCommand(0, 0, -1) : mount.motionCommand(1, 0, -1);
199 }
200
201 onClicked:
202 {
203 mountMotionLayout.focus = true;
204 }
205
206 Image {
207 anchors.fill: parent
208 source: "go-north.png"
209 }
210 }
211
212 Button {
213 id: northEast
214 Layout.fillHeight: true
215 Layout.fillWidth: true
216
217 Rectangle
218 {
219 anchors.fill: parent
220 color: northEast.pressed ? "red" : rectangle.buttonColor
221 }
222
223 onPressedChanged:
224 {
225 northEast.pressed ? mount.motionCommand(0, 0, 1) : mount.motionCommand(1, 0, 1);
226 }
227
228 onClicked:
229 {
230 mountMotionLayout.focus = true;
231 }
232
233 Image {
234 anchors.fill: parent
235 source: "go-northeast.png"
236 }
237 }
238
239 Button {
240 id: west
241 Layout.fillHeight: true
242 Layout.fillWidth: true
243
244 Rectangle
245 {
246 anchors.fill: parent
247 color: west.pressed ? "red" : rectangle.buttonColor
248 }
249
250 Rectangle
251 {
252 id: westRect
253 opacity: 0
254 anchors.fill: parent
255 color: "red"
256 }
257
258 onPressedChanged:
259 {
260 west.pressed ? mount.motionCommand(0, -1, 0) : mount.motionCommand(1, -1, 0);
261 }
262
263 onClicked:
264 {
265 mountMotionLayout.focus = true;
266 }
267
268 Image {
269 anchors.fill: parent
270 source: "go-west.png"
271 }
272 }
273
274 Button {
275 id: stop
276 Layout.fillHeight: true
277 Layout.fillWidth: true
278
279 Rectangle
280 {
281 anchors.fill: parent
282 color: stop.pressed ? "red" : rectangle.buttonColor
283 }
284
285 Image {
286 anchors.fill: parent
287 source: "stop.png"
288 }
289
290 onClicked:
291 {
292 mount.abort();
293 mountMotionLayout.focus = true;
294 }
295
296
297 }
298
299 Button {
300 id: east
301 Layout.fillHeight: true
302 Layout.fillWidth: true
303
304 Rectangle
305 {
306 anchors.fill: parent
307 color: east.pressed ? "red" : rectangle.buttonColor
308 }
309
310 Rectangle
311 {
312 id: eastRect
313 opacity: 0
314 anchors.fill: parent
315 color: "red"
316 }
317
318 onPressedChanged:
319 {
320 east.pressed ? mount.motionCommand(0, -1, 1) : mount.motionCommand(1, -1, 1);
321 }
322
323 onClicked:
324 {
325 mountMotionLayout.focus = true;
326 }
327
328 Image {
329 anchors.fill: parent
330 source: "go-east.png"
331 }
332 }
333
334 Button {
335 id: southWest
336 Layout.fillHeight: true
337 Layout.fillWidth: true
338
339 Rectangle
340 {
341 anchors.fill: parent
342 color: southWest.pressed ? "red" : rectangle.buttonColor
343 }
344
345 onPressedChanged:
346 {
347 southWest.pressed ? mount.motionCommand(0, 1, 0) : mount.motionCommand(1, 1, 0);
348 }
349
350 onClicked:
351 {
352 mountMotionLayout.focus = true;
353 }
354
355 Image {
356 anchors.fill: parent
357 source: "go-southwest.png"
358 }
359 }
360
361 Button {
362 id: south
363 Layout.fillHeight: true
364 Layout.fillWidth: true
365
366 Rectangle
367 {
368 anchors.fill: parent
369 color: south.pressed ? "red" : rectangle.buttonColor
370 }
371
372 Rectangle
373 {
374 id: southRect
375 opacity: 0
376 anchors.fill: parent
377 color: "red"
378 }
379
380 onPressedChanged:
381 {
382 south.pressed ? mount.motionCommand(0, 1, -1) : mount.motionCommand(1, 1, -1);
383 mountMotionLayout.focus = true;
384 }
385
386 Image {
387 anchors.fill: parent
388 source: "go-south.png"
389 }
390 }
391
392 Button {
393 id: southEast
394 Layout.fillHeight: true
395 Layout.fillWidth: true
396
397 Rectangle
398 {
399 anchors.fill: parent
400 color: southEast.pressed ? "red" : rectangle.buttonColor
401 }
402
403 onPressedChanged:
404 {
405 southEast.pressed ? mount.motionCommand(0, 1, 1) : mount.motionCommand(1, 1, 1);
406 }
407
408 onClicked:
409 {
410 mountMotionLayout.focus = true;
411 }
412
413 Image {
414 anchors.fill: parent
415 source: "go-southeast.png"
416 }
417 }
418 }
419
420
421 RowLayout {
422 id: mountReverseLayout
423 Layout.fillWidth: true
424 Layout.alignment: Qt.AlignHCenter
425
426 Label
427 {
428 text: xi18n("Reverse")
429 renderType: Text.QtRendering
430 }
431
432 CheckBox
433 {
434 id: updownReverse
435 style:CheckBoxStyle{
436 label:Text{
437 text: xi18n("Up/Down")
438 renderType: Text.QtRendering
439 color: "white"
440 }
441 }
442
443 objectName: "upDownCheckObject"
444 onClicked: mount.setUpDownReversed(checked)
445 }
446
447 CheckBox
448 {
449 id: leftRightReverse
450 style:CheckBoxStyle{
451 label:Text{
452 text: xi18n("Left/Right")
453 renderType: Text.QtRendering
454 color: "white"
455 }
456 }
457 objectName: "leftRightCheckObject"
458 onClicked: mount.setLeftRightReversed(checked)
459 }
460
461 }
462
463 RowLayout {
464 id: mountSpeedLayout
465 anchors.horizontalCenter: parent.Center
466 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
467 Layout.fillHeight: false
468 Layout.fillWidth: true
469
470 Slider {
471 id: speedSlider
472 x: fontMetrics.height * 0.1
473 y: 0
474 width: fontMetrics.height * 1.5
475 objectName: "speedSliderObject"
476 Layout.fillWidth: true
477 Layout.maximumWidth: fontMetrics.height * 7.5
478 stepSize: 1
479 minimumValue: 0
480 maximumValue: 4
481 value: 0
482
483 onValueChanged:
484 {
485 mount.setSlewRate(speedSlider.value)
486 }
487 }
488
489 Label {
490 id: speedLabel
491 width: fontMetrics.height * 3.75
492 objectName: "speedLabelObject"
493 text: xi18n("1x")
494 renderType: Text.QtRendering
495 horizontalAlignment: Text.AlignHCenter
496 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
497 Layout.maximumWidth: fontMetrics.height * 3.75
498 Layout.minimumWidth: fontMetrics.height * 3.75
499 font.weight: Font.Bold
500 font.bold: true
501 font.pointSize: 12
502 font.family: "Verdana"
503 fontSizeMode: Text.Fit
504 verticalAlignment: Text.AlignVCenter
505 Layout.fillWidth: true
506 color: "white"
507 }
508 }
509
510 GridLayout {
511 id: mountCoordsLayout
512 anchors.horizontalCenter: parent.Center
513 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
514 Layout.fillWidth: true
515 columns: 4
516
517 MouseArea {
518 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
519 property bool toggle: false
520 onClicked: {
521 if (toggle) {
522 targetRAText.text = ""
523 targetDEText.text = ""
524 }
525 else {
526 if (coordGroup.lastChecked == 0) {
527 targetRAText.text = raValue.text
528 targetDEText.text = deValue.text
529 }
530 if (coordGroup.lastChecked == 1) {
531 targetRAText.text = azValue.text
532 targetDEText.text = altValue.text
533 }
534 if (coordGroup.lastChecked == 2) {
535 targetRAText.text = haValue.text
536 targetDEText.text = deValue.text
537 }
538 }
539 toggle = !toggle
540 }
541 }
542
543 Label {
544 id: raLabel
545 text: xi18n("RA:")
546 renderType: Text.QtRendering
547 font.bold: true
548 color: "white"
549 fontSizeMode: Text.Fit
550 }
551
552 Label {
553 id: raValue
554 objectName: "raValueObject"
555 color: coordsColor
556 text: "00:00:00"
557 renderType: Text.QtRendering
558 Layout.fillWidth: true
559 font.pointSize: 11
560 }
561
562 Label {
563 id: azLabel
564 color: "#ffffff"
565 text: xi18n("AZ:")
566 renderType: Text.QtRendering
567 Layout.fillWidth: false
568 fontSizeMode: Text.Fit
569 font.bold: true
570 }
571
572 Label {
573 id: azValue
574 objectName: "azValueObject"
575 color: coordsColor
576 text: "00:00:00"
577 renderType: Text.QtRendering
578 Layout.fillWidth: true
579 font.pointSize: 11
580 }
581
582 Label {
583 id: deLabel
584 color: "#ffffff"
585 text: xi18n("DE:")
586 renderType: Text.QtRendering
587 fontSizeMode: Text.Fit
588 font.bold: true
589 }
590
591 Label {
592 id: deValue
593 objectName: "deValueObject"
594 color: coordsColor
595 text: "00:00:00"
596 renderType: Text.QtRendering
597 Layout.fillWidth: true
598 font.pointSize: 11
599 }
600
601 Label {
602 id: altLabel
603 color: "#ffffff"
604 text: xi18n("AL:")
605 renderType: Text.QtRendering
606 fontSizeMode: Text.Fit
607 font.bold: true
608 }
609
610 Label {
611 id: altValue
612 objectName: "altValueObject"
613 color: coordsColor
614 text: "00:00:00"
615 renderType: Text.QtRendering
616 Layout.fillWidth: true
617 font.pointSize: 11
618 }
619
620 Label {
621 id: haLabel
622 color: "#ffffff"
623 text: xi18n("HA:")
624 renderType: Text.QtRendering
625 fontSizeMode: Text.Fit
626 font.bold: true
627 }
628
629 Label {
630 id: haValue
631 objectName: "haValueObject"
632 color: coordsColor
633 text: "00:00:00"
634 renderType: Text.QtRendering
635 Layout.fillWidth: true
636 font.pointSize: 11
637 }
638
639 Label {
640 id: zaLabel
641 color: "#ffffff"
642 text: xi18n("ZA:")
643 renderType: Text.QtRendering
644 fontSizeMode: Text.Fit
645 font.bold: true
646 }
647
648 Label {
649 id: zaValue
650 objectName: "zaValueObject"
651 color: coordsColor
652 text: "00:00:00"
653 renderType: Text.QtRendering
654 Layout.fillWidth: true
655 font.pointSize: 11
656 }
657 }
658
659 RowLayout
660 {
661 id: targetFindLayout
662 Layout.fillWidth: true
663 Layout.alignment: Qt.AlignHCenter
664
665 Label {
666 id: targetLabel
667 color: "#ffffff"
668 text: xi18n("Target:")
669 renderType: Text.QtRendering
670 verticalAlignment: Text.AlignVCenter
671 Layout.fillHeight: true
672 Layout.fillWidth: false
673 font.pointSize: 14
674 font.bold: true
675 }
676
677 TextField {
678 id: targetText
679 objectName: "targetTextObject"
680 placeholderText: "Click Find Icon"
681 style: TextFieldStyle {
682 textColor: "white"
684 renderType: Text.QtRendering
685 background: Rectangle {
686 color: "#202020"
687 }
688 }
689 readOnly: true
690 Rectangle
691 {
692 color: "black"
693 radius: fontMetrics.height * 0.25
694 anchors.fill: parent
695 clip: true
696 opacity: 0.5
697 border.color: "#D4AF37"
698 border.width: fontMetrics.height * 0.05
699 }
700 verticalAlignment: Text.AlignVCenter
701 horizontalAlignment: Text.AlignHCenter
702 Layout.fillHeight: false
703 Layout.fillWidth: true
704 font.pointSize: 14
705 font.bold: true
706 }
707
708 Button {
709 id: findButton
710 objectName: "findButtonObject"
711 Layout.fillWidth: false
712 iconName: "view-history"
713 Layout.alignment: Qt.AlignRight
714 Layout.minimumHeight: fontMetrics.height * 1.4
715 Layout.maximumHeight: fontMetrics.height * 1.4
716 Layout.minimumWidth: fontMetrics.height * 1.5
717 Layout.maximumWidth: fontMetrics.height * 1.5
718 onClicked:
719 {
720 mount.findTarget()
721 }
722 }
723
724 }
725
726
727 GridLayout {
728 id: targetCoordsLayout
729 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
730 Layout.fillWidth: true
731 columns: 2
732
733 Label {
734 id: targetRALabel
735 objectName: "targetRALabelObject"
736 color: "#ffffff"
737 text: xi18n("RA:")
738 renderType: Text.QtRendering
739 font.pointSize: 14
740 font.bold: true
741 }
742
743 TextField {
744 id: targetRAText
745 objectName: "targetRATextObject"
746 placeholderText: "HH:MM:SS"
747 style: TextFieldStyle {
748 textColor: "white"
750 renderType: Text.QtRendering
751 background: Rectangle {
752 color: "#202020"
753 }
754 }
755 font.pointSize: 14
756 horizontalAlignment: Text.AlignHCenter
757 Layout.minimumWidth: fontMetrics.height * 7
758 clip: true
759 font.bold: true
760 Layout.minimumHeight: fontMetrics.height * 1.4
761 Layout.fillWidth: true
762 }
763
764 Label {
765 id: targetDELabel
766 objectName: "targetDELabelObject"
767 color: "#ffffff"
768 text: xi18n("DE:")
769 renderType: Text.QtRendering
770 font.pointSize: 14
771 font.bold: true
772 }
773
774 TextField {
775 id: targetDEText
776 objectName: "targetDETextObject"
777 placeholderText: "DD:MM:SS"
778 style: TextFieldStyle {
779 textColor: "white"
781 renderType: Text.QtRendering
782 background: Rectangle {
783 color: "#202020"
784 }
785 }
786 font.pointSize: 14
787 width: fontMetrics.height * 7.5
788 horizontalAlignment: Text.AlignHCenter
789 Layout.fillHeight: false
790 Layout.minimumWidth: fontMetrics.height * 7
791 clip: true
792 font.bold: true
793 Layout.minimumHeight: fontMetrics.height * 1.4
794 Layout.fillWidth: true
795 }
796
797 Label {
798 id: coordLabel
799 text: xi18n("Type:")
800 renderType: Text.QtRendering
801 }
802
803 RowLayout
804 {
805 ExclusiveGroup {
806 id: coordGroup
807 objectName: "coordGroupObject"
808 property int lastChecked: 0
809 property bool valid: false
810 }
811
812 RadioButton {
813 id: equatorialCheck
814 objectName: "equatorialCheckObject"
815 checked: true
816 style:RadioButtonStyle{
817 label:Text{
818 text: xi18n("RA/DE")
819 renderType: Text.QtRendering
820 color: "white"
821 }
822 }
823 exclusiveGroup: coordGroup
825 if (checked) {
826 targetRALabel.text = xi18n("RA:")
827 targetDELabel.text = xi18n("DE:")
828 targetRAText.placeholderText = "HH:MM:SS"
829 if (targetRAText.text == "" ||
830 targetDEText.text == "") {
831 targetRAText.text = ""
832 targetDEText.text = ""
833 }
834 else {
835 if (coordGroup.lastChecked == 1)
836 coordGroup.valid = mount.azAltToRaDec(
837 targetRAText.text, targetDEText.text)
838 else
839 coordGroup.valid = mount.haDecToRaDec(
840 targetRAText.text)
841 if (!coordGroup.valid) {
842 targetRAText.text = ""
843 targetDEText.text = ""
844 }
845 }
846 targetRAText.focus = false
847 targetDEText.focus = false
848 coordGroup.lastChecked = 0
849 }
850 }
851 }
852
853 RadioButton {
854 id: horizontalCheck
855 exclusiveGroup: coordGroup
856 objectName: "horizontalCheckObject"
857 style:RadioButtonStyle{
858 label:Text{
859 text: xi18n("AZ/AL")
860 renderType: Text.QtRendering
861 color: "white"
862 }
863 }
864 checked: false
866 if (checked) {
867 targetText.text = ""
868 targetRALabel.text = xi18n("AZ:")
869 targetDELabel.text = xi18n("AL:")
870 targetRAText.placeholderText = "DDD:MM:SS"
871 if (targetRAText.text == "" ||
872 targetDEText.text == "") {
873 targetRAText.text = ""
874 targetDEText.text = ""
875 }
876 else {
877 if (coordGroup.lastChecked == 0)
878 coordGroup.valid = mount.raDecToAzAlt(
879 targetRAText.text, targetDEText.text)
880 else
881 coordGroup.valid = mount.haDecToAzAlt(
882 targetRAText.text, targetDEText.text)
883 if (!coordGroup.valid) {
884 targetRAText.text = ""
885 targetDEText.text = ""
886 }
887 }
888 targetRAText.focus = false
889 targetDEText.focus = false
890 coordGroup.lastChecked = 1
891 }
892 }
893 }
894
895 RadioButton {
896 id: haEquatorialCheck
897 style:RadioButtonStyle{
898 label:Text{
899 text: xi18n("HA/DE")
900 renderType: Text.QtRendering
901 color: "white"
902 }
903 }
904 exclusiveGroup: coordGroup
905 objectName: "haEquatorialCheckObject"
906 checked: false
908 if (checked) {
909 targetText.text = ""
910 targetRALabel.text = xi18n("HA:")
911 targetDELabel.text = xi18n("DE:")
912 targetRAText.placeholderText = "HH:MM:SS"
913 if (targetRAText.text == "" ||
914 targetDEText.text == "") {
915 targetRAText.text = ""
916 targetDEText.text = ""
917 }
918 else {
919 if (coordGroup.lastChecked == 1)
920 coordGroup.valid = mount.azAltToHaDec(
921 targetRAText.text, targetDEText.text)
922 else
923 coordGroup.valid = mount.raDecToHaDec(
924 targetRAText.text)
925 if (!coordGroup.valid) {
926 targetRAText.text = ""
927 targetDEText.text = ""
928 }
929 }
930 targetRAText.focus = false
931 targetDEText.focus = false
932 coordGroup.lastChecked = 2
933 }
934 }
935 }
936 }
937
938 Label {
939 id: epochLabel
940 text: xi18n("Epoch:")
941 renderType: Text.QtRendering
942 }
943
944 RowLayout
945 {
946 ExclusiveGroup { id: epochGroup }
947
948 RadioButton {
949 id: jnowCheck
950 objectName: "jnowCheckObject"
951 checked: true
952 style:RadioButtonStyle{
953 label:Text{
954 text: xi18n("JNow")
955 renderType: Text.QtRendering
956 color: "white"
957 }
958 }
960 }
961
962 RadioButton {
963 id: j2000Check
964 objectName: "j2000CheckObject"
965 style:RadioButtonStyle{
966 label:Text{
967 text: xi18n("J2000")
968 renderType: Text.QtRendering
969 color: "white"
970 }
971 }
973 }
974 }
975 }
976
977 GridLayout {
978 id: actionLayout
979 Layout.fillHeight: false
980 Layout.fillWidth: true
981 Layout.alignment: Qt.AlignHCenter
982 columns: 2
983
984 Button {
985 id: gotoButton
986 objectName: "gotoButtonObject"
987 text: xi18n("GOTO")
988 Layout.fillWidth: true
989
990 onClicked:
991 {
992 mount.slew(targetRAText.text, targetDEText.text);
993 mountMotionLayout.focus = true;
994 }
995 }
996
997 Button {
998 id: syncButton
999 objectName: "syncButtonObject"
1000 text: xi18n("SYNC")
1001 Layout.fillWidth: true
1002
1003 onClicked:
1004 {
1005 mount.sync(targetRAText.text, targetDEText.text);
1006 mountMotionLayout.focus = true;
1007 }
1008 }
1009
1010 Button {
1011 id: parkButton
1012 objectName: "parkButtonObject"
1013 text: xi18n("PARK")
1014 Layout.fillWidth: true
1015
1016 onClicked:
1017 {
1018 mount.park()
1019 }
1020 }
1021
1022 Button {
1023 id: unparkButton
1024 objectName: "unparkButtonObject"
1025 text: xi18n("UNPARK")
1026 Layout.fillWidth: true
1027
1028 onClicked:
1029 {
1030 mount.unpark()
1031 }
1032 }
1033 }
1034
1035 RowLayout {
1036 id: statusLayout
1037 Layout.fillHeight: false
1038 Layout.fillWidth: true
1039 Layout.alignment: Qt.AlignHCenter
1040
1041 Label {
1042 id: statusLabel
1043 color: "#ffffff"
1044 text: xi18n("Status:")
1045 renderType: Text.QtRendering
1046 font.pointSize: 12
1047 font.bold: true
1048 }
1049
1050 Label {
1051 id: statusText
1052 objectName: "statusTextObject"
1053 color: "#ffffff"
1054 text: xi18n("Idle")
1055 renderType: Text.QtRendering
1056 Layout.fillWidth: true
1057 Layout.minimumWidth: fontMetrics.height * 5
1058 font.pointSize: 12
1059 font.bold: true
1060 }
1061
1062 Button {
1063 id: centerMount
1064 Layout.minimumWidth: fontMetrics.height * 1.4
1065 Layout.minimumHeight: fontMetrics.height * 1.4
1066 iconName: "crosshairs"
1067
1068 onClicked:
1069 {
1070 mount.centerMount()
1071 }
1072 }
1073 }
1074 }
1075 }
1076}
1077
1078/*##^##
1079Designer {
1080 D{i:0;autoSize:true;height:480;width:640}
1081}
1082##^##*/
QString xi18n(const char *text, const TYPE &arg...)
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
KIOCORE_EXPORT SimpleJob * mount(bool ro, const QByteArray &fstype, const QString &dev, const QString &point, JobFlags flags=DefaultFlags)
QAction * up(const QObject *recvr, const char *slot, QObject *parent)
KGuiItem stop()
QString label(StandardShortcut id)
AlignHCenter
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:48:25 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.