00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef INDIELEMENT_H
00013 #define INDIELEMENT_H
00014
00015 #include <kdialogbase.h>
00016 #include <unistd.h>
00017 #include <qstring.h>
00018 #include <qptrlist.h>
00019
00020 #include "indi/lilxml.h"
00021
00022 #define INDIVERSION 1.5
00023
00024
00025 #define PROPERTY_LABEL_WIDTH 80
00026 #define ELEMENT_LABEL_WIDTH 175
00027 #define ELEMENT_READ_WIDTH 175
00028 #define ELEMENT_WRITE_WIDTH 175
00029 #define ELEMENT_FULL_WIDTH 340
00030 #define MIN_SET_WIDTH 50
00031 #define MAX_SET_WIDTH 110
00032 #define MAXINDINAME 32
00033 #define MED_INDI_FONT 2
00034 #define MAX_LABEL_LENGTH 20
00035
00036
00037 #define INDI_PULSE_TRACKING 15000
00038
00039
00040
00041
00042 typedef enum {PS_IDLE = 0, PS_OK, PS_BUSY, PS_ALERT, PS_N} PState;
00043 #define PS_OFF PS_IDLE
00044 #define PS_ON PS_OK
00045 typedef enum {PP_RW = 0, PP_WO, PP_RO} PPerm;
00046 typedef enum {PG_NONE = 0, PG_TEXT, PG_NUMERIC, PG_BUTTONS,
00047 PG_RADIO, PG_MENU, PG_LIGHTS, PG_BLOB} PGui;
00048
00049
00050
00051 enum stdProperties { CONNECTION, DEVICE_PORT, TIME, SDTIME, GEOGRAPHIC_COORD,
00052 EQUATORIAL_COORD, EQUATORIAL_EOD_COORD, HORIZONTAL_COORD,
00053 ABORT_MOTION, ON_COORD_SET, SOLAR_SYSTEM, MOVEMENT, PARK,
00054 CCD_EXPOSE_DURATION, CCD_TEMPERATURE, CCD_FRAME,
00055 CCD_FRAME_TYPE, CCD_BINNING, CCD_INFO, CCDPREVIEW_STREAM,
00056 CCDPREVIEW_CTRL,
00057 VIDEO_STREAM,
00058 FOCUS_SPEED, FOCUS_MOTION, FOCUS_TIMER,
00059 FILTER_SLOT};
00060
00061
00062 enum deviceFamily { KSTARS_TELESCOPE, KSTARS_CCD, KSTARS_FILTER, KSTARS_VIDEO, KSTARS_FOCUSER, KSTARS_DOME, KSTARS_GPS };
00063
00064 #define MAXSCSTEPS 1000
00065 #define MAXRADIO 4
00066
00067
00068 class KLed;
00069 class KLineEdit;
00070 class KDoubleSpinBox;
00071 class KPushButton;
00072 class KCheckBox;
00073 class KSqueezedTextLabel;
00074
00075 class QLabel;
00076 class QHBoxLayout;
00077 class QVBoxLayout;
00078 class QSpacerItem;
00079 class QCheckBox;
00080 class QSlider;
00081
00082 class INDI_P;
00083
00084
00085 XMLAtt * findAtt (XMLEle *ep , const char *name , char errmsg[]);
00086 XMLEle * findEle (XMLEle *ep , INDI_P *pp, const char *child, char errmsg[]);
00087
00088
00089 class INDI_E : public QObject
00090 {
00091 Q_OBJECT
00092 public:
00093 INDI_E(INDI_P *parentProperty, QString inName, QString inLabel);
00094 ~INDI_E();
00095 QString name;
00096 QString label;
00097 PState state;
00098 INDI_P *pp;
00099
00100 QHBoxLayout *EHBox;
00101
00102
00103 KSqueezedTextLabel *label_w;
00104 KLineEdit *read_w;
00105 KLineEdit *write_w;
00106 KLed *led_w;
00107 KDoubleSpinBox *spin_w;
00108 QSlider *slider_w;
00109 KPushButton *push_w;
00110 KPushButton *browse_w;
00111 QCheckBox *check_w;
00112 QSpacerItem *hSpacer;
00113
00114 double min, max, step;
00115 double value;
00116 double targetValue;
00117 QString text;
00118 QString format;
00119
00120 int buildTextGUI (QString initText);
00121 int buildNumberGUI (double initValue);
00122 int buildLightGUI();
00123 int buildBLOBGUI();
00124 void drawLt();
00125
00126 void initNumberValues(double newMin, double newMax, double newStep, char * newFormat);
00127 void updateValue(double newValue);
00128 void setMin (double inMin);
00129 void setMax (double inMax);
00130
00131 void setupElementLabel();
00132 void setupElementRead(int length);
00133 void setupElementWrite(int length);
00134 void setupElementScale(int length);
00135 void setupBrowseButton();
00136
00137 public slots:
00138 void spinChanged(double value);
00139 void sliderChanged(int value);
00140 void browseBlob();
00141
00142 };
00143
00144 #endif