2import QtQuick.Controls 1.4
3import QtQuick.Layouts 1.1
4import QtQuick.Controls.Styles 1.4
8 objectName: "mountControlObject"
12 property color buttonColor:
"silver"
13 property color coordsColor:
"gold"
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
29 onClicked: mountMotionLayout.focus = true
32 id: mainVerticalLayout
34 anchors.margins: fontMetrics.height * 0.25
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
49 event.accepted =
true;
50 if (!
event.isAutoRepeat)
51 onPressedChanged(event,
true);
55 event.accepted =
true;
56 if (!
event.isAutoRepeat)
57 onPressedChanged(event,
false);
60 function setTimeout(delay_ms, cb) {
61 var component =
Qt.createComponent(
"timer.qml");
62 var timer = component.createObject(rectangle, {x: 0, y: 0});
65 console.error(
"Error creating timer object");
68 timer.callback = function() {
72 timer.interval = delay_ms;
76 property var keyState: ({})
78 property var motionState: ({ns: -1, we: -1})
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];
98 mount.motionCommand(0, ns, -1);
100 }
else if (motionState.ns !== -1) {
101 mount.motionCommand(1, motionState.ns, -1);
104 if (left !== right) {
110 mount.motionCommand(0, -1, we);
112 }
else if (motionState.we !== -1) {
113 mount.motionCommand(1, -1, motionState.we);
118 northRect.opacity = 1;
119 }
else if (ns === 1) {
120 southRect.opacity = 1;
122 northRect.opacity = 0;
123 southRect.opacity = 0;
126 westRect.opacity = 1;
127 }
else if (we === 1) {
128 eastRect.opacity = 1;
130 westRect.opacity = 0;
131 eastRect.opacity = 0;
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;
145 function onPressedChanged(event, pressed) {
146 deflicker(
event.key, pressed);
152 Layout.fillHeight:
true
153 Layout.fillWidth:
true
158 color: northWest.pressed ?
"red" : rectangle.buttonColor
163 northWest.pressed ?
mount.motionCommand(0, 0, 0) :
mount.motionCommand(1, 0, 0);
168 mountMotionLayout.focus =
true;
173 source:
"go-northwest.png"
179 Layout.fillHeight:
true
180 Layout.fillWidth:
true
185 color: north.pressed ?
"red" : rectangle.buttonColor
198 north.pressed ?
mount.motionCommand(0, 0, -1) :
mount.motionCommand(1, 0, -1);
203 mountMotionLayout.focus =
true;
208 source:
"go-north.png"
214 Layout.fillHeight:
true
215 Layout.fillWidth:
true
220 color: northEast.pressed ?
"red" : rectangle.buttonColor
225 northEast.pressed ?
mount.motionCommand(0, 0, 1) :
mount.motionCommand(1, 0, 1);
230 mountMotionLayout.focus =
true;
235 source:
"go-northeast.png"
241 Layout.fillHeight:
true
242 Layout.fillWidth:
true
247 color: west.pressed ?
"red" : rectangle.buttonColor
260 west.pressed ?
mount.motionCommand(0, -1, 0) :
mount.motionCommand(1, -1, 0);
265 mountMotionLayout.focus =
true;
270 source:
"go-west.png"
276 Layout.fillHeight:
true
277 Layout.fillWidth:
true
282 color:
stop.pressed ?
"red" : rectangle.buttonColor
293 mountMotionLayout.focus =
true;
301 Layout.fillHeight:
true
302 Layout.fillWidth:
true
307 color: east.pressed ?
"red" : rectangle.buttonColor
320 east.pressed ?
mount.motionCommand(0, -1, 1) :
mount.motionCommand(1, -1, 1);
325 mountMotionLayout.focus =
true;
330 source:
"go-east.png"
336 Layout.fillHeight:
true
337 Layout.fillWidth:
true
342 color: southWest.pressed ?
"red" : rectangle.buttonColor
347 southWest.pressed ?
mount.motionCommand(0, 1, 0) :
mount.motionCommand(1, 1, 0);
352 mountMotionLayout.focus =
true;
357 source:
"go-southwest.png"
363 Layout.fillHeight:
true
364 Layout.fillWidth:
true
369 color: south.pressed ?
"red" : rectangle.buttonColor
382 south.pressed ?
mount.motionCommand(0, 1, -1) :
mount.motionCommand(1, 1, -1);
383 mountMotionLayout.focus =
true;
388 source:
"go-south.png"
394 Layout.fillHeight:
true
395 Layout.fillWidth:
true
400 color: southEast.pressed ?
"red" : rectangle.buttonColor
405 southEast.pressed ?
mount.motionCommand(0, 1, 1) :
mount.motionCommand(1, 1, 1);
410 mountMotionLayout.focus =
true;
415 source:
"go-southeast.png"
422 id: mountReverseLayout
423 Layout.fillWidth:
true
424 Layout.alignment:
Qt.AlignHCenter
428 text:
xi18n(
"Reverse")
429 renderType: Text.QtRendering
437 text:
xi18n(
"Up/Down")
438 renderType: Text.QtRendering
443 objectName: "upDownCheckObject"
444 onClicked: mount.setUpDownReversed(checked)
452 text:
xi18n(
"Left/Right")
453 renderType: Text.QtRendering
457 objectName: "leftRightCheckObject"
458 onClicked: mount.setLeftRightReversed(checked)
465 anchors.horizontalCenter: parent.Center
466 Layout.alignment:
Qt.AlignHCenter |
Qt.AlignVCenter
467 Layout.fillHeight:
false
468 Layout.fillWidth:
true
472 x: fontMetrics.height * 0.1
474 width: fontMetrics.height * 1.5
475 objectName:
"speedSliderObject"
476 Layout.fillWidth:
true
477 Layout.maximumWidth: fontMetrics.height * 7.5
485 mount.setSlewRate(speedSlider.value)
491 width: fontMetrics.height * 3.75
492 objectName:
"speedLabelObject"
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
502 font.family: "Verdana"
503 fontSizeMode: Text.Fit
504 verticalAlignment: Text.AlignVCenter
505 Layout.fillWidth: true
511 id: mountCoordsLayout
512 anchors.horizontalCenter: parent.Center
513 Layout.alignment:
Qt.AlignHCenter |
Qt.AlignVCenter
514 Layout.fillWidth:
true
518 Layout.alignment:
Qt.AlignHCenter |
Qt.AlignVCenter
519 property bool toggle:
false
522 targetRAText.text =
""
523 targetDEText.text =
""
526 if (coordGroup.lastChecked == 0) {
527 targetRAText.text = raValue.text
528 targetDEText.text = deValue.text
530 if (coordGroup.lastChecked == 1) {
531 targetRAText.text = azValue.text
532 targetDEText.text = altValue.text
534 if (coordGroup.lastChecked == 2) {
535 targetRAText.text = haValue.text
536 targetDEText.text = deValue.text
546 renderType: Text.QtRendering
549 fontSizeMode: Text.Fit
554 objectName:
"raValueObject"
557 renderType: Text.QtRendering
558 Layout.fillWidth:
true
566 renderType: Text.QtRendering
567 Layout.fillWidth: false
568 fontSizeMode: Text.Fit
574 objectName:
"azValueObject"
577 renderType: Text.QtRendering
578 Layout.fillWidth:
true
586 renderType: Text.QtRendering
587 fontSizeMode: Text.Fit
593 objectName:
"deValueObject"
596 renderType: Text.QtRendering
597 Layout.fillWidth:
true
605 renderType: Text.QtRendering
606 fontSizeMode: Text.Fit
612 objectName:
"altValueObject"
615 renderType: Text.QtRendering
616 Layout.fillWidth:
true
624 renderType: Text.QtRendering
625 fontSizeMode: Text.Fit
631 objectName:
"haValueObject"
634 renderType: Text.QtRendering
635 Layout.fillWidth:
true
643 renderType: Text.QtRendering
644 fontSizeMode: Text.Fit
650 objectName:
"zaValueObject"
653 renderType: Text.QtRendering
654 Layout.fillWidth:
true
662 Layout.fillWidth:
true
663 Layout.alignment:
Qt.AlignHCenter
668 text:
xi18n(
"Target:")
669 renderType: Text.QtRendering
670 verticalAlignment: Text.AlignVCenter
671 Layout.fillHeight: true
672 Layout.fillWidth: false
679 objectName:
"targetTextObject"
680 placeholderText:
"Click Find Icon"
681 style: TextFieldStyle {
683 placeholderTextColor:
"gray"
684 renderType: Text.QtRendering
685 background: Rectangle {
693 radius: fontMetrics.height * 0.25
697 border.color:
"#D4AF37"
698 border.width: fontMetrics.height * 0.05
700 verticalAlignment: Text.AlignVCenter
701 horizontalAlignment: Text.AlignHCenter
702 Layout.fillHeight:
false
703 Layout.fillWidth:
true
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
728 id: targetCoordsLayout
729 Layout.alignment:
Qt.AlignHCenter |
Qt.AlignVCenter
730 Layout.fillWidth:
true
735 objectName:
"targetRALabelObject"
738 renderType: Text.QtRendering
745 objectName:
"targetRATextObject"
746 placeholderText:
"HH:MM:SS"
747 style: TextFieldStyle {
749 placeholderTextColor:
"gray"
750 renderType: Text.QtRendering
751 background: Rectangle {
756 horizontalAlignment: Text.AlignHCenter
757 Layout.minimumWidth: fontMetrics.height * 7
760 Layout.minimumHeight: fontMetrics.height * 1.4
761 Layout.fillWidth:
true
766 objectName:
"targetDELabelObject"
769 renderType: Text.QtRendering
776 objectName:
"targetDETextObject"
777 placeholderText:
"DD:MM:SS"
778 style: TextFieldStyle {
780 placeholderTextColor:
"gray"
781 renderType: Text.QtRendering
782 background: Rectangle {
787 width: fontMetrics.height * 7.5
788 horizontalAlignment: Text.AlignHCenter
789 Layout.fillHeight:
false
790 Layout.minimumWidth: fontMetrics.height * 7
793 Layout.minimumHeight: fontMetrics.height * 1.4
794 Layout.fillWidth:
true
800 renderType: Text.QtRendering
807 objectName:
"coordGroupObject"
808 property int lastChecked: 0
809 property bool valid:
false
814 objectName:
"equatorialCheckObject"
816 style:RadioButtonStyle{
819 renderType: Text.QtRendering
823 exclusiveGroup: coordGroup
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 =
""
835 if (coordGroup.lastChecked == 1)
836 coordGroup.valid =
mount.azAltToRaDec(
837 targetRAText.text, targetDEText.text)
839 coordGroup.valid =
mount.haDecToRaDec(
841 if (!coordGroup.valid) {
842 targetRAText.text =
""
843 targetDEText.text =
""
846 targetRAText.focus =
false
847 targetDEText.focus =
false
848 coordGroup.lastChecked = 0
855 exclusiveGroup: coordGroup
856 objectName:
"horizontalCheckObject"
857 style:RadioButtonStyle{
860 renderType: Text.QtRendering
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 =
""
877 if (coordGroup.lastChecked == 0)
878 coordGroup.valid =
mount.raDecToAzAlt(
879 targetRAText.text, targetDEText.text)
881 coordGroup.valid =
mount.haDecToAzAlt(
882 targetRAText.text, targetDEText.text)
883 if (!coordGroup.valid) {
884 targetRAText.text =
""
885 targetDEText.text =
""
888 targetRAText.focus =
false
889 targetDEText.focus =
false
890 coordGroup.lastChecked = 1
896 id: haEquatorialCheck
897 style:RadioButtonStyle{
900 renderType: Text.QtRendering
904 exclusiveGroup: coordGroup
905 objectName: "haEquatorialCheckObject"
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 =
""
919 if (coordGroup.lastChecked == 1)
920 coordGroup.valid =
mount.azAltToHaDec(
921 targetRAText.text, targetDEText.text)
923 coordGroup.valid =
mount.raDecToHaDec(
925 if (!coordGroup.valid) {
926 targetRAText.text =
""
927 targetDEText.text =
""
930 targetRAText.focus =
false
931 targetDEText.focus =
false
932 coordGroup.lastChecked = 2
940 text:
xi18n(
"Epoch:")
941 renderType: Text.QtRendering
946 ExclusiveGroup { id: epochGroup }
950 objectName:
"jnowCheckObject"
952 style:RadioButtonStyle{
955 renderType: Text.QtRendering
959 exclusiveGroup: epochGroup
964 objectName:
"j2000CheckObject"
965 style:RadioButtonStyle{
968 renderType: Text.QtRendering
972 exclusiveGroup: epochGroup
979 Layout.fillHeight:
false
980 Layout.fillWidth:
true
981 Layout.alignment:
Qt.AlignHCenter
986 objectName:
"gotoButtonObject"
988 Layout.fillWidth: true
992 mount.slew(targetRAText.text, targetDEText.text);
993 mountMotionLayout.focus =
true;
999 objectName:
"syncButtonObject"
1001 Layout.fillWidth: true
1005 mount.sync(targetRAText.text, targetDEText.text);
1006 mountMotionLayout.focus =
true;
1012 objectName:
"parkButtonObject"
1014 Layout.fillWidth: true
1024 objectName:
"unparkButtonObject"
1025 text:
xi18n(
"UNPARK")
1026 Layout.fillWidth: true
1037 Layout.fillHeight:
false
1038 Layout.fillWidth:
true
1039 Layout.alignment:
Qt.AlignHCenter
1044 text:
xi18n(
"Status:")
1045 renderType: Text.QtRendering
1052 objectName:
"statusTextObject"
1055 renderType: Text.QtRendering
1056 Layout.fillWidth: true
1057 Layout.minimumWidth: fontMetrics.height * 5
1064 Layout.minimumWidth: fontMetrics.height * 1.4
1065 Layout.minimumHeight: fontMetrics.height * 1.4
1066 iconName:
"crosshairs"
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)
QString label(StandardShortcut id)
QString & fill(QChar ch, qsizetype size)
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)