Kstars

profileeditor.h
1 /*
2  SPDX-FileCopyrightText: 2016 Jasem Mutlaq <[email protected]>
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 
20 class ProfileInfo;
21 class QStandardItemModel;
22 class DriverInfo;
23 
24 class ProfileEditorUI : public QFrame, public Ui::ProfileEditorUI
25 {
26  Q_OBJECT
27 
28  public:
29  /** @short Constructor */
30  explicit ProfileEditorUI(QWidget *parent);
31 };
32 
33 class ProfileEditor : public QDialog
34 {
35  Q_OBJECT
36  public:
37  /** @short Constructor */
38  explicit ProfileEditor(QWidget *ks);
39 
40  /** @short Destructor */
41  virtual ~ProfileEditor() override = default;
42 
43  void setPi(ProfileInfo *newProfile);
44 
45  void loadDrivers();
46  void loadScopeEquipment();
47 
48  void setProfileName(const QString &name);
49  void setAuxDrivers(const QStringList &aux);
50  void setHostPort(const QString &host, const QString &port);
51  void setWebManager(bool enabled, const QString &port = "8624");
52  void setGuiderType(int type);
53  void setConnectionOptionsEnabled(bool enable);
54 
55  void setSettings(const QJsonObject &profile);
56 
57  public slots:
58  void saveProfile();
59  void setRemoteMode(bool enable);
60 
61  private slots:
62  void updateGuiderSelection(int id);
63  void scanNetwork();
64  void showINDIHub();
65  void executeScriptEditor();
66 
67  private:
68  void populateManufacturerCombo(QStandardItemModel *model, QComboBox *combo, const QString &selectedDriver, bool isLocal,
69  const QList<DeviceFamily> &families);
70  QString getTooltip(DriverInfo *dv);
71  void scanIP(const QString &ip);
72  void clearAllRequests();
73 
74  ProfileEditorUI *ui { nullptr };
75  ProfileInfo *pi { nullptr };
76  QList<OAL::Scope *> m_scopeList;
77  QStandardItemModel *m_MountModel { nullptr };
78  QStandardItemModel *m_CameraModel { nullptr };
79  QStandardItemModel *m_GuiderModel { nullptr };
80  QStandardItemModel *m_FocuserModel { nullptr };
81  QStandardItemModel *m_Aux1Model { nullptr }, *m_Aux2Model { nullptr }, *m_Aux3Model { nullptr }, *m_Aux4Model { nullptr };
82  uint8_t m_INDIHub { 0 };
83 
84  QPointer<QProgressDialog> m_ProgressDialog;
85  QNetworkAccessManager m_Manager;
86  QList<QNetworkReply*> m_Replies;
87 
88  bool m_CancelScan { false };
89 };
Q_OBJECTQ_OBJECT
ScriptableExtension * host() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 8 2022 04:13:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.