00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef KSTARS_H
00018 #define KSTARS_H
00019
00020 #ifdef HAVE_CONFIG_H
00021 #include <config.h>
00022 #endif
00023
00024 #include <dcopclient.h>
00025 #include <kapplication.h>
00026 #include <kmainwindow.h>
00027 #include <qwidget.h>
00028
00029 #include "kstarsinterface.h"
00030 #include "observinglist.h"
00031
00032
00033 class QPalette;
00034 class QVBoxLayout;
00035 class KActionMenu;
00036 class KDialogBase;
00037 class KKey;
00038 class KToolBar;
00039
00040 class dms;
00041 class KSNewStuff;
00042 class KStarsData;
00043 class KStarsSplash;
00044 class SkyMap;
00045 class GeoLocation;
00046 class FindDialog;
00047 class LocationDialog;
00048 class TimeDialog;
00049 class InfoBoxes;
00050 class ToggleAction;
00051 class TimeStepBox;
00052
00053
00054 class INDIMenu;
00055 class INDIDriver;
00056 class imagesequence;
00057
00067 class KStars : public KMainWindow, virtual public KStarsInterface
00068 {
00069
00070 Q_OBJECT
00071 public:
00081 KStars( bool doSplash, bool startClockRunning = true, const QString &startDateString = "" );
00082
00085 ~KStars();
00086
00089 KStarsData* data();
00090
00093 dms* LST();
00094
00097 SkyMap* map();
00098
00099 ObservingList* observingList();
00100
00103 GeoLocation* geo();
00104
00107 InfoBoxes* infoBoxes();
00108
00111 INDIDriver* getINDIDriver(void) { return indidriver; }
00112
00115 INDIMenu* getINDIMenu(void) { return indimenu; }
00116
00119 void establishINDI();
00120
00125 void addColorMenuItem( QString name, QString actionName );
00126
00130 void removeColorMenuItem( QString actionName );
00131
00137 ASYNC setRaDec( double ra, double dec );
00138
00144 ASYNC setAltAz(double alt, double az);
00145
00150 ASYNC lookTowards( const QString direction );
00151
00153 ASYNC zoomIn(void) { slotZoomIn(); }
00154
00156 ASYNC zoomOut(void){ slotZoomOut(); }
00157
00159 ASYNC defaultZoom(void) { slotDefaultZoom(); }
00160
00164 ASYNC zoom(double z);
00165
00174 ASYNC setLocalTime(int yr, int mth, int day, int hr, int min, int sec);
00175
00179 ASYNC waitFor( double t );
00180
00184 ASYNC waitForKey( const QString k );
00185
00189 ASYNC setTracking( bool track );
00190
00195 ASYNC changeViewOption( const QString option, const QString value );
00196
00201 QString getOption( const QString &name );
00202
00208 ASYNC readConfig();
00209
00215 ASYNC writeConfig();
00216
00223 ASYNC popupMessage( int x, int y, const QString message );
00224
00233 ASYNC drawLine( int x1, int y1, int x2, int y2, int speed );
00234
00240 ASYNC setGeoLocation( const QString city, const QString province, const QString country );
00241
00246 ASYNC setColor( const QString colorName, const QString value );
00247
00251 ASYNC loadColorScheme( const QString name );
00252
00258 ASYNC exportImage( const QString filename, int width, int height );
00259
00264 ASYNC printImage( bool usePrintDialog, bool useChartColors );
00265
00270 ASYNC startINDI (QString driverName, bool useLocal);
00271
00275 ASYNC shutdownINDI (QString driverName);
00276
00281 ASYNC switchINDI(QString driverName, bool turnOn);
00282
00287 ASYNC setINDIPort(QString driverName, QString port);
00288
00294 ASYNC setINDITargetCoord(QString driverName, double RA, double DEC);
00295
00300 ASYNC setINDITargetName(QString driverName, QString objectName);
00301
00306 ASYNC setINDIAction(QString driverName, QString action);
00307
00312 ASYNC waitForINDIAction(QString driverName, QString action);
00313
00318 ASYNC setINDIFocusSpeed(QString driverName,unsigned int speed);
00319
00324 ASYNC startINDIFocus(QString driverName, int focusDir);
00325
00331 ASYNC setINDIGeoLocation(QString driverName, double longitude, double latitude);
00332
00337 ASYNC setINDIFocusTimeout(QString driverName, int timeout);
00338
00343 ASYNC startINDIExposure(QString driverName, int timeout);
00344
00349 ASYNC setINDIUTC(QString driverName, QString UTCDateTime);
00350
00355 ASYNC setINDIScopeAction(QString deviceName, QString action);
00356
00361 ASYNC setINDIFrameType(QString deviceName, QString type);
00362
00367 ASYNC setINDIFilterNum(QString deviceName, int filter_num);
00368
00373 ASYNC setINDICCDTemp(QString deviceName, int temp);
00374
00375
00380 void applyConfig();
00381
00382 public slots:
00387 void updateTime( const bool automaticDSTchange = true );
00388
00392 void slotApplyConfigChanges( void );
00393
00397 void slotZoomIn();
00398
00402 void slotZoomOut();
00403
00407 void slotDefaultZoom();
00408
00413 void slotSetZoom();
00414
00418 void slotTrack();
00419
00423 void slotGeoLocator();
00424
00428 void clearCachedFindDialog();
00429
00433 void resumeDCOP( void ) { kapp->dcopClient()->resume(); }
00434
00438 void slotClearAllTrails();
00439
00440 private slots:
00444 void slotSetTimeToNow();
00445
00449 void slotSetTime();
00450
00454 void slotToggleTimer();
00455
00459 void slotFind();
00460
00464 void slotWizard();
00465
00469 void slotDownload();
00470
00476 void slotCalculator();
00477
00482 void slotLCGenerator();
00483
00488 void slotAVT();
00489
00493 void slotWUT();
00494
00495
00496
00497
00498
00499
00500
00504 void slotScriptBuilder();
00505
00509 void slotSolarSystem();
00510
00514 void slotJMoonTool();
00515
00519 void slotTelescopeWizard();
00520
00524 void slotTelescopeProperties();
00525
00529 void slotImageSequence();
00530
00534 void slotINDIDriver();
00535
00539 void slotINDIPanel();
00540
00544 void slotINDIConf();
00545
00549 void slotViewOps();
00550
00553 void datainitFinished(bool worked);
00554
00556 void newWindow();
00557
00559 void closeWindow();
00560
00562 void slotOpenFITS();
00563
00565 void slotExportImage();
00566
00568 void slotRunScript();
00569
00571 void slotPrint();
00572
00574 void slotTipOfDay();
00575
00577 void slotManualFocus();
00578
00582 void slotPointFocus();
00583
00586 void slotColorScheme();
00587
00589 void slotTargetSymbol();
00590
00592 void slotFOVEdit();
00593
00595 void slotCoordSys();
00596
00598 void slotObsList();
00599
00602 void slotViewToolBar();
00603
00606 void slotShowGUIItem( bool );
00607
00610 void mapGetsFocus();
00611
00613 void slotFullScreen();
00614
00615 private:
00619 void initActions();
00620
00624 void initFOV();
00625
00629 void initStatusBar();
00630
00631 SkyMap *skymap;
00632
00633 QWidget *centralWidget;
00634 QVBoxLayout *topLayout;
00635
00636 KToolBar *viewToolBar;
00637 TimeStepBox *TimeStep;
00638
00639 ToggleAction *actCoordSys;
00640 ToggleAction *actObsList;
00641 KActionMenu *colorActionMenu, *fovActionMenu;
00642
00643 KDialogBase *AAVSODialog;
00644 FindDialog *findDialog;
00645 KSNewStuff *kns;
00646
00647 INDIMenu *indimenu;
00648 INDIDriver *indidriver;
00649 imagesequence *indiseq;
00650
00651 int idSpinBox;
00652 bool DialogIsObsolete;
00653 bool StartClockRunning;
00654 QString StartDateString;
00655
00656 QPalette OriginalPalette, DarkPalette;
00657
00658 class privatedata;
00659 friend class privatedata;
00660 privatedata *pd;
00661 ObservingList *obsList;
00662 };
00663
00664 class KStars::privatedata {
00665 public:
00666 KStars *ks;
00667 KStarsSplash *splash;
00668 KStarsData *kstarsData;
00669
00671 privatedata(KStars *parent) : ks(parent), splash(0), kstarsData(0) {}
00673 ~privatedata();
00674
00676 void buildGUI();
00677 };
00678
00679 #endif