• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • indi
indidriver.h
Go to the documentation of this file.
1 /***************************************************************************
2  INDI Driver
3  -------------------
4  begin : Wed May 7th 2003
5  copyright : (C) 2001 by Jasem Mutlaq
6  email : mutlaqja@ikarustech.com
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef INDIDRIVER_H_
18 #define INDIDRIVER_H_
19 
20 #include <QFrame>
21 #include <QHash>
22 #include <qstringlist.h>
23 #include <kdialog.h>
24 #include <unistd.h>
25 
26 #include <lilxml.h>
27 #include "ui_devmanager.h"
28 
29 class QTreeWidgetItem;
30 class QIcon;
31 
32 class INDI_D;
33 class KStars;
34 class DeviceManager;
35 class KProcess;
36 
37 struct INDIHostsInfo
38 {
39  QString name;
40  QString hostname;
41  QString portnumber;
42  bool isConnected;
43  DeviceManager *deviceManager;
44 };
45 
46 class IDevice : public QObject
47 {
48  Q_OBJECT
49 
50 public:
51  IDevice(const QString &inName, const QString &inLabel, const QString &inDriver, const QString &inVersion);
52  ~IDevice();
53 
54  enum DeviceStatus { DEV_START, DEV_TERMINATE };
55  enum XMLSource { PRIMARY_XML, THIRD_PARTY_XML, EM_XML };
56 
57  QString tree_label;
58  QString unique_label;
59  QString name;
60  QString driver;
61  QString version;
62  QString id;
63  QString port;
64  DeviceStatus state;
65  XMLSource xmlSource;
66 
67  DeviceManager *deviceManager;
68  int type;
69 
70  /* Telescope specific attributes */
71  double focal_length;
72  double aperture;
73 
74  void clear();
75  QString getServerBuffer();
76 
77 };
78 
79 class DeviceManagerUI : public QFrame, public Ui::devManager
80 {
81  Q_OBJECT
82 
83 public:
84  DeviceManagerUI(QWidget *parent=0);
85 
86  QIcon runningPix;
87  QIcon stopPix;
88  QIcon connected;
89  QIcon disconnected;
90  QIcon localMode;
91  QIcon serverMode;
92 
93 public slots:
94  void makePortEditable(QTreeWidgetItem* selectedItem, int column);
95 
96 };
97 
98 class INDIDriver : public KDialog
99 {
100 
101  Q_OBJECT
102 
103 public:
104 
105  enum { LOCAL_NAME_COLUMN=0, LOCAL_STATUS_COLUMN, LOCAL_MODE_COLUMN, LOCAL_VERSION_COLUMN, LOCAL_PORT_COLUMN };
106  enum { HOST_STATUS_COLUMN=0, HOST_NAME_COLUMN, HOST_PORT_COLUMN };
107 
108  INDIDriver(KStars *ks);
109  ~INDIDriver();
110 
111  bool readXMLDrivers();
112  void processXMLDriver(QString & driverName);
113  bool buildDeviceGroup (XMLEle *root, char errmsg[]);
114  bool buildDriverElement(XMLEle *root, QTreeWidgetItem *DGroup, int groupType, char errmsg[]);
115 
116  KStars *ksw;
117  DeviceManagerUI *ui;
118  QList<IDevice *> devices;
119  QTreeWidgetItem *lastGroup;
120  QTreeWidgetItem *lastDevice;
121 
122  QHash<QString, QString> driversList;
123  int currentPort;
124  IDevice::XMLSource xmlSource;
125 
126  int getINDIPort(int customPort);
127  bool isDeviceRunning(const QString &deviceLabel);
128 
129  void saveHosts();
130 
131  void processLocalTree(IDevice::DeviceStatus dev_request);
132  void processRemoteTree(IDevice::DeviceStatus dev_request);
133  IDevice * findDeviceByLabel(const QString &label);
134 
135 
136 
137  public slots:
138  void enableDevice(INDI_D *device);
139  void disableDevice(INDI_D *device);
140 
141  void resizeDeviceColumn();
142  void updateLocalTab();
143  void updateClientTab();
144 
145  void updateMenuActions();
146 
147  void addINDIHost();
148  void modifyINDIHost();
149  void removeINDIHost();
150  void activateRunService();
151  void activateStopService();
152  void activateHostConnection();
153  void activateHostDisconnection();
154  void newTelescopeDiscovered();
155  void newCCDDiscovered();
156  void updateCustomDrivers();
157 
158 signals:
159  void newDevice();
160  void newTelescope();
161  void newCCD();
162 };
163 
164 #endif
INDIHostsInfo::portnumber
QString portnumber
Definition: indidriver.h:41
DeviceManagerUI::runningPix
QIcon runningPix
Definition: indidriver.h:86
INDIDriver::ui
DeviceManagerUI * ui
Definition: indidriver.h:117
IDevice::id
QString id
Definition: indidriver.h:62
INDIDriver::newTelescopeDiscovered
void newTelescopeDiscovered()
Definition: indidriver.cpp:386
INDIDriver::activateHostConnection
void activateHostConnection()
Definition: indidriver.cpp:233
IDevice::DEV_START
Definition: indidriver.h:54
INDIDriver::modifyINDIHost
void modifyINDIHost()
Definition: indidriver.cpp:855
INDIDriver::removeINDIHost
void removeINDIHost()
Definition: indidriver.cpp:896
INDIDriver::updateLocalTab
void updateLocalTab()
Definition: indidriver.cpp:243
INDIDriver::activateStopService
void activateStopService()
Definition: indidriver.cpp:228
INDIDriver::buildDeviceGroup
bool buildDeviceGroup(XMLEle *root, char errmsg[])
Definition: indidriver.cpp:576
DeviceManagerUI::makePortEditable
void makePortEditable(QTreeWidgetItem *selectedItem, int column)
Definition: indidriver.cpp:83
INDIDriver::activateHostDisconnection
void activateHostDisconnection()
Definition: indidriver.cpp:238
IDevice::DeviceStatus
DeviceStatus
Definition: indidriver.h:54
INDIDriver::resizeDeviceColumn
void resizeDeviceColumn()
Definition: indidriver.cpp:399
INDIDriver::getINDIPort
int getINDIPort(int customPort)
Definition: indidriver.cpp:455
QWidget
IDevice::DEV_TERMINATE
Definition: indidriver.h:54
INDIHostsInfo::name
QString name
Definition: indidriver.h:39
INDIDriver::LOCAL_STATUS_COLUMN
Definition: indidriver.h:105
KDialog
INDIDriver::addINDIHost
void addINDIHost()
Definition: indidriver.cpp:805
INDIDriver::enableDevice
void enableDevice(INDI_D *device)
QObject
INDIDriver::devices
QList< IDevice * > devices
Definition: indidriver.h:118
IDevice::tree_label
QString tree_label
Definition: indidriver.h:57
IDevice::name
QString name
Definition: indidriver.h:59
DeviceManagerUI::localMode
QIcon localMode
Definition: indidriver.h:90
KStars
This is the main window for KStars.
Definition: kstars.h:94
INDIDriver::disableDevice
void disableDevice(INDI_D *device)
INDIHostsInfo::isConnected
bool isConnected
Definition: indidriver.h:42
INDIDriver::findDeviceByLabel
IDevice * findDeviceByLabel(const QString &label)
Definition: indidriver.cpp:962
INDIHostsInfo
Definition: indidriver.h:37
INDIDriver::LOCAL_MODE_COLUMN
Definition: indidriver.h:105
IDevice::type
int type
Definition: indidriver.h:68
INDIDriver::INDIDriver
INDIDriver(KStars *ks)
Definition: indidriver.cpp:92
INDIDriver::newDevice
void newDevice()
INDIDriver::buildDriverElement
bool buildDriverElement(XMLEle *root, QTreeWidgetItem *DGroup, int groupType, char errmsg[])
Definition: indidriver.cpp:641
INDIDriver::processRemoteTree
void processRemoteTree(IDevice::DeviceStatus dev_request)
Definition: indidriver.cpp:348
DeviceManagerUI
Definition: indidriver.h:79
INDIDriver::LOCAL_NAME_COLUMN
Definition: indidriver.h:105
IDevice::clear
void clear()
Definition: indidriver.cpp:1014
INDIDriver::HOST_NAME_COLUMN
Definition: indidriver.h:106
INDIDriver::saveHosts
void saveHosts()
Definition: indidriver.cpp:925
DeviceManagerUI::stopPix
QIcon stopPix
Definition: indidriver.h:87
INDIDriver::isDeviceRunning
bool isDeviceRunning(const QString &deviceLabel)
Definition: indidriver.cpp:446
INDIDriver::currentPort
int currentPort
Definition: indidriver.h:123
INDIDriver::LOCAL_VERSION_COLUMN
Definition: indidriver.h:105
IDevice::THIRD_PARTY_XML
Definition: indidriver.h:55
IDevice::getServerBuffer
QString getServerBuffer()
Definition: indidriver.cpp:1023
INDIDriver::lastDevice
QTreeWidgetItem * lastDevice
Definition: indidriver.h:120
INDI_D
Definition: indidevice.h:30
INDIDriver::HOST_PORT_COLUMN
Definition: indidriver.h:106
INDIHostsInfo::deviceManager
DeviceManager * deviceManager
Definition: indidriver.h:43
DeviceManagerUI::DeviceManagerUI
DeviceManagerUI(QWidget *parent=0)
Definition: indidriver.cpp:61
IDevice::driver
QString driver
Definition: indidriver.h:60
INDIDriver::updateCustomDrivers
void updateCustomDrivers()
Definition: indidriver.cpp:728
IDevice::focal_length
double focal_length
Definition: indidriver.h:71
INDIHostsInfo::hostname
QString hostname
Definition: indidriver.h:40
INDIDriver::newTelescope
void newTelescope()
IDevice::EM_XML
Definition: indidriver.h:55
INDIDriver::updateClientTab
void updateClientTab()
Definition: indidriver.cpp:265
INDIDriver::HOST_STATUS_COLUMN
Definition: indidriver.h:106
IDevice::version
QString version
Definition: indidriver.h:61
IDevice::state
DeviceStatus state
Definition: indidriver.h:64
DeviceManagerUI::connected
QIcon connected
Definition: indidriver.h:88
INDIDriver::driversList
QHash< QString, QString > driversList
Definition: indidriver.h:122
IDevice::IDevice
IDevice(const QString &inName, const QString &inLabel, const QString &inDriver, const QString &inVersion)
Definition: indidriver.cpp:981
INDIDriver::processXMLDriver
void processXMLDriver(QString &driverName)
Definition: indidriver.cpp:534
DeviceManagerUI::disconnected
QIcon disconnected
Definition: indidriver.h:89
INDIDriver::LOCAL_PORT_COLUMN
Definition: indidriver.h:105
IDevice::port
QString port
Definition: indidriver.h:63
IDevice::~IDevice
~IDevice()
Definition: indidriver.cpp:1009
INDIDriver::newCCD
void newCCD()
IDevice
Definition: indidriver.h:46
IDevice::aperture
double aperture
Definition: indidriver.h:72
IDevice::xmlSource
XMLSource xmlSource
Definition: indidriver.h:65
INDIDriver::processLocalTree
void processLocalTree(IDevice::DeviceStatus dev_request)
Definition: indidriver.cpp:282
INDIDriver::activateRunService
void activateRunService()
Definition: indidriver.cpp:223
INDIDriver::newCCDDiscovered
void newCCDDiscovered()
Definition: indidriver.cpp:393
IDevice::XMLSource
XMLSource
Definition: indidriver.h:55
INDIDriver::~INDIDriver
~INDIDriver()
Definition: indidriver.cpp:971
INDIDriver
Definition: indidriver.h:98
IDevice::unique_label
QString unique_label
Definition: indidriver.h:58
IDevice::deviceManager
DeviceManager * deviceManager
Definition: indidriver.h:67
IDevice::PRIMARY_XML
Definition: indidriver.h:55
INDIDriver::lastGroup
QTreeWidgetItem * lastGroup
Definition: indidriver.h:119
INDIDriver::readXMLDrivers
bool readXMLDrivers()
Definition: indidriver.cpp:491
INDIDriver::ksw
KStars * ksw
Definition: indidriver.h:116
DeviceManager
Definition: devicemanager.h:27
QFrame
INDIDriver::xmlSource
IDevice::XMLSource xmlSource
Definition: indidriver.h:124
DeviceManagerUI::serverMode
QIcon serverMode
Definition: indidriver.h:91
INDIDriver::updateMenuActions
void updateMenuActions()
Definition: indidriver.cpp:404
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal