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

KDE's Doxygen guidelines are available online.