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

KDE's Doxygen guidelines are available online.