diff --git a/kstars/data/icons/atikbase.svg b/kstars/data/icons/atikbase.svg new file mode 100644 index 000000000..4e432e02e --- /dev/null +++ b/kstars/data/icons/atikbase.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + diff --git a/kstars/data/kstars.qrc b/kstars/data/kstars.qrc index 553672f24..26edb671c 100644 --- a/kstars/data/kstars.qrc +++ b/kstars/data/kstars.qrc @@ -1,75 +1,76 @@ icons/ekos_align.png icons/ekos_ccd.png icons/ekos_focus.png icons/ekos_guide.png icons/ekos_mount.png icons/ekos_scheduler.png icons/ekos_setup.png icons/fov.png icons/histogram.png icons/glstarbase.png icons/center_telescope.svg icons/center_telescope_red.svg icons/AlignFailure.svg icons/AlignSuccess.svg icons/AlignWarning.svg icons/astrometry.svg icons/stellarmate.svg icons/center_telescope_magenta.svg icons/dome-park.svg icons/dome-unpark.svg icons/star_profile.svg icons/astrometry-optional.svg icons/astrometry-recommended.svg icons/astrometry-required.svg indidrivers.xml qml/whatisinteresting/CategoryTitle.qml qml/whatisinteresting/DetailsItem.qml qml/whatisinteresting/downloadIcon.png qml/whatisinteresting/favoriteIcon.png qml/whatisinteresting/helpIcon.png qml/whatisinteresting/iconcredits.dat qml/whatisinteresting/inspectIcon.png qml/whatisinteresting/leftArrow.png qml/whatisinteresting/next.png qml/whatisinteresting/previous.png qml/whatisinteresting/reloadIcon.png qml/whatisinteresting/ScrollBar.qml qml/whatisinteresting/settingsIcon.png qml/whatisinteresting/visibleIcon.png qml/whatisinteresting/wiview.qml qml/mount/go-east.png qml/mount/go-north.png qml/mount/go-northeast.png qml/mount/go-northwest.png qml/mount/go-south.png qml/mount/go-southeast.png qml/mount/go-southwest.png qml/mount/go-west.png qml/mount/mountbox.qml qml/mount/stop.png icons/kstars_satellites_invisible.svg icons/kstars_satellites_visible.svg icons/cloud-online.svg icons/ekos_observatory.png icons/cfa.svg icons/pi.svg + icons/atikbase.svg kstars.knsrc kstarsui.rc fitsviewerui.rc noimage.png reticle12.png reticle24.png sm_animation.gif diff --git a/kstars/ekos/profilewizard.cpp b/kstars/ekos/profilewizard.cpp index 7141b0a79..9558b7b0d 100644 --- a/kstars/ekos/profilewizard.cpp +++ b/kstars/ekos/profilewizard.cpp @@ -1,324 +1,328 @@ /* Ekos Profile Wizard Copyright (C) 2017 Jasem Mutlaq This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "profilewizard.h" #include #include #include #include #include "kstars.h" #include "auxiliary/kspaths.h" #include "ksnotification.h" #include "qMDNS.h" ProfileWizard::ProfileWizard() : QDialog(KStars::Instance()) { setupUi(this); #ifdef Q_OS_OSX setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint); #endif QPixmap im; if (im.load(KSPaths::locate(QStandardPaths::GenericDataLocation, "wzekos.png"))) wizardPix->setPixmap(im); remoteEquipmentSVG->load(QString(":/icons/pi.svg")); connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(buttonBox, &QDialogButtonBox::helpRequested, this, []() { KStars::Instance()->appHelpActivated(); }); connect(buttonBox, &QDialogButtonBox::clicked, this, [this](QAbstractButton * button) { if (button == buttonBox->button(QDialogButtonBox::Reset)) reset(); }); connect(discoverEkosB, &QPushButton::clicked, this, []() { QDesktopServices::openUrl(QUrl("http://www.indilib.org/about/ekos.html")); }); connect(videoTutorialsB, &QPushButton::clicked, this, []() { QDesktopServices::openUrl(QUrl("https://www.youtube.com/user/QAstronomy")); }); connect(INDIInfoB, &QPushButton::clicked, this, []() { QDesktopServices::openUrl(QUrl("http://indilib.org/about/discover-indi.html")); }); // Intro actions connect(introNextB, &QPushButton::clicked, this, [this]() { wizardContainer->setCurrentIndex(EQUIPMENT_LOCATION); }); // Equipment Location actions connect(localEquipmentB, SIGNAL(clicked()), this, SLOT(processLocalEquipment())); connect(remoteEquipmentB, &QPushButton::clicked, this, [this]() { wizardContainer->setCurrentIndex(REMOTE_EQUIPMENT_SELECTION); }); + equipmentStellarmateB->setIcon(QIcon(":/icons/stellarmate.svg")); connect(equipmentStellarmateB, &QPushButton::clicked, this, &ProfileWizard::processRemoteEquipmentSelection); + + equipmentAtikbaseB->setIcon(QIcon(":/icons/atikbase.svg")); connect(equipmentAtikbaseB, &QPushButton::clicked, this, &ProfileWizard::processRemoteEquipmentSelection); + connect(equipmentOtherB, &QPushButton::clicked, this, &ProfileWizard::processRemoteEquipmentSelection); // Remote Equipment Action connect(remoteEquipmentNextB, SIGNAL(clicked()), this, SLOT(processRemoteEquipment())); // StellarMate Equipment Action connect(stellarMateEquipmentNextB, SIGNAL(clicked()), this, SLOT(processPiEquipment())); #ifdef Q_OS_WIN // Auto Detect does not work on Windows yet for some reason. // Packet is sent correctly, but no replies are received from anything on the LAN outside of PC. stellarMateAutoDetectB->setEnabled(false); #else connect(PiAutoDetectB, SIGNAL(clicked()), this, SLOT(detectStellarMate())); #endif // Local Mac connect(useExternalINDIB, SIGNAL(clicked()), this, SLOT(processLocalMac())); connect(useInternalINDIB, SIGNAL(clicked()), this, SLOT(processLocalMac())); // Create Profile connect(createProfileB, SIGNAL(clicked()), this, SLOT(createProfile())); } void ProfileWizard::reset() { useInternalServer = true; useWebManager = false; useJoystick = false; useRemoteAstrometry = false; useSkySafari = false; useWatchDog = false; useGuiderType = INTERNAL_GUIDER; host.clear(); port = "7624"; wizardContainer->setCurrentIndex(INTRO); } void ProfileWizard::processLocalEquipment() { #if defined(Q_OS_OSX) wizardContainer->setCurrentIndex(MAC_LOCAL); #elif defined(Q_OS_WIN) wizardContainer->setCurrentIndex(WINDOWS_LOCAL); #else useInternalServer = true; useJoystickCheck->setEnabled(true); useRemoteAstrometryCheck->setEnabled(false); useWatchDogCheck->setEnabled(false); useSkySafariCheck->setEnabled(true); wizardContainer->setCurrentIndex(CREATE_PROFILE); #endif } void ProfileWizard::processRemoteEquipment() { bool portOK = false; remotePortEdit->text().toInt(&portOK); if (portOK == false) { KSNotification::error(i18n("Invalid port.")); return; } if (remoteHostEdit->text().isEmpty()) { KSNotification::error(i18n("Host name cannot be empty.")); return; } useInternalServer = false; host = remoteHostEdit->text(); port = remotePortEdit->text(); if (webManagerNotSureB->isChecked()) { QTcpSocket socket; // Should probably make 8624 configurable too? socket.connectToHost(host, 8624); useWebManager = socket.waitForConnected(); } else useWebManager = webManagerYesR->isChecked(); useJoystickCheck->setEnabled(true); useRemoteAstrometryCheck->setEnabled(true); useWatchDogCheck->setEnabled(true); useSkySafariCheck->setEnabled(true); wizardContainer->setCurrentIndex(CREATE_PROFILE); } void ProfileWizard::processPiEquipment() { if (PiHost->text().isEmpty()) { KSNotification::error(i18n("Host name cannot be empty.")); return; } host = PiHost->text(); port = PiPort->text(); useInternalServer = false; useWebManager = true; useJoystickCheck->setEnabled(true); useRemoteAstrometryCheck->setEnabled(true); useWatchDogCheck->setEnabled(true); useSkySafariCheck->setEnabled(true); wizardContainer->setCurrentIndex(CREATE_PROFILE); } void ProfileWizard::processLocalMac() { QPushButton *button = qobject_cast(sender()); if (button == nullptr) return; host = "localhost"; port = "7624"; useInternalServer = (button == useInternalINDIB); useJoystickCheck->setEnabled(false); useRemoteAstrometryCheck->setEnabled(false); useWatchDogCheck->setEnabled(false); useSkySafariCheck->setEnabled(true); wizardContainer->setCurrentIndex(CREATE_PROFILE); } void ProfileWizard::createProfile() { if (profileNameEdit->text().isEmpty()) { KSNotification::error(i18n("Profile name cannot be empty.")); return; } useJoystick = useJoystickCheck->isEnabled() && useJoystickCheck->isChecked(); useWatchDog = useWatchDogCheck->isEnabled() && useWatchDogCheck->isChecked(); useSkySafari = useSkySafariCheck->isEnabled() && useSkySafariCheck->isChecked(); useRemoteAstrometry = useRemoteAstrometryCheck->isEnabled() && useRemoteAstrometryCheck->isChecked(); if (useInternalGuiderR->isChecked()) useGuiderType = INTERNAL_GUIDER; else if (usePHD2R->isChecked()) useGuiderType = PHD2_GUIDER; else useGuiderType = LIN_GUIDER; profileName = profileNameEdit->text(); if (useInternalServer) { host.clear(); port.clear(); } accept(); } QStringList ProfileWizard::selectedAuxDrivers() { QStringList auxList; if (useJoystick) auxList << "Joystick"; if (useWatchDog) auxList << "WatchDog"; if (useSkySafari) auxList << "SkySafari"; if (useRemoteAstrometry) auxList << "Astrometry"; return auxList; } int ProfileWizard::selectedExternalGuider() { return useGuiderType; } void ProfileWizard::detectStellarMate() { stellarMateDetectDialog = new QProgressDialog(this); stellarMateDetectDialog->setMinimum(0); stellarMateDetectDialog->setMaximum(0); stellarMateDetectDialog->setWindowTitle(i18n("Detecting StellarMate...")); stellarMateDetectDialog->setLabelText(i18n("Please wait while searching for StellarMate...")); stellarMateDetectDialog->show(); connect(stellarMateDetectDialog.data(), &QProgressDialog::canceled, [&]() { qMDNS::getInstance()->disconnect(); }); connect(qMDNS::getInstance(), SIGNAL(hostFound(QHostInfo)), this, SLOT(processHostInfo(QHostInfo))); QTimer::singleShot(120 * 1000, this, SLOT(detectStellarMateTimeout())); qMDNS::getInstance()->lookup("stellarmate"); } void ProfileWizard::processHostInfo(QHostInfo info) { PiHost->setText(info.hostName()); qMDNS::getInstance()->disconnect(); stellarMateDetectDialog->close(); } void ProfileWizard::detectStellarMateTimeout() { if (stellarMateDetectDialog->isHidden() == false) { KSNotification::error(i18n("Failed to detect any StellarMate gadget. Make sure it is powered and on the same network.")); stellarMateDetectDialog->close(); } } void ProfileWizard::processRemoteEquipmentSelection() { - QPushButton *button = qobject_cast(sender()); + QToolButton *button = qobject_cast(sender()); if (!button) return; if (button == equipmentStellarmateB) { PiHost->setText("stellarmate.local"); wizardContainer->setCurrentIndex(PI_EQUIPMENT); } else if (button == equipmentAtikbaseB) { PiHost->setText("atikbase.local"); wizardContainer->setCurrentIndex(PI_EQUIPMENT); } else { wizardContainer->setCurrentIndex(GENERIC_EQUIPMENT); } } diff --git a/kstars/ekos/profilewizard.ui b/kstars/ekos/profilewizard.ui index d870afdce..55d9079f8 100644 --- a/kstars/ekos/profilewizard.ui +++ b/kstars/ekos/profilewizard.ui @@ -1,1214 +1,1218 @@ ProfileWizard 0 0 651 366 0 0 16777215 366 Ekos Profile Wizard true 3 3 3 3 3 0 0 120 360 120 360 QFrame::Box true 3 0 0 16 16 16777215 16777215 0 0 0 12 <html><head/><body><p>Welcome to the <span style=" font-weight:600;">Ekos Profile Wizard</span></p><p>Ekos is the premier observatory control and automation platform. With Ekos, you can capture images and gather scientific data with ease. This Wizard will help you create your equipment profile. You will be asked to verify some basic information. </p><p>Please click <span style=" font-weight:600;">next</span> to continue. </p></body></html> true Qt::AlignJustify|Qt::AlignVCenter true Qt::Vertical 20 40 Qt::Horizontal 40 20 0 64 Next false Qt::Horizontal 40 20 Qt::Vertical 20 72 10 <html><head/><body><p><span style=" font-weight:600;">Online Resources:</span></p></body></html> Qt::Horizontal 40 20 0 64 What is INDI? false false false 0 64 Discover Ekos false false false 0 64 Video Tutorials false false false Qt::Horizontal 40 20 Arial Black 12 Where is your equipment connected? 0 0 Arial Black 12 Qt::ClickFocus Equipment is attached to this device .. 64 64 false false false 0 0 Arial Black 12 Qt::ClickFocus Equipment is attached to a remote device .. 64 64 false 0 0 Arial Black 12 <html><head/><body><p>Which <span style=" color:#ff5500;">remote</span> device is the equipment connected to?</p></body></html> - - + + 64 64 128 128 - StellarMate - - - - :/icons/stellarmate.svg - + AtikBase 48 48 + + Qt::ToolButtonTextUnderIcon + - - + + 64 64 128 128 - AtikBase + Other - - + + 64 64 128 128 - Other + StellarMate + + + + 48 + 48 + + + + Qt::ToolButtonTextUnderIcon 99 250 99 250 0 0 Arial Black 12 Enter the remote computer information: Host: Enter IP address or host name Port: 7624 Arial Black 12 <html><head/><body><p><a href="https://github.com/knro/indiwebmanager"><span style=" text-decoration: underline; color:#007af4;">INDI Web Manager</span></a> running on the Remote Computer?</p></body></html> true Yes No Not Sure true Qt::Horizontal 40 20 10 <html><head/><body><p><span style=" font-weight:600;">Tip</span>: <span style=" font-style:italic;">INDI Web Manager</span> is a service that runs on remote devices to help you start and stop INDI services remotely.</p></body></html> Qt::AlignJustify|Qt::AlignVCenter true Qt::Horizontal 40 20 0 64 Next false Qt::Horizontal 40 20 0 0 Arial Black 12 Enter host name and port. If you do not know, leave as is. true Host: stellarmate.local Enter IP address or host name false Auto Detect Port: 7624 Qt::Horizontal 40 20 0 64 Next false Qt::Horizontal 40 20 10 <html><head/><body><p>Using Ekos locally on Windows is not supported. You must connect to a remote gadget to control devices.</p></body></html> true Arial Black 14 Which INDI Server do you want to use? 0 0 Arial Black 12 Qt::ClickFocus Internal INDI Server .. 64 64 false 0 0 Arial Black 12 Qt::ClickFocus External INDI Server .. 64 64 false 10 <html><head/><body><p><span style=" font-weight:600;">Tip</span>: External INDI Server can be <a href="http://www.cloudmakers.eu/indiserver/"><span style=" text-decoration: underline; color:#007af4;">INDI Server for OSX</span></a> or an INDI Server launched manually locally. If unsure, select Internal INDI Server.</p></body></html> Qt::AlignJustify|Qt::AlignVCenter true 14 <html><head/><body><p>You're almost done...</p></body></html> Arial Black 12 <html><head/><body><p>What do you want to name your profile?</p></body></html> Profile: My Astro Gear Arial Black 12 <html><head/><body><p>Which guider application do you want to use?</p></body></html> Internal Guider true PHD2 Lin Guider Qt::Horizontal 40 20 10 <html><head/><body><p><span style=" font-weight:600;">Tip</span>: Internal Guider is recommended. Using external guider applications requires additional setup instructions outside the scope of Ekos.</p></body></html> Qt::AlignJustify|Qt::AlignVCenter true Arial Black 12 <html><head/><body><p>Do you want to select additional services?</p></body></html> false <html><head/><body><p>Use INDI Joystick driver to enable control of mounts, domes, and focusers with any compatible game pad.</p></body></html> Joystick false <html><head/><body><p>If the remote computer has astrometry.net installed, you can run the remote astrometry driver and use it to solve images in Ekos Align module.</p></body></html> Remote Astrometry false <html><head/><body><p>Use the INDI WatchDog driver. It monitors connection between your remote equipment and Ekos. If the communication is lost between the two, the WatchDog driver goes into safe mode and executes a shutdown procedure to protect your equipment.</p></body></html> Watch Dog <html><head/><body><p>If you plan to use SkySafari to monitor and/or control your mount, check this box to start INDI SkySafari Server. You can connect SkySafari to this server and it shall enable you to connect and control your mount. For more details, please check the <a href="http://indilib.org/devices/telescopes/skysafari.html"><span style=" text-decoration: underline; color:#007af4;">INDI SkySafari Documentation.</span></a></p></body></html> SkySafari Qt::Horizontal 40 20 0 64 14 Create Profile && Select Devices - + :/icons/AlignSuccess.svg:/icons/AlignSuccess.svg 64 64 false QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Reset QSvgWidget QWidget
qsvgwidget.h
1
- - - - +