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 setWindowFlags(Qt::Window);
25
26 // forward motion commands
27 connect(mountMotion, &MountMotionWidget::newMotionCommand, this, &MountControlPanel::newMotionCommand);
28 connect(mountMotion, &MountMotionWidget::newSlewRate, this, &MountControlPanel::newSlewRate);
29 connect(mountMotion, &MountMotionWidget::aborted, this, &MountControlPanel::aborted);
30 connect(mountMotion, &MountMotionWidget::updownReversed, this, &MountControlPanel::updownReversed);
31 connect(mountMotion, &MountMotionWidget::leftrightReversed, this, &MountControlPanel::leftrightReversed);
32
33 // forward J2000 selection to the target widget, which does not have its own selection
34 connect(mountPosition, &MountPositionWidget::J2000Enabled, mountTarget, &MountTargetWidget::setJ2000Enabled);
35
36 // forward target commands
37 connect(mountTarget, &MountTargetWidget::slew, this, &MountControlPanel::slew);
38 connect(mountTarget, &MountTargetWidget::sync, this, &MountControlPanel::sync);
39
40 // PARK
41 connect(parkButtonObject, &QPushButton::clicked, this, &MountControlPanel::park);
42 // UNPARK
43 connect(unparkButtonObject, &QPushButton::clicked, this, &MountControlPanel::unpark);
44 // center
45 connect(centerButtonObject, &QPushButton::clicked, this, &MountControlPanel::center);
46
47 // ensure that all J2000 attributes are in sync
48 setJ2000Enabled(true);
49}
50
51
52
53/////////////////////////////////////////////////////////////////////////////////////////
54///
55/////////////////////////////////////////////////////////////////////////////////////////
56void MountControlPanel::setJ2000Enabled(bool enabled)
57{
58 mountPosition->setJ2000Enabled(enabled);
59 mountTarget->setJ2000Enabled(enabled);
60}
61
62/////////////////////////////////////////////////////////////////////////////////////////
63///
64/////////////////////////////////////////////////////////////////////////////////////////
65void MountControlPanel::keyPressEvent(QKeyEvent *event)
66{
67 // forward to sub widget
68 mountMotion->keyPressEvent(event);
69}
70
71/////////////////////////////////////////////////////////////////////////////////////////
72///
73/////////////////////////////////////////////////////////////////////////////////////////
74void MountControlPanel::keyReleaseEvent(QKeyEvent *event)
75{
76 // forward to sub widget
77 mountMotion->keyReleaseEvent(event);
78}
79
80}
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
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 Mon Nov 18 2024 12:16:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.