Kstars

opscalibration.cpp
1/*
2 SPDX-FileCopyrightText: 2003 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "opscalibration.h"
8
9#include "guide.h"
10#include "kstars.h"
11#include "Options.h"
12#include "internalguide/internalguider.h"
13#include "internalguide/calibration.h"
14
15#include <QPushButton>
16#include <QFileDialog>
17#include <QCheckBox>
18#include <QStringList>
19#include <QComboBox>
20
21#include <KConfigDialog>
22
23namespace Ekos
24{
25OpsCalibration::OpsCalibration(InternalGuider *guiderObject) : QFrame(KStars::Instance())
26{
27 setupUi(this);
28
29 guider = guiderObject;
30
31 //Get a pointer to the KConfigDialog
32 m_ConfigDialog = KConfigDialog::exists("guidesettings");
33
34 connect(m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(slotApply()));
35 connect(m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL(clicked()), SLOT(slotApply()));
36}
37
38void OpsCalibration::showEvent(QShowEvent *)
39{
40 double x, y;
41 guider->getReticleParameters(&x, &y);
42
43 spinBox_ReticleX->setValue(x);
44 spinBox_ReticleY->setValue(y);
45
46 uint16_t subX, subY, subW, subH, subBinX, subBinY;
47 guider->getFrameParams(&subX, &subY, &subW, &subH, &subBinX, &subBinY);
48
49 spinBox_ReticleX->setMaximum(subW);
50 spinBox_ReticleY->setMaximum(subH);
51
52 auto cal = guider->getCalibration();
53 if (cal.isInitialized())
54 {
55 ra_cal_degrees->setText(QString::number(cal.getRAAngle(), 'f', 1));
56 ra_cal_mspp->setText(QString::number(cal.raPulseMillisecondsPerArcsecond(), 'f', 1));
57 dec_cal_degrees->setText(QString::number(cal.getDECAngle(), 'f', 1));
58 dec_cal_mspp->setText(QString::number(cal.decPulseMillisecondsPerArcsecond(), 'f', 1));
59 dec_cal_degrees_unit->setText(
60 cal.declinationSwapEnabled() ? "degrees (swapped)" : "degrees");
61 }
62 else
63 {
64 ra_cal_degrees->setText("xxxx");
65 ra_cal_mspp->setText("xxxx");
66 dec_cal_degrees->setText("xxxx");
67 dec_cal_degrees_unit->setText("degrees");
68 dec_cal_mspp->setText("xxxx");
69 }
70}
71
72void OpsCalibration::slotApply()
73{
74 // HY (7/12/20):
75 // This can be an issue if the window is opened and then the reticle changes, e.g.
76 // if the options window is opened before guiding starts!
77 // I've seen a few other random unintended changes of the reticle when setting other params.
78 // Commenting it out.
79 // guider->setReticleParameters(spinBox_ReticleX->value(), spinBox_ReticleY->value());
80}
81}
static KConfigDialog * exists(const QString &name)
This is the main window for KStars.
Definition kstars.h:89
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
QString number(double n, char format, int precision)
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 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.