kstars
devicemanager.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef DEVICEMANAGER_H
00015 #define DEVICEMANAGER_H
00016
00017 #include "indielement.h"
00018
00019 class INDIMenu;
00020 class INDI_P;
00021 class INDI_D;
00022
00023 class QSocketNotifier;
00024
00025
00026 class DeviceManager : public QObject
00027 {
00028 Q_OBJECT
00029 public:
00030 DeviceManager(INDIMenu *INDIparent, int inID);
00031 ~DeviceManager();
00032
00033 INDIMenu *parent;
00034
00035 QPtrList<INDI_D> indi_dev;
00036
00037 int mgrID;
00038 int serverFD;
00039 FILE *serverFP;
00040 LilXML *XMLParser;
00041 QSocketNotifier *sNotifier;
00042 QString host;
00043 QString port;
00044
00045 int dispatchCommand (XMLEle *root, char errmsg[]);
00046
00047 INDI_D * addDevice (XMLEle *dep , char errmsg[]);
00048 INDI_D * findDev (XMLEle *root, int create, char errmsg[]);
00049
00050
00051
00052
00053 void sendNewText (INDI_P *pp);
00054 void sendNewNumber (INDI_P *pp);
00055 void sendNewSwitch (INDI_P *pp, int index);
00056 void startBlob (QString devName, QString propName, QString timestamp);
00057 void sendOneBlob(QString blobName, unsigned int blobSize, QString blobFormat, unsigned char * blobBuffer);
00058 void finishBlob();
00059
00060
00061
00062
00063 int delPropertyCmd (XMLEle *root, char errmsg[]);
00064 int removeDevice (QString devName, char errmsg[]);
00065 INDI_D * findDev (QString devName, char errmsg[]);
00066
00067 int messageCmd (XMLEle *root, char errmsg[]);
00068 void checkMsg (XMLEle *root, INDI_D *dp);
00069 void doMsg (XMLEle *msg , INDI_D *dp);
00070
00071 bool indiConnect (QString inHost, QString inPort);
00072
00073 public slots:
00074 void dataReceived();
00075
00076 signals:
00077 void newDevice();
00078
00079 };
00080
00081 #endif