Kstars
11 #include "imageexporter.h"
12 #include "kstarsdata.h"
13 #include "kstars_debug.h"
14 #include "ksnotification.h"
18 #include "texturemanager.h"
19 #include "dialogs/exportimagedialog.h"
20 #include "dialogs/finddialog.h"
21 #include "dialogs/focusdialog.h"
22 #include "dialogs/fovdialog.h"
23 #include "dialogs/locationdialog.h"
24 #include "dialogs/timedialog.h"
25 #include "dialogs/catalogsdbui.h"
26 #include "oal/execute.h"
27 #include "oal/equipmentwriter.h"
28 #include "oal/observeradd.h"
29 #include "options/opsadvanced.h"
30 #include "options/opscatalog.h"
31 #include "options/opscolors.h"
32 #include "options/opsguides.h"
33 #include "options/opsterrain.h"
34 #include "options/opsimageoverlay.h"
35 #include "options/opsdeveloper.h"
36 #include "options/opssatellites.h"
37 #include "options/opssolarsystem.h"
38 #include "options/opssupernovae.h"
39 #include "printing/printingwizard.h"
40 #include "projections/projector.h"
41 #include "skycomponents/asteroidscomponent.h"
42 #include "skycomponents/cometscomponent.h"
43 #include "skycomponents/satellitescomponent.h"
44 #include "skycomponents/skymapcomposite.h"
45 #include "skycomponents/solarsystemcomposite.h"
46 #include "skycomponents/supernovaecomponent.h"
47 #include "skycomponents/catalogscomponent.h"
48 #include "skycomponents/mosaiccomponent.h"
49 #include "skycomponents/imageoverlaycomponent.h"
51 #include "skyobjects/mosaictiles.h"
53 #include "tools/altvstime.h"
54 #include "tools/astrocalc.h"
55 #include "tools/eyepiecefield.h"
56 #include "tools/flagmanager.h"
57 #include "tools/horizonmanager.h"
58 #include "tools/observinglist.h"
59 #include "tools/planetviewer.h"
60 #include "tools/jmoontool.h"
61 #include "tools/scriptbuilder.h"
62 #include "tools/skycalendar.h"
63 #include "tools/wutdialog.h"
64 #include "tools/polarishourangle.h"
65 #include "tools/whatsinteresting/wiequipsettings.h"
66 #include "tools/whatsinteresting/wilpsettings.h"
67 #include "tools/whatsinteresting/wiview.h"
68 #include "hips/hipsmanager.h"
69 #include "catalogsdb.h"
71 #include <basedevice.h>
73 #include "indi/opsindi.h"
74 #include "indi/drivermanager.h"
75 #include "indi/guimanager.h"
76 #include "indi/indilistener.h"
80 #include "fitsviewer/fitsviewer.h"
81 #include "fitsviewer/opsfits.h"
83 #include "ekos/manager.h"
84 #include "ekos/scheduler/framingassistantui.h"
85 #include "ekos/opsekos.h"
89 #include "xplanet/opsxplanet.h"
91 #ifdef HAVE_NOTIFYCONFIG
92 #include <KNotifyConfigWidget>
94 #include <KActionCollection>
95 #include <KActionMenu>
97 #include <KToggleAction>
98 #include <kns3/downloaddialog.h>
100 #include <QQuickWindow>
101 #include <QQuickView>
107 #include <sys/stat.h>
111 void KStars::slotViewToolBar()
121 opcatalog->kcfg_ShowStars->setChecked(a->
isChecked());
129 opcatalog->kcfg_ShowDeepSky->setChecked(a->
isChecked());
134 Options::setShowSolarSystem(a->
isChecked());
137 opsolsys->kcfg_ShowSolarSystem->setChecked(a->
isChecked());
145 opguides->kcfg_ShowCLines->setChecked(a->
isChecked());
153 opguides->kcfg_ShowCNames->setChecked(a->
isChecked());
161 opguides->kcfg_ShowCBounds->setChecked(a->
isChecked());
166 Options::setShowConstellationArt(a->
isChecked());
169 opguides->kcfg_ShowConstellationArt->setChecked(a->
isChecked());
174 Options::setShowMilkyWay(a->
isChecked());
177 opguides->kcfg_ShowMilkyWay->setChecked(a->
isChecked());
185 Options::setAutoSelectGrid(
false);
186 Options::setShowEquatorialGrid(a->
isChecked());
189 opguides->kcfg_ShowEquatorialGrid->setChecked(a->
isChecked());
190 opguides->kcfg_AutoSelectGrid->setChecked(
false);
195 Options::setAutoSelectGrid(
false);
196 Options::setShowHorizontalGrid(a->
isChecked());
199 opguides->kcfg_ShowHorizontalGrid->setChecked(a->
isChecked());
200 opguides->kcfg_AutoSelectGrid->setChecked(
false);
206 if (!a->
isChecked() && Options::useRefraction())
210 "are temporarily disabled.");
216 opguides->kcfg_ShowGround->setChecked(a->
isChecked());
224 opguides->kcfg_ShowFlags->setChecked(a->
isChecked());
229 Options::setShowSatellites(a->
isChecked());
232 opssatellites->kcfg_ShowSatellites->setChecked(a->
isChecked());
237 Options::setShowSupernovae(a->
isChecked());
240 opssupernovae->kcfg_ShowSupernovae->setChecked(a->
isChecked());
252 void KStars::slotINDIToolBar()
261 GUIManager::Instance()->
raise();
266 GUIManager::Instance()->
hide();
272 Ekos::Manager::Instance()->raise();
273 Ekos::Manager::Instance()->activateWindow();
274 Ekos::Manager::Instance()->showNormal();
277 Ekos::Manager::Instance()->hide();
281 for (
auto &oneDevice : INDIListener::devices())
283 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
286 if (oneDevice->isConnected() ==
false)
288 KSNotification::error(
i18n(
"Mount %1 is offline. Please connect and retry again.", oneDevice->getDeviceName()));
292 auto mount = oneDevice->getMount();
299 mount->centerUnlock();
303 KSNotification::sorry(
i18n(
"No connected mounts found."));
308 if (m_FITSViewers.isEmpty())
316 for (
auto &view : m_FITSViewers)
318 if (view->tabs().empty() ==
false)
321 view->activateWindow();
328 for (
auto &view : m_FITSViewers)
336 Ekos::Manager::Instance()->mountModule()->toggleMountToolBox();
340 Options::setShowSensorFOV(a->
isChecked());
341 for (
auto &oneFOV :
data()->getTransientFOVs())
343 if (oneFOV->objectName() ==
"sensor_fov")
344 oneFOV->setProperty(
"visible", a->
isChecked());
349 Options::setShowMosaicPanel(a->
isChecked());
352 auto scheduler = Ekos::Manager::Instance()->schedulerModule();
353 if (a->
isChecked() && scheduler && scheduler->status() != Ekos::SCHEDULER_RUNNING)
356 if (findChild<Ekos::FramingAssistantUI *>(
"FramingAssistant") ==
nullptr)
358 Ekos::FramingAssistantUI *assistant =
new Ekos::FramingAssistantUI();
373 for (
auto &a : telescopeGroup->
actions())
385 for (
auto &a : domeGroup->
actions())
394 void KStars::slotCalculator()
406 Options::setRunStartupWizard(
false);
408 updateLocationFromWizard(*(wizard->geo()));
412 void KStars::updateLocationFromWizard(
const GeoLocation &geo)
421 data()->isTimeRunningForward());
434 if (!Options::isTracking() && Options::useAltAz())
444 void KStars::slotDownload()
446 KSNotification::event(
448 i18n(
"Due to a known issue in the kde frameworks, "
449 "updating already downloaded items is currently not possible. <br> "
450 "Please uninstall and reinstall them to update."));
453 auto dlg = std::make_unique<KNS3::DownloadDialog>(
":/kconfig/kstars.knsrc",
this);
461 const auto changed_entries = dlg->changedEntries();
466 if (entry.category() !=
"dso")
468 const auto id = entry.id().
toInt();
470 if (entry.status() == KNS3::Entry::Installed)
471 for (
const QString &name : entry.installedFiles())
473 if (
name.endsWith(CatalogsDB::db_file_extension))
475 const auto meta{ CatalogsDB::read_catalog_meta_from_file(name) };
481 i18n(
"The catalog \"%1\" is corrupt.", entry.name()));
485 if (meta.second.id !=
id)
489 i18n(
"The catalog \"%1\" is corrupt.<br>Expected id=%2 but "
491 entry.name(),
id, meta.second.id));
495 const auto success{ manager.import_catalog(name,
true) };
499 i18n(
"Could not import the catalog \"%1\"<br>%2",
500 entry.name(), success.second));
504 if (entry.status() == KNS3::Entry::Deleted)
506 manager.remove_catalog(
id);
517 void KStars::slotAVT()
520 m_AltVsTime =
new AltVsTime(
this);
524 void KStars::slotWUT()
527 m_WUTDialog =
new WUTDialog(
this);
542 m_WIEquipmentSettings->populateScopeListWidget();
551 m_WISettings =
new WILPSettings(
this);
552 m_WIEquipmentSettings =
new WIEquipSettings();
553 dialog->
addPage(m_WISettings,
i18n(
"Light Pollution Settings"));
554 dialog->
addPage(m_WIEquipmentSettings,
555 i18n(
"Equipment Settings - Equipment Type and Parameters"));
557 if (m_WIEquipmentSettings)
558 m_WIEquipmentSettings->setAperture();
568 m_WIView =
new WIView(
nullptr);
570 m_wiDock->
setStyleSheet(
"QDockWidget::title{background-color:black;}");
577 connect(m_wiDock, SIGNAL(visibilityChanged(
bool)),
579 SLOT(setChecked(
bool)));
588 void KStars::slotCalendar()
591 m_SkyCalendar =
new SkyCalendar(
this);
592 m_SkyCalendar->show();
595 void KStars::slotGlossary()
606 void KStars::slotScriptBuilder()
608 if (!m_ScriptBuilder)
609 m_ScriptBuilder =
new ScriptBuilder(
this);
610 m_ScriptBuilder->show();
613 void KStars::slotSolarSystem()
616 m_PlanetViewer =
new PlanetViewer(
this);
617 m_PlanetViewer->show();
620 void KStars::slotJMoonTool()
627 void KStars::slotMoonPhaseTool()
637 m_FlagManager =
new FlagManager(
this);
638 m_FlagManager->show();
642 void KStars::slotTelescopeWizard()
647 QString indiServerDir = Options::indiServer();
650 if (Options::indiServerIsInternal())
658 <<
"/usr/local/bin" << indiServerDir;
664 KSNotification::error(
i18n(
"Unable to find INDI server. Please make sure the package that provides "
665 "the 'indiserver' binary is installed."));
678 void KStars::slotINDIPanel()
683 QString indiServerDir = Options::indiServer();
686 if (Options::indiServerIsInternal())
694 <<
"/usr/local/bin" << indiServerDir;
700 KSNotification::error(
i18n(
701 "Unable to find INDI server. Please make sure the package that provides "
702 "the 'indiserver' binary is installed."));
707 GUIManager::Instance()->updateStatus(
true);
711 void KStars::slotINDIDriver()
718 i18n(
"INDI Device Manager should only be used by advanced technical users. "
719 "It cannot be used with Ekos. Do you still want to open INDI device "
723 "indi_device_manager_warning") == KMessageBox::Cancel)
726 QString indiServerDir = Options::indiServer();
729 if (Options::indiServerIsInternal())
737 <<
"/usr/local/bin" << indiServerDir;
743 KSNotification::error(
i18n(
744 "Unable to find INDI server. Please make sure the package that provides "
745 "the 'indiserver' binary is installed."));
751 DriverManager::Instance()->raise();
752 DriverManager::Instance()->activateWindow();
753 DriverManager::Instance()->showNormal();
758 void KStars::slotEkos()
765 QString indiServerDir = Options::indiServer();
768 if (Options::indiServerIsInternal())
776 <<
"/usr/local/bin" << indiServerDir;
782 KSNotification::error(
i18n(
783 "Unable to find INDI server. Please make sure the package that provides "
784 "the 'indiserver' binary is installed."));
790 if (Ekos::Manager::Instance()->
isVisible() &&
793 Ekos::Manager::Instance()->hide();
797 Ekos::Manager::Instance()->raise();
798 Ekos::Manager::Instance()->activateWindow();
799 Ekos::Manager::Instance()->showNormal();
806 void KStars::slotINDITelescopeTrack()
809 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
812 for (
auto &oneDevice : INDIListener::devices())
814 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
817 auto mount = oneDevice->getMount();
818 if (!mount ||
mount->isConnected() ==
false)
832 void KStars::slotINDITelescopeSlew(
bool focused_object)
835 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
838 for (
auto &oneDevice : INDIListener::devices())
840 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
843 auto mount = oneDevice->getMount();
844 if (!mount ||
mount->isConnected() ==
false)
857 Q_UNUSED(focused_object)
861 void KStars::slotINDITelescopeSlewMousePointer()
864 slotINDITelescopeSlew(
false);
868 void KStars::slotINDITelescopeSync(
bool focused_object)
871 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
874 for (
auto &oneDevice : INDIListener::devices())
876 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
879 auto mount = oneDevice->getMount();
880 if (!mount ||
mount->isConnected() ==
false)
894 Q_UNUSED(focused_object)
898 void KStars::slotINDITelescopeSyncMousePointer()
901 slotINDITelescopeSync(
false);
905 void KStars::slotINDITelescopeAbort()
908 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
911 for (
auto &oneDevice : INDIListener::devices())
913 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
916 auto mount = oneDevice->getMount();
917 if (!mount ||
mount->isConnected() ==
false)
926 void KStars::slotINDITelescopePark()
929 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
932 for (
auto &oneDevice : INDIListener::devices())
934 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
937 auto mount = oneDevice->getMount();
938 if (!mount ||
mount->isConnected() ==
false ||
mount->canPark() ==
false)
947 void KStars::slotINDITelescopeUnpark()
950 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
953 for (
auto &oneDevice : INDIListener::devices())
955 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
958 auto mount = oneDevice->getMount();
959 if (!mount ||
mount->isConnected() ==
false ||
mount->canPark() ==
false)
968 void KStars::slotINDIDomePark()
971 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
974 for (
auto &oneDevice : INDIListener::devices())
976 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::DOME_INTERFACE))
979 auto dome = oneDevice->getDome();
980 if (!dome || dome->isConnected() ==
false)
991 void KStars::slotINDIDomeUnpark()
994 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
997 for (
auto &oneDevice : INDIListener::devices())
999 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::DOME_INTERFACE))
1002 auto dome = oneDevice->getDome();
1003 if (!dome || dome->isConnected() ==
false)
1005 if (dome->canPark())
1019 GeoLocation *newLocation = locationdialog->selectedCity();
1031 data()->isTimeRunningForward());
1044 if (!Options::isTracking() && Options::useAltAz())
1047 data()->geo()->lat());
1055 delete locationdialog;
1058 void KStars::slotViewOps()
1063 auto ops = prepareOps();
1067 ops->activateWindow();
1073 if (
nullptr != dialog)
1077 dialog =
new KConfigDialog(
this,
"settings", Options::self());
1081 dialog->
resize(800, 600);
1089 opcatalog =
new OpsCatalog();
1090 opguides =
new OpsGuides();
1091 opterrain =
new OpsTerrain();
1092 opsImageOverlay =
new OpsImageOverlay();
1093 opsdeveloper =
new OpsDeveloper();
1094 opsolsys =
new OpsSolarSystem();
1095 opssatellites =
new OpsSatellites();
1096 opssupernovae =
new OpsSupernovae();
1097 opcolors =
new OpsColors();
1098 opadvanced =
new OpsAdvanced();
1102 page = dialog->
addPage(opcatalog,
i18n(
"Catalogs"),
"kstars_catalog");
1105 page = dialog->
addPage(opsolsys,
i18n(
"Solar System"),
"kstars_solarsystem");
1108 page = dialog->
addPage(opssatellites,
i18n(
"Satellites"),
"kstars_satellites");
1111 page = dialog->
addPage(opssupernovae,
i18n(
"Supernovae"),
"kstars_supernovae");
1114 page = dialog->
addPage(opguides,
i18n(
"Guides"),
"kstars_guides");
1117 page = dialog->
addPage(opterrain,
i18n(
"Terrain"),
"kstars_terrain");
1120 page = dialog->
addPage(opsImageOverlay,
i18n(
"Image Overlays"),
"kstars_imageoverlay");
1122 KStarsData::Instance()->
skyComposite()->imageOverlay()->setWidgets(
1123 opsImageOverlay->table(), opsImageOverlay->statusDisplay(), opsImageOverlay->solvePushButton(),
1124 opsImageOverlay->tableTitleBox(), opsImageOverlay->solverProfile());
1126 page = dialog->
addPage(opcolors,
i18n(
"Colors"),
"kstars_colors");
1130 opsfits =
new OpsFITS();
1131 page = dialog->
addPage(opsfits,
i18n(
"FITS"),
"kstars_fitsviewer");
1136 opsindi =
new OpsINDI();
1137 page = dialog->
addPage(opsindi,
i18n(
"INDI"),
"kstars_indi");
1140 opsekos =
new OpsEkos();
1143 if (Ekos::Manager::Instance())
1144 Ekos::Manager::Instance()->setOptionsWidget(ekosOption, opsekos);
1149 opsxplanet =
new OpsXplanet(
this);
1150 page = dialog->
addPage(opsxplanet,
i18n(
"Xplanet"),
"kstars_xplanet");
1153 page = dialog->
addPage(opadvanced,
i18n(
"Advanced"),
"kstars_advanced");
1156 page = dialog->
addPage(opsdeveloper,
i18n(
"Developer"),
"kstars_developer");
1159 #ifdef Q_OS_OSX // This is because KHelpClient doesn't seem to be working right on MacOS
1163 KStars::Instance()->appHelpActivated();
1172 opterrain->syncOptions();
1174 ->
setText(Options::showTerrain() ?
i18n(
"Hide Terrain") :
i18n(
"Show Terrain"));
1176 opsImageOverlay->syncOptions();
1178 ->
setText(Options::showImageOverlays() ?
i18n(
"Hide Image Overlays") :
i18n(
"Show Image Overlays"));
1183 Options::self()->save();
1193 Options::self()->save();
1199 void KStars::slotSetTime()
1207 if (Options::useAltAz())
1209 if (
map()->focusObject())
1212 data()->geo()->lat());
1238 if (Options::useAltAz())
1240 if (
map()->focusObject())
1243 data()->geo()->lat());
1261 void KStars::slotFind()
1266 (targetObject = FindDialog::Instance()->targetObject()))
1278 void KStars::slotOpenFITS()
1285 "Images (*.fits *.fits.fz *.fit *.fts *.xisf "
1286 "*.jpg *.jpeg *.png *.gif *.bmp "
1287 "*.cr2 *.cr3 *.crw *.nef *.raf *.dng *.arw *.orf)");
1294 auto fv = createFITSViewer();
1295 connect(fv.get(), &FITSViewer::failed,
this, [](
const QString & errorMessage)
1297 KSNotification::error(errorMessage, i18n(
"Open FITS"), 10);
1300 fv->loadFile(fileURL, FITS_NORMAL, FITS_NONE,
QString());
1304 void KStars::slotExportImage()
1313 "Images (*.png *.jpeg *.gif *.bmp *.svg)");
1326 i18n(
"A file named \"%1\" already exists. Overwrite it?", fileURL.
fileName()),
1328 if (r == KMessageBox::Cancel)
1338 if (!m_ExportImageDialog)
1340 m_ExportImageDialog =
new ExportImageDialog(
1342 KStarsData::Instance()->imageExporter());
1346 m_ExportImageDialog->setOutputUrl(fileURL.
toLocalFile());
1350 m_ExportImageDialog->show();
1353 void KStars::slotRunScript()
1358 i18nc(
"Filter by file type: KStars Scripts.",
"KStars Scripts (*.kstars)"));
1366 KSNotification::sorry(
i18n(
"Executing remote scripts is not supported."));
1375 KSNotification::sorry(
message,
i18n(
"Could Not Open File"));
1383 while (!istream.atEnd())
1385 line = istream.readLine();
1386 if (line.
at(0) !=
'#' && line.
left(9) !=
"dbus-send")
1399 "The selected script contains unrecognized elements, "
1400 "indicating that it was not created using the KStars script builder. "
1401 "This script may not function properly, and it may even contain "
1403 "Would you like to execute it anyway?"),
1406 if (answer == KMessageBox::Cancel)
1418 p.
start(f.fileName(), arguments);
1424 qApp->processEvents();
1433 void KStars::slotPrint()
1435 bool switchColors(
false);
1438 if (
data()->colorScheme()->colorNamed(
"SkyColor") !=
QColor(255, 255, 255))
1441 i18n(
"You can save printer ink by using the \"Star Chart\" "
1442 "color scheme, which uses a white background. Would you like to "
1443 "temporarily switch to the Star Chart color scheme for printing?");
1446 nullptr,
message,
i18n(
"Switch to Star Chart Colors?"),
1450 if (answer == KMessageBox::Cancel)
1453 switchColors =
true;
1459 void KStars::slotPrintingWizard()
1461 if (m_PrintingWizard)
1463 delete m_PrintingWizard;
1467 m_PrintingWizard->
show();
1470 void KStars::slotToggleTimer()
1472 if (
data()->clock()->isActive())
1479 if (fabs(
data()->clock()->scale()) > Options::slewTimeScale())
1482 if (
data()->clock()->isManualMode())
1487 Options::setRunClock(
data()->clock()->isActive());
1490 void KStars::slotStepForward()
1492 if (
data()->clock()->isActive())
1498 void KStars::slotStepBackward()
1500 if (
data()->clock()->isActive())
1507 void KStars::slotPointFocus()
1510 map()->stopTracking();
1514 Options::useRefraction());
1527 if (Options::isTracking())
1529 Options::setIsTracking(
false);
1536 if (planet &&
data()->temporaryTrail)
1539 data()->temporaryTrail =
false;
1552 Options::setIsTracking(
true);
1562 void KStars::slotManualFocus()
1579 double realAlt(focusDialog->point()->alt().Degrees());
1580 double realDec(focusDialog->point()->dec().Degrees());
1581 if (Options::useAltAz() && realAlt > 89.0)
1583 focusDialog->point()->setAlt(89.0);
1584 focusDialog->point()->HorizontalToEquatorial(
data()->lst(),
1585 data()->geo()->lat());
1587 if (!Options::useAltAz() && realDec > 89.0)
1589 focusDialog->point()->setDec(89.0);
1590 focusDialog->point()->EquatorialToHorizontal(
data()->lst(),
1596 if (Options::isTracking())
1609 if (Options::useAltAz())
1613 focusDialog->point()->az(),
false);
1618 focusDialog->point()->dec());
1622 if (Options::useAltAz() && realAlt > 89.0)
1624 if (!Options::useAltAz() && realDec > 89.0)
1628 if (focusDialog->usedAltAz())
1629 map()->stopTracking();
1644 ki18nc(
"approximate field of view",
"Approximate FOV: %1 degrees");
1649 ki18nc(
"approximate field of view",
"Approximate FOV: %1 arcminutes");
1655 ki18nc(
"approximate field of view",
"Approximate FOV: %1 arcseconds");
1671 i18nc(
"The user should enter an angle for the field-of-view of the display",
1672 "Enter Desired Field-of-View Angle"),
1673 i18n(
"Enter a field-of-view angle in degrees: "), currentAngle, minAngle,
1682 void KStars::slotCoordSys()
1684 if (Options::useAltAz())
1686 Options::setUseAltAz(
false);
1687 if (Options::useRefraction())
1689 if (
map()->focusObject())
1696 data()->geo()->lat());
1701 ->
setText(
i18n(
"Switch to Horizontal View (Horizontal &Coordinates)"));
1703 ->
action(
"up_orientation")
1704 ->
setText(
i18nc(
"Orientation of the sky map",
"North &Up"));
1706 ->
action(
"down_orientation")
1707 ->
setText(
i18nc(
"Orientation of the sky map",
"North &Down"));
1709 ->
action(
"erect_observer_correction")
1714 Options::setUseAltAz(
true);
1715 if (Options::useRefraction())
1722 ->
setText(
i18n(
"Switch to Star Globe View (Equatorial &Coordinates)"));
1724 ->
action(
"up_orientation")
1725 ->
setText(
i18nc(
"Orientation of the sky map",
"Zenith &Up"));
1727 ->
action(
"down_orientation")
1728 ->
setText(
i18nc(
"Orientation of the sky map",
"Zenith &Down"));
1730 ->
action(
"erect_observer_correction")
1736 void KStars::slotSkyMapOrientation()
1740 Options::setSkyRotation(0.0);
1744 Options::setSkyRotation(180.0);
1748 Q_ASSERT(
false &&
"Unhandled orientation action");
1749 qCWarning(KSTARS) <<
"Unhandled orientation action";
1752 Options::setErectObserverCorrection(
actionCollection()->
action(
"erect_observer_correction")->isChecked());
1756 void KStars::slotMapProjection()
1759 Options::setProjection(Projector::Lambert);
1761 Options::setProjection(Projector::AzimuthalEquidistant);
1763 Options::setProjection(Projector::Orthographic);
1765 Options::setProjection(Projector::Equirectangular);
1767 Options::setProjection(Projector::Stereographic);
1769 Options::setProjection(Projector::Gnomonic);
1772 qCDebug(KSTARS) <<
"Projection system: " << Options::projection();
1778 void KStars::slotColorScheme()
1783 void KStars::slotTargetSymbol(
bool flag)
1800 Options::setFOVNames(names);
1808 void KStars::slotHIPSSource()
1810 QAction *selectedAction = qobject_cast<QAction *>(
sender());
1811 Q_ASSERT(selectedAction !=
nullptr);
1813 QString selectedSource = selectedAction->
text().remove(
'&');
1817 if (selectedSource ==
i18n(
"None"))
1818 HIPSManager::Instance()->setCurrentSource(
"None");
1820 HIPSManager::Instance()->setCurrentSource(selectedSource);
1825 void KStars::slotFOVEdit()
1836 void KStars::slotObsList()
1838 m_KStarsData->observingList()->show();
1841 void KStars::slotEquipmentWriter()
1844 equipmentdlg->loadEquipment();
1845 equipmentdlg->exec();
1846 delete equipmentdlg;
1849 void KStars::slotObserverManager()
1852 m_observerAdd->exec();
1853 delete m_observerAdd;
1856 void KStars::slotHorizonManager()
1858 if (!m_HorizonManager)
1860 m_HorizonManager =
new HorizonManager(
this);
1861 connect(m_SkyMap, SIGNAL(positionClicked(
SkyPoint *)), m_HorizonManager,
1865 m_HorizonManager->show();
1870 if (!m_EyepieceView)
1875 const FOV *fov =
nullptr;
1876 if (!
data()->getAvailableFOVs().isEmpty())
1882 foreach (f,
data()->getAvailableFOVs())
1884 nameToFovMap.
insert(f->name(), f);
1886 nameToFovMap.
insert(
i18n(
"Attempt to determine from image"),
nullptr);
1888 this,
i18n(
"Eyepiece View: Choose a field-of-view"),
1889 i18n(
"FOV to render eyepiece view for:"), nameToFovMap.
keys(), 0,
false,
1896 void KStars::slotExecute()
1898 KStarsData::Instance()->executeSession()->init();
1899 KStarsData::Instance()->executeSession()->show();
1902 void KStars::slotPolarisHourAngle()
1909 void KStars::slotTipOfDay()
1915 void KStars::slotFullScreen()
1930 void KStars::slotTerrain()
1932 Options::setShowTerrain(!Options::showTerrain());
1934 ->
setText(Options::showTerrain() ?
i18n(
"Hide Terrain") :
i18n(
"Show Terrain"));
1935 opterrain->syncOptions();
1940 void KStars::slotImageOverlays()
1942 Options::setShowImageOverlays(!Options::showImageOverlays());
1944 ->
setText(Options::showImageOverlays() ?
i18n(
"Hide Image Overlays") :
i18n(
"Show Image Overlays"));
1945 opsImageOverlay->syncOptions();
1953 if (
map()->focusObject() &&
map()->focusObject()->isSolarSystem() &&
1954 data()->temporaryTrail)
1965 void KStars::slotShowGUIItem(
bool show)
1970 Options::setShowStatusBar(
show);
1976 Options::setShowAltAzField(
show);
1982 Options::setShowRADecField(
show);
1988 Options::setShowJ2000RADecField(
show);
2003 if (actionName.
mid(3) ==
2004 cg.
readEntry(
"ColorSchemeFile",
"moonless-night.colors").
remove(
".colors"))
2011 connect(kta, SIGNAL(toggled(
bool)),
this, SLOT(slotColorScheme()));
2016 qCDebug(KSTARS) <<
"removing " << actionName;
2020 void KStars::slotAboutToQuit()
2022 if (m_SkyMap ==
nullptr)
2026 DriverManager::Instance()->disconnectClients();
2037 Options::setWindowWidth(
width());
2038 Options::setWindowHeight(
height());
2049 quit->start(
"killall kdeinit5");
2050 quit->waitForFinished(1000);
2051 quit->start(
"killall klauncher");
2052 quit->waitForFinished(1000);
2053 quit->start(
"killall kioslave");
2054 quit->waitForFinished(1000);
2055 quit->start(
"killall kio_http_cache_cleaner");
2056 quit->waitForFinished(1000);
2063 if (Options::showAltAzField())
2066 if (Options::useAltAz())
2074 if (Options::showRADecField())
2077 lastUpdate.
setDJD(KStarsData::Instance()->updateNum()->getJD());
2086 if (Options::showJ2000RADecField())
2090 p0 = p->
catalogueCoord(KStarsData::Instance()->updateNum()->julianDay());
2099 void KStars::slotUpdateComets(
bool isAutoUpdate)
2101 data()->
skyComposite()->solarSystemComposite()->cometsComponent()->updateDataFile(
2105 void KStars::slotUpdateAsteroids(
bool isAutoUpdate)
2107 data()->
skyComposite()->solarSystemComposite()->asteroidsComponent()->updateDataFile(
2111 void KStars::slotUpdateSupernovae()
2116 void KStars::slotUpdateSatellites()
2121 void KStars::slotConfigureNotifications()
2123 #ifdef HAVE_NOTIFYCONFIG
2129 auto *ui =
new CatalogsDBUI{
this, CatalogsDB::dso_db_path() };
void start(const QString &program, const QStringList &arguments, QIODevice::OpenMode mode)
QProcess::ProcessState state() const const
void append(const T &value)
static void clearTrailsExcept(SkyObject *o)
Remove trail for all objects but one which is passed as parameter.
QString readEntry(const char *key, const char *aDefault=nullptr) const
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
QUrl getOpenFileUrl(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes)
void updateTime(const bool automaticDSTchange=true)
Update time-dependent data and (possibly) repaint the sky map.
QAction * action(const QString &name) const
void setAlt(dms alt)
Sets Alt, the Altitude.
void setDestinationAltAz(const dms &alt, const dms &az, bool altIsRefracted)
sets the destination point of the sky map, using its alt/az coordinates.
void forceUpdateNow()
Convenience function; simply calls forceUpdate(true).
void setLocation(const GeoLocation &l)
Set the GeoLocation according to the argument.
void setText(const QString &)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
QString number(int n, int base)
void slotSetDomeEnabled(bool enable)
slotSetDomeEnabled call when dome comes online or goes offline.
KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text)
void slotFlagManager()
action slot: open Flag Manager
Class representing Printing Wizard for KStars printed documents (currently only finder charts).
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
bool waitForFinished(int msecs)
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
void slotSetTelescopeEnabled(bool enable)
slotSetTelescopeEnabled call when telescope comes online or goes offline.
void setZoomFactor(double factor)
@ Set zoom factor.
void slotSetTimeToNow()
action slot: sync kstars clock to system time
static constexpr double DegToRad
DegToRad is a const static member equal to the number of radians in one degree (dms::PI/180....
void slotToggleWIView()
action slot: toggle What's Interesting window
void setClickedPoint(const SkyPoint *f)
Set the ClickedPoint to the skypoint given as an argument.
QString url(QUrl::FormattingOptions options) const const
QIcon fromTheme(const QString &name)
void slotApplyConfigChanges()
Apply new settings and redraw skymap.
QObject * sender() const const
Manages the QML user interface for What's Interesting. WIView is used to display the QML UI using a Q...
QString applicationDirPath()
static KStarsDateTime currentDateTimeUtc()
void slotDSOCatalogGUI()
Show the DSO Catalog Management GUI.
Manages the catalog database and provides an interface to provide an interface to query and modify th...
static bool showDialog(const QString &name)
void setFullTimeUpdate()
The Sky is updated more frequently than the moon, which is updated more frequently than the planets.
bool exists() const const
void EquatorialToHorizontal(const CachingDms *LST, const CachingDms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates,...
void setFocusObject(SkyObject *o)
Set the FocusObject pointer to the argument.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)
void addToTrail(const QString &label=QString())
adds a point to the planet's trail
const QString toHMSString(const bool machineReadable=false, const bool highPrecision=false) const
void slotSetZoom()
action slot: Allow user to specify a field-of-view angle for the display window in degrees,...
static KStars * Instance()
QString findExecutable(const QString &executableName, const QStringList &paths)
void setIcon(const QIcon &icon)
void showMessage(const QString &message, int timeout)
bool isValid() const const
QMap::iterator insert(const Key &key, const T &value)
void setDestination(const SkyPoint &f)
sets the destination point of the sky map.
KIOCORE_EXPORT SimpleJob * mount(bool ro, const QByteArray &fstype, const QString &dev, const QString &point, JobFlags flags=DefaultFlags)
static bool save()
Write list of FOVs to "fov.dat".
void setIcon(const QIcon &icon)
Renders the view through the eyepiece of various telescope types.
void updateObservingConditions()
void changeDateTime(const KStarsDateTime &newDate)
Change the current simulation date/time to the KStarsDateTime argument.
This is the base class for the KStars astronomical calculator.
void clearTrail()
clear the Trail
QString i18n(const char *text, const TYPE &arg...)
double epoch() const
This is (approximately) the year expressed as a floating-point value.
const QString toDMSString(const bool forceSign=false, const bool machineReadable=false, const bool highPrecision=false) const
const CachingDms & dec() const
bool isEmpty() const const
void syncOps()
Sync Options to GUI, if any.
QList< QAction * > actions() const const
Q_SCRIPTABLE Q_NOREPLY void loadColorScheme(const QString &name)
DBUS interface function.
SkyPoint * focus()
Retrieve the Focus point; the position on the sky at the center of the skymap.
ActionType * add(const QString &name, const QObject *receiver=nullptr, const char *member=nullptr)
void setActionGroup(QActionGroup *group)
KPageWidgetItem * addPage(QWidget *page, const QString &itemName, const QString &pixmapName=QString(), const QString &header=QString(), bool manage=true)
ColorScheme * colorScheme()
QUrl getSaveFileUrl(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes)
QUrl fromLocalFile(const QString &localFile)
QString fileName(QUrl::ComponentFormattingOptions options) const const
bool waitForStarted(int msecs)
void setupProjector()
Call to set up the projector before a draw cycle.
void slotShowPositionBar(SkyPoint *)
Display position in the status bar.
void slotWizard()
action slot: open KStars startup wizard
void setFocusPoint(SkyPoint *f)
set the FocusPoint; the position that is to be the next Destination.
Q_INVOKABLE SimClock * clock()
void setText(const QString &text)
void setClickedObject(SkyObject *o)
Set the ClickedObject pointer to the argument.
int toInt(bool *ok, int base) const const
QString toLocalFile() const const
static KConfigDialog * exists(const QString &name)
KLocalizedString subs(const KLocalizedString &a, int fieldWidth=0, QChar fillChar=QLatin1Char(' ')) const
GeoCoordinates geo(const QVariant &location)
void slotZoomChanged()
Called when zoom level is changed.
int indexOf(QStringView str, int from) const const
void setFocus(SkyPoint *f)
sets the central focus point of the sky map.
void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget)
QString path() const const
void slotApplyWIConfigChanges()
Apply new settings for WI.
void saveToConfig()
Save color-scheme data to the Config object.
Q_SCRIPTABLE Q_NOREPLY void stop()
DBUS function to stop the SimClock.
Q_SCRIPTABLE Q_NOREPLY void writeConfig()
DBUS interface function.
void onReloadIconClicked()
public slot - Reload list of visible sky-objects.
void slotCenter()
Center the display at the point ClickedPoint.
QString & remove(int position, int n)
QStatusBar * statusBar() const const
SkyMapComposite * skyComposite()
An angle, stored as degrees, but expressible in many ways.
void setSnapNextFocus(bool b=true)
Disable or re-enable the slewing animation for the next Focus change.
Q_SCRIPTABLE Q_NOREPLY void start()
DBUS function to start the SimClock.
void updateTLEs()
Download new TLE files.
void slotTriggerDataFileUpdate()
This initiates updating of the data file.
static bool Closing
Set to true when the application is being closed.
void slotTrack()
action slot: Toggle whether kstars is tracking current position
QAction * action(const char *name) const
virtual KActionCollection * actionCollection() const
const CachingDms & ra() const
QList< Key > keys() const const
SkyObject * focusObject() const
Retrieve the object which is centered in the sky map.
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
void setManualMode(bool on=true)
Sets Manual Mode on/off according to the bool argument.
QString path(const QString &relativePath)
QString left(int n) const const
double fov() const
Return the FOV of this projection.
void setObjectName(const QString &name)
bool isLocalFile() const const
const char * name(StandardAction id)
SkyPoint * mousePoint()
Retrieve the mouse pointer position.
void setDec(dms d)
Sets Dec, the current Declination.
const QChar at(int position) const const
A simple UI to manage downloaded and custom Catalogs.
Q_SCRIPTABLE Q_NOREPLY void printImage(bool usePrintDialog, bool useChartColors)
DBUS interface function.
static void showTip(const QString &tipFile=QString(), bool force=false)
void showEyepieceField(SkyPoint *sp, FOV const *const fov=nullptr, const QString &imagePath=QString())
Show the eyepiece field dialog.
void manualTick(bool force=false, bool backward=false)
Equivalent of tick() for manual mode.
QString i18nc(const char *context, const char *text, const TYPE &arg...)
void add_color_scheme(const QString &filename, const QString &name)
Register a color scheme with filename and name.
void HorizontalToEquatorial(const dms *LST, const dms *lat)
Determine the (RA, Dec) coordinates of the SkyPoint from its (Altitude, Azimuth) coordinates,...
void slotWISettings()
action slot: open What's Interesting settings window
void removeColorMenuItem(const QString &actionName)
Remove an item from the color-scheme action manu.
void addColorMenuItem(QString name, const QString &actionName)
Add an item to the color-scheme action manu.
KStarsData * data() const
ButtonCode questionYesNoCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
void information(QWidget *parent, const QString &text, const QString &title=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
void forceUpdate(bool now=false)
Recalculates the positions of objects in the sky, and then repaints the sky map.
void syncFOV()
Synchronize list of visible FOVs and list of selected FOVs in Options.
const Projector * projector() const
Get the current projector.
void reset_with_ltime(KStarsDateTime <ime, const double TZoffset, const bool time_runs_forward, const bool automaticDSTchange=false)
Recalculate next dst change and if DST is active by a given local time with timezone offset and time ...
void setNextDSTChange(const KStarsDateTime &dt)
Set the NextDSTChange member.
void setFocusAltAz(const dms &alt, const dms &az)
sets the focus point of the sky map, using its alt/az coordinates
bool isChecked() const const
QPushButton * button(QDialogButtonBox::StandardButton which) const
QString mid(int position, int n) const const
void slotClearAllTrails()
Remove all trails which may have been added to solar system bodies.
void slotGeoLocator()
action slot: open dialog for selecting a new geographic location
void dropCache()
Clear the internal cache and effectively reload all objects from the database.
Information about an object in the sky.
void applyConfig(bool doApplyFocus=true)
Apply config options throughout the program.
QMessageBox::StandardButton critical(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
void slotEyepieceView(SkyPoint *sp, const QString &imagePath=QString())
Show the eyepiece view tool.
void finished(int result)
void syncLST()
Sync the LST with the simulation clock.
SkyPoint catalogueCoord(long double jdf)
Computes the J2000.0 catalogue coordinates for this SkyPoint using the epoch removing aberration,...
Provides necessary information about objects in the solar system.
Relevant data about an observing location on Earth.
KStarsDateTime nextDSTChange() const
void setDJD(long double jd)
Assign the static_cast<long double> Julian Day value, which includes the time of day encoded in the f...
static void discoverTextureDirs()
Clear the cache and discover the directories to load textures from.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:02:11 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.