summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/indistd.h
blob: f2780493353a7fad9e60f0f22a5ddefd1787f0e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*  INDI STD
    Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)

    This application is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
    
    2004-01-18: Classes that handle INDI Standard properties.
 */
 
 #ifndef INDISTD_H
 #define INDISTD_H
 
 #include <qobject.h>
 #include <indi/lilxml.h>
 #include <kfileitem.h>
 
 class INDI_E;
 class INDI_P;
 class INDI_D;
 class KStars;
 class SkyObject;
 class StreamWG;
 class CCDPreviewWG;
 class QSocketNotifier;
 class KProgressDialog;
 class KDirLister;
 class SkyObject;
 
 
 /* This class implmements standard properties on the device level*/
 class INDIStdDevice : public QObject
 {
   Q_OBJECT
   public:
   INDIStdDevice(INDI_D *associatedDevice, KStars * kswPtr);
   ~INDIStdDevice();
   
   KStars      		*ksw;			/* Handy pointer to KStars */
   INDI_D      		*dp;			/* associated device */

   StreamWG             *streamWindow;
   CCDPreviewWG    *CCDPreviewWindow;
   SkyObject   		*currentObject;
   QTimer      		*devTimer;	
   KProgressDialog      *downloadDialog;
   
    
   enum DTypes { DATA_FITS, DATA_STREAM, DATA_OTHER, DATA_CCDPREVIEW };
   
   void setTextValue(INDI_P *pp);
   void setLabelState(INDI_P *pp);
   void registerProperty(INDI_P *pp);
   void handleBLOB(unsigned char *buffer, int bufferSize, QString dataFormat);
    
   /* Device options */
   void initDeviceOptions();
   void handleDevCounter();
   bool handleNonSidereal();
   void streamDisabled();
   
   
   /* INDI STD: Updates device time */
   void updateTime();
    /* INDI STD: Updates device location */
   void updateLocation();
   /* Update image prefix */
   void updateSequencePrefix(QString newPrefix);
   
   int                  dataType;
   int 			initDevCounter;
   QString		dataExt;
   LilXML		*parser;
   
   QString		seqPrefix;
   int			seqCount;
   bool			batchMode;
   bool			ISOMode;
   KDirLister           *seqLister;
   SkyObject		*telescopeSkyObject;
   
   public slots:
   void timerDone();
   
   protected slots:
   void checkSeqBoundary(const KFileItemList & items);
   
   signals:
   void linkRejected();
   void linkAccepted();
   void FITSReceived(QString deviceLabel);
 
 };
 
 /* This class implmements standard properties */
 class INDIStdProperty : public QObject
 {
    Q_OBJECT
   public:
   INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, INDIStdDevice *stdDevPtr);
   ~INDIStdProperty();

    KStars        *ksw;			/* Handy pointer to KStars */
    INDIStdDevice *stdDev;              /* pointer to common std device */
    INDI_P	  *pp;			/* associated property */
    
    /* Perform switch converting */
    bool convertSwitch(int switchIndex, INDI_E *lp);
    bool newSwitch(int id, INDI_E* el);
    
    public slots:
    void newTime();
    void newText();
    

    
};

#endif