Kstars

indidevice.h
1 /*
2  SPDX-FileCopyrightText: 2012 Jasem Mutlaq <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QDialog>
10 
11 #include <QFrame>
12 #include <QHBoxLayout>
13 #include <QLabel>
14 #include <QVBoxLayout>
15 #include <QMutex>
16 
17 #include <indiapi.h>
18 #include <basedevice.h>
19 
20 class QTextEdit;
21 class QTabWidget;
22 class QSplitter;
23 class GUIManager;
24 class ClientManager;
25 class INDI_G;
26 
27 /**
28  * @class INDI_D
29  * INDI_D represents an INDI GUI Device. INDI_D is the top level device container. It contains a collection of groups of properties.
30  * Each group is represented as a separate tab within the GUI.
31  *
32  * @author Jasem Mutlaq
33  */
34 class INDI_D : public QWidget
35 {
36  Q_OBJECT
37  public:
38  INDI_D(QWidget *parent, INDI::BaseDevice *in_idv, ClientManager *in_cm);
39 
40 
41  ClientManager *getClientManager() const
42  {
43  return m_ClientManager;
44  }
45 
46  INDI_G *getGroup(const QString &groupName) const;
47 
48  INDI::BaseDevice *getBaseDevice() const
49  {
50  return m_BaseDevice;
51  }
52 
53  QList<INDI_G *> getGroups() const
54  {
55  return groupsList;
56  }
57 
58  void clearMessageLog();
59 
60  const QString &name() const
61  {
62  return m_Name;
63  }
64 
65  public slots:
66  bool buildProperty(INDI::Property prop);
67  //bool removeProperty(INDI::Property prop);
68  bool removeProperty(const QString &device, const QString &name);
69  bool updateSwitchGUI(ISwitchVectorProperty *svp);
70  bool updateTextGUI(ITextVectorProperty *tvp);
71  bool updateNumberGUI(INumberVectorProperty *nvp);
72  bool updateLightGUI(ILightVectorProperty *lvp);
73  bool updateBLOBGUI(IBLOB *bp);
74 
75  void updateMessageLog(INDI::BaseDevice *idv, int messageID);
76 
77  private:
78  QString m_Name;
79 
80  // GUI
81  QSplitter *deviceVBox { nullptr };
82  QTabWidget *groupContainer { nullptr };
83  QTextEdit *msgST_w { nullptr };
84 
85  // Managers
86  INDI::BaseDevice *m_BaseDevice { nullptr };
87  ClientManager *m_ClientManager { nullptr };
88 
89  QList<INDI_G *> groupsList;
90 };
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Aug 14 2022 04:13:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.