Kstars

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

KDE's Doxygen guidelines are available online.