11#include "auxiliary/ksnotification.h"
12#include "internalguide/internalguider.h"
13#include "ekos/auxiliary/stellarsolverprofileeditor.h"
16#include <KConfigDialog>
26OpsGuide::OpsGuide() : QFrame(KStars::Instance())
36 if (Options::gPGEnabled())
39 Options::setGPGEnabled(
false);
40 Options::setRAGuidePulseAlgorithm(GPG_ALGORITHM);
41 kcfg_RAGuidePulseAlgorithm->setCurrentIndex(
static_cast<int>(GPG_ALGORITHM));
48 optionsProfileEditor =
new StellarSolverProfileEditor(
this, Ekos::GuideProfiles, optionsEditor);
54 connect(optionsProfileEditor, &StellarSolverProfileEditor::optionsProfilesUpdated,
this, &OpsGuide::loadOptionsProfiles);
55 optionsProfileEditor->loadProfile(kcfg_GuideOptionsProfile->currentText());
56 optionsEditor->
show();
59 loadOptionsProfiles();
64void OpsGuide::setRAGuidePulseAlg(
int index)
69 case STANDARD_ALGORITHM:
70 kcfg_RAHysteresis->setDisabled(
true);
71 kcfg_RAIntegralGain->setDisabled(
false);
73 case HYSTERESIS_ALGORITHM:
74 kcfg_RAHysteresis->setDisabled(
false);
75 kcfg_RAIntegralGain->setDisabled(
true);
77 case LINEAR_ALGORITHM:
78 kcfg_RAHysteresis->setDisabled(
true);
79 kcfg_RAIntegralGain->setDisabled(
true);
82 kcfg_RAHysteresis->setDisabled(
true);
83 kcfg_RAIntegralGain->setDisabled(
true);
86 kcfg_RAHysteresis->setDisabled(
false);
87 kcfg_RAIntegralGain->setDisabled(
false);
92void OpsGuide::setDECGuidePulseAlg(
int index)
96 case STANDARD_ALGORITHM:
97 kcfg_DECHysteresis->setDisabled(
true);
98 kcfg_DECIntegralGain->setDisabled(
false);
100 case HYSTERESIS_ALGORITHM:
101 kcfg_DECHysteresis->setDisabled(
false);
102 kcfg_DECIntegralGain->setDisabled(
true);
104 case LINEAR_ALGORITHM:
105 kcfg_DECHysteresis->setDisabled(
true);
106 kcfg_DECIntegralGain->setDisabled(
true);
109 kcfg_DECHysteresis->setDisabled(
false);
110 kcfg_DECIntegralGain->setDisabled(
false);
115void OpsGuide::loadOptionsProfiles()
117 QString savedOptionsProfiles =
QDir(KSPaths::writableLocation(
119 if(
QFile(savedOptionsProfiles).exists())
120 optionsList = StellarSolver::loadSavedOptionsProfiles(savedOptionsProfiles);
122 optionsList = getDefaultGuideOptionsProfiles();
123 kcfg_GuideOptionsProfile->clear();
124 for(SSolver::Parameters param : optionsList)
125 kcfg_GuideOptionsProfile->addItem(param.listName);
126 kcfg_GuideOptionsProfile->setCurrentIndex(Options::guideOptionsProfile());
KPageWidgetItem * addPage(QWidget *page, const QString &itemName, const QString &pixmapName=QString(), const QString &header=QString(), bool manage=true)
static KConfigDialog * exists(const QString &name)
void settingsChanged(const QString &dialogName)
void setIcon(const QIcon &icon)
QString i18n(const char *text, const TYPE &arg...)
Ekos is an advanced Astrophotography tool for Linux.
QString filePath(const QString &fileName) const const
QIcon fromTheme(const QString &name)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)