summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/tools/scriptbuilder.h
blob: 7b78bc1c69a1945df143b9e58a6872567ab1bbc0 (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/***************************************************************************
                          scriptbuilder.h  -  description
                             -------------------
    begin                : Thu Apr 17 2003
    copyright            : (C) 2003 by Jason Harris
    email                : kstars@30doradus.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SCRIPTBUILDER_H
#define SCRIPTBUILDER_H

class KStars;
class QListViewItem;
class QWidget;
class QLayout;
class KURL;
class ScriptFunction;
class ScriptBuilderUI;
class ScriptNameDialog;
class OptionsTreeView;
class ArgLookToward;
class ArgSetRaDec;
class ArgSetAltAz;
class ArgSetLocalTime;
class ArgWaitFor;
class ArgWaitForKey;
class ArgSetTrack;
class ArgChangeViewOption;
class ArgSetGeoLocation;
class ArgTimeScale;
class ArgZoom;
class ArgExportImage;
class ArgPrintImage;
class ArgSetColor;
class ArgLoadColorScheme;
class ArgStartINDI;
class ArgShutdownINDI;
class ArgSwitchINDI;
class ArgSetPortINDI;
class ArgSetTargetCoordINDI;
class ArgSetTargetNameINDI;
class ArgSetActionINDI;
class ArgSetFocusSpeedINDI;
class ArgStartFocusINDI;
class ArgSetFocusTimeoutINDI;
class ArgSetGeoLocationINDI;
class ArgStartExposureINDI;
class ArgSetUTCINDI;
class ArgSetScopeActionINDI;
class ArgSetFrameTypeINDI;
class ArgSetCCDTempINDI;
class ArgSetFilterNumINDI;

/**@class ScriptBuilder
	*A GUI tool for building behavioral DCOP scripts for KStars.
	*@author Jason Harris
	*@version 1.0
	*/
class ScriptBuilder : public KDialogBase
{
Q_OBJECT
public:
	ScriptBuilder( QWidget *parent, const char *name=0 );
	~ScriptBuilder();

	bool unsavedChanges() const { return UnsavedChanges; }
	void setUnsavedChanges( bool b=true );
	void saveWarning();
	void readScript( QTextStream &istream );
	void writeScript( QTextStream &ostream );
	bool parseFunction( QStringList &fn );

public slots:
	void slotAddFunction();
	void slotMoveFunctionUp();
	void slotMoveFunctionDown();
	void slotArgWidget();
	void slotShowDoc();

	void slotNew();
	void slotOpen();
	void slotSave();
	void slotSaveAs();
	void slotRunScript();
	void slotClose();

	void slotCopyFunction();
	void slotRemoveFunction();

	void slotFindCity();
	void slotFindObject();
	void slotShowOptions();
	void slotLookToward();
	void slotRa();
	void slotDec();
	void slotAz();
	void slotAlt();
	void slotChangeDate();
	void slotChangeTime();
	void slotWaitFor();
	void slotWaitForKey();
	void slotTracking();
	void slotViewOption();
	void slotChangeCity();
	void slotChangeProvince();
	void slotChangeCountry();
	void slotTimeScale();
	void slotZoom();
	void slotExportImage();
	void slotPrintImage();
	void slotChangeColor();
	void slotChangeColorName();
	void slotLoadColorScheme(QListBoxItem*);
	
	void slotEnableScriptNameOK();
	
	void slotINDIWaitCheck(bool toggleState);
	void slotINDIFindObject();
	void slotINDIStartDeviceName();
	void slotINDIStartDeviceMode();
	void slotINDIShutdown();
	void slotINDISwitchDeviceName();
	void slotINDISwitchDeviceConnection();
	void slotINDISetPortDeviceName();
	void slotINDISetPortDevicePort();
	void slotINDISetTargetCoordDeviceName();
	void slotINDISetTargetCoordDeviceRA();
	void slotINDISetTargetCoordDeviceDEC();
	void slotINDISetTargetNameDeviceName();
	void slotINDISetTargetNameObjectName();
	void slotINDISetActionDeviceName();
	void slotINDISetActionName();
	void slotINDIWaitForActionDeviceName();
	void slotINDIWaitForActionName();
	void slotINDISetFocusSpeedDeviceName();
	void slotINDISetFocusSpeed();
	void slotINDIStartFocusDeviceName();
	void slotINDIStartFocusDirection();
	void slotINDISetFocusTimeoutDeviceName();
	void slotINDISetFocusTimeout();
	void slotINDISetGeoLocationDeviceName();
	void slotINDISetGeoLocationDeviceLong();
	void slotINDISetGeoLocationDeviceLat();
	void slotINDIStartExposureDeviceName();
	void slotINDIStartExposureTimeout();
	void slotINDISetUTCDeviceName();
	void slotINDISetUTC();
	void slotINDISetScopeActionDeviceName();
	void slotINDISetScopeAction();
	void slotINDISetFrameTypeDeviceName();
	void slotINDISetFrameType();
	void slotINDISetCCDTempDeviceName();
	void slotINDISetCCDTemp();
	void slotINDISetFilterNumDeviceName();
	void slotINDISetFilterNum();

private:
	void initViewOptions();

	ScriptBuilderUI *sb;

	KStars *ks; //parent needed for sub-dialogs
	QPtrList<ScriptFunction> KStarsFunctionList;
	QPtrList<ScriptFunction> INDIFunctionList;
	QPtrList<ScriptFunction> ScriptList;
	QVBoxLayout *vlay;

	QWidget *argBlank;
	ArgLookToward *argLookToward;
	ArgSetRaDec *argSetRaDec;
	ArgSetAltAz *argSetAltAz;
	ArgSetLocalTime *argSetLocalTime;
	ArgWaitFor *argWaitFor;
	ArgWaitForKey *argWaitForKey;
	ArgSetTrack *argSetTracking;
	ArgChangeViewOption *argChangeViewOption;
	ArgSetGeoLocation *argSetGeoLocation;
	ArgTimeScale *argTimeScale;
	ArgZoom *argZoom;
	ArgExportImage *argExportImage;
	ArgPrintImage *argPrintImage;
	ArgSetColor *argSetColor;
	ArgLoadColorScheme *argLoadColorScheme;
	ArgStartINDI *argStartINDI;
	ArgShutdownINDI *argShutdownINDI;
	ArgSwitchINDI *argSwitchINDI;
	ArgSetPortINDI *argSetPortINDI;
	ArgSetTargetCoordINDI *argSetTargetCoordINDI;
	ArgSetTargetNameINDI *argSetTargetNameINDI;
	ArgSetActionINDI *argSetActionINDI;
	ArgSetActionINDI *argWaitForActionINDI;
	ArgSetFocusSpeedINDI *argSetFocusSpeedINDI;
	ArgStartFocusINDI *argStartFocusINDI;
	ArgSetFocusTimeoutINDI *argSetFocusTimeoutINDI;
	ArgSetGeoLocationINDI *argSetGeoLocationINDI;
	ArgStartExposureINDI *argStartExposureINDI;
	ArgSetUTCINDI *argSetUTCINDI;
	ArgSetScopeActionINDI *argSetScopeActionINDI;
	ArgSetFrameTypeINDI *argSetFrameTypeINDI;
	ArgSetCCDTempINDI *argSetCCDTempINDI;
        ArgSetFilterNumINDI *argSetFilterNumINDI;
	
	ScriptNameDialog *snd;
	OptionsTreeView *otv;

	QListViewItem *opsGUI, *opsToolbar, *opsShowObj, *opsShowOther, *opsCName, *opsHide, *opsSkymap, *opsLimit;

	bool UnsavedChanges;
	KURL currentFileURL;
	QString currentDir;
	QString currentScriptName, currentAuthor;
	QString lastINDIDeviceName;
};

#endif