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);
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() {
83 property var
filteredKeyState: {0x13:
false, 0x15:
false, 0x12:
false, 0x14:
false}
104 if (left !== right) {
110 mount.motionCommand(0, -1,
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;
137 setTimeout(5, function() {
145 function onPressedChanged(event, pressed) {
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"
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"
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"
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"
282 color:
stop.pressed ?
"red" : rectangle.buttonColor
293 mountMotionLayout.focus =
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"
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"
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"
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
428 text:
xi18n(
"Reverse")
437 text:
xi18n(
"Up/Down")
444 onClicked: mount.setUpDownReversed(checked)
452 text:
xi18n(
"Left/Right")
458 onClicked: mount.setLeftRightReversed(checked)
465 anchors.horizontalCenter: parent.Center
466 Layout.alignment:
Qt.AlignHCenter |
Qt.AlignVCenter
472 x: fontMetrics.height * 0.1
474 width: fontMetrics.height * 1.5
475 objectName:
"speedSliderObject"
477 Layout.maximumWidth: fontMetrics.height * 7.5
485 mount.setSlewRate(speedSlider.value)
491 width: fontMetrics.height * 3.75
492 objectName:
"speedLabelObject"
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
504 verticalAlignment: Text.AlignVCenter
511 id: mountCoordsLayout
512 anchors.horizontalCenter: parent.Center
513 Layout.alignment:
Qt.AlignHCenter |
Qt.AlignVCenter
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
554 objectName:
"raValueObject"
557 renderType: Text.QtRendering
574 objectName:
"azValueObject"
577 renderType: Text.QtRendering
593 objectName:
"deValueObject"
596 renderType: Text.QtRendering
612 objectName:
"altValueObject"
615 renderType: Text.QtRendering
631 objectName:
"haValueObject"
634 renderType: Text.QtRendering
650 objectName:
"zaValueObject"
653 renderType: Text.QtRendering
668 text:
xi18n(
"Target:")
670 verticalAlignment: Text.AlignVCenter
679 objectName:
"targetTextObject"
680 placeholderText:
"Click Find Icon"
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
710 objectName:
"findButtonObject"
712 iconName:
"view-history"
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
735 objectName:
"targetRALabelObject"
745 objectName:
"targetRATextObject"
746 placeholderText:
"HH:MM:SS"
750 renderType: Text.QtRendering
751 background: Rectangle {
756 horizontalAlignment: Text.AlignHCenter
757 Layout.minimumWidth: fontMetrics.height * 7
760 Layout.minimumHeight: fontMetrics.height * 1.4
766 objectName:
"targetDELabelObject"
776 objectName:
"targetDETextObject"
777 placeholderText:
"DD:MM:SS"
781 renderType: Text.QtRendering
782 background: Rectangle {
787 width: fontMetrics.height * 7.5
788 horizontalAlignment: Text.AlignHCenter
790 Layout.minimumWidth: fontMetrics.height * 7
793 Layout.minimumHeight: fontMetrics.height * 1.4
807 objectName:
"coordGroupObject"
809 property bool valid:
false
814 objectName:
"equatorialCheckObject"
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
856 objectName:
"horizontalCheckObject"
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
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:")
950 objectName:
"jnowCheckObject"
964 objectName:
"j2000CheckObject"
986 objectName:
"gotoButtonObject"
992 mount.slew(targetRAText.text, targetDEText.text);
993 mountMotionLayout.focus =
true;
999 objectName:
"syncButtonObject"
1005 mount.sync(targetRAText.text, targetDEText.text);
1006 mountMotionLayout.focus =
true;
1012 objectName:
"parkButtonObject"
1024 objectName:
"unparkButtonObject"
1025 text:
xi18n(
"UNPARK")
1044 text:
xi18n(
"Status:")
1052 objectName:
"statusTextObject"
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)
QString label(StandardShortcut id)
const QList< QKeySequence > & up()
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)