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

KDE's Doxygen guidelines are available online.