Kstars

profileeditor.h
1/*
2 SPDX-FileCopyrightText: 2016 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "oal/scope.h"
10#include "ui_profileeditor.h"
11#include "indi/indicommon.h"
12#include <QDialog>
13#include <QFrame>
14#include <QString>
15#include <QStringList>
16#include <QPointer>
17#include <QProgressDialog>
18#include <QNetworkAccessManager>
19
20class ProfileInfo;
22class DriverInfo;
23
24class ProfileEditorUI : public QFrame, public Ui::ProfileEditorUI
25{
27
28 public:
29 /** @short Constructor */
30 explicit ProfileEditorUI(QWidget *parent);
31};
32
33class ProfileEditor : public QDialog
34{
36 public:
37 /** @short Constructor */
38 explicit ProfileEditor(QWidget *ks);
39
40 /** @short Destructor */
41 virtual ~ProfileEditor() override = default;
42
43 void setPi(const QSharedPointer<ProfileInfo> &newProfile);
44
45 void loadDrivers();
46
47 void setProfileName(const QString &name);
48 void setAuxDrivers(const QStringList &aux);
49 void setHostPort(const QString &host, const QString &port);
50 void setWebManager(bool enabled, const QString &port = "8624");
51 void setGuiderType(int type);
52 void setConnectionOptionsEnabled(bool enable);
53
54 void setSettings(const QJsonObject &profile);
55
56 public slots:
57 void saveProfile();
58 void setRemoteMode(bool enable);
59
60 private slots:
61 void updateGuiderSelection(int id);
62 void scanNetwork();
63 void showINDIHub();
64 void executeScriptEditor();
65
66 private:
67 void populateManufacturerCombo(QStandardItemModel *model, QComboBox *combo, const QString &selectedDriver, bool isLocal,
68 const QList<DeviceFamily> &families);
69 QString getTooltip(const QSharedPointer<DriverInfo> &driver);
70 void scanIP(const QString &ip);
71 void clearAllRequests();
72
73 ProfileEditorUI *ui { nullptr };
75 QStandardItemModel *m_MountModel { nullptr };
76 QStandardItemModel *m_CameraModel { nullptr };
77 QStandardItemModel *m_GuiderModel { nullptr };
78 QStandardItemModel *m_FocuserModel { nullptr };
79 QStandardItemModel *m_Aux1Model { nullptr }, *m_Aux2Model { nullptr }, *m_Aux3Model { nullptr }, *m_Aux4Model { nullptr };
80 uint8_t m_INDIHub { 0 };
81
82 QPointer<QProgressDialog> m_ProgressDialog;
83 QNetworkAccessManager m_Manager;
84 QList<QNetworkReply*> m_Replies;
85
86 bool m_CancelScan { false };
87};
DriverInfo holds all metadata associated with a particular INDI driver.
Definition driverinfo.h:46
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:49:22 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.