Kstars

mountcontrolpanel.cpp
1/*
2 SPDX-FileCopyrightText: 2024 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "mountcontrolpanel.h"
8#include "skypoint.h"
9#include "kstars.h"
10#include "kstarsdata.h"
11#include "geolocation.h"
12#include "ekos/manager.h"
13#include "dialogs/finddialog.h"
14
15#define EQ_BUTTON_ID 0
16#define HOR_BUTTON_ID 1
17#define HA_BUTTON_ID 2
18
19namespace Ekos
20{
21MountControlPanel::MountControlPanel(QWidget *parent) : QDialog(parent)
22{
23 setupUi(this);
24#ifdef Q_OS_OSX
25 setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint);
26#endif
27
28 // forward motion commands
29 connect(mountMotion, &MountMotionWidget::newMotionCommand, this, &MountControlPanel::newMotionCommand);
30 connect(mountMotion, &MountMotionWidget::newSlewRate, this, &MountControlPanel::newSlewRate);
31 connect(mountMotion, &MountMotionWidget::aborted, this, &MountControlPanel::aborted);
32 connect(mountMotion, &MountMotionWidget::updownReversed, this, &MountControlPanel::updownReversed);
33 connect(mountMotion, &MountMotionWidget::leftrightReversed, this, &MountControlPanel::leftrightReversed);
34
35 // forward J2000 selection to the target widget, which does not have its own selection
36 connect(mountPosition, &MountPositionWidget::J2000Enabled, mountTarget, &MountTargetWidget::setJ2000Enabled);
37
38 // forward target commands
39 connect(mountTarget, &MountTargetWidget::slew, this, &MountControlPanel::slew);
40 connect(mountTarget, &MountTargetWidget::sync, this, &MountControlPanel::sync);
41
42 // PARK
43 connect(parkButtonObject, &QPushButton::clicked, this, &MountControlPanel::park);
44 // UNPARK
45 connect(unparkButtonObject, &QPushButton::clicked, this, &MountControlPanel::unpark);
46 // center
47 connect(centerButtonObject, &QPushButton::clicked, this, &MountControlPanel::center);
48
49 // ensure that all J2000 attributes are in sync
50 setJ2000Enabled(true);
51}
52
53
54
55/////////////////////////////////////////////////////////////////////////////////////////
56///
57/////////////////////////////////////////////////////////////////////////////////////////
58void MountControlPanel::setJ2000Enabled(bool enabled)
59{
60 mountPosition->setJ2000Enabled(enabled);
61 mountTarget->setJ2000Enabled(enabled);
62}
63
64/////////////////////////////////////////////////////////////////////////////////////////
65///
66/////////////////////////////////////////////////////////////////////////////////////////
67void MountControlPanel::keyPressEvent(QKeyEvent *event)
68{
69 // forward to sub widget
70 mountMotion->keyPressEvent(event);
71}
72
73/////////////////////////////////////////////////////////////////////////////////////////
74///
75/////////////////////////////////////////////////////////////////////////////////////////
76void MountControlPanel::keyReleaseEvent(QKeyEvent *event)
77{
78 // forward to sub widget
79 mountMotion->keyReleaseEvent(event);
80}
81
82}
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:79
void clicked(bool checked)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:59:51 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.