Kstars

kstars.h
1 /*
2  SPDX-FileCopyrightText: 2001 Jason Harris <[email protected]>
3  SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #pragma once
7 
8 #include "config-kstars.h"
9 
10 #include <KXmlGuiWindow>
11 #include <KLocalizedString>
12 #include <QLabel>
13 
14 #include <QDockWidget>
15 #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
16 #include <QtDBus/qtdbusglobal.h>
17 #else
18 #include <QtDBus/qdbusmacros.h>
19 #endif
20 #ifdef HAVE_CFITSIO
21 #include <QPointer>
22 #endif
23 
24 // forward declaration is enough. We only need pointers
25 class QActionGroup;
26 class QDockWidget;
27 class QPalette;
28 class KActionMenu;
29 class KConfigDialog;
30 
31 class KStarsData;
32 class SkyPoint;
33 class SkyMap;
34 class GeoLocation;
35 class FindDialog;
36 class TimeStepBox;
37 class ImageExporter;
38 
39 class AltVsTime;
40 class WUTDialog;
41 class WIView;
42 class WILPSettings;
43 class WIEquipSettings;
44 class ObsConditions;
45 class AstroCalc;
46 class SkyCalendar;
47 class ScriptBuilder;
48 class PlanetViewer;
49 class JMoonTool;
50 class MoonPhaseTool;
51 class FlagManager;
52 class Execute;
53 class ExportImageDialog;
54 class PrintingWizard;
55 class HorizonManager;
56 class EyepieceField;
57 class AddDeepSkyObject;
58 
59 class OpsCatalog;
60 class OpsGuides;
61 class OpsSolarSystem;
62 class OpsSatellites;
63 class OpsSupernovae;
64 class OpsTerrain;
65 class OpsDeveloper;
66 class OpsColors;
67 class OpsAdvanced;
68 class OpsINDI;
69 class OpsEkos;
70 class OpsFITS;
71 class OpsXplanet;
72 
73 namespace Ekos
74 {
75 class Manager;
76 }
77 
78 #ifdef HAVE_CFITSIO
79 class FITSViewer;
80 #endif
81 
82 /**
83  *@class KStars
84  *@short This is the main window for KStars.
85  *In addition to the GUI elements, the class contains the program clock,
86  KStarsData, and SkyMap objects. It also contains functions for the \ref DBusInterface D-Bus interface. KStars is now a singleton class. Use KStars::createInstance() to
87  create an instance and KStars::Instance() to get a pointer to the instance
88  *@author Jason Harris, Jasem Mutlaq
89  *@version 1.1
90  */
91 
92 class KStars : public KXmlGuiWindow
93 {
94  Q_OBJECT
95  Q_CLASSINFO("D-Bus Interface", "org.kde.kstars")
96  Q_SCRIPTABLE Q_PROPERTY(QString colorScheme READ colorScheme WRITE loadColorScheme NOTIFY colorSchemeChanged)
97 
98  public:
99  Q_SCRIPTABLE QString colorScheme() const;
100 
101  private:
102  /**
103  * @short Constructor.
104  * @param doSplash should the splash panel be displayed during
105  * initialization.
106  * @param startClockRunning should the clock be running on startup?
107  * @param startDateString date (in string representation) to start running from.
108  *
109  * @todo Refer to documentation on date format.
110  */
111  explicit KStars(bool doSplash, bool startClockRunning = true, const QString &startDateString = QString());
112 
113  public:
114  /**
115  * @short Create an instance of this class. Destroy any previous instance
116  * @param doSplash
117  * @param clockrunning
118  * @param startDateString
119  * @note See KStars::KStars for details on parameters
120  * @return a pointer to the instance
121  */
122  static KStars *createInstance(bool doSplash, bool clockrunning = true, const QString &startDateString = QString());
123 
124  /** @return a pointer to the instance of this class */
125  inline static KStars *Instance()
126  {
127  return pinstance;
128  }
129 
130  /** Destructor. */
131  ~KStars() override;
132 
133  /** Syncs config file. Deletes objects. */
134  void releaseResources();
135 
136  /** @return pointer to KStarsData object which contains application data. */
137  inline KStarsData *data() const
138  {
139  return m_KStarsData;
140  }
141 
142  /** @return pointer to SkyMap object which is the sky display widget. */
143  inline SkyMap *map() const
144  {
145  return m_SkyMap;
146  }
147 
148  inline FlagManager *flagManager() const
149  {
150  return m_FlagManager;
151  }
152 
153  inline PrintingWizard *printingWizard() const
154  {
155  return m_PrintingWizard;
156  }
157 
158 #ifdef HAVE_CFITSIO
159  // void addFITSViewer(const QSharedPointer<FITSViewer> &fv);
160  const QPointer<FITSViewer> &genericFITSViewer();
161  const QPointer<FITSViewer> &createFITSViewer();
162  void clearAllViewers();
163 #endif
164 
165  /** Add an item to the color-scheme action manu
166  * @param name The name to use in the menu
167  * @param actionName The internal name for the action (derived from filename)
168  */
169  void addColorMenuItem(QString name, const QString &actionName);
170 
171  /** Remove an item from the color-scheme action manu
172  * @param actionName The internal name of the action (derived from filename)
173  */
174  void removeColorMenuItem(const QString &actionName);
175 
176  /** @short Apply config options throughout the program.
177  * In most cases, options are set in the "Options" object directly,
178  * but for some things we have to manually react to config changes.
179  * @param doApplyFocus If true, then focus position will be set
180  * from config file
181  */
182  void applyConfig(bool doApplyFocus = true);
183 
184  /** Sync Options to GUI, if any */
185  void syncOps();
186 
187  void showImgExportDialog();
188 
189  void syncFOVActions();
190 
191  void hideAllFovExceptFirst();
192 
193  void selectNextFov();
194 
195  void selectPreviousFov();
196 
197  void showWISettingsUI();
198 
199  void showWI(ObsConditions *obs);
200 
201  /** Load HIPS information and repopulate menu. */
202  void repopulateHIPS();
203 
204  WIEquipSettings *getWIEquipSettings()
205  {
206  return m_WIEquipmentSettings;
207  }
208 
209  public Q_SLOTS:
210  /** @defgroup DBusInterface DBus Interface
211  KStars provides powerful scripting functionality via DBus. The most common DBus functions can be constructed and executed within the ScriptBuilder tool.
212  Any 3rd party language or tool with support for DBus can access several interfaces provided by KStars:
213  <ul>
214  <li>KStars: Provides functions to manipulate the skymap including zoom, pan, and motion to selected objects. Add and remove object trails and labels. Wait for user input before running further actions.</li>
215  <li>SimClock: Provides functions to start and stop time, set a different date and time, and to set the clock scale.</li>
216  <li>Ekos: Provides functions to start and stop Ekos Manager, set Ekos connection mode, and access to Ekos modules:
217  <ul>
218  <li>Capture: Provides functions to capture images, load sequence queues, control filter wheel, and obtain information on job progress.</li>
219  <li>Focus: Provides functions to focus control in manual and automated mode. Start and stop focusing procedures and set autofocus options.</li>
220  <li>Guide: Provides functions to start and stop calibration and autoguiding procedures. Set calibration and autoguide options.</li>
221  <li>Align: Provides functions to solve images use online or offline astrometry.net solver.</li>
222  </ul>
223  </li>
224  </ul>
225  */
226 
227  /*@{*/
228 
229  /** DBUS interface function.
230  * Set focus to given Ra/Dec coordinates
231  * @param ra the Right Ascension coordinate for the focus (in Hours)
232  * @param dec the Declination coordinate for the focus (in Degrees)
233  */
234  Q_SCRIPTABLE Q_NOREPLY void setRaDec(double ra, double dec);
235 
236  /** DBUS interface function.
237  * Set focus to given J2000.0 Ra/Dec coordinates
238  * @param ra the J2000.0 Right Ascension coordinate for the focus (in Hours)
239  * @param dec the J2000.0 Declination coordinate for the focus (in Degrees)
240  */
241  Q_SCRIPTABLE Q_NOREPLY void setRaDecJ2000(double ra0, double dec0);
242 
243  /** DBUS interface function.
244  * Set focus to given Alt/Az coordinates.
245  * @param alt the Altitude coordinate for the focus (in Degrees)
246  * @param az the Azimuth coordinate for the focus (in Degrees)
247  * @param altIsRefracted If set to true, the altitude is interpreted as if it were corrected for atmospheric refraction (i.e. the altitude is an apparent altitude)
248  */
249  Q_SCRIPTABLE Q_NOREPLY void setAltAz(double alt, double az, bool altIsRefracted = false);
250 
251  /** DBUS interface function.
252  * Point in the direction described by the string argument.
253  * @param direction either an object name, a compass direction (e.g., "north"), or "zenith"
254  */
255  Q_SCRIPTABLE Q_NOREPLY void lookTowards(const QString &direction);
256 
257  /** DBUS interface function.
258  * Add a name label to the named object
259  * @param name the name of the object to which the label will be attached
260  */
261  Q_SCRIPTABLE Q_NOREPLY void addLabel(const QString &name);
262 
263  /** DBUS interface function.
264  * Remove a name label from the named object
265  * @param name the name of the object from which the label will be removed
266  */
267  Q_SCRIPTABLE Q_NOREPLY void removeLabel(const QString &name);
268 
269  /** DBUS interface function.
270  * Add a trail to the named solar system body
271  * @param name the name of the body to which the trail will be attached
272  */
273  Q_SCRIPTABLE Q_NOREPLY void addTrail(const QString &name);
274 
275  /** DBUS interface function.
276  * Remove a trail from the named solar system body
277  * @param name the name of the object from which the trail will be removed
278  */
279  Q_SCRIPTABLE Q_NOREPLY void removeTrail(const QString &name);
280 
281  /** DBUS interface function. Zoom in one step. */
282  Q_SCRIPTABLE Q_NOREPLY void zoomIn();
283 
284  /** DBUS interface function. Zoom out one step. */
285  Q_SCRIPTABLE Q_NOREPLY void zoomOut();
286 
287  /** DBUS interface function. reset to the default zoom level. */
288  Q_SCRIPTABLE Q_NOREPLY void defaultZoom();
289 
290  /** DBUS interface function. Set zoom level to specified value.
291  * @param z the zoom level. Units are pixels per radian. */
292  Q_SCRIPTABLE Q_NOREPLY void zoom(double z);
293 
294  /** DBUS interface function. Set local time and date.
295  * @param yr year of date
296  * @param mth month of date
297  * @param day day of date
298  * @param hr hour of time
299  * @param min minute of time
300  * @param sec second of time
301  */
302  Q_SCRIPTABLE Q_NOREPLY void setLocalTime(int yr, int mth, int day, int hr, int min, int sec);
303 
304  /** DBUS interface function. Set local time and date to present values acc. system clock
305  * @note Just a proxy for slotSetTimeToNow(), but it is better to
306  * keep the DBus interface separate from the internal methods.
307  */
308  Q_SCRIPTABLE Q_NOREPLY void setTimeToNow();
309 
310  /** DBUS interface function. Delay further execution of DBUS commands.
311  * @param t number of seconds to delay
312  */
313  Q_SCRIPTABLE Q_NOREPLY void waitFor(double t);
314 
315  /** DBUS interface function. Pause further DBUS execution until a key is pressed.
316  * @param k the key which will resume DBUS execution
317  */
318  Q_SCRIPTABLE Q_NOREPLY void waitForKey(const QString &k);
319 
320  /** DBUS interface function. Toggle tracking.
321  * @param track engage tracking if true; else disengage tracking
322  */
323  Q_SCRIPTABLE Q_NOREPLY void setTracking(bool track);
324 
325  /** DBUS interface function. modify a view option.
326  * @param option the name of the option to be modified
327  * @param value the option's new value
328  */
329  Q_SCRIPTABLE Q_NOREPLY void changeViewOption(const QString &option, const QString &value);
330 
331  /** DBUS interface function.
332  * @param name the name of the option to query
333  * @return the current value of the named option
334  */
335  Q_SCRIPTABLE QString getOption(const QString &name);
336 
337  /** DBUS interface function. Read config file.
338  * This function is useful for restoring the user settings from the config file,
339  * after having modified the settings in memory.
340  * @sa writeConfig()
341  */
342  Q_SCRIPTABLE Q_NOREPLY void readConfig();
343 
344  /** DBUS interface function. Write current settings to config file.
345  * This function is useful for storing user settings before modifying them with a DBUS
346  * script. The original settings can be restored with readConfig().
347  * @sa readConfig()
348  */
349  Q_SCRIPTABLE Q_NOREPLY void writeConfig();
350 
351  /** DBUS interface function. Show text message in a popup window.
352  * @note Not Yet Implemented
353  * @param x x-coordinate for message window
354  * @param y y-coordinate for message window
355  * @param message the text to display in the message window
356  */
357  Q_SCRIPTABLE Q_NOREPLY void popupMessage(int x, int y, const QString &message);
358 
359  /** DBUS interface function. Draw a line on the sky map.
360  * @note Not Yet Implemented
361  * @param x1 starting x-coordinate of line
362  * @param y1 starting y-coordinate of line
363  * @param x2 ending x-coordinate of line
364  * @param y2 ending y-coordinate of line
365  * @param speed speed at which line should appear from start to end points (in pixels per second)
366  */
367  Q_SCRIPTABLE Q_NOREPLY void drawLine(int x1, int y1, int x2, int y2, int speed);
368 
369  /** DBUS interface function. Set the geographic location.
370  * @param city the city name of the location
371  * @param province the province name of the location
372  * @param country the country name of the location
373  * @return True if geographic location is found and set, false otherwise.
374  */
375  Q_SCRIPTABLE bool setGeoLocation(const QString &city, const QString &province, const QString &country);
376 
377  /**
378  * @brief location Returns a JSON Object (as string) that contains the following information:
379  * name: String
380  * province: String
381  * country: String
382  * longitude: Double (-180 to +180)
383  * latitude: Double (-90 to +90)
384  * tz0 (Time zone without DST): Double
385  * tz (Time zone with DST): Double
386  * @return Stringified JSON object as described above.
387  */
388  Q_SCRIPTABLE QString location();
389 
390  /** DBUS interface function. Set the GPS geographic location.
391  * @param longitude longitude in degrees (-180 West to +180 East)
392  * @param latitude latitude in degrees (-90 South to +90 North)
393  * @param elevation site elevation in meters
394  * @param tz0 Time zone offset WITHOUT daylight saving time.
395  * @return True if geographic location is set, false otherwise.
396  */
397  Q_SCRIPTABLE bool setGPSLocation(double longitude, double latitude, double elevation, double tz0);
398 
399  /** DBUS interface function. Modify a color.
400  * @param colorName the name of the color to be modified (e.g., "SkyColor")
401  * @param value the new color to use
402  */
403  Q_SCRIPTABLE Q_NOREPLY void setColor(const QString &colorName, const QString &value);
404 
405  /** DBUS interface function. Load a color scheme.
406  * @param name the name of the color scheme to load (e.g., "Moonless Night")
407  */
408  Q_SCRIPTABLE Q_NOREPLY void loadColorScheme(const QString &name);
409 
410  /** DBUS interface function. Export the sky image to a file.
411  * @param filename the filename for the exported image
412  * @param width the width for the exported image. Map's width will be used if nothing or an invalid value is supplied.
413  * @param height the height for the exported image. Map's height will be used if nothing or an invalid value is supplied.
414  * @param includeLegend should we include a legend?
415  */
416  Q_SCRIPTABLE Q_NOREPLY void exportImage(const QString &filename, int width = -1, int height = -1,
417  bool includeLegend = false);
418 
419  /** DBUS interface function. Return a URL to retrieve Digitized Sky Survey image.
420  * @param objectName name of the object.
421  * @note If the object is note found, the string "ERROR" is returned.
422  */
423  Q_SCRIPTABLE QString getDSSURL(const QString &objectName);
424 
425  /** DBUS interface function. Return a URL to retrieve Digitized Sky Survey image.
426  * @param RA_J2000 J2000.0 RA
427  * @param Dec_J2000 J2000.0 Declination
428  * @param width width of the image, in arcminutes (default = 15)
429  * @param height height of the image, in arcminutes (default = 15)
430  */
431  Q_SCRIPTABLE QString getDSSURL(double RA_J2000, double Dec_J2000, float width = 15, float height = 15);
432 
433  /** DBUS interface function. Return XML containing information about a sky object
434  * @param objectName name of the object.
435  * @param fallbackToInternet Attempt to resolve the name using internet databases if not found
436  * @param storeInternetResolved If we fell back to the internet, save the result in DSO database for future offline access
437  * @note If the object was not found, the XML is empty.
438  */
439  Q_SCRIPTABLE QString getObjectDataXML(const QString &objectName,
440  bool fallbackToInternet = false,
441  bool storeInternetResolved = true);
442 
443  /** DBUS interface function. Return XML containing position info about a sky object
444  * @param objectName name of the object.
445  * @note If the object was not found, the XML is empty.
446  */
447  Q_SCRIPTABLE QString getObjectPositionInfo(const QString &objectName);
448 
449  /** DBUS interface function. Render eyepiece view and save it in the file(s) specified
450  * @note See EyepieceField::renderEyepieceView() for more info. This is a DBus proxy that calls that method, and then writes the resulting image(s) to file(s).
451  * @note Important: If imagePath is empty, but overlay is true, or destPathImage is supplied, this method will make a blocking DSS download.
452  */
453  Q_SCRIPTABLE Q_NOREPLY void renderEyepieceView(const QString &objectName, const QString &destPathChart,
454  const double fovWidth = -1.0, const double fovHeight = -1.0,
455  const double rotation = 0.0, const double scale = 1.0,
456  const bool flip = false, const bool invert = false,
457  QString imagePath = QString(),
458  const QString &destPathImage = QString(), const bool overlay = false,
459  const bool invertColors = false);
460 
461  /** DBUS interface function. Set the approx field-of-view
462  * @param FOV_Degrees field of view in degrees
463  */
464  Q_SCRIPTABLE Q_NOREPLY void setApproxFOV(double FOV_Degrees);
465 
466  /** DBUS interface function. Get the dimensions of the Sky Map.
467  * @return a string containing widthxheight in pixels.
468  */
469  Q_SCRIPTABLE QString getSkyMapDimensions();
470 
471  /** DBUS interface function. Return a newline-separated list of objects in the observing wishlist.
472  * @note Unfortunately, unnamed objects are troublesome. Hopefully, we don't have them on the observing list.
473  */
475 
476  /** DBUS interface function. Return a newline-separated list of objects in the observing session plan.
477  * @note Unfortunately, unnamed objects are troublesome. Hopefully, we don't have them on the observing list.
478  */
480 
481  /** DBUS interface function. Print the sky image.
482  * @param usePrintDialog if true, the KDE print dialog will be shown; otherwise, default parameters will be used
483  * @param useChartColors if true, the "Star Chart" color scheme will be used for the printout, which will save ink.
484  */
485  Q_SCRIPTABLE Q_NOREPLY void printImage(bool usePrintDialog, bool useChartColors);
486 
487  /** DBUS interface function. Open FITS image.
488  * @param imageUrl URL of FITS image to load. For a local file the prefix must be file:// For example
489  * if the file is located at /home/john/m42.fits then the full URL is file:///home/john/m42.fits
490  */
491  Q_SCRIPTABLE Q_NOREPLY void openFITS(const QUrl &imageUrl);
492 
493  /** @}*/
494 
495  signals:
496  /** DBUS interface notification. Color scheme was updated.
497  */
498  void colorSchemeChanged();
499 
500  public Q_SLOTS:
501  /**
502  * Update time-dependent data and (possibly) repaint the sky map.
503  * @param automaticDSTchange change DST status automatically?
504  */
505  void updateTime(const bool automaticDSTchange = true);
506 
507  /** action slot: sync kstars clock to system time */
508  void slotSetTimeToNow();
509 
510  /** Apply new settings and redraw skymap */
511  void slotApplyConfigChanges();
512 
513  /** Apply new settings for WI */
515 
516  /** Called when zoom level is changed. Enables/disables zoom
517  * actions and updates status bar. */
518  void slotZoomChanged();
519 
520  /** action slot: Allow user to specify a field-of-view angle for the display window in degrees,
521  * and set the zoom level accordingly. */
522  void slotSetZoom();
523 
524  /** action slot: Toggle whether kstars is tracking current position */
525  void slotTrack();
526 
527  /** action slot: open dialog for selecting a new geographic location */
528  void slotGeoLocator();
529 
530  /**
531  * @brief slotSetTelescopeEnabled call when telescope comes online or goes offline.
532  * @param enable True if telescope is online and connected, false otherwise.
533  */
534  void slotSetTelescopeEnabled(bool enable);
535 
536  /**
537  * @brief slotSetDomeEnabled call when dome comes online or goes offline.
538  * @param enable True if dome is online and connected, false otherwise.
539  */
540  void slotSetDomeEnabled(bool enable);
541 
542  /** Delete FindDialog because ObjNames list has changed in KStarsData due to
543  * reloading star data. So list in FindDialog must be new filled with current data. */
544  void clearCachedFindDialog();
545 
546  /** Remove all trails which may have been added to solar system bodies */
547  void slotClearAllTrails();
548 
549  /** Display position in the status bar. */
551 
552  /** action slot: open Flag Manager */
553  void slotFlagManager();
554 
555  /** Show the eyepiece view tool */
556  void slotEyepieceView(SkyPoint *sp, const QString &imagePath = QString());
557 
558  /** Show the DSO Catalog Management GUI */
559  void slotDSOCatalogGUI();
560 
561  /** action slot: open KStars startup wizard */
562  void slotWizard();
563 
564  void updateLocationFromWizard(const GeoLocation &geo);
565 
566  WIView *wiView()
567  {
568  return m_WIView;
569  }
570 
571  bool isWIVisible()
572  {
573  if (!m_WIView)
574  return false;
575  if (!m_wiDock)
576  return false;
577  return m_wiDock->isVisible();
578  }
579 
580  //FIXME Port to QML2
581  //#if 0
582  /** action slot: open What's Interesting settings window */
583  void slotWISettings();
584 
585  /** action slot: toggle What's Interesting window */
586  void slotToggleWIView();
587  //#endif
588 
589  private slots:
590  /** action slot: open a dialog for setting the time and date */
591  void slotSetTime();
592 
593  /** action slot: toggle whether kstars clock is running or not */
594  void slotToggleTimer();
595 
596  /** action slot: advance one step forward in time */
597  void slotStepForward();
598 
599  /** action slot: advance one step backward in time */
600  void slotStepBackward();
601 
602  /** action slot: open dialog for finding a named object */
603  void slotFind();
604 
605  /** action slot: open KNewStuff window to download extra data. */
606  void slotDownload();
607 
608  /** action slot: open KStars calculator to compute astronomical ephemeris */
609  void slotCalculator();
610 
611  /** action slot: open Elevation vs. Time tool */
612  void slotAVT();
613 
614  /** action slot: open What's up tonight dialog */
615  void slotWUT();
616 
617  /** action slot: open Sky Calendar tool */
618  void slotCalendar();
619 
620  /** action slot: open the glossary */
621  void slotGlossary();
622 
623  /** action slot: open ScriptBuilder dialog */
624  void slotScriptBuilder();
625 
626  /** action slot: open Solar system viewer */
627  void slotSolarSystem();
628 
629  /** action slot: open Jupiter Moons tool */
630  void slotJMoonTool();
631 
632  /** action slot: open Moon Phase Calendar tool */
633  void slotMoonPhaseTool();
634 
635 #if 0
636  /** action slot: open Telescope wizard */
637  void slotTelescopeWizard();
638 #endif
639 
640  /** action slot: open INDI driver panel */
641  void slotINDIDriver();
642 
643  /** action slot: open INDI control panel */
644  void slotINDIPanel();
645 
646  /** action slot: open Ekos panel */
647  void slotEkos();
648 
649  /** action slot: Track with the telescope (INDI) */
650  void slotINDITelescopeTrack();
651 
652  /**
653  * Action slot: Slew with the telescope (INDI)
654  *
655  * @param focused_object Slew to the focused object or the mouse pointer if false.
656  *
657  */
658  void slotINDITelescopeSlew(bool focused_object = true);
659  void slotINDITelescopeSlewMousePointer();
660 
661  /**
662  * Action slot: Sync the telescope (INDI)
663  *
664  * @param focused_object Sync the position of the focused object or the mouse pointer if false.
665  *
666  */
667  void slotINDITelescopeSync(bool focused_object = true);
668  void slotINDITelescopeSyncMousePointer();
669 
670  /** action slot: Abort any telescope motion (INDI) */
671  void slotINDITelescopeAbort();
672 
673  /** action slot: Park the telescope (INDI) */
674  void slotINDITelescopePark();
675 
676  /** action slot: Unpark the telescope (INDI) */
677  void slotINDITelescopeUnpark();
678 
679  /** action slot: Park the dome (INDI) */
680  void slotINDIDomePark();
681 
682  /** action slot: UnPark the dome (INDI) */
683  void slotINDIDomeUnpark();
684 
685  /** action slot: open dialog for setting the view options */
686  void slotViewOps();
687 
688  /** finish setting up after the kstarsData has finished */
689  void datainitFinished();
690 
691  /** Open FITS image. */
692  void slotOpenFITS();
693 
694  /** Action slot to save the sky image to a file.*/
695  void slotExportImage();
696 
697  /** Action slot to select a DBUS script and run it.*/
698  void slotRunScript();
699 
700  /** Action slot to print skymap. */
701  void slotPrint();
702 
703  /** Action slot to start Printing Wizard. */
704  void slotPrintingWizard();
705 
706  /** Action slot to show tip-of-the-day window. */
707  void slotTipOfDay();
708 
709  /** Action slot to set focus coordinates manually (opens FocusDialog). */
710  void slotManualFocus();
711 
712  /** Meta-slot to point the focus at special points (zenith, N, S, E, W).
713  * Uses the name of the Action which sent the Signal to identify the
714  * desired direction. */
715  void slotPointFocus();
716 
717  /** Meta-slot to set the color scheme according to the name of the
718  * Action which sent the activating signal. */
719  void slotColorScheme();
720 
721  /**
722  * @brief slotThemeChanged save theme name in options
723  */
724  void slotThemeChanged();
725 
726  /** Select the Target symbol (a.k.a. field-of-view indicator) */
727  void slotTargetSymbol(bool flag);
728 
729  /** Select the HIPS Source catalog. */
730  void slotHIPSSource();
731 
732  /** Invoke the Field-of-View symbol editor window */
733  void slotFOVEdit();
734 
735  /** Toggle between Equatorial and Ecliptic coordinate systems */
736  void slotCoordSys();
737 
738  /** Set the map projection according to the menu selection */
739  void slotMapProjection();
740 
741  /** Toggle display of the observing list tool*/
742  void slotObsList();
743 
744  /** Meta-slot to handle display toggles for all of the viewtoolbar buttons.
745  * uses the name of the sender to identify the item to change. */
746  void slotViewToolBar();
747 
748  /** Meta-slot to handle display toggles for all of the INDItoolbar buttons.
749  * uses the name of the sender to identify the item to change. */
750  void slotINDIToolBar();
751 
752  /** Meta-slot to handle toggling display of GUI elements (toolbars and infoboxes)
753  * uses name of the sender action to identify the widget to hide/show. */
754  void slotShowGUIItem(bool);
755 
756  /** Toggle to and from full screen mode */
757  void slotFullScreen();
758 
759  /** Toggle whether to show the terrain image on the skymap. */
760  void slotTerrain();
761 
762  /** Save data to config file before exiting.*/
763  void slotAboutToQuit();
764 
765  void slotEquipmentWriter();
766 
767  void slotObserverManager();
768 
769  void slotHorizonManager();
770 
771  void slotExecute();
772 
773  void slotPolarisHourAngle();
774 
775  /** Update comets orbital elements*/
776  void slotUpdateComets(bool isAutoUpdate = false);
777 
778  /** Update asteroids orbital elements*/
779  void slotUpdateAsteroids(bool isAutoUpdate = false);
780 
781  /** Update list of recent supernovae*/
782  void slotUpdateSupernovae();
783 
784  /** Update satellites orbital elements*/
785  void slotUpdateSatellites();
786 
787  /** Configure Notifications */
788  void slotConfigureNotifications();
789 
790  private:
791  /** Load FOV information and repopulate menu. */
792  void repopulateFOV();
793 
794  /**
795  * @brief populateThemes Populate application themes
796  */
797  void populateThemes();
798 
799  /** Initialize Menu bar, toolbars and all Actions. */
800  void initActions();
801 
802  /** Prepare options dialog. */
803  KConfigDialog* prepareOps();
804 
805  /** Initialize Status bar. */
806  void initStatusBar();
807 
808  /** Initialize focus position */
809  void initFocus();
810 
811  /** Build the KStars main window */
812  void buildGUI();
813 
814  void closeEvent(QCloseEvent *event) override;
815 
816  public:
817  /** Check if the KStars main window is shown */
818  bool isGUIReady()
819  {
820  return m_SkyMap != nullptr;
821  }
822 
823  /** Was KStars started with the clock running, or paused? */
825  {
826  return StartClockRunning;
827  }
828 
829  /// Set to true when the application is being closed
830  static bool Closing;
831 
832  /** @brief Override KStars UI resource file.
833  * @note This is used by UI tests, which need to use the same resources with a different app name
834  */
835  static bool setResourceFile(QString const rc);
836 
837  private:
838  /// Pointer to an instance of KStars
839  static KStars *pinstance;
840 
841  // Resource file to load - overridable by UI tests
842  static QString m_KStarsUIResource;
843 
844  KActionMenu *colorActionMenu { nullptr };
845  KActionMenu *fovActionMenu { nullptr };
846  KActionMenu *hipsActionMenu { nullptr };
847 
848  KStarsData *m_KStarsData { nullptr };
849  SkyMap *m_SkyMap { nullptr };
850 
851  // Widgets
852  TimeStepBox *m_TimeStepBox { nullptr };
853 
854  // Dialogs & Tools
855 
856  // File Menu
857  ExportImageDialog *m_ExportImageDialog { nullptr };
858  PrintingWizard *m_PrintingWizard { nullptr };
859 
860  // Tool Menu
861  AstroCalc *m_AstroCalc { nullptr };
862  AltVsTime *m_AltVsTime { nullptr };
863  SkyCalendar *m_SkyCalendar { nullptr };
864  ScriptBuilder *m_ScriptBuilder { nullptr };
865  PlanetViewer *m_PlanetViewer { nullptr };
866  WUTDialog *m_WUTDialog { nullptr };
867  JMoonTool *m_JMoonTool { nullptr };
868  FlagManager *m_FlagManager { nullptr };
869  HorizonManager *m_HorizonManager { nullptr };
870  EyepieceField *m_EyepieceView { nullptr };
871 #ifdef HAVE_CFITSIO
872  QPointer<FITSViewer> m_GenericFITSViewer;
873  QList<QPointer<FITSViewer>> m_FITSViewers;
874 #endif
875 
876 #ifdef HAVE_INDI
877  QPointer<Ekos::Manager> m_EkosManager;
878 #endif
879 
880  AddDeepSkyObject *m_addDSODialog { nullptr };
881 
882  // FIXME Port to QML2
883  //#if 0
884  WIView *m_WIView { nullptr };
885  WILPSettings *m_WISettings { nullptr };
886  WIEquipSettings *m_WIEquipmentSettings { nullptr };
887  ObsConditions *m_ObsConditions { nullptr };
888  QDockWidget *m_wiDock { nullptr };
889  //#endif
890 
891  QActionGroup *projectionGroup { nullptr };
892  QActionGroup *cschemeGroup { nullptr };
893  QActionGroup *hipsGroup { nullptr };
894  QActionGroup *telescopeGroup { nullptr };
895  QActionGroup *domeGroup { nullptr };
896 
897  bool DialogIsObsolete { false };
898  bool StartClockRunning { false };
899  QString StartDateString;
900  QLabel AltAzField, RADecField, J2000RADecField;
901  //QPalette OriginalPalette, DarkPalette;
902 
903  OpsCatalog *opcatalog { nullptr };
904  OpsGuides *opguides { nullptr };
905  OpsTerrain *opterrain { nullptr };
906  OpsDeveloper *opsdeveloper { nullptr };
907  OpsSolarSystem *opsolsys { nullptr };
908  OpsSatellites *opssatellites { nullptr };
909  OpsSupernovae *opssupernovae { nullptr };
910  OpsColors *opcolors { nullptr };
911  OpsAdvanced *opadvanced { nullptr };
912  OpsINDI *opsindi { nullptr };
913  OpsEkos *opsekos { nullptr };
914  OpsFITS *opsfits { nullptr };
915  OpsXplanet *opsxplanet { nullptr };
916 
917  friend class TestArtificialHorizon;
918 };
Q_OBJECTQ_OBJECT
Q_SCRIPTABLE QString getObjectDataXML(const QString &objectName, bool fallbackToInternet=false, bool storeInternetResolved=true)
DBUS interface function.
Definition: kstarsdbus.cpp:714
Q_SCRIPTABLE Q_NOREPLY void defaultZoom()
DBUS interface function.
Definition: kstarsdbus.cpp:197
Q_SCRIPTABLE QString getOption(const QString &name)
DBUS interface function.
Definition: kstarsdbus.cpp:375
void updateTime(const bool automaticDSTchange=true)
Update time-dependent data and (possibly) repaint the sky map.
Definition: kstars.cpp:567
Q_PROPERTY(...)
Q_SCRIPTABLE Q_NOREPLY void drawLine(int x1, int y1, int x2, int y2, int speed)
DBUS interface function.
Definition: kstarsdbus.cpp:248
bool isStartedWithClockRunning()
Was KStars started with the clock running, or paused?
Definition: kstars.h:824
void slotSetDomeEnabled(bool enable)
slotSetDomeEnabled call when dome comes online or goes offline.
void slotFlagManager()
action slot: open Flag Manager
Class representing Printing Wizard for KStars printed documents (currently only finder charts).
Q_SCRIPTABLE Q_NOREPLY void removeTrail(const QString &name)
DBUS interface function.
Definition: kstarsdbus.cpp:172
Q_SLOTSQ_SLOTS
Q_SCRIPTABLE Q_NOREPLY void waitFor(double t)
DBUS interface function.
Definition: kstarsdbus.cpp:212
Ekos is an advanced Astrophotography tool for Linux. It is based on a modular extensible framework to...
Definition: align.cpp:66
Q_SCRIPTABLE Q_NOREPLY void waitForKey(const QString &k)
DBUS interface function.
Definition: kstarsdbus.cpp:222
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
void slotSetTelescopeEnabled(bool enable)
slotSetTelescopeEnabled call when telescope comes online or goes offline.
Q_CLASSINFO(Name, Value)
void slotSetTimeToNow()
action slot: sync kstars clock to system time
void slotToggleWIView()
action slot: toggle What's Interesting window
Shows a moon phase calendar for an entire month.
Definition: moonphasetool.h:37
Backends for exporting a sky image, either raster or vector, with a legend.
Definition: imageexporter.h:23
Q_SCRIPTABLE QString getObservingSessionPlanObjectNames()
DBUS interface function.
Definition: kstarsdbus.cpp:958
bool event(QEvent *event) override
Q_SCRIPTABLE Q_NOREPLY void addLabel(const QString &name)
DBUS interface function.
Definition: kstarsdbus.cpp:142
Manages adding/removing and editing regions and points associated with user-customized artificial hor...
Find Object Dialog.
Definition: finddialog.h:42
void colorSchemeChanged()
DBUS interface notification.
void slotApplyConfigChanges()
Apply new settings and redraw skymap.
Manages the QML user interface for What's Interesting. WIView is used to display the QML UI using a Q...
Definition: wiview.h:32
SkyMap * map() const
Definition: kstars.h:143
void slotDSOCatalogGUI()
Show the DSO Catalog Management GUI.
Q_SCRIPTABLE Q_NOREPLY void lookTowards(const QString &direction)
DBUS interface function.
Definition: kstarsdbus.cpp:75
Flag manager Dialog box to add and remove flags.
Definition: flagmanager.h:35
Q_SCRIPTABLE Q_NOREPLY void setColor(const QString &colorName, const QString &value)
DBUS interface function.
Definition: kstarsdbus.cpp:592
Q_SCRIPTABLE QString getObjectPositionInfo(const QString &objectName)
DBUS interface function.
Definition: kstarsdbus.cpp:795
Q_SCRIPTABLE Q_NOREPLY void changeViewOption(const QString &option, const QString &value)
DBUS interface function.
Definition: kstarsdbus.cpp:395
void slotSetZoom()
action slot: Allow user to specify a field-of-view angle for the display window in degrees,...
Q_SCRIPTABLE Q_NOREPLY void readConfig()
DBUS interface function.
Definition: kstarsdbus.cpp:350
bool isGUIReady()
Check if the KStars main window is shown.
Definition: kstars.h:818
static KStars * Instance()
Definition: kstars.h:125
Export sky image dialog.
Q_SCRIPTABLE Q_NOREPLY void zoomOut()
DBUS interface function.
Definition: kstarsdbus.cpp:192
bool isVisible() const const
Q_SCRIPTABLE Q_NOREPLY void setAltAz(double alt, double az, bool altIsRefracted=false)
DBUS interface function.
Definition: kstarsdbus.cpp:61
Renders the view through the eyepiece of various telescope types.
Definition: eyepiecefield.h:36
User interface for "Light Pollution Settings" page in WI settings dialog This class deals with light ...
Definition: wilpsettings.h:22
This is the base class for the KStars astronomical calculator.
Definition: astrocalc.h:25
Q_SCRIPTABLE bool setGeoLocation(const QString &city, const QString &province, const QString &country)
DBUS interface function.
Definition: kstarsdbus.cpp:271
void syncOps()
Sync Options to GUI, if any.
User interface for "Equipment Type and Parameters" page in WI settings dialog.
Q_SCRIPTABLE Q_NOREPLY void loadColorScheme(const QString &name)
DBUS interface function.
Definition: kstarsdbus.cpp:607
the Altitude vs. Time Tool. Plot the altitude as a function of time for any list of objects,...
Definition: altvstime.h:40
static bool setResourceFile(QString const rc)
Override KStars UI resource file.
Definition: kstarsinit.cpp:125
Q_SCRIPTABLE QString getSkyMapDimensions()
DBUS interface function.
Definition: kstarsdbus.cpp:974
void releaseResources()
Syncs config file.
Definition: kstars.cpp:282
Primary window to view monochrome and color FITS images. The FITSviewer can open multiple images each...
Definition: fitsviewer.h:48
void slotShowPositionBar(SkyPoint *)
Display position in the status bar.
void slotWizard()
action slot: open KStars startup wizard
Q_SCRIPTABLE Q_NOREPLY void setTracking(bool track)
DBUS interface function.
Definition: kstarsdbus.cpp:237
Q_SCRIPTABLE Q_NOREPLY void zoomIn()
DBUS interface function.
Definition: kstarsdbus.cpp:187
Display the positions of Jupiter's moons as a function of time.
Definition: jmoontool.h:23
Q_SCRIPTABLE Q_NOREPLY void setLocalTime(int yr, int mth, int day, int hr, int min, int sec)
DBUS interface function.
Definition: kstarsdbus.cpp:202
Q_SCRIPTABLE Q_NOREPLY void zoom(double z)
DBUS interface function.
Definition: kstarsdbus.cpp:182
Q_SCRIPTABLE Q_NOREPLY void renderEyepieceView(const QString &objectName, const QString &destPathChart, const double fovWidth=-1.0, const double fovHeight=-1.0, const double rotation=0.0, const double scale=1.0, const bool flip=false, const bool invert=false, QString imagePath=QString(), const QString &destPathImage=QString(), const bool overlay=false, const bool invertColors=false)
DBUS interface function.
Definition: kstarsdbus.cpp:894
void slotZoomChanged()
Called when zoom level is changed.
This is the main window for KStars. In addition to the GUI elements, the class contains the program c...
Definition: kstars.h:92
Display an overhead view of the solar system.
Definition: planetviewer.h:37
void slotApplyWIConfigChanges()
Apply new settings for WI.
Q_SCRIPTABLE Q_NOREPLY void writeConfig()
DBUS interface function.
Definition: kstarsdbus.cpp:367
Q_SCRIPTABLE QString location()
location Returns a JSON Object (as string) that contains the following information: name: String prov...
Definition: kstarsdbus.cpp:253
Q_SCRIPTABLE Q_NOREPLY void openFITS(const QUrl &imageUrl)
DBUS interface function.
static bool Closing
Set to true when the application is being closed.
Definition: kstars.h:830
void repopulateHIPS()
Load HIPS information and repopulate menu.
Definition: kstarsinit.cpp:723
void slotTrack()
action slot: Toggle whether kstars is tracking current position
Primary class to handle all Ekos modules. The Ekos Manager class manages startup and shutdown of INDI...
Definition: manager.h:52
Composite spinbox for specifying a time step. This composite widget consists of a TimeSpinBox (a QSpi...
Definition: timestepbox.h:27
~KStars() override
Destructor.
Definition: kstars.cpp:248
Q_SCRIPTABLE QString getObservingWishListObjectNames()
DBUS interface function.
Definition: kstarsdbus.cpp:947
Q_SCRIPTABLE Q_NOREPLY void exportImage(const QString &filename, int width=-1, int height=-1, bool includeLegend=false)
DBUS interface function.
Definition: kstarsdbus.cpp:679
Canvas widget for displaying the sky bitmap; also handles user interaction events.
Definition: skymap.h:52
Catalog page of the Options window.
Definition: opscatalog.h:27
Q_SCRIPTABLE Q_NOREPLY void printImage(bool usePrintDialog, bool useChartColors)
DBUS interface function.
Definition: kstarsdbus.cpp:978
Q_SCRIPTABLE Q_NOREPLY void setRaDec(double ra, double dec)
DBUS interface function.
Definition: kstarsdbus.cpp:44
void slotWISettings()
action slot: open What's Interesting settings window
void removeColorMenuItem(const QString &actionName)
Remove an item from the color-scheme action manu.
void addColorMenuItem(QString name, const QString &actionName)
Add an item to the color-scheme action manu.
Q_SCRIPTABLE Q_NOREPLY void removeLabel(const QString &name)
DBUS interface function.
Definition: kstarsdbus.cpp:152
KStarsData * data() const
Definition: kstars.h:137
Q_SCRIPTABLE Q_NOREPLY void setApproxFOV(double FOV_Degrees)
DBUS interface function.
Definition: kstarsdbus.cpp:969
The Solar System page of the Options window.
Q_SCRIPTABLE Q_NOREPLY void setRaDecJ2000(double ra0, double dec0)
DBUS interface function.
Definition: kstarsdbus.cpp:51
void clearCachedFindDialog()
Delete FindDialog because ObjNames list has changed in KStarsData due to reloading star data.
Definition: kstars.cpp:305
Q_SCRIPTABLE Q_NOREPLY void addTrail(const QString &name)
DBUS interface function.
Definition: kstarsdbus.cpp:162
Q_SCRIPTABLE Q_NOREPLY void popupMessage(int x, int y, const QString &message)
DBUS interface function.
Definition: kstarsdbus.cpp:243
Q_SCRIPTABLE QString getDSSURL(const QString &objectName)
DBUS interface function.
Definition: kstarsdbus.cpp:695
void slotClearAllTrails()
Remove all trails which may have been added to solar system bodies.
void slotGeoLocator()
action slot: open dialog for selecting a new geographic location
The Colors page of the Options window.
Definition: opscolors.h:31
void applyConfig(bool doApplyFocus=true)
Apply config options throughout the program.
Definition: kstars.cpp:323
static KStars * createInstance(bool doSplash, bool clockrunning=true, const QString &startDateString=QString())
Create an instance of this class.
Definition: kstars.cpp:239
Q_SCRIPTABLE bool setGPSLocation(double longitude, double latitude, double elevation, double tz0)
DBUS interface function.
Definition: kstarsdbus.cpp:325
QString message
void slotEyepieceView(SkyPoint *sp, const QString &imagePath=QString())
Show the eyepiece view tool.
Relevant data about an observing location on Earth.
Definition: geolocation.h:27
Q_SCRIPTABLE Q_NOREPLY void setTimeToNow()
DBUS interface function.
Definition: kstarsdbus.cpp:207
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 19 2022 03:57:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.