From mutlaqja at ikarustech.com Wed Feb 1 06:31:21 2017
From: mutlaqja at ikarustech.com (Jasem Mutlaq)
Date: Wed, 1 Feb 2017 09:31:21 +0300
Subject: Improving comets and new meteor showers component
Message-ID:
Folks,
I added the 4th and I believe final GSoC project here:
https://community.kde.org/GSoC/2017/Ideas#Project:_Improving_Comets_and_new_Meteor_Showers_component
I still didn't get feedback for the first 3 projects, so hopefully we get
some participation now! I am working (almost) full time for KStars/INDI so
I can take in 3 or 4 projects comfortably but I usually take a couple of
weeks off in the summer for annual vacation so I'd appreciate having backup
(and even primary) mentor for these projects.
--
Best Regards,
Jasem Mutlaq
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From null at kde.org Wed Feb 1 07:18:23 2017
From: null at kde.org (Jasem Mutlaq)
Date: Wed, 01 Feb 2017 07:18:23 +0000
Subject: [websites/edu-kde-org] kstars: Update page for GSoC 2017
Message-ID:
Git commit 5541811e4f0d8c024041449262e048968375e903 by Jasem Mutlaq.
Committed on 01/02/2017 at 07:17.
Pushed by mutlaqja into branch 'master'.
Update page for GSoC 2017
CCMAIL:kstars-devel at kde.org
M +12 -9 kstars/gsoc.php
https://commits.kde.org/websites/edu-kde-org/5541811e4f0d8c024041449262e048968375e903
diff --git a/kstars/gsoc.php b/kstars/gsoc.php
index ab59fa8d..404f6df8 100644
--- a/kstars/gsoc.php
+++ b/kstars/gsoc.php
@@ -6,18 +6,18 @@
?>
Welcome prospective students!
-
KStars welcomes all prospective students planning on participating in GSoC 2016.
+
KStars welcomes all prospective students planning on participating in GSoC 2017.
-
By participating in Open Source projects such as KStars, you shall gain a considerable experience not only in terms of real world development practices in the software industry, but also improve your skills in planning, management, and communication. There are usually two/three slots available for KStars, so the competition to win is stiff! After a student is selected, he/she shall implement the selected project over the course of roughly three months with mid-term evaluations submitted to Google on the progress of the project's objectives.
+
By participating in Open Source projects such as KStars, you shall gain a considerable experience not only in terms of real world development practices in the software industry, but also improve your skills in planning, management, and communication. There are usually three/four slots available for KStars, so the competition to win is stiff! After a student is selected, he/she shall implement the selected project over the course of roughly three months with mid-term evaluations submitted to Google on the progress of the project's objectives.
-
You are expected to fully dedicate the GSoC 2016 summer period to the development of KStars. Specifically, the following is NOT accepted during the program duration:
+
You are expected to fully dedicate the GSoC 2017 summer period to the development of KStars. Specifically, the following is NOT accepted during the program duration:
Full/Part time job.
University summer course.
Internship.
Travel/Vacation.
-
GSoC 2016 should be treated as a full time job by the prospective student for the duration of the program.
+
GSoC 2017 should be treated as a full time job by the prospective student for the duration of the program. If you have any college examinations during the GSoC 2017 period they must be clearly indicated in the proposal.
Before any student is selected for any KStars GSoC project, they must demonstrate their ability to work in KStars/KDE/Qt environment as discussed in the next section.
@@ -26,16 +26,17 @@
To develop for KStars, you are expected to be well versed in the following areas:
C/C++
-
Qt
+
Algorithms, data structures, and design patterns.
+
Qt/QML
KDE
Since you selected KStars for your project, it is safe to assume you are interested in astronomy; Therefore, a background in Astronomy also helps in the development process. To prepare yourself for GSoC, perform the following steps:
-
Read KStars GSoC ideas: The KStars team compiled a few ideas for GSoC students. You need to carefully read all ideas and select which one best suit your interests and abilities. If none match your interest, you can propose a new idea pending the approval of KStars mentor.
+
Read KStars GSoC ideas: The KStars team compiled a few ideas for GSoC students. You need to carefully read all ideas and select which one best suit your interests and abilities. If none match your interest, you can propose a new idea pending the approval of KStars mentor.
Prepare your computer environment for KStars development:
-
Download and install a modern Linux distribution: While you can build KStars on any Linux distribution, it is recommended to install a modern KDE-based distribution such as Kubuntu 15.10/16.04.
+
Download and install a modern Linux distribution: While you can build KStars on any Linux distribution, it is recommended to install a modern KDE-based distribution such as Kubuntu 16.04 or later.
Download Qt Creator: Ensure to install all examples and documentation. Several examples are available online as well. Start with simple Hello World application to get familiar with Qt, and proceed with building GUI applications based on QWidget and QML.
Build GIT version of KStars. You should be able to open KStars project in Qt Creator. KDE applications using CMake build system. Go to File --> Open Project and select CMakelists.txt
@@ -49,15 +50,17 @@
-
Students are highly recommended to be actively involved in KStars before the GSoC official proposal submission date and evaluation.
+
Students are required to either implement one of junior jobs and/or resolve bugs to prove eligibility to participate in KStars. You need to be actively involved in KStars before the GSoC official proposal submission date and evaluation.
Communication
During the course of the GSoC project, you are expected to keep your mentor and the KStars developers informed throughout the project cycle:
First and foremost is KStars Developement mailing list: Use the mailing list for everything from inquiry, non-trivial code commits, and progress reports.
-
Developers sometimes hang out at IRC on #kde-kstars on irc.freenode.net, you can discuss a variety of topics with them subject to availability.
+
Developers sometimes hang out at Matrix KStars channel. You can discuss a variety of topics with them subject to availability.
+
While students are strongly encouraged to ask any development related questions via any communication channel above, you are expected to do your research before you ask. Repetitively asking trivial questions to mentors shows you have not performed your research well into the issue or lack basic problem-solving abilities. Therefore, research your issues then ask specific direct questions to the mailing list or mentors.
+
3 and simple averaging for the rest. Please note that invalid
values for currentHFR (-1) must be counted and passed to the focusing
algorithm since it is responsible for making decisions on how to correct
this.
Message-ID:
Git commit 989cae1a874efa4be31ba3b0acbbcb3b388581b6 by Jasem Mutlaq.
Committed on 04/02/2017 at 07:54.
Pushed by mutlaqja into branch 'master'.
Use sigmal clipping when focus frames count > 3 and simple averaging for the rest. Please note that invalid values for currentHFR (-1) must be counted and passed to the focusing algorithm since it is responsible for making decisions on how to correct this.
Also using read-only QLineEdit instead of QLabel because it looks better and users can copy the current absolute position from it.
CCMAIL:kstars-devel at kde.org
M +44 -14 kstars/ekos/focus/focus.cpp
M +13 -7 kstars/ekos/focus/focus.ui
https://commits.kde.org/kstars/989cae1a874efa4be31ba3b0acbbcb3b388581b6
diff --git a/kstars/ekos/focus/focus.cpp b/kstars/ekos/focus/focus.cpp
index 63dfbec4c..dab573dcd 100644
--- a/kstars/ekos/focus/focus.cpp
+++ b/kstars/ekos/focus/focus.cpp
@@ -1117,27 +1117,57 @@ void Focus::setCaptureComplete()
if (Options::focusLogging())
qDebug() << "Focus newFITS #" << HFRFrames.count()+1 << ": Current HFR " << currentHFR;
-
- if (currentHFR != -1)
- HFRFrames.append(currentHFR);
+ HFRFrames.append(currentHFR);
// Check if we need to average more than a single frame
if (HFRFrames.count() >= focusFramesSpin->value())
{
currentHFR=0;
- // Sort all HFRs
- qSort(HFRFrames.begin(), HFRFrames.end(), [](double a, double b){return a < b;});
- // Reject 10% outliers for frames > 3
- int cutOff=0;
- if (HFRFrames.count() > 3)
- cutOff = ceil(HFRFrames.count() * 0.1);
- for (int i=cutOff; i < HFRFrames.count()-cutOff; i++)
- currentHFR+= HFRFrames[i];
+ // Remove all -1
+ QMutableVectorIterator i(HFRFrames);
+ while (i.hasNext())
+ {
+ if (i.next() == -1)
+ i.remove();
+ }
+
+ if (HFRFrames.isEmpty())
+ currentHFR = -1;
+ else
+ {
+ // Perform simple sigma clipping if frames count > 3
+ if (HFRFrames.count() > 3)
+ {
+ // Sort all HFRs
+ std::sort(HFRFrames.begin(), HFRFrames.end());
+ const auto median = HFRFrames.size()%2 ? HFRFrames[HFRFrames.size() / 2]
+ : ((double)HFRFrames[HFRFrames.size() / 2 - 1] + HFRFrames[HFRFrames.size() / 2]) * .5;
+ const auto mean = std::accumulate(HFRFrames.begin(), HFRFrames.end(), .0) / HFRFrames.size();
+ double variance =0;
+ foreach(auto val, HFRFrames)
+ variance += (val-mean)*(val-mean);
+ const double stddev = sqrt(variance/HFRFrames.size());
+
+ // Reject those 2 sigma away from median
+ const double sigmaHigh = median + stddev*2;
+ const double sigmaLow = median - stddev*2;
+
+ QMutableVectorIterator i(HFRFrames);
+ while (i.hasNext())
+ {
+ auto val = i.next();
+ if (val > sigmaHigh || val < sigmaLow)
+ i.remove();
+ }
+ }
+
+ // Find average HFR
+ currentHFR = std::accumulate(HFRFrames.begin(), HFRFrames.end(), .0) / HFRFrames.size();
- currentHFR /= (HFRFrames.count() - (2 * cutOff));
+ HFRFrames.clear();
+ }
- HFRFrames.clear();
}
else
{
@@ -1147,7 +1177,7 @@ void Focus::setCaptureComplete()
emit newHFR(currentHFR);
- QString HFRText = QString("%1").arg(currentHFR, 0,'g', 3);
+ QString HFRText = QString("%1").arg(currentHFR, 0,'f', 2);
if (/*focusType == FOCUS_MANUAL && */ lastHFR == -1)
appendLogText(i18n("FITS received. No stars detected."));
diff --git a/kstars/ekos/focus/focus.ui b/kstars/ekos/focus/focus.ui
index 21a36ebc6..419995e87 100644
--- a/kstars/ekos/focus/focus.ui
+++ b/kstars/ekos/focus/focus.ui
@@ -146,6 +146,9 @@
false
+
+ Set desired absolute focus position
+ Set
@@ -162,18 +165,21 @@
0
+
+ Desired absolute focus position
+
-
-
- QFrame::Box
+
+
+ false
-
- QFrame::Sunken
+
+ Current absolute focuser position
-
-
+
+ true
From null at kde.org Sat Feb 4 07:57:04 2017
From: null at kde.org (Jasem Mutlaq)
Date: Sat, 04 Feb 2017 07:57:04 +0000
Subject: [kstars] kstars/ekos: This is the summary screen patch. It should
display HFR for focus, sigmas for RA and Dec in guiding,
and more uniform colors for the Progress Indicators. I used Mount indicator
as a guide. If they are doing their primary task,
they are green and if they are doing another task
Message-ID:
Git commit 6481dcec7ade05b1f7d3c44c48550f3286913d70 by Jasem Mutlaq, on behalf of Robert Lancaste.
Committed on 04/02/2017 at 06:48.
Pushed by mutlaqja into branch 'master'.
This is the summary screen patch. It should display HFR for focus, sigmas for RA and Dec in guiding, and more uniform colors for the Progress Indicators. I used Mount indicator as a guide. If they are doing their primary task, they are green and if they are doing another task
to prepare they are the target color. I also updated it so that if you have the autofocus/focus monitor option enabled during capture you will not only get a new star image, but also a new profile and a new hfr.
In addition during the capture process because the focus is being monitored, it appears with a green indicator. If autofocus is happening it is a red indicator and if there is nothing going on it is blank.
CCMAIL:kstars-devel at kde.org
M +1 -1 kstars/ekos/ekos.h
M +60 -8 kstars/ekos/ekosmanager.cpp
M +2 -0 kstars/ekos/ekosmanager.h
M +101 -2 kstars/ekos/ekosmanager.ui
M +8 -9 kstars/ekos/focus/focus.cpp
M +0 -2 kstars/ekos/focus/focus.h
M +1 -0 kstars/ekos/guide/guide.cpp
M +1 -0 kstars/ekos/guide/guide.h
https://commits.kde.org/kstars/6481dcec7ade05b1f7d3c44c48550f3286913d70
diff --git a/kstars/ekos/ekos.h b/kstars/ekos/ekos.h
index f54814625..3cb39823f 100644
--- a/kstars/ekos/ekos.h
+++ b/kstars/ekos/ekos.h
@@ -17,7 +17,7 @@ namespace Ekos
// Guide States
static const QStringList guideStates = { I18N_NOOP("Idle"), I18N_NOOP("Aborted"), I18N_NOOP("Connected"), I18N_NOOP("Disconnected"), I18N_NOOP("Capturing"), I18N_NOOP("Subtracting"), I18N_NOOP("Subframing"),
- I18N_NOOP("Selecting star"), I18N_NOOP("Calibrating"), I18N_NOOP("Calibration error"), I18N_NOOP("Calibration successful"), I18N_NOOP("Guiding"),
+ I18N_NOOP("Selecting star"), I18N_NOOP("Calibrating"), I18N_NOOP("Calibration error"), I18N_NOOP("Calibrated"), I18N_NOOP("Guiding"),
I18N_NOOP("Suspended"), I18N_NOOP("Dithering"), I18N_NOOP("Dithering error"), I18N_NOOP("Dithering successful")};
typedef enum { GUIDE_IDLE, GUIDE_ABORTED, GUIDE_CONNECTED, GUIDE_DISCONNECTED, GUIDE_CAPTURE, GUIDE_DARK, GUIDE_SUBFRAME, GUIDE_STAR_SELECT, GUIDE_CALIBRATING, GUIDE_CALIBRATION_ERROR,
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index b2d0f4b3e..8549526e7 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -1419,8 +1419,10 @@ void EkosManager::initCapture()
captureProgress->setEnabled(true);
imageProgress->setEnabled(true);
- capturePI = new QProgressIndicator(captureProcess);
- captureStatusLayout->addWidget(capturePI);
+ if(!capturePI){
+ capturePI = new QProgressIndicator(captureProcess);
+ captureStatusLayout->insertWidget(0,capturePI);
+ }
foreach(ISD::GDInterface *device, findDevices(KSTARS_AUXILIARY))
{
@@ -1509,11 +1511,14 @@ void EkosManager::initFocus()
connect(focusProcess, SIGNAL(newStatus(Ekos::FocusState)), this, SLOT(setFocusStatus(Ekos::FocusState)));
connect(focusProcess, SIGNAL(newStarPixmap(QPixmap&)), this, SLOT(updateFocusStarPixmap(QPixmap&)));
connect(focusProcess, SIGNAL(newProfilePixmap(QPixmap&)), this, SLOT(updateFocusProfilePixmap(QPixmap&)));
+ connect(focusProcess, SIGNAL(newHFR(double)), this, SLOT(updateCurrentHFR(double)));
focusGroup->setEnabled(true);
- focusPI = new QProgressIndicator(focusProcess);
- focusStatusLayout->addWidget(focusPI);
+ if(!focusPI){
+ focusPI = new QProgressIndicator(focusProcess);
+ focusStatusLayout->insertWidget(0,focusPI);
+ }
if (captureProcess)
{
@@ -1546,6 +1551,15 @@ void EkosManager::initFocus()
}
+void EkosManager::updateCurrentHFR(double newHFR){
+ currentHFR->setText(QString("%1").arg(newHFR, 0,'f', 2)+" px");
+}
+
+void EkosManager::updateSigmas(double ra, double de){
+ errRA->setText(QString::number(ra, 'f', 2)+"\"");
+ errDEC->setText(QString::number(de, 'f', 2)+"\"");
+}
+
void EkosManager::initMount()
{
if (mountProcess)
@@ -1560,10 +1574,14 @@ void EkosManager::initMount()
connect(mountProcess, SIGNAL(newStatus(ISD::Telescope::TelescopeStatus)), this, SLOT(updateMountStatus(ISD::Telescope::TelescopeStatus)));
connect(mountProcess, SIGNAL(newTarget(QString)), mountTarget, SLOT(setText(QString)));
- mountPI = new QProgressIndicator(mountProcess);
- mountStatusLayout->addWidget(mountPI);
+ if(!mountPI){
+ mountPI = new QProgressIndicator(mountProcess);
+ mountStatusLayout->insertWidget(0,mountPI);
+ }
+
mountGroup->setEnabled(true);
+
if (captureProcess)
{
// Meridian Flip
@@ -1596,12 +1614,15 @@ void EkosManager::initGuide()
connect(guideProcess, SIGNAL(newLog()), this, SLOT(updateLog()));
guideGroup->setEnabled(true);
- guidePI = new QProgressIndicator(guideProcess);
- guideStatusLayout->addWidget(guidePI);
+ if(!guidePI){
+ guidePI = new QProgressIndicator(guideProcess);
+ guideStatusLayout->insertWidget(0,guidePI);
+ }
connect(guideProcess, SIGNAL(newStatus(Ekos::GuideState)), this, SLOT(updateGuideStatus(Ekos::GuideState)));
connect(guideProcess, SIGNAL(newStarPixmap(QPixmap&)), this, SLOT(updateGuideStarPixmap(QPixmap&)));
connect(guideProcess, SIGNAL(newProfilePixmap(QPixmap&)), this, SLOT(updateGuideProfilePixmap(QPixmap&)));
+ connect(guideProcess, SIGNAL(sigmasUpdated(double,double)), this, SLOT(updateSigmas(double,double)));
}
if (captureProcess)
@@ -1913,6 +1934,10 @@ void EkosManager::updateCaptureStatus(Ekos::CaptureState status)
if (status != Ekos::CAPTURE_ABORTED && status != Ekos::CAPTURE_COMPLETE)
{
+ if (status==Ekos::CAPTURE_CAPTURING)
+ capturePI->setColor(Qt::darkGreen);
+ else
+ capturePI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
if (capturePI->isAnimated() == false)
{
capturePI->startAnimation();
@@ -1926,6 +1951,11 @@ void EkosManager::updateCaptureStatus(Ekos::CaptureState status)
capturePI->stopAnimation();
countdownTimer.stop();
+ if(focusStatus->text()=="Complete"){
+ if (focusPI->isAnimated())
+ focusPI->stopAnimation();
+ }
+
imageProgress->setValue(0);
imageRemainingTime->setText("--:--:--");
overallRemainingTime->setText("--:--:--");
@@ -2006,9 +2036,16 @@ void EkosManager::setFocusStatus(Ekos::FocusState status)
if (status >= Ekos::FOCUS_PROGRESS)
{
+ focusPI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
if (focusPI->isAnimated() == false)
focusPI->startAnimation();
}
+ else if(status == Ekos::FOCUS_COMPLETE&&Options::enforceAutofocus()&&captureProcess->getActiveJobID()!=-1)
+ {
+ focusPI->setColor(Qt::darkGreen);
+ if (focusPI->isAnimated() == false)
+ focusPI->startAnimation();
+ }
else
{
if (focusPI->isAnimated())
@@ -2033,14 +2070,29 @@ void EkosManager::updateGuideStatus(Ekos::GuideState status)
break;
case Ekos::GUIDE_CALIBRATING:
+ guidePI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
+ if (guidePI->isAnimated() == false)
+ guidePI->startAnimation();
+ break;
case Ekos::GUIDE_GUIDING:
+ guidePI->setColor(Qt::darkGreen);
+ if (guidePI->isAnimated() == false)
+ guidePI->startAnimation();
+ break;
case Ekos::GUIDE_DITHERING:
+ guidePI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
+ if (guidePI->isAnimated() == false)
+ guidePI->startAnimation();
+ break;
case Ekos::GUIDE_DITHERING_SUCCESS:
+ guidePI->setColor(Qt::darkGreen);
if (guidePI->isAnimated() == false)
guidePI->startAnimation();
break;
default:
+ if (guidePI->isAnimated())
+ guidePI->stopAnimation();
break;
}
}
diff --git a/kstars/ekos/ekosmanager.h b/kstars/ekos/ekosmanager.h
index 37963175c..d8af917ac 100644
--- a/kstars/ekos/ekosmanager.h
+++ b/kstars/ekos/ekosmanager.h
@@ -205,11 +205,13 @@ private slots:
void setFocusStatus(Ekos::FocusState status);
void updateFocusStarPixmap(QPixmap &starPixmap);
void updateFocusProfilePixmap(QPixmap &profilePixmap);
+ void updateCurrentHFR(double newHFR);
// Guide Summary
void updateGuideStatus(Ekos::GuideState status);
void updateGuideStarPixmap(QPixmap &starPix);
void updateGuideProfilePixmap(QPixmap &profilePix);
+ void updateSigmas(double ra, double de);
private:
diff --git a/kstars/ekos/ekosmanager.ui b/kstars/ekos/ekosmanager.ui
index e150b537d..3340a7b8c 100644
--- a/kstars/ekos/ekosmanager.ui
+++ b/kstars/ekos/ekosmanager.ui
@@ -862,7 +862,7 @@
50
- 0
+ 20
@@ -1037,6 +1037,38 @@
+
+
+
+ HFR:
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 20
+ 20
+
+
+
+
+ 16777215
+ 20
+
+
+
+
+
+
+
@@ -1698,14 +1730,81 @@
Qt::Horizontal
+
+ QSizePolicy::Minimum
+
- 40
+ 120
+
+
+
+ σRA:
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 30
+ 20
+
+
+
+
+ 25
+ 20
+
+
+
+
+
+
+
+
+
+
+ σDEC:
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 30
+ 20
+
+
+
+
+ 25
+ 20
+
+
+
+
+
+
+
diff --git a/kstars/ekos/focus/focus.cpp b/kstars/ekos/focus/focus.cpp
index c56d7d076..63dfbec4c 100644
--- a/kstars/ekos/focus/focus.cpp
+++ b/kstars/ekos/focus/focus.cpp
@@ -93,7 +93,7 @@ Focus::Focus()
currentFilterIndex=-1;
minPos=1e6;
maxPos=0;
- frameNum=0;
+ HFRFrames.clear();
showFITSViewerB->setIcon(QIcon::fromTheme("kstars_fitsviewer", QIcon(":/icons/breeze/default/kstars_fitsviewer.svg")));
showFITSViewerB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
@@ -713,7 +713,7 @@ void Focus::start()
}
inAutoFocus = true;
- frameNum=0;
+ HFRFrames.clear();
resetButtons();
@@ -804,7 +804,7 @@ void Focus::stop(bool aborted)
starSelected= false;
minimumRequiredHFR = -1;
noStarCount = 0;
- frameNum=0;
+ HFRFrames.clear();
//maxHFR=1;
disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
@@ -1115,15 +1115,14 @@ void Focus::setCaptureComplete()
}
if (Options::focusLogging())
- qDebug() << "Focus newFITS #" << frameNum+1 << ": Current HFR " << currentHFR;
+ qDebug() << "Focus newFITS #" << HFRFrames.count()+1 << ": Current HFR " << currentHFR;
- frameNum++;
if (currentHFR != -1)
HFRFrames.append(currentHFR);
// Check if we need to average more than a single frame
- if (frameNum >= focusFramesSpin->value())
+ if (HFRFrames.count() >= focusFramesSpin->value())
{
currentHFR=0;
// Sort all HFRs
@@ -1136,9 +1135,8 @@ void Focus::setCaptureComplete()
for (int i=cutOff; i < HFRFrames.count()-cutOff; i++)
currentHFR+= HFRFrames[i];
- currentHFR /= (HFRFrames.count() - (2 * cutOff));
+ currentHFR /= (HFRFrames.count() - (2 * cutOff));
- frameNum =0;
HFRFrames.clear();
}
else
@@ -1395,6 +1393,7 @@ void Focus::setCaptureComplete()
else
{
setAutoFocusResult(true);
+ drawProfilePlot();
}
minimumRequiredHFR = -1;
@@ -2109,7 +2108,7 @@ void Focus::startFraming()
waitStarSelectTimer.stop();
inFocusLoop = true;
- frameNum=0;
+ HFRFrames.clear();
clearDataPoints();
diff --git a/kstars/ekos/focus/focus.h b/kstars/ekos/focus/focus.h
index ddbc52683..ddeff4660 100644
--- a/kstars/ekos/focus/focus.h
+++ b/kstars/ekos/focus/focus.h
@@ -391,8 +391,6 @@ private:
int HFRInc;
// If HFR decreasing? Well, good job. Once HFR start decreasing, we can start calculating HFR slope and estimating our next move.
int HFRDec;
- // How many frames have we captured thus far? Do we need to average them?
- uint8_t frameNum;
/****************************
* Absolute position focusers
diff --git a/kstars/ekos/guide/guide.cpp b/kstars/ekos/guide/guide.cpp
index ea7ed3e06..9ca80f400 100644
--- a/kstars/ekos/guide/guide.cpp
+++ b/kstars/ekos/guide/guide.cpp
@@ -1835,6 +1835,7 @@ void Guide::setAxisSigma(double ra, double de)
{
l_ErrRA->setText(QString::number(ra, 'f', 2));
l_ErrDEC->setText(QString::number(de, 'f', 2));
+ emit sigmasUpdated(ra,de);
}
void Guide::setAxisPulse(double ra, double de)
diff --git a/kstars/ekos/guide/guide.h b/kstars/ekos/guide/guide.h
index 16e4e5789..b5b24b94b 100644
--- a/kstars/ekos/guide/guide.h
+++ b/kstars/ekos/guide/guide.h
@@ -385,6 +385,7 @@ signals:
void newProfilePixmap(QPixmap &);
void newAxisDelta(double delta_ra, double delta_dec);
+ void sigmasUpdated(double ra, double dec);
void guideChipUpdated(ISD::CCDChip*);
private:
From daniel_mihai.leu at cti.pub.ro Sat Feb 4 11:34:17 2017
From: daniel_mihai.leu at cti.pub.ro (Daniel Leu)
Date: Sat, 04 Feb 2017 11:34:17 -0000
Subject: Review Request 122694: Fix Bug 303715 - scripts does not work with
kstars in french
In-Reply-To: <20150225103131.12884.35110@probe.kde.org>
References: <20150225103131.12884.35110@probe.kde.org>
Message-ID: <20170204113417.23300.50213@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122694/
-----------------------------------------------------------
(Updated Feb. 4, 2017, 11:34 a.m.)
Status
------
This change has been marked as submitted.
Review request for KStars and Jasem Mutlaq.
Repository: kstars
Description
-------
Arguments are translated into script and so it dows nothing. Used xi18n to fix it.
Diffs
-----
kstars/kstarsdbus.cpp e19ff49
Diff: https://git.reviewboard.kde.org/r/122694/diff/
Testing
-------
It compiles. Tested it and it works.
Thanks,
Daniel Leu
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From null at kde.org Sat Feb 4 13:01:58 2017
From: null at kde.org (Jasem Mutlaq)
Date: Sat, 04 Feb 2017 13:01:58 +0000
Subject: [kstars] kstars: Update color schemes to properly account for Dark
Palette option. It was only enabled for night vision scheme,
but if a user customizes the night vision scheme and saves it as a new
scheme then
Message-ID:
Git commit 849a505d31a43e2c182046e78d49f1f7e9b4ada1 by Jasem Mutlaq.
Committed on 04/02/2017 at 12:59.
Pushed by mutlaqja into branch 'master'.
Update color schemes to properly account for Dark Palette option. It was only enabled for night vision scheme, but if a user customizes the night vision scheme and saves it as a new scheme then
dark palette is no longer used because it was hard-coded to night vision scheme only. Now it is a separate option that is saved to both config and color scheme files. Please test.
CCMAIL:kstars-devel at kde.org
M +35 -7 kstars/auxiliary/colorscheme.cpp
M +10 -1 kstars/auxiliary/colorscheme.h
M +1 -1 kstars/data/chart.colors
M +1 -1 kstars/data/classic.colors
M +1 -1 kstars/data/moonless-night.colors
M +1 -1 kstars/data/night.colors
M +12 -8 kstars/kstarsdbus.cpp
M +9 -0 kstars/options/opscolors.cpp
M +1 -0 kstars/options/opscolors.h
M +87 -17 kstars/options/opscolors.ui
https://commits.kde.org/kstars/849a505d31a43e2c182046e78d49f1f7e9b4ada1
diff --git a/kstars/auxiliary/colorscheme.cpp b/kstars/auxiliary/colorscheme.cpp
index 9c926762e..752f1e6f0 100644
--- a/kstars/auxiliary/colorscheme.cpp
+++ b/kstars/auxiliary/colorscheme.cpp
@@ -101,6 +101,7 @@ ColorScheme::ColorScheme() : FileName() {
//Default values for integer variables:
StarColorMode = 0;
StarColorIntensity = 4;
+ DarkPalette = 0;
}
void ColorScheme::appendItem(QString key, QString name, QString def) {
@@ -178,17 +179,34 @@ bool ColorScheme::load( const QString &name ) {
//If we reach here, the file should have been successfully opened
QTextStream stream( &file );
- //first line is the star-color mode and star color intensity
+ //first line is the star-color mode and star color intensity and dark palette
QString line = stream.readLine();
- int newmode = line.left(1).toInt( &ok );
- if( ok )
- setStarColorMode( newmode );
- if( line.contains(':') ) {
- int newintens = line.mid( line.indexOf(':')+1, 2 ).toInt( &ok );
+ QStringList modes = line.split(":");
+
+ // Star Color Mode
+ if (modes.count() > 0)
+ {
+ int newmode = modes[0].toInt( &ok );
+ if( ok )
+ setStarColorMode( newmode );
+ }
+
+ // Star Intensity
+ if (modes.count() > 1)
+ {
+ int newintens = modes[1].toInt( &ok );
if ( ok )
setStarColorIntensity( newintens );
}
+ // Dark Palette
+ if (modes.count() > 2)
+ {
+ int newintens = modes[2].toInt( &ok );
+ if ( ok )
+ setDarkPalette(newintens == 1);
+ }
+
//More flexible method for reading in color values. Any order is acceptable, and
//missing entries are ignored.
while ( !stream.atEnd() ) {
@@ -254,7 +272,7 @@ bool ColorScheme::save( const QString &name ) {
return false;
} else {
QTextStream stream( &file );
- stream << StarColorMode << ":" << StarColorIntensity << endl;
+ stream << StarColorMode << ":" << StarColorIntensity << ":" << DarkPalette << endl;
foreach(const QString& key, KeyName )
stream << Palette[ key ] << " :" << key << endl;
@@ -298,6 +316,7 @@ void ColorScheme::loadFromConfig() {
setColor( KeyName.at(i), cg.readEntry( KeyName.at(i).toUtf8().constData(), Default.at( i ) ) );
setStarColorModeIntensity( cg.readEntry( "StarColorMode", 0 ), cg.readEntry( "StarColorIntensity", 5 ) );
+ setDarkPalette(cg.readEntry("DarkAppColors", false));
FileName = cg.readEntry( "ColorSchemeFile", "moonless-night.colors" );
}
@@ -312,6 +331,7 @@ void ColorScheme::saveToConfig() {
cg.writeEntry( "StarColorMode", starColorMode() );
cg.writeEntry( "StarColorIntensity", starColorIntensity() );
cg.writeEntry( "ColorSchemeFile", FileName);
+ cg.writeEntry( "DarkAppColors", useDarkPalette());
}
void ColorScheme::setStarColorMode( int mode ) {
@@ -322,6 +342,14 @@ void ColorScheme::setStarColorMode( int mode ) {
#endif
}
+void ColorScheme::setDarkPalette( bool enable ) {
+ DarkPalette = enable ? 1 : 0 ;
+ Options::setDarkAppColors(enable);
+#ifndef KSTARS_LITE
+ SkyQPainter::initStarImages();
+#endif
+}
+
void ColorScheme::setStarColorIntensity( int intens ) {
StarColorIntensity = intens;
Options::setStarColorIntensity( intens );
diff --git a/kstars/auxiliary/colorscheme.h b/kstars/auxiliary/colorscheme.h
index ffff1a61f..919d429cf 100644
--- a/kstars/auxiliary/colorscheme.h
+++ b/kstars/auxiliary/colorscheme.h
@@ -104,6 +104,9 @@ public:
/** @return the star color mode used by the color scheme */
int starColorMode() const { return StarColorMode; }
+ /** @return True if dark palette colors are used by the color scheme */
+ bool useDarkPalette() const { return DarkPalette == 1; }
+
/** @return the star color intensity value used by the color scheme */
int starColorIntensity() const { return StarColorIntensity; }
@@ -123,11 +126,17 @@ public:
*/
void setStarColorModeIntensity( int mode, int intens);
+ /**
+ * @brief setDarkPalette Set whether the color schemes uses dark palette
+ * @param enable True to use dark palette. False to use application default palette
+ */
+ void setDarkPalette( bool enable );
+
private:
/** Append items to all string lists. */
void appendItem(QString key, QString name, QString def);
- int StarColorMode, StarColorIntensity;
+ int StarColorMode, StarColorIntensity, DarkPalette;
QString FileName;
QStringList KeyName, Name, Default;
QMap Palette;
diff --git a/kstars/data/chart.colors b/kstars/data/chart.colors
index 7ca5dbadc..4b0d718f2 100644
--- a/kstars/data/chart.colors
+++ b/kstars/data/chart.colors
@@ -1,4 +1,4 @@
-2:0 StarColorMode:StarColorIntensity
+2:0:0
#FFFFFF :SkyColor
#00FF00 :MessColor
#006666 :NGCColor
diff --git a/kstars/data/classic.colors b/kstars/data/classic.colors
index 2b2441651..25e426185 100644
--- a/kstars/data/classic.colors
+++ b/kstars/data/classic.colors
@@ -1,4 +1,4 @@
-0:4 StarColorMode:StarColorIntensity
+0:4:0
#000022 :SkyColor
#00FF00 :MessColor
#006666 :NGCColor
diff --git a/kstars/data/moonless-night.colors b/kstars/data/moonless-night.colors
index 0a48f76d7..0c985e63d 100644
--- a/kstars/data/moonless-night.colors
+++ b/kstars/data/moonless-night.colors
@@ -1,4 +1,4 @@
-0:4
+0:4:0
#000000 :SkyColor
#008f00 :MessColor
#006666 :NGCColor
diff --git a/kstars/data/night.colors b/kstars/data/night.colors
index 85cf938b8..470561cfb 100644
--- a/kstars/data/night.colors
+++ b/kstars/data/night.colors
@@ -1,4 +1,4 @@
-1:0 StarColorMode:StarColorIntensity
+1:0:1
#000000 :SkyColor
#CC0099 :MessColor
#CC0099 :NGCColor
diff --git a/kstars/kstarsdbus.cpp b/kstars/kstarsdbus.cpp
index 5deab5ae6..22db62536 100644
--- a/kstars/kstarsdbus.cpp
+++ b/kstars/kstarsdbus.cpp
@@ -400,13 +400,16 @@ void KStars::setColor( const QString &name, const QString &value ) {
void KStars::loadColorScheme( const QString &name ) {
bool ok = data()->colorScheme()->load( name );
- QString filename = data()->colorScheme()->fileName();
+ //QString filename = data()->colorScheme()->fileName();
- if ( ok ) {
+ if ( ok )
+ {
//set the application colors for the Night Vision scheme
- if ( Options::darkAppColors() == false && filename == "night.colors" ) {
- Options::setDarkAppColors( true );
- OriginalPalette = QApplication::palette();
+ //if ( Options::darkAppColors() == false && filename == "night.colors" ) {
+ //Options::setDarkAppColors( true );
+ if (Options::darkAppColors())
+ {
+ //OriginalPalette = QApplication::palette();
QApplication::setPalette( DarkPalette );
//Note: This uses style sheets to set the dark colors, this is cross platform. Palettes have a different behavior on OS X and Windows as opposed to Linux.
//It might be a good idea to use stylesheets in the future instead of palettes but this will work for now for OS X.
@@ -437,9 +440,10 @@ void KStars::loadColorScheme( const QString &name ) {
"");
#endif
}
-
- if ( Options::darkAppColors() && filename != "night.colors" ) {
- Options::setDarkAppColors( false );
+ else
+ {
+ //if ( Options::darkAppColors() && filename != "night.colors" ) {
+ //Options::setDarkAppColors( false );
QApplication::setPalette( OriginalPalette );
#ifdef Q_OS_OSX
qApp->setStyleSheet("QRoundProgressBar { background-color: rgb(208,208,208) }" \
diff --git a/kstars/options/opscolors.cpp b/kstars/options/opscolors.cpp
index 62c1e9368..6fb80245b 100644
--- a/kstars/options/opscolors.cpp
+++ b/kstars/options/opscolors.cpp
@@ -102,9 +102,12 @@ OpsColors::OpsColors()
else
kcfg_StarColorIntensity->setEnabled( true );
+ kcfg_DarkAppColors->setChecked(KStarsData::Instance()->colorScheme()->useDarkPalette());
+
connect( ColorPalette, SIGNAL( itemClicked( QListWidgetItem* ) ), this, SLOT( newColor( QListWidgetItem* ) ) );
connect( kcfg_StarColorIntensity, SIGNAL( valueChanged( int ) ), this, SLOT( slotStarColorIntensity( int ) ) );
connect( kcfg_StarColorMode, SIGNAL( activated( int ) ), this, SLOT( slotStarColorMode( int ) ) );
+ connect( kcfg_DarkAppColors, SIGNAL(toggled(bool)), this, SLOT(slotDarkAppColors(bool)));
connect( PresetBox, SIGNAL( currentRowChanged( int ) ), this, SLOT( slotPreset( int ) ) );
connect( AddPreset, SIGNAL( clicked() ), this, SLOT( slotAddPreset() ) );
connect( RemovePreset, SIGNAL( clicked() ), this, SLOT( slotRemovePreset() ) );
@@ -165,6 +168,7 @@ bool OpsColors::setColors( const QString &filename ) {
kcfg_StarColorMode->setCurrentIndex( KStarsData::Instance()->colorScheme()->starColorMode() );
kcfg_StarColorIntensity->setValue( KStarsData::Instance()->colorScheme()->starColorIntensity() );
+ kcfg_DarkAppColors->setChecked(KStarsData::Instance()->colorScheme()->useDarkPalette());
for ( unsigned int i=0; i < KStarsData::Instance()->colorScheme()->numberOfColors(); ++i ) {
QColor itemColor( KStarsData::Instance()->colorScheme()->colorAt( i ) );
@@ -274,4 +278,9 @@ void OpsColors::slotStarColorIntensity( int i ) {
KStarsData::Instance()->colorScheme()->setStarColorIntensity( i );
}
+void OpsColors::slotDarkAppColors(bool enable)
+{
+ KStarsData::Instance()->colorScheme()->setDarkPalette(enable);
+}
+
diff --git a/kstars/options/opscolors.h b/kstars/options/opscolors.h
index fca9a4fe6..800b2b0d7 100644
--- a/kstars/options/opscolors.h
+++ b/kstars/options/opscolors.h
@@ -52,6 +52,7 @@ private slots:
void slotRemovePreset();
void slotStarColorMode( int );
void slotStarColorIntensity( int );
+ void slotDarkAppColors(bool);
private:
bool setColors( const QString &filename );
diff --git a/kstars/options/opscolors.ui b/kstars/options/opscolors.ui
index abcb6d551..c2fee6962 100644
--- a/kstars/options/opscolors.ui
+++ b/kstars/options/opscolors.ui
@@ -6,16 +6,25 @@
00
- 590
- 445
+ 447
+ 336
- 6
+ 5
-
- 8
+
+ 5
+
+
+ 5
+
+
+ 5
+
+
+ 5
@@ -24,10 +33,19 @@
- 6
+ 5
+
+
+ 5
+
+
+ 5
-
- 8
+
+ 5
+
+
+ 5
@@ -42,9 +60,18 @@
- 6
+ 3
+
+
+ 0
+
+
+ 0
+
+
+ 0
-
+ 0
@@ -80,7 +107,16 @@
6
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ 0
@@ -108,9 +144,18 @@
- 6
+ 3
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ 0
@@ -132,6 +177,13 @@
+
+
+
+ Use Dark Palette
+
+
+
@@ -142,10 +194,19 @@
- 6
+ 5
-
- 8
+
+ 5
+
+
+ 5
+
+
+ 5
+
+
+ 5
@@ -159,7 +220,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ 0
From null at kde.org Sat Feb 4 14:14:27 2017
From: null at kde.org (Jasem Mutlaq)
Date: Sat, 04 Feb 2017 14:14:27 +0000
Subject: [kstars] kstars/ekos: This patch will disable key buttons while
slewing to address a problem I have had many times when using kstars,
particularly with the align module.
Message-ID:
Git commit 6f4da3394457e1e2c97627a136af8119f2fda275 by Jasem Mutlaq, on behalf of Robert Lancaster.
Committed on 04/02/2017 at 14:13.
Pushed by mutlaqja into branch 'master'.
This patch will disable key buttons while slewing to address a problem I have had many times when using kstars, particularly with the align module.
I often hit the button before it is ready because there is no definitive indication on the screen that it has arrived at the location. So I wrote some code that will disable the buttons in question while the telescope is slewing and then re-enables them afterward.
CCMAIL:kstars-devel at kde.org
M +2 -0 kstars/ekos/capture/capture.h
M +24 -0 kstars/ekos/ekosmanager.cpp
https://commits.kde.org/kstars/6f4da3394457e1e2c97627a136af8119f2fda275
diff --git a/kstars/ekos/capture/capture.h b/kstars/ekos/capture/capture.h
index c6960d248..e6fb4a98d 100644
--- a/kstars/ekos/capture/capture.h
+++ b/kstars/ekos/capture/capture.h
@@ -255,6 +255,8 @@ public:
/* Capture */
void updateSequencePrefix( const QString &newPrefix, const QString &dir);
+ bool currentCCDHasVideo() {return currentCCD->hasVideoStream();}
+
public slots:
/** \addtogroup CaptureDBusInterface
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index 89d7e0403..8616c11f4 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -1897,11 +1897,35 @@ void EkosManager::updateMountStatus(ISD::Telescope::TelescopeStatus status)
mountPI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
if (mountPI->isAnimated() == false)
mountPI->startAnimation();
+ //This code will disable a bunch of buttons in the Ekos modules while the scope is slewing.
+ //Pressing these buttons while slewing will cause problems in the images that result because either the stars will be streaked or they won't be the right stars.
+ //It might be better to do this in each module, but this is more centralized.
+ alignProcess->solveB->setEnabled(false);
+ alignProcess->loadSlewB->setEnabled(false);
+ captureProcess->previewB->setEnabled(false);
+ captureProcess->liveVideoB->setEnabled(false);
+ captureProcess->startB->setEnabled(false);
+ focusProcess->captureB->setEnabled(false);
+ focusProcess->startFocusB->setEnabled(false);
+ focusProcess->startLoopB->setEnabled(false);
+ guideProcess->captureB->setEnabled(false);
+ guideProcess->calibrateB->setEnabled(false);
break;
case ISD::Telescope::MOUNT_TRACKING:
mountPI->setColor(Qt::darkGreen);
if (mountPI->isAnimated() == false)
mountPI->startAnimation();
+ //This will re-enabled the disabled buttons
+ alignProcess->solveB->setEnabled(true);
+ alignProcess->loadSlewB->setEnabled(true);
+ captureProcess->previewB->setEnabled(true);
+ captureProcess->liveVideoB->setEnabled(captureProcess->currentCCDHasVideo());
+ captureProcess->startB->setEnabled(true);
+ focusProcess->captureB->setEnabled(true);
+ focusProcess->startFocusB->setEnabled(true);
+ focusProcess->startLoopB->setEnabled(true);
+ guideProcess->captureB->setEnabled(true);
+ guideProcess->calibrateB->setEnabled(true);
break;
default:
From null at kde.org Sun Feb 5 06:14:45 2017
From: null at kde.org (Jasem Mutlaq)
Date: Sun, 05 Feb 2017 06:14:45 +0000
Subject: [kstars] kstars: This includes 3 small fixes.
Message-ID:
Git commit 960f016e5383c22ca759e200b6cab136a671f3dd by Jasem Mutlaq, on behalf of Robert Lancaster.
Committed on 05/02/2017 at 06:13.
Pushed by mutlaqja into branch 'master'.
This includes 3 small fixes.
CCMAIL:kstars-devel at kde.org
M +5 -5 kstars/fitsviewer/fitsview.cpp
M +4 -1 kstars/indi/indiccd.cpp
M +1 -0 kstars/options/opscolors.cpp
https://commits.kde.org/kstars/960f016e5383c22ca759e200b6cab136a671f3dd
diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp
index d84db6f26..e7124b4b8 100644
--- a/kstars/fitsviewer/fitsview.cpp
+++ b/kstars/fitsviewer/fitsview.cpp
@@ -289,6 +289,11 @@ void FITSLabel::mouseMoveEvent(QMouseEvent *e)
QToolTip::hideText();
}
+ double HFR = image->getImageData()->getHFR(x, y);
+
+ if (HFR > 0)
+ QToolTip::showText(e->globalPos(), i18nc("Half Flux Radius", "HFR: %1", QString::number(HFR, 'g' , 3)), this);
+
//setCursor(Qt::CrossCursor);
e->accept();
@@ -382,11 +387,6 @@ void FITSLabel::mousePressEvent(QMouseEvent *e)
if (e->buttons() & Qt::LeftButton&&image->getMouseMode()==FITSView::selectMouse)
{
emit pointSelected(x, y);
-
- double HFR = image->getImageData()->getHFR(x, y);
-
- if (HFR > 0)
- QToolTip::showText(e->globalPos(), i18nc("Half Flux Radius", "HFR: %1", QString::number(HFR, 'g' , 3)), this);
}
}
diff --git a/kstars/indi/indiccd.cpp b/kstars/indi/indiccd.cpp
index 80ba85a05..fb0196220 100644
--- a/kstars/indi/indiccd.cpp
+++ b/kstars/indi/indiccd.cpp
@@ -1446,7 +1446,10 @@ void CCD::processBLOB(IBLOB* bp)
return;
}
} else{
- targetChip->setImageView(KStars::Instance()->ekosManager()->getPreviewView(),FITS_NORMAL);
+ if(previewView){
+ targetChip->setImageView(previewView,FITS_NORMAL);
+ emit newImage(previewView->getDisplayImage(), targetChip);
+ }
}
}
break;
diff --git a/kstars/options/opscolors.cpp b/kstars/options/opscolors.cpp
index 6fb80245b..4a88e8c14 100644
--- a/kstars/options/opscolors.cpp
+++ b/kstars/options/opscolors.cpp
@@ -281,6 +281,7 @@ void OpsColors::slotStarColorIntensity( int i ) {
void OpsColors::slotDarkAppColors(bool enable)
{
KStarsData::Instance()->colorScheme()->setDarkPalette(enable);
+ KStars::Instance()->loadColorScheme( KStars::Instance()->data()->colorScheme()->fileName());
}
From null at kde.org Sun Feb 5 07:21:35 2017
From: null at kde.org (Jasem Mutlaq)
Date: Sun, 05 Feb 2017 07:21:35 +0000
Subject: [kstars] kstars: + Adding Meridian flip notifications (started,
completed, failed)
Message-ID:
Git commit 12c3d9497e73a0790a824bc7667ac37d9fad271a by Jasem Mutlaq.
Committed on 05/02/2017 at 07:20.
Pushed by mutlaqja into branch 'master'.
+ Adding Meridian flip notifications (started, completed, failed)
+ Fixed park/unpark notifications
CCMAIL:kstars-devel at kde.org
M +7 -0 kstars/ekos/capture/capture.cpp
M +45 -23 kstars/indi/inditelescope.cpp
M +5 -3 kstars/indi/inditelescope.h
M +14 -0 kstars/kstars.notifyrc
https://commits.kde.org/kstars/12c3d9497e73a0790a824bc7667ac37d9fad271a
diff --git a/kstars/ekos/capture/capture.cpp b/kstars/ekos/capture/capture.cpp
index 91ca33d2f..af51fdaae 100644
--- a/kstars/ekos/capture/capture.cpp
+++ b/kstars/ekos/capture/capture.cpp
@@ -3096,6 +3096,8 @@ void Capture::processTelescopeNumber(INumberVectorProperty *nvp)
appendLogText(i18n("Telescope completed the meridian flip."));
+ KNotification::event( QLatin1String( "MeridianFlipCompleted" ) , i18n("Meridian flip is successfully completed"));
+
if (resumeAlignmentAfterFlip == true)
{
appendLogText(i18n("Performing post flip re-alignment..."));
@@ -3188,6 +3190,8 @@ bool Capture::checkMeridianFlip()
appendLogText(i18n("Current hour angle %1 hours exceeds meridian flip limit of %2 hours. Auto meridian flip is initiated.", QString::number(currentHA, 'f', 2), meridianHours->value()));
meridianFlipStage = MF_INITIATED;
+ KNotification::event( QLatin1String( "MeridianFlipStarted" ) , i18n("Meridian flip started"));
+
// Suspend guiding first before commanding a meridian flip
//if (isAutoGuiding && currentCCD->getChip(ISD::CCDChip::GUIDE_CCD) == guideChip)
// emit suspendGuiding(false);
@@ -3221,6 +3225,9 @@ void Capture::checkMeridianFlipTimeout()
if (meridianFlipStage < MF_ALIGNING)
{
appendLogText(i18n("Telescope meridian flip timed out."));
+
+ KNotification::event( QLatin1String( "MeridianFlipFailed" ) , i18n("Meridian flip failed"));
+
abort();
}
}
diff --git a/kstars/indi/inditelescope.cpp b/kstars/indi/inditelescope.cpp
index 4aaa2fcdd..5835a506f 100644
--- a/kstars/indi/inditelescope.cpp
+++ b/kstars/indi/inditelescope.cpp
@@ -27,10 +27,8 @@ Telescope::Telescope(GDInterface *iPtr) : DeviceDecorator(iPtr)
{
dType = KSTARS_TELESCOPE;
minAlt=-1;
- maxAlt=-1;
- IsParked=false;
- EqCoordPreviousState=IPS_IDLE;
- LastParkingState=IPS_IDLE;
+ maxAlt=-1;
+ EqCoordPreviousState=IPS_IDLE;
}
Telescope::~Telescope()
@@ -95,7 +93,10 @@ void Telescope::registerProperty(INDI::Property *prop)
ISwitch *sp = IUFindSwitch(svp, "PARK");
if (sp)
{
- IsParked = ( (sp->s == ISS_ON) && svp->s == IPS_OK);
+ if ( (sp->s == ISS_ON) && svp->s == IPS_OK)
+ parkStatus = PARK_PARKED;
+ else if ( (sp->s == ISS_OFF) && svp->s == IPS_OK)
+ parkStatus = PARK_UNPARKED;
}
}
}
@@ -120,7 +121,7 @@ void Telescope::processNumber(INumberVectorProperty *nvp)
}
else if (EqCoordPreviousState == IPS_BUSY && nvp->s == IPS_OK)
{
- KNotification::event( QLatin1String( "SlewComplete" ) , i18n("Mount arrived at target location"));
+ KNotification::event( QLatin1String( "SlewCompleted" ) , i18n("Mount arrived at target location"));
}
EqCoordPreviousState = nvp->s;
@@ -165,23 +166,49 @@ void Telescope::processSwitch(ISwitchVectorProperty *svp)
ISwitch *sp = IUFindSwitch(svp, "PARK");
if (sp)
{
- IsParked = ( (sp->s == ISS_ON) && svp->s == IPS_OK);
+ if (svp->s == IPS_ALERT)
+ {
+ // If alert, set park status to whatever it was opposite to. That is, if it was parking and failed
+ // then we set status to unparked since it did not successfully complete parking.
+ if (parkStatus == PARK_PARKING)
+ parkStatus = PARK_UNPARKED;
+ else if (parkStatus == PARK_UNPARKING)
+ parkStatus = PARK_PARKED;
+
+ KNotification::event( QLatin1String( "MountParkingFailed" ) , i18n("Mount parking failed"));
+ }
+ else if (svp->s == IPS_BUSY && sp->s == ISS_ON && parkStatus != PARK_PARKING)
+ {
+ parkStatus = PARK_PARKING;
+ KNotification::event( QLatin1String( "MountParking" ) , i18n("Mount parking is in progress"));
+ }
+ else if (svp->s == IPS_BUSY && sp->s == ISS_OFF && parkStatus != PARK_UNPARKING)
+ {
+ parkStatus = PARK_UNPARKING;
+ KNotification::event( QLatin1String( "MountUnParking" ) , i18n("Mount unparking is in progress"));
+ }
+ else if (svp->s == IPS_OK && sp->s == ISS_ON && parkStatus != PARK_PARKED)
+ {
+ parkStatus = PARK_PARKED;
+ KNotification::event( QLatin1String( "MountParked" ) , i18n("Mount parked"));
+ }
+ else if (svp->s == IPS_OK && sp->s == ISS_OFF && parkStatus != PARK_UNPARKED)
+ {
+ parkStatus = PARK_UNPARKED;
+ KNotification::event( QLatin1String( "MountUnparked" ) , i18n("Mount unparked"));
+ }
}
- if (svp->s == IPS_ALERT)
- KNotification::event( QLatin1String( "ParkingMountFailed" ) , i18n("Mount parking failed"));
- else if (svp->s == IPS_BUSY && LastParkingState != IPS_BUSY)
- KNotification::event( QLatin1String( "ParkingMount" ) , i18n("Mount parking is in progress"));
- else if (LastParkingState == IPS_BUSY && IsParked)
- KNotification::event( QLatin1String( "MountParked" ) , i18n("Mount parked"));
- else if (LastParkingState == IPS_BUSY && IsParked == false)
- KNotification::event( QLatin1String( "MountUnparked" ) , i18n("Mount unparked"));
-
- LastParkingState = svp->s;
-
emit switchUpdated(svp);
return;
}
+ else if (!strcmp(svp->name, "TELESCOPE_ABORT_MOTION"))
+ {
+ if (svp->s == IPS_OK)
+ {
+ KNotification::event( QLatin1String( "MountAborted" ) , i18n("Mount motion was aborted"));
+ }
+ }
DeviceDecorator::processSwitch(svp);
}
@@ -733,11 +760,6 @@ void Telescope::setAltLimits(double minAltitude, double maxAltitude)
maxAlt=maxAltitude;
}
-bool Telescope::isParked()
-{
- return IsParked;
-}
-
Telescope::TelescopeStatus Telescope::getStatus()
{
INumberVectorProperty *EqProp(NULL);
diff --git a/kstars/indi/inditelescope.h b/kstars/indi/inditelescope.h
index 5c202fc13..068d9129a 100644
--- a/kstars/indi/inditelescope.h
+++ b/kstars/indi/inditelescope.h
@@ -34,6 +34,7 @@ public:
typedef enum { MOTION_WEST, MOTION_EAST } TelescopeMotionWE;
typedef enum { MOTION_START, MOTION_STOP } TelescopeMotionCommand;
typedef enum { MOUNT_IDLE, MOUNT_SLEWING, MOUNT_TRACKING, MOUNT_PARKING, MOUNT_PARKED, MOUNT_ERROR } TelescopeStatus;
+ typedef enum { PARK_UNKNOWN, PARK_PARKED, PARK_PARKING, PARK_UNPARKING, PARK_UNPARKED } ParkStatus;
void registerProperty(INDI::Property *prop);
void processSwitch(ISwitchVectorProperty *svp);
@@ -53,7 +54,8 @@ public:
bool canSync();
bool canPark();
bool isSlewing();
- bool isParked();
+ bool isParked() { return parkStatus == PARK_PARKED; }
+ ParkStatus getParkStatus() { return parkStatus; }
bool isInMotion();
TelescopeStatus getStatus();
bool doPulse(GuideDirection ra_dir, int ra_msecs, GuideDirection dec_dir, int dec_msecs );
@@ -79,8 +81,8 @@ signals:
private:
SkyPoint currentCoord;
double minAlt,maxAlt;
- bool IsParked;
- IPState EqCoordPreviousState, LastParkingState;
+ ParkStatus parkStatus = PARK_UNKNOWN;
+ IPState EqCoordPreviousState;
};
diff --git a/kstars/kstars.notifyrc b/kstars/kstars.notifyrc
index a6c8e6eae..abb77f4b4 100644
--- a/kstars/kstars.notifyrc
+++ b/kstars/kstars.notifyrc
@@ -699,6 +699,12 @@ Comment[sv]=Stativ har nått målposition
Comment[uk]=Лафет навів телескоп на точку цілі
Comment[x-test]=xxMount arrived at target locationxx
Action=None
+[Event/MountAborted]
+Name=Mount Aborted
+Name[x-test]=xxMount Abortedxx
+Comment=Mount motion was aborted
+Comment[x-test]=xxMount motion was abortedxx
+Action=None
[Event/MountParking]
Name=Mount Parking
Name[ca]=Aparcament de la muntura
@@ -916,3 +922,11 @@ Name[sv]=Videoinspelning stoppad
Name[uk]=Припинено запис відео
Name[x-test]=xxVideo Recording Stoppedxx
Action=None
+[Event/MeridianFlipStarted]
+Name=Meridian Flip Started
+Action=None
+[Event/MeridianFlipCompleted]
+Name=Meridian Flip Completed
+Action=None
+[Event/MeridianFlipFailed]
+Name=Meridian Flip Failed
From mutlaqja at ikarustech.com Sun Feb 5 09:25:31 2017
From: mutlaqja at ikarustech.com (Jasem Mutlaq)
Date: Sun, 5 Feb 2017 12:25:31 +0300
Subject: [snapcraft-kde-applications] kstars: Addinig initial KStars snap
files. It needs DBus stuff plus notification and notifyconfig as
well. INDI
still uses /usr/share but it needs to be using XDG paths maybe? what are they
exactly in a snap environment? It requires latest KDE frameworks to build.
In-Reply-To:
References:
Message-ID:
Thanks! I tried installing that snap today on a 16.04 system but got the
following:
error: cannot find signatures with metadata for snap
"kstars_16.12.04_amd64.snap"
Do I need to install anything else before it?. It seems the bug you linked
is already resolved.
Regards,
Jasem
On Mon, Jan 30, 2017 at 11:10 PM, Harald Sitter wrote:
> On Fri, Jan 27, 2017 at 10:45 PM, Jasem Mutlaq wrote:
> > Git commit 950126423a616452f8b8eafb940bbbba6e4079e6 by Jasem Mutlaq.
> > Committed on 27/01/2017 at 21:41.
> > Pushed by mutlaqja into branch 'master'.
> >
> > Addinig initial KStars snap files. It needs DBus stuff plus notification
> and notifyconfig as well.
> > INDI still uses /usr/share but it needs to be using XDG paths maybe?
>
> yes, or really any env var. It simply must not be hardcoded to /usr as
> snaps do not get their root changed, so /usr == /usr, $SNAP/usr is the
> snap's /usr.
>
> > What are they exactly in a snap environment?
>
> https://github.com/apachelogger/kf5-snap-env/blob/master/kf5-launch
>
> That is to say: the app author needs to set them to whatever makes
> sense. In terms of the content snap the launch helper does that.
>
> I twiddled the snap into somewhat building shape [1]. FWIW I am not
> sure if the restriction was lifted but at some point content snaps
> would only be usable from the same publisher, so publishing kstars
> under a different user on the ubuntu store would possibly result in
> snapd refusing to set up the content interface.
>
> NB: this hits [2] which the build script patches for CI builds.
>
> [1] http://build.neon.kde.org/view/snap%20(build)/job/
> kstars-trunk_amd64.snap/
> [2] https://bugs.launchpad.net/snapcraft/+bug/1658155
>
> HS
>
--
Best Regards,
Jasem Mutlaq
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From null at kde.org Tue Feb 7 15:40:28 2017
From: null at kde.org (Jasem Mutlaq)
Date: Tue, 07 Feb 2017 15:40:28 +0000
Subject: [kstars] kstars: Fix a couple of issues with flags. They are
supposed to be saved in J2000 internally but where in JNow before.
Message-ID:
Git commit 8ed61da615ba9dceda1b2a4301feb5c2324172ed by Jasem Mutlaq.
Committed on 07/02/2017 at 15:38.
Pushed by mutlaqja into branch 'master'.
Fix a couple of issues with flags. They are supposed to be saved in J2000 internally but where in JNow before.
Fixed other issues with adding, updating, and removing flags.
CCMAIL:kstars-devel at kde.org
M +49 -15 kstars/skycomponents/flagcomponent.cpp
M +7 -5 kstars/skycomponents/flagcomponent.h
M +2 -0 kstars/skycomponents/skymapcomposite.cpp
M +3 -3 kstars/tools/flagmanager.cpp
https://commits.kde.org/kstars/8ed61da615ba9dceda1b2a4301feb5c2324172ed
diff --git a/kstars/skycomponents/flagcomponent.cpp b/kstars/skycomponents/flagcomponent.cpp
index b4bef9b9c..6897e4b10 100644
--- a/kstars/skycomponents/flagcomponent.cpp
+++ b/kstars/skycomponents/flagcomponent.cpp
@@ -99,7 +99,9 @@ void FlagComponent::loadFromFile() {
SkyPoint* flagPoint = new SkyPoint( r, d );
// Convert to JNow
- toJNow(flagPoint, flagEntry.at( 2 ));
+ toJ2000(flagPoint, flagEntry.at( 2 ));
+
+ flagPoint->updateCoordsNow(KStarsData::Instance()->updateNum());
pointList().append( flagPoint );
@@ -155,14 +157,20 @@ void FlagComponent::saveToFile() {
}
}
-void FlagComponent::add( SkyPoint* flagPoint, QString epoch, QString image, QString label, QColor labelColor ) {
+void FlagComponent::add( const SkyPoint & flagPoint, QString epoch, QString image, QString label, QColor labelColor ) {
//JM 2015-02-21: Insert original coords in list and convert skypint to JNow
- m_EpochCoords.append(qMakePair(flagPoint->ra().Degrees(), flagPoint->dec().Degrees()));
+ // JM 2017-02-07: Discard above! We add RAW epoch coordinates to list.
+ // If not J2000, we convert to J2000
+ m_EpochCoords.append(qMakePair(flagPoint.ra().Degrees(), flagPoint.dec().Degrees()));
+
+ SkyPoint *newFlagPoint = new SkyPoint(flagPoint.ra(), flagPoint.dec());
+
+ toJ2000(newFlagPoint, epoch);
- toJNow(flagPoint, epoch);
+ newFlagPoint->updateCoordsNow(KStarsData::Instance()->updateNum());
- pointList().append( flagPoint );
+ pointList().append( newFlagPoint );
m_Epoch.append( epoch );
for(int i = 0; i pointList().size() - 1 ) {
+ if ( index > pointList().size() - 1 )
+ {
return;
}
@@ -193,17 +202,22 @@ void FlagComponent::remove( int index ) {
#endif
}
-void FlagComponent::updateFlag( int index, SkyPoint *flagPoint, QString epoch, QString image, QString label, QColor labelColor ) {
- if ( index > pointList().size() -1 ) {
+void FlagComponent::updateFlag( int index, const SkyPoint &flagPoint, QString epoch, QString image, QString label, QColor labelColor )
+{
+ if ( index > pointList().size() -1 )
return;
- }
- delete pointList().at( index );
- m_EpochCoords.replace(index, qMakePair(flagPoint->ra().Degrees(), flagPoint->dec().Degrees()));
+ SkyPoint *existingFlag = pointList().at( index );
+
+ existingFlag->setRA0(flagPoint.ra());
+ existingFlag->setDec0(flagPoint.dec());
- toJNow(flagPoint, epoch);
+ // If epoch not J2000, to convert to J2000
+ toJ2000(existingFlag, epoch);
- pointList().replace( index, flagPoint);
+ existingFlag->updateCoordsNow(KStarsData::Instance()->updateNum());
+
+ m_EpochCoords.replace(index, qMakePair(flagPoint.ra().Degrees(), flagPoint.dec().Degrees()));
m_Epoch.replace( index, epoch );
@@ -314,12 +328,19 @@ QImage FlagComponent::imageList( int index ) {
return m_Images.at( index );
}
-void FlagComponent::toJNow(SkyPoint *p, QString epoch)
+void FlagComponent::toJ2000(SkyPoint *p, QString epoch)
{
KStarsDateTime dt;
dt.setFromEpoch(epoch);
- p->apparentCoord(dt.djd(), KStarsData::Instance()->ut().djd());
+ if (dt.djd() == J2000)
+ return;
+
+ p->apparentCoord(dt.djd(), J2000);
+
+ // Store J2000 coords in RA0, DEC0
+ p->setRA0(p->ra());
+ p->setDec0(p->dec());
}
QPair FlagComponent::epochCoords(int index)
@@ -331,3 +352,16 @@ QPair FlagComponent::epochCoords(int index)
return m_EpochCoords.at(index);
}
+
+void FlagComponent::update( KSNumbers *num )
+{
+ if ( ! selected() )
+ return;
+ KStarsData *data = KStarsData::Instance();
+ foreach ( SkyPoint *p, pointList() )
+ {
+ if (num)
+ p->updateCoordsNow(num);
+ p->EquatorialToHorizontal(data->lst(), data->geo()->lat() );
+ }
+}
diff --git a/kstars/skycomponents/flagcomponent.h b/kstars/skycomponents/flagcomponent.h
index bacffafa7..1039bd670 100644
--- a/kstars/skycomponents/flagcomponent.h
+++ b/kstars/skycomponents/flagcomponent.h
@@ -55,13 +55,15 @@ public:
virtual bool selected();
+ virtual void update( KSNumbers *num=0 );
+
/** @short Add a flag.
- * @param SkyPoint Reference to the SkyPoint used to store coordinates
+ * @param SkyPoint Sky point in epoch coordinates
* @param epoch Moment for which celestial coordinates are specified
* @param image Image name
* @param label Label of the flag
*/
- void add( SkyPoint* flagPoint, QString epoch, QString image, QString label, QColor labelColor );
+ void add( const SkyPoint & flagPoint, QString epoch, QString image, QString label, QColor labelColor );
/** @short Remove a flag.
* @param index Index of the flag to be remove.
@@ -70,13 +72,12 @@ public:
/** @short Update a flag.
*@param index index of the flag to be updated.
- *@param flagPoint new flag point.
*@param epoch new flag epoch.
*@param image new flag image.
*@param label new flag label.
*@param labelColor new flag label color.
*/
- void updateFlag ( int index, SkyPoint* flagPoint, QString epoch, QString image, QString label, QColor labelColor );
+ void updateFlag(int index, const SkyPoint &flagPoint, QString epoch, QString image, QString label, QColor labelColor );
/** @short Return image names.
* @return the list of all image names
@@ -149,7 +150,8 @@ public:
void saveToFile();
private:
- void toJNow(SkyPoint *p, QString epoch);
+ // Convert from given epoch to J2000. If epoch is already J2000, do nothing
+ void toJ2000(SkyPoint *p, QString epoch);
QStringList m_Epoch; /**< List of epochs */
QList> m_EpochCoords; /**< RA/DEC stored in original Epoch */
diff --git a/kstars/skycomponents/skymapcomposite.cpp b/kstars/skycomponents/skymapcomposite.cpp
index 460cb5c9d..b6173ee87 100644
--- a/kstars/skycomponents/skymapcomposite.cpp
+++ b/kstars/skycomponents/skymapcomposite.cpp
@@ -221,6 +221,8 @@ void SkyMapComposite::update(KSNumbers *num )
m_Supernovae->update(num);
//15. Horizon
m_Horizon->update( num );
+ //16. Flags
+ m_Flags->update(num);
}
void SkyMapComposite::updateSolarSystemBodies(KSNumbers *num )
diff --git a/kstars/tools/flagmanager.cpp b/kstars/tools/flagmanager.cpp
index 2f6f3fce0..6717377f1 100644
--- a/kstars/tools/flagmanager.cpp
+++ b/kstars/tools/flagmanager.cpp
@@ -206,13 +206,13 @@ void FlagManager::deleteFlagItem( int flagIdx ) {
void FlagManager::slotAddFlag() {
dms ra( ui->raBox->createDms( false) ); //false means expressed in hours
- dms dec( ui->decBox->createDms( true ) );
- SkyPoint* flagPoint = new SkyPoint( ra, dec );
+ dms dec( ui->decBox->createDms( true ) );
insertFlag( true );
FlagComponent *flags = m_Ks->data()->skyComposite()->flags();
//Add flag in FlagComponent
+ SkyPoint flagPoint( ra, dec );
flags->add( flagPoint, ui->epochBox->text(), ui->flagCombobox->currentText(), ui->flagLabel->text(), ui->labelColorcombo->color() );
ui->flagList->selectRow( m_Model->rowCount() - 1 );
@@ -304,7 +304,7 @@ void FlagManager::slotSaveChanges() {
dms ra( ui->raBox->createDms( false) ); //false means expressed in hours
dms dec( ui->decBox->createDms( true ) );
- SkyPoint* flagPoint = new SkyPoint( ra, dec );
+ SkyPoint flagPoint( ra, dec );
//Update FlagComponent
m_Ks->data()->skyComposite()->flags()->updateFlag( row, flagPoint, ui->epochBox->text(), ui->flagCombobox->currentText(),
From null at kde.org Tue Feb 14 10:01:08 2017
From: null at kde.org (Jasem Mutlaq)
Date: Tue, 14 Feb 2017 10:01:08 +0000
Subject: [kstars] kstars: This patch contains 3 fixes. First,
It will allow kstars to handle drivers that have xml files but no
binary files. That way,
if your remote server has a driver that your local computer does not,
then you can still use the driver in remote mode,
but not local mode in kstars.
Message-ID:
Git commit 6c76b5c7c9ce98cc7584ffca3f56f2a7494e2724 by Jasem Mutlaq, on behalf of Robert Lancaster.
Committed on 14/02/2017 at 05:34.
Pushed by mutlaqja into branch 'master'.
This patch contains 3 fixes. First, It will allow kstars to handle drivers that have xml files but no binary files. That way, if your remote server has a driver that your local computer does not, then you can still use the driver in remote mode, but not local mode in kstars.
I made it so that in both the device manager and in the profile editor, drivers that have no binary file are displayed with a remote icon. Also in the profile editor, when in local mode, the remote drivers do not appear.
Second, this patch addresses a fits view default size problem. I improved the algorithm for calculating what the default size should be based on the viewport and I updated the base size to reflect the correct size of the fits view inside the fits viewer.
And finally, I made several corrections for OS X where the windows were not QT Tools and they could end up behind the main application window.
CCMAIL:kstars-devel at kde.org
M +4 -0 kstars/ekos/capture/dslrinfodialog.cpp
M +82 -52 kstars/ekos/profileeditor.cpp
M +29 -3 kstars/indi/drivermanager.cpp
M +2 -0 kstars/indi/drivermanager.h
M +4 -0 kstars/indi/streamwg.cpp
https://commits.kde.org/kstars/6c76b5c7c9ce98cc7584ffca3f56f2a7494e2724
diff --git a/kstars/ekos/capture/dslrinfodialog.cpp b/kstars/ekos/capture/dslrinfodialog.cpp
index 1e89156b6..ba164c6cc 100644
--- a/kstars/ekos/capture/dslrinfodialog.cpp
+++ b/kstars/ekos/capture/dslrinfodialog.cpp
@@ -16,6 +16,10 @@
DSLRInfo::DSLRInfo(QWidget *parent, ISD::CCD *ccd) : QDialog(parent)
{
+#ifdef Q_OS_OSX
+ setWindowFlags(Qt::Tool| Qt::WindowStaysOnTopHint);
+#endif
+
setupUi(this);
currentCCD = ccd;
diff --git a/kstars/ekos/profileeditor.cpp b/kstars/ekos/profileeditor.cpp
index 7fe634e49..9a008f496 100644
--- a/kstars/ekos/profileeditor.cpp
+++ b/kstars/ekos/profileeditor.cpp
@@ -194,6 +194,8 @@ ProfileInfo *ProfileEditor::getPi() const
void ProfileEditor::setRemoteMode(bool enable)
{
+ loadDrivers();//This is needed to reload the drivers because some may not be available locally
+
ui->remoteHost->setEnabled(enable);
ui->remoteHostLabel->setEnabled(enable);
ui->remotePort->setEnabled(enable);
@@ -394,92 +396,116 @@ void ProfileEditor::setPi(ProfileInfo *value)
void ProfileEditor::loadDrivers()
{
- ui->mountCombo->addItem("--");
- ui->ccdCombo->addItem("--");
- ui->guiderCombo->addItem("--");
- ui->AOCombo->addItem("--");
- ui->focuserCombo->addItem("--");
- ui->filterCombo->addItem("--");
- ui->domeCombo->addItem("--");
- ui->weatherCombo->addItem("--");
- ui->aux1Combo->addItem("--");
- ui->aux2Combo->addItem("--");
- ui->aux3Combo->addItem("--");
- ui->aux4Combo->addItem("--");
+
+ QVector boxes;
+ boxes.append(ui->mountCombo);
+ boxes.append(ui->ccdCombo);
+ boxes.append(ui->guiderCombo);
+ boxes.append(ui->AOCombo);
+ boxes.append(ui->focuserCombo);
+ boxes.append(ui->filterCombo);
+ boxes.append(ui->domeCombo);
+ boxes.append(ui->weatherCombo);
+ boxes.append(ui->aux1Combo);
+ boxes.append(ui->aux2Combo);
+ boxes.append(ui->aux3Combo);
+ boxes.append(ui->aux4Combo);
+
+ QVector selectedItems;
+
+ foreach(QComboBox *box,boxes){
+ selectedItems.append(box->currentText());
+ box->clear();
+ box->addItem("--");
+ box->setMaxVisibleItems(20);
+ }
+
+ QIcon remoteIcon=QIcon::fromTheme("modem", QIcon(":/icons/breeze/default/modem.svg"));
foreach(DriverInfo *dv, DriverManager::Instance()->getDrivers())
{
+ bool locallyAvailable=false;
+ QIcon icon;
+ if (dv->getAuxInfo().contains("LOCALLY_AVAILABLE"))
+ locallyAvailable = dv->getAuxInfo().value("LOCALLY_AVAILABLE", false).toBool();
+ if(!locallyAvailable){
+ if(ui->localMode->isChecked())
+ continue;
+ else
+ icon=remoteIcon;
+ }
+
switch (dv->getType())
{
case KSTARS_TELESCOPE:
{
- ui->mountCombo->addItem(dv->getTreeLabel());
+ ui->mountCombo->addItem(icon, dv->getTreeLabel());
}
break;
case KSTARS_CCD:
{
- ui->ccdCombo->addItem(dv->getTreeLabel());
- ui->guiderCombo->addItem(dv->getTreeLabel());
+ ui->ccdCombo->addItem(icon, dv->getTreeLabel());
+ ui->guiderCombo->addItem(icon, dv->getTreeLabel());
- ui->aux1Combo->addItem(dv->getTreeLabel());
- ui->aux2Combo->addItem(dv->getTreeLabel());
- ui->aux3Combo->addItem(dv->getTreeLabel());
- ui->aux4Combo->addItem(dv->getTreeLabel());
+ ui->aux1Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux2Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux3Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux4Combo->addItem(icon, dv->getTreeLabel());
}
break;
case KSTARS_ADAPTIVE_OPTICS:
{
- ui->AOCombo->addItem(dv->getTreeLabel());
+ ui->AOCombo->addItem(icon, dv->getTreeLabel());
}
break;
case KSTARS_FOCUSER:
{
- ui->focuserCombo->addItem(dv->getTreeLabel());
+ ui->focuserCombo->addItem(icon, dv->getTreeLabel());
- ui->aux1Combo->addItem(dv->getTreeLabel());
- ui->aux2Combo->addItem(dv->getTreeLabel());
- ui->aux3Combo->addItem(dv->getTreeLabel());
- ui->aux4Combo->addItem(dv->getTreeLabel());
+ ui->aux1Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux2Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux3Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux4Combo->addItem(icon, dv->getTreeLabel());
}
break;
case KSTARS_FILTER:
{
- ui->filterCombo->addItem(dv->getTreeLabel());
+ ui->filterCombo->addItem(icon, dv->getTreeLabel());
- ui->aux1Combo->addItem(dv->getTreeLabel());
- ui->aux2Combo->addItem(dv->getTreeLabel());
- ui->aux3Combo->addItem(dv->getTreeLabel());
- ui->aux4Combo->addItem(dv->getTreeLabel());
+ ui->aux1Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux2Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux3Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux4Combo->addItem(icon, dv->getTreeLabel());
}
break;
case KSTARS_DOME:
{
- ui->domeCombo->addItem(dv->getTreeLabel());
+ ui->domeCombo->addItem(icon, dv->getTreeLabel());
}
break;
case KSTARS_WEATHER:
{
- ui->weatherCombo->addItem(dv->getTreeLabel());
+ ui->weatherCombo->addItem(icon, dv->getTreeLabel());
- ui->aux1Combo->addItem(dv->getTreeLabel());
- ui->aux2Combo->addItem(dv->getTreeLabel());
- ui->aux3Combo->addItem(dv->getTreeLabel());
- ui->aux4Combo->addItem(dv->getTreeLabel());
+ ui->aux1Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux2Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux3Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux4Combo->addItem(icon, dv->getTreeLabel());
}
break;
case KSTARS_AUXILIARY:
{
- ui->aux1Combo->addItem(dv->getTreeLabel());
- ui->aux2Combo->addItem(dv->getTreeLabel());
- ui->aux3Combo->addItem(dv->getTreeLabel());
- ui->aux4Combo->addItem(dv->getTreeLabel());
+ ui->aux1Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux2Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux3Combo->addItem(icon, dv->getTreeLabel());
+ ui->aux4Combo->addItem(icon, dv->getTreeLabel());
}
break;
@@ -490,17 +516,21 @@ void ProfileEditor::loadDrivers()
}
//ui->mountCombo->setCurrentIndex(-1);
- ui->mountCombo->model()->sort(0);
- ui->ccdCombo->model()->sort(0);
- ui->guiderCombo->model()->sort(0);
- ui->AOCombo->model()->sort(0);
- ui->focuserCombo->model()->sort(0);
- ui->filterCombo->model()->sort(0);
- ui->domeCombo->model()->sort(0);
- ui->weatherCombo->model()->sort(0);
- ui->aux1Combo->model()->sort(0);
- ui->aux2Combo->model()->sort(0);
- ui->aux3Combo->model()->sort(0);
- ui->aux4Combo->model()->sort(0);
+
+ for(int i=0;ifindText(selectedItemText);
+ if(index==-1){
+ if(ui->localMode->isChecked())
+ box->setCurrentIndex(0);
+ else
+ box->addItem(remoteIcon,selectedItemText);
+
+ } else{
+ box->setCurrentIndex(index);
+ }
+ box->model()->sort(0);
+ }
}
diff --git a/kstars/indi/drivermanager.cpp b/kstars/indi/drivermanager.cpp
index 52d79c604..6825440e1 100644
--- a/kstars/indi/drivermanager.cpp
+++ b/kstars/indi/drivermanager.cpp
@@ -183,12 +183,17 @@ void DriverManager::processDeviceStatus(DriverInfo *dv)
cState = dv->getClientState() && dState;
+ bool locallyAvailable=false;
+ if (dv->getAuxInfo().contains("LOCALLY_AVAILABLE"))
+ locallyAvailable = dv->getAuxInfo().value("LOCALLY_AVAILABLE", false).toBool();
+
switch (mode)
{
case SERVER_ONLY:
ui->runServiceB->setEnabled(!dState);
ui->stopServiceB->setEnabled(dState);
- item->setIcon(LOCAL_STATUS_COLUMN, dState ? ui->runningPix : ui->stopPix);
+ if(locallyAvailable)
+ item->setIcon(LOCAL_STATUS_COLUMN, dState ? ui->runningPix : ui->stopPix);
if (dState)
{
item->setIcon(LOCAL_MODE_COLUMN, ui->serverMode);
@@ -206,7 +211,8 @@ void DriverManager::processDeviceStatus(DriverInfo *dv)
case SERVER_CLIENT:
ui->runServiceB->setEnabled(!cState);
ui->stopServiceB->setEnabled(cState);
- item->setIcon(LOCAL_STATUS_COLUMN, cState ? ui->runningPix : ui->stopPix);
+ if(locallyAvailable)
+ item->setIcon(LOCAL_STATUS_COLUMN, cState ? ui->runningPix : ui->stopPix);
if (cState)
{
item->setIcon(LOCAL_MODE_COLUMN, ui->localMode);
@@ -1204,10 +1210,18 @@ bool DriverManager::buildDriverElement(XMLEle *root, QTreeWidgetItem *DGroup, De
version = pcdataXMLEle(el);
+ bool driverIsAvailable=checkDriverAvailability(driver);
+
+ vMap.insert("LOCALLY_AVAILABLE", driverIsAvailable);
+ QIcon remoteIcon=QIcon::fromTheme("modem", QIcon(":/icons/breeze/default/modem.svg"));
+
QTreeWidgetItem *device = new QTreeWidgetItem(DGroup);
device->setText(LOCAL_NAME_COLUMN, label);
- device->setIcon(LOCAL_STATUS_COLUMN, ui->stopPix);
+ if(driverIsAvailable)
+ device->setIcon(LOCAL_STATUS_COLUMN, ui->stopPix);
+ else
+ device->setIcon(LOCAL_STATUS_COLUMN, remoteIcon);
device->setText(LOCAL_VERSION_COLUMN, version);
device->setText(LOCAL_PORT_COLUMN, port);
@@ -1237,6 +1251,18 @@ bool DriverManager::buildDriverElement(XMLEle *root, QTreeWidgetItem *DGroup, De
return true;
}
+bool DriverManager::checkDriverAvailability(QString driver){
+ QString indiServerDir=Options::indiServer();
+ if(Options::indiServerIsInternal())
+ indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
+ else
+ indiServerDir=QFileInfo(Options::indiServer()).dir().path();
+
+ QFile driverFile(indiServerDir + "/" + driver);
+
+ return driverFile.exists();
+}
+
void DriverManager::updateCustomDrivers()
{
diff --git a/kstars/indi/drivermanager.h b/kstars/indi/drivermanager.h
index 46068d9a0..5784c5a03 100644
--- a/kstars/indi/drivermanager.h
+++ b/kstars/indi/drivermanager.h
@@ -136,6 +136,8 @@ private:
QList clients;
QStringList driversStringList;
+ bool checkDriverAvailability(QString driver);
+
INDIDBus indiDBUS;
public slots:
diff --git a/kstars/indi/streamwg.cpp b/kstars/indi/streamwg.cpp
index 374d60668..600f907cb 100644
--- a/kstars/indi/streamwg.cpp
+++ b/kstars/indi/streamwg.cpp
@@ -38,6 +38,10 @@
RecordOptions::RecordOptions(QWidget *parent) : QDialog(parent)
{
+#ifdef Q_OS_OSX
+ setWindowFlags(Qt::Tool| Qt::WindowStaysOnTopHint);
+#endif
+
setupUi(this);
dirPath = QUrl::fromLocalFile(QDir::homePath());
From null at kde.org Wed Feb 15 10:13:56 2017
From: null at kde.org (Jasem Mutlaq)
Date: Wed, 15 Feb 2017 10:13:56 +0000
Subject: [kstars] kstars: + Add FITS page options in KStars settings to
better separate it from the rest of advanced options since it deserves its
own.
Message-ID:
Git commit b57a305c714ac975bbde767f91ea766fa6023906 by Jasem Mutlaq.
Committed on 15/02/2017 at 08:42.
Pushed by mutlaqja into branch 'master'.
+ Add FITS page options in KStars settings to better separate it from the rest of advanced options since it deserves its own.
+ Use Limited Resources Mode to prevent processing of WCS.
CCMAIL:kstars-devel at kde.org
M +2 -0 kstars/CMakeLists.txt
M +3 -0 kstars/ekos/align/align.cpp
M +21 -0 kstars/ekos/align/alignview.cpp
M +1 -1 kstars/ekos/align/alignview.h
M +3 -3 kstars/ekos/opsekos.cpp
M +5 -1 kstars/fitsviewer/fitsdata.cpp
M +4 -3 kstars/fitsviewer/fitsview.cpp
A +24 -0 kstars/fitsviewer/opsfits.cpp [License: GPL (v2+)]
A +36 -0 kstars/fitsviewer/opsfits.h [License: GPL (v2+)]
A +184 -0 kstars/fitsviewer/opsfits.ui
M +2 -0 kstars/kstars.h
M +4 -4 kstars/kstars.kcfg
M +7 -1 kstars/kstarsactions.cpp
M +0 -12 kstars/options/opsadvanced.cpp
M +0 -1 kstars/options/opsadvanced.h
M +230 -352 kstars/options/opsadvanced.ui
https://commits.kde.org/kstars/b57a305c714ac975bbde767f91ea766fa6023906
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index f68defdc5..16ac8dd30 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -46,6 +46,7 @@ if(NOT BUILD_KSTARS_LITE)
fitsviewer/fitstab.cpp
fitsviewer/fitsdebayer.cpp
fitsviewer/bayer.c
+ fitsviewer/opsfits.cpp
)
set (fitsui_SRCS
fitsviewer/fitsheaderdialog.ui
@@ -54,6 +55,7 @@ if(NOT BUILD_KSTARS_LITE)
indi/streamform.ui
indi/recordingoptions.ui
fitsviewer/fitshistogramui.ui
+ fitsviewer/opsfits.ui
)
include_directories(${CFITSIO_INCLUDE_DIR})
endif(CFITSIO_FOUND)
diff --git a/kstars/ekos/align/align.cpp b/kstars/ekos/align/align.cpp
index 7e7a18e26..75bac0561 100644
--- a/kstars/ekos/align/align.cpp
+++ b/kstars/ekos/align/align.cpp
@@ -2742,6 +2742,9 @@ void Align::startPAHProcess()
nothingR->setChecked(true);
currentGotoMode = GOTO_NOTHING;
+ if (Options::limitedResourcesMode())
+ appendLogText(i18n("Warning: Equatorial Grid Lines will not be drawn due to limited resources mode."));
+
PAHWidgets->setCurrentWidget(PAHFirstCapturePage);
}
diff --git a/kstars/ekos/align/alignview.cpp b/kstars/ekos/align/alignview.cpp
index 113821e93..4994e27c7 100644
--- a/kstars/ekos/align/alignview.cpp
+++ b/kstars/ekos/align/alignview.cpp
@@ -11,7 +11,9 @@
#include
+#include "Options.h"
#include "alignview.h"
+#include "kstarsdata.h"
#define ZOOM_DEFAULT 100.0
#define ZOOM_MIN 10
@@ -59,6 +61,7 @@ void AlignView::setCorrectionParams(QLineF line)
}
correctionLine = line;
+ celestialPolePoint = line.p1();
markerCrosshair = line.p2();
updateFrame();
@@ -107,6 +110,24 @@ void AlignView::drawLine(QPainter *painter)
double y2 = zoomedLine.p2().y() * zoomFactor;
painter->drawLine(x1,y1,x2,y2);
+
+ // In limited memory mode, WCS data is not loaded so no Equatorial Gridlines are drawn
+ // so we have to at least draw the NCP/SCP locations
+ if (Options::limitedResourcesMode())
+ {
+ QPen pen;
+ pen.setWidth(2);
+ pen.setColor(Qt::darkRed);
+ painter->setPen(pen);
+ double x = celestialPolePoint.x() * zoomFactor;
+ double y = celestialPolePoint.y() * zoomFactor;
+ double sr= 3*zoomFactor;
+
+ if (KStarsData::Instance()->geo()->lat()->Degrees() > 0)
+ painter->drawText(x+sr,y+sr, i18nc("North Celestial Pole", "NCP"));
+ else
+ painter->drawText(x+sr,y+sr, i18nc("South Celestial Pole", "SCP"));
+ }
}
void AlignView::drawCircle(QPainter *painter)
diff --git a/kstars/ekos/align/alignview.h b/kstars/ekos/align/alignview.h
index 591fd3995..6e352999f 100644
--- a/kstars/ekos/align/alignview.h
+++ b/kstars/ekos/align/alignview.h
@@ -40,7 +40,7 @@ protected:
private:
// Correction Line
QLineF correctionLine;
- QPointF correctionOffset;
+ QPointF correctionOffset, celestialPolePoint;
QVector3D RACircle;
};
diff --git a/kstars/ekos/opsekos.cpp b/kstars/ekos/opsekos.cpp
index 239f5d4f4..ad7523207 100644
--- a/kstars/ekos/opsekos.cpp
+++ b/kstars/ekos/opsekos.cpp
@@ -1,12 +1,12 @@
-/* INDI Options
- Copyright (C) 2003 Jasem Mutlaq (mutlaqja at ikarustech.com)
+/* Ekos Options
+ Copyright (C) 2017 Jasem Mutlaq (mutlaqja at ikarustech.com)
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
#include
diff --git a/kstars/fitsviewer/fitsdata.cpp b/kstars/fitsviewer/fitsdata.cpp
index 4daed8a1e..c27c739af 100644
--- a/kstars/fitsviewer/fitsdata.cpp
+++ b/kstars/fitsviewer/fitsdata.cpp
@@ -272,7 +272,7 @@ bool FITSData::loadFITS (const QString &inFilename, bool silent)
calculateStats();
- if (Options::autoDebayerFITS() && checkDebayer())
+ if (Options::autoDebayer() && checkDebayer())
{
bayerBuffer = imageBuffer;
debayer();
@@ -3886,6 +3886,10 @@ bool FITSData::createWCSFile(const QString & newWCSFile, double orientation, dou
fits_flush_file(fptr, &status);
+ // We do not process WCS in limited resource mode
+ if (Options::limitedResourcesMode())
+ return true;
+
return loadWCS();
}
diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp
index 3d048e660..6995f4ea6 100644
--- a/kstars/fitsviewer/fitsview.cpp
+++ b/kstars/fitsviewer/fitsview.cpp
@@ -620,7 +620,8 @@ bool FITSView::loadFITS (const QString &inFilename , bool silent)
{
if (fitsProg.wasCanceled())
return false;
- else
+ // Only invoke loadWCS when we are not restricted by CPU/Memory
+ else if (Options::limitedResourcesMode() == false)
{
QFuture future = QtConcurrent::run(imageData, &FITSData::loadWCS);
wcsWatcher.setFuture(future);
@@ -880,9 +881,9 @@ template int FITSView::rescale(FITSZoom type)
void FITSView::ZoomIn()
{
- if (currentZoom >= ZOOM_DEFAULT && Options::limitedMemoryMode())
+ if (currentZoom >= ZOOM_DEFAULT && Options::limitedResourcesMode())
{
- emit newStatus(i18n("Cannot zoom in further due to active limited memory mode."), FITS_MESSAGE);
+ emit newStatus(i18n("Cannot zoom in further due to active limited resources mode."), FITS_MESSAGE);
return;
}
diff --git a/kstars/fitsviewer/opsfits.cpp b/kstars/fitsviewer/opsfits.cpp
new file mode 100644
index 000000000..3fe3a0f6a
--- /dev/null
+++ b/kstars/fitsviewer/opsfits.cpp
@@ -0,0 +1,24 @@
+/* FITS Options
+ Copyright (C) 2017 Jasem Mutlaq (mutlaqja at ikarustech.com)
+
+ 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 "opsfits.h"
+
+#include "Options.h"
+#include "kstars.h"
+#include "kstarsdata.h"
+
+OpsFITS::OpsFITS() : QFrame(KStars::Instance())
+{
+ setupUi( this );
+
+ connect(kcfg_LimitedResourcesMode, &QCheckBox::toggled, this, [this](bool toggled) { if (toggled) { kcfg_Auto3DCube->setChecked(false); kcfg_AutoDebayer->setChecked(false); } });
+ connect(kcfg_Auto3DCube, &QCheckBox::toggled, this, [this](bool toggled) { if (toggled) kcfg_LimitedResourcesMode->setChecked(false);});
+ connect(kcfg_AutoDebayer, &QCheckBox::toggled, this, [this](bool toggled) { if (toggled) kcfg_LimitedResourcesMode->setChecked(false);});
+}
diff --git a/kstars/fitsviewer/opsfits.h b/kstars/fitsviewer/opsfits.h
new file mode 100644
index 000000000..fa8984e3a
--- /dev/null
+++ b/kstars/fitsviewer/opsfits.h
@@ -0,0 +1,36 @@
+/* FITS Options
+ Copyright (C) 2017 Jasem Mutlaq (mutlaqja at ikarustech.com)
+
+ 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.
+
+*/
+
+#ifndef OPSFITS_H_
+#define OPSFITS_H_
+
+#include "ui_opsfits.h"
+
+#include
+
+#include
+
+class KStars;
+
+
+/** @class OpsFITS
+ *The FITS Tab of the Options window. Configure FITS options including look and feel and how FITS Viewer processes the data.
+ *@author Jasem Mutlaq
+ *@version 1.0
+ */
+class OpsFITS : public QFrame, public Ui::OpsFITS
+{
+ Q_OBJECT
+
+public:
+ explicit OpsFITS();
+};
+
+#endif
diff --git a/kstars/fitsviewer/opsfits.ui b/kstars/fitsviewer/opsfits.ui
new file mode 100644
index 000000000..0c5e84941
--- /dev/null
+++ b/kstars/fitsviewer/opsfits.ui
@@ -0,0 +1,184 @@
+
+
+ OpsFITS
+
+
+
+ 0
+ 0
+ 335
+ 128
+
+
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+
+
+
+
+ true
+
+
+ Look && Feel
+
+
+
+
+
+ Display all captured FITS images in a single tab instead of multiple tabs per image.
+
+
+
+
+
+
+
+
+ Preview Mode
+
+
+ true
+
+
+
+
+
+
+ Display captured FITS images from all cameras in a single FITS Viewer window instead of a dedicated window to each camera.
+
+
+
+
+
+ Single Window Capture
+
+
+ false
+
+
+
+
+
+
+ Display opened FITS images in a single FITS Viewer window instead of a dedicated window to each file.
+
+
+
+
+
+ Single Window Open
+
+
+ true
+
+
+
+
+
+
+ Make FITS Viewer window independent from KStars
+
+
+ Independent Window
+
+
+
+
+
+
+
+
+
+ Processing
+
+
+
+
+
+ Always apply auto stretch to images in FITS Viewer
+
+
+ Auto Stretch
+
+
+
+
+
+
+ <html><head/><body><p>Enable limited resource mode to turn off any resource-intensive operations:</p>
+<ul>
+<li>Auto Debayer: Bayered images will not be debayered. Only grayscale images are shown.</li>
+<li>3D Cube: RGB images will not be processed. Only grayscale images are shown.</li>
+<li>World Coordinate System (WCS): WCS data will not be processed. WCS maps sky coordiantes to image coordinates. Equatorial grid lines, object identification, and telescope slew within an image are disabled.</li>
+</ul>
+</body></html>
+
+
+ Limited Resources Mode
+
+
+
+
+
+
+ Automatically debayer captured image if it contains a bayer pattern
+
+
+ Auto Debayer
+
+
+ true
+
+
+
+
+
+
+ Process 3D (RGB) FITS images. If unchecked, only first channel is processed.
+
+
+ 3D Cube
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 3
+
+
+
+
+
+
+
+
+
diff --git a/kstars/kstars.h b/kstars/kstars.h
index 7f99bdb91..f5dff855b 100644
--- a/kstars/kstars.h
+++ b/kstars/kstars.h
@@ -69,6 +69,7 @@ class OpsColors;
class OpsAdvanced;
class OpsINDI;
class OpsEkos;
+class OpsFITS;
#ifdef HAVE_XPLANET
class OpsXplanet;
@@ -721,6 +722,7 @@ private:
OpsAdvanced *opadvanced;
OpsINDI *opsindi;
OpsEkos *opsekos;
+ OpsFITS *opsfits;
#ifdef HAVE_XPLANET
OpsXplanet *opsxplanet;
#endif
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index 8be890ff0..d98be1848 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -1293,16 +1293,16 @@
false
-
+ true
-
+ true
-
-
+
+
false
diff --git a/kstars/kstarsactions.cpp b/kstars/kstarsactions.cpp
index 9e64efb93..7c69b7ea1 100644
--- a/kstars/kstarsactions.cpp
+++ b/kstars/kstarsactions.cpp
@@ -124,6 +124,7 @@
#ifdef HAVE_CFITSIO
#include "fitsviewer/fitsviewer.h"
+#include "fitsviewer/opsfits.h"
#ifdef HAVE_INDI
#include "ekos/ekosmanager.h"
#include "ekos/opsekos.h"
@@ -744,11 +745,16 @@ void KStars::slotViewOps() {
page = dialog->addPage(opcolors, i18n("Colors"), "kstars_colors");
page->setIcon(QIcon::fromTheme("kstars_colors", QIcon(":/icons/breeze/default/kstars_colors.svg")));
+ #ifdef HAVE_CFITSIO
+ opsfits = new OpsFITS();
+ page = dialog->addPage(opsfits, i18n("FITS"), "kstars_fitsviewer");
+ page->setIcon(QIcon::fromTheme("kstars_fitsviewer", QIcon(":/icons/breeze/default/kstars_fitsviewer.svg")));
+ #endif
+
#ifdef HAVE_INDI
opsindi = new OpsINDI();
page= dialog->addPage(opsindi, i18n("INDI"), "kstars_indi");
page->setIcon(QIcon::fromTheme("kstars_indi", QIcon(":/icons/breeze/default/kstars_indi.svg")));
-
#ifdef HAVE_CFITSIO
opsekos = new OpsEkos();
KPageWidgetItem *ekosOption = dialog->addPage(opsekos, i18n("Ekos"), "kstars_ekos");
diff --git a/kstars/options/opsadvanced.cpp b/kstars/options/opsadvanced.cpp
index b22554048..20166e677 100644
--- a/kstars/options/opsadvanced.cpp
+++ b/kstars/options/opsadvanced.cpp
@@ -34,10 +34,6 @@ OpsAdvanced::OpsAdvanced()
{
setupUi( this );
- #ifdef HAVE_CFITSIO
- FITSViewerGroup->setEnabled(true);
- #endif
-
//Initialize the timestep value
SlewTimeScale->tsbox()->changeScale( Options::slewTimeScale() );
@@ -51,8 +47,6 @@ OpsAdvanced::OpsAdvanced()
connect(showLogsB, SIGNAL(clicked()), this, SLOT(slotShowLogFiles()));
- connect(kcfg_LimitedMemoryMode, SIGNAL(toggled(bool)), this, SLOT(slotToggleLimitedMemoryMode(bool)));
-
connect( kcfg_ObsListDemoteHole, &QCheckBox::toggled, [this]( bool state ) {
kcfg_ObsListHoleSize->setEnabled( state );
} );
@@ -104,9 +98,3 @@ void OpsAdvanced::slotShowLogFiles()
QDesktopServices::openUrl(path);
}
-
-void OpsAdvanced::slotToggleLimitedMemoryMode(bool enabled)
-{
- kcfg_auto3DCube->setChecked(!enabled);
- kcfg_autoDebayerFITS->setChecked(!enabled);
-}
diff --git a/kstars/options/opsadvanced.h b/kstars/options/opsadvanced.h
index 0f5b77492..f779791a0 100644
--- a/kstars/options/opsadvanced.h
+++ b/kstars/options/opsadvanced.h
@@ -48,7 +48,6 @@ private slots:
void slotToggleVerbosityOptions();
void slotToggleOutputOptions();
void slotShowLogFiles();
- void slotToggleLimitedMemoryMode(bool enabled);
};
#endif //OPSADVANCED_H_
diff --git a/kstars/options/opsadvanced.ui b/kstars/options/opsadvanced.ui
index 63ece29bb..bae384a47 100644
--- a/kstars/options/opsadvanced.ui
+++ b/kstars/options/opsadvanced.ui
@@ -6,11 +6,26 @@
00
- 591
- 418
+ 605
+ 312
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
@@ -22,261 +37,152 @@
-
-
- Backends
-
-
-
-
-
- Correct coordinates of objects for the effects of the atmosphere
-
-
- The atmosphere bends light passing through it, like a lens. If this item is checked, this "atmospheric refraction" will be simulated in the sky map. Note that this correction is only applied when using the Horizontal coordinate system.
-
-
- Correct for atmospheric refraction
-
-
-
-
-
-
- Correct for the effect of sun's gravity on star positions, as predicted by General Relativity, and verified by Eddington's experiment.
-
-
- General Relativity effects near the sun
-
-
-
-
-
-
- Checking this option causes recomputation of current equatorial coordinates from catalog coordinates (i.e. application of precession, nutation and aberration corrections) for every redraw of the map. This makes processing slower when there are many stars to handle, but is more likely to be bug-free. There are known bugs in the rendering of stars when this recomputation is avoided.
-
-
- Always recompute coordinates
-
-
-
-
-
-
-
-
-
- DSS Imagery
-
-
-
-
-
- Default DSS Image Size:
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 75
- 0
-
-
-
- 1
-
-
- 1.000000000000000
-
-
- 75.000000000000000
-
-
- 15.000000000000000
-
-
-
-
-
-
-
- 0
- 0
-
-
-
- arcminutes
-
-
-
-
-
-
- Padding around Deep Sky Objects:
-
-
-
-
-
-
-
- 75
- 0
-
-
-
- 1
-
-
- 1.000000000000000
-
-
- 75.000000000000000
-
-
- 10.000000000000000
-
-
-
-
-
-
-
- 0
- 0
-
-
-
- arcminutes
-
-
-
-
-
-
-
-
-
- false
-
-
- FITS Viewer
+
+
+ 3
-
-
-
-
- Display all captured FITS images in a single tab instead of multiple tabs per image.
-
-
-
-
-
-
-
-
- Preview Mode
-
-
- true
-
-
-
-
-
-
- Display captured FITS images from all cameras in a single FITS Viewer window instead of a dedicated window to each camera.
-
-
-
-
-
- Single Window Capture
-
-
- false
-
-
-
-
-
-
- Display opened FITS images in a single FITS Viewer window instead of a dedicated window to each file.
-
-
-
-
-
- Single Window Open
-
-
- true
-
-
-
-
-
-
- Make FITS Viewer window independent from KStars
-
-
- Independent Window
-
-
-
-
-
-
- <html><head/><body><p>Enable limited memory mode to turn off any memory-intensive operations. This mode is mostly useful on embedded devices with limited memory.</p></body></html>
-
-
- Limited Memory Mode
-
-
-
-
-
-
- Always apply auto stretch to images in FITS Viewer
-
-
- Auto Stretch
-
-
-
-
-
-
- Automatically debayer captured image if it contains a bayer pattern
-
-
- Auto Debayer
-
-
- true
-
-
-
-
-
-
- Process 3D (RGB) FITS images. If unchecked, only first channel is processed.
-
-
- 3D Cube
-
-
-
-
-
+
+
+
+ Backends
+
+
+
+
+
+ Correct coordinates of objects for the effects of the atmosphere
+
+
+ The atmosphere bends light passing through it, like a lens. If this item is checked, this "atmospheric refraction" will be simulated in the sky map. Note that this correction is only applied when using the Horizontal coordinate system.
+
+
+ Correct for atmospheric refraction
+
+
+
+
+
+
+ Correct for the effect of sun's gravity on star positions, as predicted by General Relativity, and verified by Eddington's experiment.
+
+
+ General Relativity effects near the sun
+
+
+
+
+
+
+ Checking this option causes recomputation of current equatorial coordinates from catalog coordinates (i.e. application of precession, nutation and aberration corrections) for every redraw of the map. This makes processing slower when there are many stars to handle, but is more likely to be bug-free. There are known bugs in the rendering of stars when this recomputation is avoided.
+
+
+ Always recompute coordinates
+
+
+
+
+
+
+
+
+
+ DSS Imagery
+
+
+
+
+
+ Default DSS Image Size:
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 75
+ 0
+
+
+
+ 1
+
+
+ 1.000000000000000
+
+
+ 75.000000000000000
+
+
+ 15.000000000000000
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+ arcminutes
+
+
+
+
+
+
+ Padding around Deep Sky Objects:
+
+
+
+
+
+
+
+ 75
+ 0
+
+
+
+ 1
+
+
+ 1.000000000000000
+
+
+ 75.000000000000000
+
+
+ 10.000000000000000
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+ arcminutes
+
+
+
+
+
+
+
@@ -501,109 +407,82 @@
-
-
- Show slewing motion when focus changes?
-
-
- If checked, changing the focus position will result in a visible animated "slew" to the new position. Otherwise, the display will center on the new position instantaneously.
-
-
- Use animated slewing
-
-
-
-
-
-
- Show name label of centered object?
-
-
- If checked, a name label will be temporarily attached to an object while it is centered in the display. You can attach a more persistent label to any object using the right-click popup menu.
-
-
- Attach label to centered object
-
-
-
-
-
-
- Show name label of centered object?
-
-
- If checked, a name label will be temporarily attached to an object while it is centered in the display. You can attach a more persistent label to any object using the right-click popup menu.
-
-
- Attach temporary label when hovering mouse
-
-
-
-
-
-
- Select this for smoother (but slower) graphics
-
-
- Use antialiased drawing
-
-
-
-
-
-
- Do not draw all objects while the map is moving?
-
-
- When the map is in motion, smooth animation is compromised if the program has too many objects to draw on the map; check this item to temporarily hide some of the objects while the display is in motion.
-
-
- Hide objects while moving
-
-
-
-
-
-
- 6
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
+
+
+
+
+ Show slewing motion when focus changes?
+
+
+ If checked, changing the focus position will result in a visible animated "slew" to the new position. Otherwise, the display will center on the new position instantaneously.
+
- Also hide if time step larger than:
+ Use animated slewing
-
-
+
+
+
+ Show name label of centered object?
+
+
+ If checked, a name label will be temporarily attached to an object while it is centered in the display. You can attach a more persistent label to any object using the right-click popup menu.
+
+
+ Attach label to centered object
+
+
-
-
-
- Qt::Horizontal
+
+
+
+ Select this for smoother (but slower) graphics
-
- QSizePolicy::Expanding
+
+ Use antialiased drawing
-
-
- 111
- 20
-
+
+
+
+
+
+ Show name label of centered object?
+
+
+ If checked, a name label will be temporarily attached to an object while it is centered in the display. You can attach a more persistent label to any object using the right-click popup menu.
+
+
+ Attach temporary label when hovering mouse
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Do not draw all objects while the map is moving?
+
+
+ When the map is in motion, smooth animation is compromised if the program has too many objects to draw on the map; check this item to temporarily hide some of the objects while the display is in motion.
-
+
+ Hide objects while moving
+
+
+
+
+
+
+ Also hide if time step larger than:
+
+
@@ -1073,7 +952,6 @@
kcfg_UseHoverLabelkcfg_UseAntialiaskcfg_HideOnSlew
- SlewTimeScalekcfg_HideStarskcfg_MagLimitHideStarkcfg_HidePlanets
From mutlaqja at ikarustech.com Wed Feb 15 11:01:09 2017
From: mutlaqja at ikarustech.com (Jasem Mutlaq)
Date: Wed, 15 Feb 2017 14:01:09 +0300
Subject: Fwd: Rotation of projection plane
In-Reply-To:
References:
Message-ID:
---------- Forwarded message ----------
From: "Artem Fedoskin"
Date: Feb 15, 2017 2:00 PM
Subject: Fwd: Rotation of projection plane
To: "Jasem Mutlaq"
Cc:
Dear contributors and users of KStars,
At the moment I am working on "Automatic mode" for KStars Lite (that is, a
mode in which Sky Map is controlled by accelerometer and magnetometer of
your smartphone). I built Java backend for getting data from sensors data
but I have the following problem:
Imagine you a pointing to the Moon (a center of your screen is pointing to
the Moon). If you will rotate the screen of you phone around the Moon
without rotating the whole Sky Map the image will stay same. The goal is to
rotate the Sky Map so that your smartphone still points to the Moon but all
other parts of Sky Map will change according to rotation (imagine of your
smartphone as a window to the sky or simply check Google Skymap in Play
Store).
Right now I am getting the following when I rotate SkyMapLite according to
roll data from sensors. As you can see, current projection system is not
rotated therefore objects that should be drawn are hidden and ground
polygon isn't drawn correctly ( I guess in case of ground I will simply
disable its rectangle form and draw the whole thing in Automatic mode).
http://imgur.com/a/QCFxc
[image: Inline image 1]
What I have already tried is the following - http://math.stackexchange.com/
questions/270194/how-to-find-the-vertices-angle-after-rotation I am
calculating new coordinates according to formulas in Projector::
checkVisibility( SkyPoint *p ) but it doesn't work. Any ideas how should I
calculate new points?
You can check "Automatic mode" by building KStars Lite using the following
script https://github.com/knro/build_kstarslite/.
My another small question is - should we set slewing to false in "Automatic
mode"? With slewing set to "on" it will be just like controlling Sky Map
with touch screen and won't be that spectacular as a lot of objects are
hidden. But on the other hand it will make automatic mode much smoother on
low-end devices.
Regards, Artem
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kstars_lite_rotation.png
Type: image/png
Size: 78949 bytes
Desc: not available
URL:
From raphael.cojocaru at gmail.com Wed Feb 15 15:17:09 2017
From: raphael.cojocaru at gmail.com (Cojocaru Raphael)
Date: Wed, 15 Feb 2017 17:17:09 +0200
Subject: SoK project is done
Message-ID:
Hi guys!
As you probably know, this year KStars took part in Season of KDE program.
Our project was called “Update KStars Images for Messier Objects” and aimed
to collect a new and complete set of images for the whole Messier Catalog
along with orientation (angle from north) and pixel scale (arcsecs/pixel)
for each object. The project was a real success, having Aniketh as
student. He worked constantly and followed all the required steps for
completing this project. Firstly, we had to find out the best sources. A
good source was a reliable source and at the same time a source that
provides us the data needed (orientation and pixel scale) along with the
image itself.
After we found the sources for each Messier object, Aniketh collected the
data and took care of the image background. All the images had to be processed
for overlaying onto KStars SkyMap, so each of them must have transparency
where the background sky is. Aniketh came with a clever idea and thus,
removing the background has been done easily by using a Python program.
Also, if for any Messier object the data required was missing, Aniketh
asked the author personally in order to get it.
The next and final step was solving the legal issues regarding authors’
rights. After a discussion with Jasem, we decided over a CC license (
https://creativecommons.org/licenses/by-sa/3.0/ ). Then, Aniketh asked all
authors if they agree with it. He succeeded on this too, all authors giving
their permission.
All the work can be found in the following public repository:
https://github.com/Aniketh01/SoK-KStars
As I suggested, for each Messier object, Aniketh kept the following:
- The image processed
- The original image (raw image)
- The data
- An evidence of copyright approval
Now, since this project is complete, the images can be integrated in KStars
and thus, the old images can be replaced.
Best regards,
Raphael
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From hans at lambermont.dyndns.org Wed Feb 15 20:12:33 2017
From: hans at lambermont.dyndns.org (Hans)
Date: Wed, 15 Feb 2017 21:12:33 +0100
Subject: SoK project is done
In-Reply-To:
References:
Message-ID: <20170215201233.GF28086@leia.lambermont.dyndns.org>
Congratulations to Aniketh for completing the project !
-- Hans
Cojocaru Raphael wrote on 20170215:
> Hi guys!
>
>
> As you probably know, this year KStars took part in Season of KDE program.
> Our project was called “Update KStars Images for Messier Objects” and aimed
> to collect a new and complete set of images for the whole Messier Catalog
> along with orientation (angle from north) and pixel scale (arcsecs/pixel)
> for each object. The project was a real success, having Aniketh as
> student. He worked constantly and followed all the required steps for
> completing this project. Firstly, we had to find out the best sources. A
> good source was a reliable source and at the same time a source that
> provides us the data needed (orientation and pixel scale) along with the
> image itself.
>
> After we found the sources for each Messier object, Aniketh collected the
> data and took care of the image background. All the images had to be processed
> for overlaying onto KStars SkyMap, so each of them must have transparency
> where the background sky is. Aniketh came with a clever idea and thus,
> removing the background has been done easily by using a Python program.
> Also, if for any Messier object the data required was missing, Aniketh
> asked the author personally in order to get it.
>
>
>
> The next and final step was solving the legal issues regarding authors’
> rights. After a discussion with Jasem, we decided over a CC license (
> https://creativecommons.org/licenses/by-sa/3.0/ ). Then, Aniketh asked all
> authors if they agree with it. He succeeded on this too, all authors giving
> their permission.
>
>
>
> All the work can be found in the following public repository:
>
> https://github.com/Aniketh01/SoK-KStars
>
>
>
> As I suggested, for each Messier object, Aniketh kept the following:
>
>
>
> - The image processed
>
> - The original image (raw image)
>
> - The data
>
> - An evidence of copyright approval
>
>
>
> Now, since this project is complete, the images can be integrated in KStars
> and thus, the old images can be replaced.
>
>
>
> Best regards,
>
> Raphael
From mutlaqja at ikarustech.com Fri Feb 17 17:29:41 2017
From: mutlaqja at ikarustech.com (Jasem Mutlaq)
Date: Fri, 17 Feb 2017 20:29:41 +0300
Subject: KStars 2.7.4 for Windows is released
Message-ID:
Hello all,
For our Windows users out there, please download and try our latest
release! Wrote a blog post about the release here:
http://knro.blogspot.com/2017/02/kstars-274-for-windows-is-released.html
--
Best Regards,
Jasem Mutlaq
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From null at kde.org Mon Feb 20 07:19:51 2017
From: null at kde.org (Jasem Mutlaq)
Date: Mon, 20 Feb 2017 07:19:51 +0000
Subject: [kstars] kstars: This patch fixes several things you asked me to
take a look at.
Message-ID:
Git commit ddc789ba0f02e04a412d2155367f809402bffe3e by Jasem Mutlaq, on behalf of Robert Lancaster.
Committed on 20/02/2017 at 07:17.
Pushed by mutlaqja into branch 'master'.
This patch fixes several things you asked me to take a look at.
First, it changes the color of the center telescope cursor to red to make it more visible when trying to center the telescope.
Second, it makes the center Telescope Cursor switch back to whatever cursor you had before after you start a slew and will reset whatever button was checked to make the center telescope function work.
Third, the floating toolbar looked like buttons were not checked when in fact they were checked, so I adjusted the colors a bit. This fix had an extra benefit of making the toolbar a little smaller, matching the button size.
Finally, I changed the mouse cursor for the Preview view to be drag mouse, just like the fits viewer.
CCMAIL:kstars-devel at kde.org
M +1 -0 kstars/CMakeLists.txt
A +64 -0 kstars/data/icons/center_telescope_red.svg
M +1 -0 kstars/data/kstars.qrc
M +1 -0 kstars/ekos/ekosmanager.cpp
M +127 -443 kstars/fitsviewer/fitsview.cpp
M +19 -54 kstars/fitsviewer/fitsview.h
M +3 -1 kstars/fitsviewer/fitsviewer.cpp
https://commits.kde.org/kstars/ddc789ba0f02e04a412d2155367f809402bffe3e
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index 16ac8dd30..7baebad8d 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -42,6 +42,7 @@ if(NOT BUILD_KSTARS_LITE)
fitsviewer/fitshistogram.cpp
fitsviewer/fitsdata.cpp
fitsviewer/fitsview.cpp
+ fitsviewer/fitslabel.cpp
fitsviewer/fitsviewer.cpp
fitsviewer/fitstab.cpp
fitsviewer/fitsdebayer.cpp
diff --git a/kstars/data/icons/center_telescope_red.svg b/kstars/data/icons/center_telescope_red.svg
new file mode 100644
index 000000000..ddad86a72
--- /dev/null
+++ b/kstars/data/icons/center_telescope_red.svg
@@ -0,0 +1,64 @@
+
+
diff --git a/kstars/data/kstars.qrc b/kstars/data/kstars.qrc
index 5c7307a03..483dab992 100644
--- a/kstars/data/kstars.qrc
+++ b/kstars/data/kstars.qrc
@@ -131,6 +131,7 @@
icons/breeze/default/view-filter.svgicons/breeze/default/media-record.svgicons/breeze/default/camera-photo.svg
+ icons/center_telescope_red.svgkstars.knsrc
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index 4e6768fff..db31c5569 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -187,6 +187,7 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(parent)
previewView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
previewView->setBaseSize(previewWidget->size());
previewView->createFloatingToolBar();
+ previewView->setMouseMode(FITSView::dragMouse);
QVBoxLayout *vlayout = new QVBoxLayout();
vlayout->addWidget(previewView);
previewWidget->setLayout(vlayout);
diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp
index 3c5a93ba6..e0434a42d 100644
--- a/kstars/fitsviewer/fitsview.cpp
+++ b/kstars/fitsviewer/fitsview.cpp
@@ -1,21 +1,13 @@
-/***************************************************************************
- FITSView.cpp - FITS Image
- -------------------
- begin : Thu Jan 22 2004
- copyright : (C) 2004 by Jasem Mutlaq
- email : mutlaqja at ikarustech.com
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program 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. *
- * *
- * Some code fragments were adapted from Peter Kirchgessner's FITS plugin*
- * See http://members.aol.com/pkirchg for more details. *
- ***************************************************************************/
+/* FITS View
+ Copyright (C) 2003-2017 Jasem Mutlaq
+ Copyright (C) 2016-2017 Robert Lancaster
+
+ 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
#include "fitsview.h"
@@ -52,9 +44,10 @@
#include
#include
+#include "Options.h"
#include "kstarsdata.h"
#include "ksutils.h"
-#include "Options.h"
+#include "fitslabel.h"
#ifdef HAVE_INDI
#include "basedevice.h"
@@ -70,422 +63,6 @@
#define ZOOM_LOW_INCR 10
#define ZOOM_HIGH_INCR 50
-//#define FITS_DEBUG
-
-FITSLabel::FITSLabel(FITSView *img, QWidget *parent) : QLabel(parent)
-{
- image = img;
-
-}
-
-void FITSLabel::setSize(double w, double h)
-{
- width = w;
- height = h;
- size = w*h;
-}
-
-FITSLabel::~FITSLabel() {}
-
-/**
-This method looks at what mouse mode is currently selected and updates the cursor to match.
- */
-
-void FITSView::updateMouseCursor(){
- if(mouseMode==dragMouse){
- if(horizontalScrollBar()->maximum()>0||verticalScrollBar()->maximum()>0){
- if(!image_frame->getMouseButtonDown())
- viewport()->setCursor(Qt::PointingHandCursor);
- else
- viewport()->setCursor(Qt::ClosedHandCursor);
- }
- else
- viewport()->setCursor(Qt::CrossCursor);
- }
- if(mouseMode==selectMouse){
- viewport()->setCursor(Qt::CrossCursor);
- }
- if(mouseMode==scopeMouse){
- QPixmap scope_pix=QPixmap(":/icons/center_telescope.svg").scaled(32,32,Qt::KeepAspectRatio,Qt::FastTransformation);
- viewport()->setCursor(QCursor(scope_pix,10,10));
- }
-}
-
-/**
-This is how the mouse mode gets set.
-The default for a FITSView in a FITSViewer should be the dragMouse
-The default for a FITSView in the Focus or Align module should be the selectMouse
-The different defaults are accomplished by putting making the dactual default mouseMode
-the selectMouse, but when a FITSViewer loads an image, it immediately makes it the dragMouse.
- */
-
-void FITSView::setMouseMode(int mode){
- if(mode>-1&&mode<3){
- mouseMode=mode;
- updateMouseCursor();
- }
-}
-
-bool FITSLabel::getMouseButtonDown(){
- return mouseButtonDown;
-}
-
-int FITSView::getMouseMode(){
- return mouseMode;
-}
-
-
-void FITSView::enterEvent(QEvent *)
-{
- if(floatingToolBar&&imageData){
- QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
- floatingToolBar->setGraphicsEffect(eff);
- QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
- a->setDuration(500);
- a->setStartValue(0.2);
- a->setEndValue(1);
- a->setEasingCurve(QEasingCurve::InBack);
- a->start(QPropertyAnimation::DeleteWhenStopped);
- }
-}
-
-void FITSView::leaveEvent(QEvent *)
-{
- if(floatingToolBar&&imageData){
- QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
- floatingToolBar->setGraphicsEffect(eff);
- QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
- a->setDuration(500);
- a->setStartValue(1);
- a->setEndValue(0.2);
- a->setEasingCurve(QEasingCurve::OutBack);
- a->start(QPropertyAnimation::DeleteWhenStopped);
- }
-
-}
-
-/**
-This method was added to make the panning function work.
-If the mouse button is released, it resets mouseButtonDown variable and the mouse cursor.
- */
-void FITSLabel::mouseReleaseEvent(QMouseEvent *e)
-{
- Q_UNUSED(e);
- if(image->getMouseMode()==FITSView::dragMouse){
- mouseButtonDown=false;
- image->updateMouseCursor();
- }
-}
-/**
-I added some things to the top of this method to allow panning and Scope slewing to function.
-If you are in the dragMouse mode and the mousebutton is pressed, The method checks the difference
-between the location of the last point stored and the current event point to see how the mouse has moved.
-Then it moves the scrollbars and thus the image to the right location.
-Then it stores the current point so next time it can do it again.
- */
-void FITSLabel::mouseMoveEvent(QMouseEvent *e)
-{
- float scale=(image->getCurrentZoom() / ZOOM_DEFAULT);
-
- if(image->getMouseMode()==FITSView::dragMouse&&mouseButtonDown){
- QPoint newPoint=e->globalPos();
- int dx=newPoint.x()-lastMousePoint.x();
- int dy=newPoint.y()-lastMousePoint.y();
- image->horizontalScrollBar()->setValue(image->horizontalScrollBar()->value()-dx);
- image->verticalScrollBar()->setValue(image->verticalScrollBar()->value()-dy);
-
- lastMousePoint=newPoint;
- }
-
- double x,y;
- FITSData *image_data = image->getImageData();
-
- uint8_t *buffer = image_data->getImageBuffer();
-
- if (buffer == NULL)
- return;
-
- x = round(e->x() / scale);
- y = round(e->y() / scale);
-
- x = KSUtils::clamp(x, 1.0, width);
- y = KSUtils::clamp(y, 1.0, height);
-
- emit newStatus(QString("X:%1 Y:%2").arg( (int)x ).arg( (int)y ), FITS_POSITION);
-
- // Range is 0 to dim-1 when accessing array
- x -= 1;
- y -= 1;
-
- QString stringValue;
-
- switch (image_data->getDataType())
- {
- case TBYTE:
- stringValue = QLocale().toString(buffer[(int) (y * width + x)]);
- break;
-
- case TSHORT:
- stringValue = QLocale().toString( (reinterpret_cast(buffer)) [(int) (y * width + x)]);
- break;
-
- case TUSHORT:
- stringValue = QLocale().toString( (reinterpret_cast(buffer)) [(int) (y * width + x)]);
- break;
-
- case TLONG:
- stringValue = QLocale().toString( (reinterpret_cast(buffer)) [(int) (y * width + x)]);
- break;
-
- case TULONG:
- stringValue = QLocale().toString( (reinterpret_cast(buffer)) [(int) (y * width + x)]);
- break;
-
- case TFLOAT:
- stringValue = QLocale().toString( (reinterpret_cast(buffer)) [(int) (y * width + x)], 'f', 5);
- break;
-
- case TLONGLONG:
- stringValue = QLocale().toString(static_cast((reinterpret_cast(buffer)) [(int) (y * width + x)]));
- break;
-
- case TDOUBLE:
- stringValue = QLocale().toString( (reinterpret_cast(buffer)) [(int) (y * width + x)], 'f', 5);
-
- break;
-
- default:
- break;
- }
-
- emit newStatus(stringValue, FITS_VALUE);
-
- if (image_data->hasWCS()&&image->getMouseMode()!=FITSView::selectMouse)
- {
- int index = x + y * width;
-
- wcs_point * wcs_coord = image_data->getWCSCoord();
-
- if (wcs_coord)
- {
- if (index > size)
- return;
-
- ra.setD(wcs_coord[index].ra);
- dec.setD(wcs_coord[index].dec);
-
- emit newStatus(QString("%1 , %2").arg( ra.toHMSString()).arg(dec.toDMSString()), FITS_WCS);
- }
-
- bool objFound=false;
- foreach(FITSSkyObject *listObject, image_data->objList){
- if((std::abs(listObject->x()-x)<5/scale)&&(std::abs(listObject->y()-y)<5/scale)){
- QToolTip::showText(e->globalPos(), listObject->skyObject()->name() +"\n"+listObject->skyObject()->longname() , this);
- objFound=true;
- break;
- }
- }
- if(!objFound)
- QToolTip::hideText();
- }
-
- double HFR = image->getImageData()->getHFR(x, y);
-
- if (HFR > 0)
- QToolTip::showText(e->globalPos(), i18nc("Half Flux Radius", "HFR: %1", QString::number(HFR, 'g' , 3)), this);
-
- //setCursor(Qt::CrossCursor);
-
- e->accept();
-}
-
-/**
-I added some things to the top of this method to allow panning and Scope slewing to function.
-If in dragMouse mode, the Panning function works by storing the cursor position when the mouse was pressed and setting
-the mouseButtonDown variable to true.
-If in ScopeMouse mode and the mouse is clicked, if there is WCS data and a scope is available, the method will verify that you actually
-do want to slew to the WCS coordinates associated with the click location. If so, it calls the centerTelescope function.
- */
-
-void FITSLabel::mousePressEvent(QMouseEvent *e)
-{
- float scale=(image->getCurrentZoom() / ZOOM_DEFAULT);
-
- if(image->getMouseMode()==FITSView::dragMouse)
- {
- mouseButtonDown=true;
- lastMousePoint=e->globalPos();
- image->updateMouseCursor();
- } else if(e->buttons() & Qt::LeftButton&&image->getMouseMode()==FITSView::scopeMouse)
- {
-#ifdef HAVE_INDI
- FITSData *image_data = image->getImageData();
- if (image_data->hasWCS())
- {
-
- wcs_point * wcs_coord = image_data->getWCSCoord();
- double x,y;
- x = round(e->x() / scale);
- y = round(e->y() / scale);
-
- x = KSUtils::clamp(x, 1.0, width);
- y = KSUtils::clamp(y, 1.0, height);
- int index = x + y * width;
- if(KMessageBox::Continue==KMessageBox::warningContinueCancel(NULL, "Slewing to Coordinates: \nRA: " + dms(wcs_coord[index].ra).toHMSString() + "\nDec: " + dms(wcs_coord[index].dec).toDMSString(),
- i18n("Continue Slew"), KStandardGuiItem::cont(), KStandardGuiItem::cancel(), "continue_slew_warning")){
- centerTelescope(wcs_coord[index].ra/15.0, wcs_coord[index].dec);
- }
- }
-#endif
- }
-
- double x,y;
-
- x = round(e->x() / scale);
- y = round(e->y() / scale);
-
- x = KSUtils::clamp(x, 1.0, width);
- y = KSUtils::clamp(y, 1.0, height);
-
-#ifdef HAVE_INDI
- FITSData *image_data = image->getImageData();
-
- if (e->buttons() & Qt::RightButton&&image->getMouseMode()!=FITSView::scopeMouse)
- {
- mouseReleaseEvent(e);
- if (image_data->hasWCS())
- {
- foreach(FITSSkyObject *listObject, image_data->objList){
- if((std::abs(listObject->x()-x)<5/scale)&&(std::abs(listObject->y()-y)<5/scale)){
- SkyObject *object=listObject->skyObject();
- KSPopupMenu *pmenu;
- pmenu=new KSPopupMenu();
- object->initPopupMenu(pmenu);
- QList actions= pmenu->actions();
- foreach(QAction *action,actions){
- if(action->text().left(7)=="Starhop")
- pmenu->removeAction(action);
- if(action->text().left(7)=="Angular")
- pmenu->removeAction(action);
- if(action->text().left(8)=="Add flag")
- pmenu->removeAction(action);
- if(action->text().left(12)=="Attach Label")
- pmenu->removeAction(action);
- }
- pmenu->popup(e->globalPos());
- KStars::Instance()->map()->setClickedObject(object);
- break;
- }
- }
- }
-
- if (fabs(image->markerCrosshair.x()-x) <= 15 && fabs(image->markerCrosshair.y()-y) <= 15)
- emit markerSelected(0, 0);
- }
-#endif
-
- if (e->buttons() & Qt::LeftButton&&image->getMouseMode()==FITSView::selectMouse)
- {
- emit pointSelected(x, y);
- }
-
-}
-
-void FITSLabel::mouseDoubleClickEvent(QMouseEvent *e)
-{
- double x,y;
-
- x = round(e->x() / (image->getCurrentZoom() / ZOOM_DEFAULT));
- y = round(e->y() / (image->getCurrentZoom() / ZOOM_DEFAULT));
-
- x = KSUtils::clamp(x, 1.0, width);
- y = KSUtils::clamp(y, 1.0, height);
-
- emit markerSelected(x, y);
-
- return;
-}
-
-/**
-This method just verifies if INDI is online, a telescope present, and is connected
- */
-
-bool FITSView::isTelescopeActive(){
-#ifdef HAVE_INDI
- if (INDIListener::Instance()->size() == 0)
- {
- return false;
- }
-
- foreach(ISD::GDInterface *gd, INDIListener::Instance()->getDevices())
- {
- INDI::BaseDevice *bd = gd->getBaseDevice();
-
- if (gd->getType() != KSTARS_TELESCOPE)
- continue;
-
- if (bd == NULL)
- continue;
-
- return bd->isConnected();
- }
- return false;
-#else
- return false;
-#endif
-}
-
-void FITSLabel::centerTelescope(double raJ2000, double decJ2000)
-{
-#ifdef HAVE_INDI
-
- if (INDIListener::Instance()->size() == 0)
- {
- KMessageBox::sorry(0, i18n("KStars did not find any active telescopes."));
- return;
- }
-
- foreach(ISD::GDInterface *gd, INDIListener::Instance()->getDevices())
- {
- INDI::BaseDevice *bd = gd->getBaseDevice();
-
- if (gd->getType() != KSTARS_TELESCOPE)
- continue;
-
- if (bd == NULL)
- continue;
-
- if (bd->isConnected() == false)
- {
- KMessageBox::error(0, i18n("Telescope %1 is offline. Please connect and retry again.", gd->getDeviceName()));
- return;
- }
-
- ISD::GDSetCommand SlewCMD(INDI_SWITCH, "ON_COORD_SET", "TRACK", ISS_ON, this);
-
- SkyObject selectedObject;
-
- selectedObject.setRA0(raJ2000);
- selectedObject.setDec0(decJ2000);
-
- selectedObject.apparentCoord(J2000, KStarsData::Instance()->ut().djd());
-
- gd->setProperty(&SlewCMD);
- gd->runCommand(INDI_SEND_COORDS, &selectedObject);
-
- return;
- }
-
- KMessageBox::sorry(0, i18n("KStars did not find any active telescopes."));
-
-#else
-
- Q_UNUSED(raJ2000);
- Q_UNUSED(decJ2000);
-
-#endif
-}
-
FITSView::FITSView(QWidget * parent, FITSMode fitsMode, FITSScale filterType) : QScrollArea(parent) , zoomFactor(1.2)
{
@@ -525,6 +102,8 @@ FITSView::FITSView(QWidget * parent, FITSMode fitsMode, FITSScale filterType) :
noImageLabel->setAlignment(Qt::AlignCenter);
this->setWidget(noImageLabel);
+ scopePixmap = QPixmap(":/icons/center_telescope_red.svg").scaled(32,32,Qt::KeepAspectRatio,Qt::FastTransformation);
+
//if (fitsMode == FITS_GUIDE)
//connect(image_frame, SIGNAL(pointSelected(int,int)), this, SLOT(processPointSelection(int,int)));
@@ -541,6 +120,44 @@ FITSView::~FITSView()
delete(display_image);
}
+/**
+This method looks at what mouse mode is currently selected and updates the cursor to match.
+ */
+
+void FITSView::updateMouseCursor(){
+ if(mouseMode==dragMouse){
+ if(horizontalScrollBar()->maximum()>0||verticalScrollBar()->maximum()>0){
+ if(!image_frame->getMouseButtonDown())
+ viewport()->setCursor(Qt::PointingHandCursor);
+ else
+ viewport()->setCursor(Qt::ClosedHandCursor);
+ }
+ else
+ viewport()->setCursor(Qt::CrossCursor);
+ }
+ if(mouseMode==selectMouse){
+ viewport()->setCursor(Qt::CrossCursor);
+ }
+ if(mouseMode==scopeMouse){
+ viewport()->setCursor(QCursor(scopePixmap,10,10));
+ }
+}
+
+/**
+This is how the mouse mode gets set.
+The default for a FITSView in a FITSViewer should be the dragMouse
+The default for a FITSView in the Focus or Align module should be the selectMouse
+The different defaults are accomplished by putting making the actual default mouseMode
+the selectMouse, but when a FITSViewer loads an image, it immediately makes it the dragMouse.
+ */
+
+void FITSView::setMouseMode(int mode){
+ if(mode>-1&&mode<3){
+ mouseMode=mode;
+ updateMouseCursor();
+ }
+}
+
void FITSView::resizeEvent(QResizeEvent * event){
if(!imageData&&noImageLabel){
noImageLabel->setPixmap(noImage.scaled( width()-20, height()-20,Qt::KeepAspectRatio,Qt::FastTransformation));
@@ -718,6 +335,40 @@ int FITSView::rescale(FITSZoom type)
return 0;
}
+int FITSView::getMouseMode(){
+ return mouseMode;
+}
+
+
+void FITSView::enterEvent(QEvent *)
+{
+ if(floatingToolBar&&imageData){
+ QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
+ floatingToolBar->setGraphicsEffect(eff);
+ QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
+ a->setDuration(500);
+ a->setStartValue(0.2);
+ a->setEndValue(1);
+ a->setEasingCurve(QEasingCurve::InBack);
+ a->start(QPropertyAnimation::DeleteWhenStopped);
+ }
+}
+
+void FITSView::leaveEvent(QEvent *)
+{
+ if(floatingToolBar&&imageData){
+ QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
+ floatingToolBar->setGraphicsEffect(eff);
+ QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
+ a->setDuration(500);
+ a->setStartValue(1);
+ a->setEndValue(0.2);
+ a->setEasingCurve(QEasingCurve::OutBack);
+ a->start(QPropertyAnimation::DeleteWhenStopped);
+ }
+
+}
+
template int FITSView::rescale(FITSZoom type)
{
double val=0;
@@ -1691,8 +1342,10 @@ void FITSView::createFloatingToolBar()
eff->setOpacity(0.2);
floatingToolBar->setVisible(false);
floatingToolBar->setStyleSheet("QToolBar{background: rgba(150, 150, 150, 210); border:none; color: yellow}"
- "QToolButton{background: transparent; color: yellow}"
- "QToolButton:hover{background: rgba(200, 200, 200, 255); color: yellow}");
+ "QToolButton{background: transparent; border:none; color: yellow}"
+ "QToolButton:hover{background: rgba(200, 200, 200, 255);border:solid; color: yellow}"
+ "QToolButton:checked{background: rgba(110, 110, 110, 255);border:solid; color: yellow}"
+ );
floatingToolBar->setFloatable(true);
floatingToolBar->setIconSize(QSize(25,25));
//floatingToolBar->setMovable(true);
@@ -1746,10 +1399,11 @@ void FITSView::centerTelescope()
if(imageHasWCS()){
if(getMouseMode()==FITSView::scopeMouse)
{
- setMouseMode(FITSView::selectMouse);
+ setMouseMode(lastMouseMode);
}
else
{
+ lastMouseMode=getMouseMode();
setMouseMode(FITSView::scopeMouse);
}
updateFrame();
@@ -1760,13 +1414,43 @@ void FITSView::centerTelescope()
void FITSView::updateScopeButton()
{
- if(getMouseMode()==FITSView::scopeMouse)
+ if(centerTelescopeAction){
+ if(getMouseMode()==FITSView::scopeMouse)
+ {
+ centerTelescopeAction->setChecked(true);
+ }
+ else
+ {
+ centerTelescopeAction->setChecked(false);
+ }
+ }
+}
+
+/**
+This method just verifies if INDI is online, a telescope present, and is connected
+ */
+
+bool FITSView::isTelescopeActive(){
+#ifdef HAVE_INDI
+ if (INDIListener::Instance()->size() == 0)
{
- centerTelescopeAction->setChecked(true);
+ return false;
}
- else
+
+ foreach(ISD::GDInterface *gd, INDIListener::Instance()->getDevices())
{
- centerTelescopeAction->setChecked(false);
+ INDI::BaseDevice *bd = gd->getBaseDevice();
+
+ if (gd->getType() != KSTARS_TELESCOPE)
+ continue;
+
+ if (bd == NULL)
+ continue;
+
+ return bd->isConnected();
}
+ return false;
+#else
+ return false;
+#endif
}
-
diff --git a/kstars/fitsviewer/fitsview.h b/kstars/fitsviewer/fitsview.h
index 25ff07cc2..de0cf59c8 100644
--- a/kstars/fitsviewer/fitsview.h
+++ b/kstars/fitsviewer/fitsview.h
@@ -1,21 +1,13 @@
-/***************************************************************************
- FITSView.cpp - FITS Image
- -------------------
- begin : Tue Feb 24 2004
- copyright : (C) 2004 by Jasem Mutlaq
- email : mutlaqja at ikarustech.com
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program 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. *
- * *
- * Some code fragments were adapted from Peter Kirchgessner's FITS plugin*
- * See http://members.aol.com/pkirchg for more details. *
- ***************************************************************************/
+/* FITS Label
+ Copyright (C) 2003-2017 Jasem Mutlaq
+ Copyright (C) 2016-2017 Robert Lancaster
+
+ 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.
+*/
+
#ifndef FITSView_H_
#define FITSView_H_
@@ -53,39 +45,7 @@
#define MINIMUM_PIXEL_RANGE 5
#define MINIMUM_STDVAR 5
-class FITSView;
-
-
-class FITSLabel : public QLabel
-{
- Q_OBJECT
-public:
- explicit FITSLabel(FITSView *img, QWidget *parent=NULL);
- virtual ~FITSLabel();
- void setSize(double w, double h);
- void centerTelescope(double raJ2000, double decJ2000);
- bool getMouseButtonDown();
-
-protected:
-
- virtual void mouseMoveEvent(QMouseEvent *e);
- virtual void mousePressEvent(QMouseEvent *e);
- virtual void mouseReleaseEvent(QMouseEvent *e);
- virtual void mouseDoubleClickEvent(QMouseEvent *e);
-
-private:
- bool mouseButtonDown=false;
- QPoint lastMousePoint;
- FITSView *image;
- dms ra;
- dms dec;
- double width,height,size;
-
-signals:
- void newStatus(const QString &msg, FITSBar id);
- void pointSelected(int x, int y);
- void markerSelected(int x, int y);
-};
+class FITSLabel;
class FITSView : public QScrollArea
{
@@ -148,6 +108,10 @@ public:
static const int selectMouse=1;
static const int scopeMouse=2;
+ void updateScopeButton();
+ void setScopeButton(QAction *action){centerTelescopeAction=action;}
+ int lastMouseMode;
+
// Zoom related
void cleanUpZoom(QPoint viewCenter);
QPoint getImagePoint(QPoint viewPortPoint);
@@ -207,7 +171,7 @@ private:
bool event(QEvent *event);
bool gestureEvent(QGestureEvent *event);
void pinchTriggered(QPinchGesture *gesture);
- void updateScopeButton();
+
template int rescale(FITSZoom type);
@@ -253,8 +217,6 @@ private:
QStack filterStack;
-
-
// Star selection algorithm
StarAlgorithm starAlgorithm = ALGORITHM_GRADIENT;
@@ -264,6 +226,9 @@ private:
QRect trackingBox;
QPixmap trackingBoxPixmap;
+ // Scope pixmap
+ QPixmap scopePixmap;
+
// Floating toolbar
QToolBar *floatingToolBar = NULL;
QAction *centerTelescopeAction = NULL;
diff --git a/kstars/fitsviewer/fitsviewer.cpp b/kstars/fitsviewer/fitsviewer.cpp
index 52d41bd60..748f0806c 100644
--- a/kstars/fitsviewer/fitsviewer.cpp
+++ b/kstars/fitsviewer/fitsviewer.cpp
@@ -912,9 +912,11 @@ void FITSViewer::updateScopeButton(){
*/
void FITSViewer::centerTelescope(){
+ getCurrentView()->setScopeButton(actionCollection()->action("center_telescope"));
if(getCurrentView()->getMouseMode()==FITSView::scopeMouse){
- getCurrentView()->setMouseMode(FITSView::dragMouse);
+ getCurrentView()->setMouseMode(getCurrentView()->lastMouseMode);
} else{
+ getCurrentView()->lastMouseMode=getCurrentView()->getMouseMode();
getCurrentView()->setMouseMode(FITSView::scopeMouse);
}
updateScopeButton();
From null at kde.org Mon Feb 20 19:29:56 2017
From: null at kde.org (Jasem Mutlaq)
Date: Mon, 20 Feb 2017 19:29:56 +0000
Subject: [kstars] kstars: Re-work how alignment module options are generated
for different modes (online, offline, remote,
from file) and how they are saved between sessions. Move Alignment options
from Ekos settings to alignment module own settings module.
Message-ID:
Git commit 9764bad786aa851f24493d0b5d6f79a5a3ce3b28 by Jasem Mutlaq.
Committed on 20/02/2017 at 19:27.
Pushed by mutlaqja into branch 'master'.
Re-work how alignment module options are generated for different modes (online, offline, remote, from file) and how they are saved between sessions. Move Alignment options from Ekos settings to alignment module own settings module.
BUGS:376708
FIXED-IN:17.04
CCMAIL:kstars-devel at kde.org
M +5 -1 kstars/CMakeLists.txt
M +259 -470 kstars/ekos/align/align.cpp
M +29 -17 kstars/ekos/align/align.h
M +26 -136 kstars/ekos/align/align.ui
D +0 -696 kstars/ekos/align/astrometryoptions.ui
M +8 -7 kstars/ekos/align/offlineastrometryparser.cpp
M +3 -3 kstars/ekos/align/onlineastrometryparser.cpp
A +91 -0 kstars/ekos/align/opsalign.cpp [License: GPL (v2+)]
A +48 -0 kstars/ekos/align/opsalign.h [License: GPL (v2+)]
A +207 -0 kstars/ekos/align/opsalign.ui
A +156 -0 kstars/ekos/align/opsastrometry.cpp [License: GPL (v2+)]
A +51 -0 kstars/ekos/align/opsastrometry.h [License: GPL (v2+)]
A +741 -0 kstars/ekos/align/opsastrometry.ui
M +1 -1 kstars/ekos/align/remoteastrometryparser.cpp
M +21 -8 kstars/ekos/ekosmanager.cpp
M +0 -63 kstars/ekos/opsekos.cpp
M +0 -6 kstars/ekos/opsekos.h
M +2 -208 kstars/ekos/opsekos.ui
M +121 -64 kstars/kstars.kcfg
https://commits.kde.org/kstars/9764bad786aa851f24493d0b5d6f79a5a3ce3b28
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index 7baebad8d..ad318fb5d 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -129,7 +129,9 @@ if (INDI_FOUND)
ekos/capture/dslrinfo.ui
# Align
ekos/align/align.ui
- ekos/align/astrometryoptions.ui
+ ekos/align/opsekos.ui
+ ekos/align/opsastrometry.ui
+ ekos/align/opsalign.ui
# Focus
ekos/focus/focus.ui
# Mount
@@ -176,6 +178,8 @@ if (INDI_FOUND)
ekos/align/align.cpp
ekos/align/alignview.cpp
ekos/align/astrometryparser.cpp
+ ekos/align/opsastrometry.cpp
+ ekos/align/opsalign.cpp
ekos/align/offlineastrometryparser.cpp
ekos/align/onlineastrometryparser.cpp
ekos/align/remoteastrometryparser.cpp
diff --git a/kstars/ekos/align/align.cpp b/kstars/ekos/align/align.cpp
index 3be686c19..f0df0bd21 100644
--- a/kstars/ekos/align/align.cpp
+++ b/kstars/ekos/align/align.cpp
@@ -20,6 +20,7 @@
#include
#include
+#include
#include
#include "ekos/auxiliary/QProgressIndicator.h"
@@ -37,8 +38,8 @@
#include "onlineastrometryparser.h"
#include "offlineastrometryparser.h"
#include "remoteastrometryparser.h"
-
-#include "ui_astrometryoptions.h"
+#include "opsastrometry.h"
+#include "opsalign.h"
#include
@@ -87,7 +88,7 @@ Align::Align()
retries=0;
targetDiff=1e6;
solverIterations=0;
- fov_x=fov_y=0;
+ fov_x=fov_y=fov_pixscale=0;
parser = NULL;
solverFOV = new FOV();
@@ -116,10 +117,12 @@ Align::Align()
connect(stopB, SIGNAL(clicked()), this, SLOT(abort()));
connect(measureAltB, SIGNAL(clicked()), this, SLOT(measureAltError()));
connect(measureAzB, SIGNAL(clicked()), this, SLOT(measureAzError()));
+#if 0
connect(raBox, SIGNAL(textChanged( const QString & ) ), this, SLOT( checkLineEdits() ) );
connect(decBox, SIGNAL(textChanged( const QString & ) ), this, SLOT( checkLineEdits() ) );
connect(syncBoxesB, SIGNAL(clicked()), this, SLOT(copyCoordsToBoxes()));
connect(clearBoxesB, SIGNAL(clicked()), this, SLOT(clearCoordBoxes()));
+#endif
connect(editOptionsB,SIGNAL(clicked()), this, SLOT(slotEditOptions()));
connect(CCDCaptureCombo, SIGNAL(activated(QString)), this, SLOT(setDefaultCCD(QString)));
@@ -143,13 +146,25 @@ Align::Align()
gotoModeButtonGroup->button(currentGotoMode)->setChecked(true);
editOptionsB->setIcon(QIcon::fromTheme("document-edit", QIcon(":/icons/breeze/default/document-edit.svg")));
- editOptionsB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
+ editOptionsB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
+ KConfigDialog* dialog = new KConfigDialog(this, "alignsettings", Options::self());
+
+ opsAlign = new OpsAlign(this);
+ dialog->addPage(opsAlign, i18n("Astrometry.net"));
+
+ opsAstrometry = new OpsAstrometry(this);
+ dialog->addPage(opsAstrometry, i18n("Solver Options"));
+ connect(editOptionsB, SIGNAL(clicked()), dialog, SLOT(show()));
+
+
+#if 0
syncBoxesB->setIcon(QIcon::fromTheme("edit-copy", QIcon(":/icons/breeze/default/edit-copy.svg")));
syncBoxesB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
clearBoxesB->setIcon(QIcon::fromTheme("edit-clear", QIcon(":/icons/breeze/default/edit-clear.svg")));
clearBoxesB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
raBox->setDegType(false); //RA box should be HMS-style
+#endif
appendLogText(i18n("Idle."));
@@ -196,7 +211,7 @@ Align::Align()
connect(parser, SIGNAL(solverFailed()), this, SLOT(solverFailed()), Qt::UniqueConnection);
}
- solverOptions->setText(Options::solverOptions());
+ //solverOptions->setText(Options::solverOptions());
// Which telescope info to use for FOV calculations
//kcfg_solverOTA->setChecked(Options::solverOTA());
@@ -450,10 +465,9 @@ void Align::syncTelescopeInfo()
QString::number(guideFL, 'f', 2),
QString::number(guideAperture, 'f', 2)), Qt::ToolTipRole);
calculateFOV();
- }
- if (currentCCD)
generateArgs();
+ }
}
@@ -488,7 +502,7 @@ void Align::syncCCDInfo()
ISwitchVectorProperty *svp = currentCCD->getBaseDevice()->getSwitch("WCS_CONTROL");
if (svp)
- setWCSEnabled(Options::solverWCS());
+ setWCSEnabled(Options::astrometrySolverWCS());
targetChip->setImageView(alignView, FITS_ALIGN);
@@ -515,20 +529,31 @@ void Align::syncCCDInfo()
return;
if (ccd_hor_pixel != -1 && ccd_ver_pixel != -1 && focal_length != -1 && aperture != -1)
+ {
calculateFOV();
-
- if (currentCCD && currentTelescope)
generateArgs();
-
+ }
}
+void Align::getFOVScale(double &fov_w, double & fov_h, double &fov_scale)
+{
+ fov_w = fov_x;
+ fov_h = fov_y;
+ fov_scale = fov_pixscale;
+}
void Align::calculateFOV()
{
// Calculate FOV
+
+ // FOV in arcsecs
fov_x = 206264.8062470963552 * ccd_width * ccd_hor_pixel / 1000.0 / focal_length;
fov_y = 206264.8062470963552 * ccd_height * ccd_ver_pixel / 1000.0 / focal_length;
+ // Pix Scale
+ fov_pixscale = (fov_x * (Options::solverBinningIndex()+1)) / ccd_width;
+
+ // FOV in arcmins
fov_x /= 60.0;
fov_y /= 60.0;
@@ -549,14 +574,52 @@ void Align::calculateFOV()
" 0.5 degrees
For small FOVs, use the Legacy Polar Alignment Tool.
"));
FOVDisabledLabel->show();
}
-}
+ if (opsAstrometry->kcfg_AstrometryUseImageScale->isChecked())
+ {
+ int unitType = opsAstrometry->kcfg_AstrometryImageScaleUnits->currentIndex();
+
+ // Degrees
+ if (unitType == 0)
+ {
+ double fov_low = qMin(fov_x/60, fov_y/60);
+ double fov_high= qMax(fov_x/60, fov_y/60);
+ opsAstrometry->kcfg_AstrometryImageScaleLow->setValue(fov_low);
+ opsAstrometry->kcfg_AstrometryImageScaleHigh->setValue(fov_high);
+
+ Options::setAstrometryImageScaleLow(fov_low);
+ Options::setAstrometryImageScaleHigh(fov_high);
+ }
+ // Arcmins
+ else if (unitType == 1)
+ {
+ double fov_low = qMin(fov_x, fov_y);
+ double fov_high= qMax(fov_x, fov_y);
+ opsAstrometry->kcfg_AstrometryImageScaleLow->setValue(fov_low);
+ opsAstrometry->kcfg_AstrometryImageScaleHigh->setValue(fov_high);
+
+ Options::setAstrometryImageScaleLow(fov_low);
+ Options::setAstrometryImageScaleHigh(fov_high);
+ }
+ // Arcsec per pixel
+ else
+ {
+ opsAstrometry->kcfg_AstrometryImageScaleLow->setValue(fov_pixscale*0.9);
+ opsAstrometry->kcfg_AstrometryImageScaleHigh->setValue(fov_pixscale*1.1);
+
+ // 10% boundary
+ Options::setAstrometryImageScaleLow(fov_pixscale*0.9);
+ Options::setAstrometryImageScaleHigh(fov_pixscale*1.1);
+ }
+ }
+}
//This starts upthe Astrometry Options Dialog Window and connects the various buttons and line edits to slots.
//If accepted upon dialog close,the astrometry solver options are updated.
-void Align::slotEditOptions(){
-
+void Align::slotEditOptions()
+{
+#if 0
QDialog astrometryOptionsDialog;
astrometryOptions.setupUi(&astrometryOptionsDialog);
@@ -607,402 +670,89 @@ void Align::slotEditOptions(){
solverOptions->setText(astrometryOptions.solverOptions->text().simplified());
}
+#endif
}
-//This interprets the solver options to set the checkboxes and line edits to the values contained in the sovler arguments
-
-void Align::slotUpdateAstrometryOptionEditor(QString text){
- QString options = text.simplified();
- QStringList solver_args;
- solver_args = options.split(" ");
-
- int index=-1;
- int index2=-1;
- int index3=-1;
- bool allExist=false;
-
- index = solver_args.indexOf("--no-fits2fits");
- astrometryOptions.checkFits2Fits->setChecked(index != -1);
-
- index = solver_args.indexOf("--resort");
- astrometryOptions.checkResort->setChecked(index != -1);
-
- index = solver_args.indexOf("--no-verify");
- astrometryOptions.checkVerify->setChecked(index != -1);
-
- index = solver_args.indexOf("--downsample");
- astrometryOptions.checkDownSample->setChecked(index != -1);
- if(index != -1 && index != solver_args.count()-1){
- QString nextValue=solver_args.at(index+1);
- if(!nextValue.startsWith('-'))
- astrometryOptions.downSampleValue->setText(solver_args.at(index+1));
- }
-
- index = solver_args.indexOf("-L");
- index2 = solver_args.indexOf("-H");
- index3 = solver_args.indexOf("-u");
- allExist=index != -1 && index2 != -1 && index3 != -1;
- astrometryOptions.checkScale->setChecked(allExist);
-
- QString fov_low,fov_high;
- QString units="aw";
- QComboBox *comboBox=astrometryOptions.unitSelector;
- if(comboBox->currentIndex()==0)
- units="dw";
- if(comboBox->currentIndex()==1)
- units="aw";
- generateFOV(fov_low,fov_high, units);
-
- if(index!=-1){
- if(index!=solver_args.count()-1){
- QString nextValue=solver_args.at(index+1);
- if(!nextValue.startsWith('-'))
- astrometryOptions.scaleL->setText(solver_args.at(index+1));
- }
- }else
- astrometryOptions.scaleL->setText(fov_low);
-
- if(index2!=-1){
- if(index2!=solver_args.count()-1){
- QString nextValue=solver_args.at(index+1);
- if(!nextValue.startsWith('-'))
- astrometryOptions.scaleH->setText(solver_args.at(index2+1));
- }
- }else
- astrometryOptions.scaleH->setText(fov_high);
-
- if(index3!=-1){
- if(index3!=solver_args.count()-1){
- QString nextValue=solver_args.at(index3+1);
- if(nextValue=="dw")
- astrometryOptions.unitSelector->setCurrentIndex(0);
- if(nextValue=="aw")
- astrometryOptions.unitSelector->setCurrentIndex(1);
- }
- }
-
- index = solver_args.indexOf("-3");
- index2 = solver_args.indexOf("-4");
- index3 = solver_args.indexOf("-5");
- allExist=index != -1 && index2 != -1 && index3 != -1;
- astrometryOptions.checkPosition->setChecked(allExist);
-
- if (raBox->isEmpty() == false && decBox->isEmpty() == false){
- astrometryOptions.estRA->setText(raBox->text());
- astrometryOptions.estDec->setText(decBox->text());
- }
-
- index = solver_args.indexOf("-5");
- if(index != -1 && index != solver_args.count()-1){
- QString nextValue=solver_args.at(index+1);
- if(!nextValue.startsWith('-'))
- astrometryOptions.estRadius->setText(solver_args.at(index+1));
- }
-
- //We might not want to force these, but if they don't have these options selected, it will cause problems.
-
- index = solver_args.indexOf("--no-plots");
- if(index==-1){
- solver_args.prepend("--no-plots");
- astrometryOptions.solverOptions->setText(solver_args.join(" "));
- }
-
- index = solver_args.indexOf("-O");
- if(index==-1){
- solver_args.prepend("-O");
- astrometryOptions.solverOptions->setText(solver_args.join(" "));
- }
-}
-
-//This updates solver options in real time based on line edits the user makes.
-
-void Align::slotUpdateLineEditOptions(){
- QString options = astrometryOptions.solverOptions->text().simplified();
- QStringList solver_args;
- solver_args = options.split(" ");
- QLineEdit *lineEdit=(QLineEdit *)sender();
- QString argument;
-
- if(lineEdit==astrometryOptions.downSampleValue)
- argument="--downsample";
- if(lineEdit==astrometryOptions.scaleL)
- argument="-L";
- if(lineEdit==astrometryOptions.scaleH)
- argument="-H";
- if(lineEdit==astrometryOptions.estRA)
- argument="-3";
- if(lineEdit==astrometryOptions.estDec)
- argument="-4";
- if(lineEdit==astrometryOptions.estRadius)
- argument="-5";
-
- if(argument=="")
- return;
-
- if(lineEdit==astrometryOptions.estRA){
- bool raOk=false;
- dms ra( astrometryOptions.estRA->createDms( false, &raOk ));
- if(raOk){
- if ( ra.Hours() < 0.0 || ra.Hours() > 24.0 ){
- KMessageBox::sorry( 0, i18n( "The Right Ascension value must be between 0.0 and 24.0." ), i18n( "Invalid Coordinate Data" ) );
- return;
- }
- editAstrometryOption(solver_args, argument, QString().setNum(ra.Degrees()));
- }
- }else if(lineEdit==astrometryOptions.estDec){
- bool decOk=false;
- dms dec( astrometryOptions.estDec->createDms( true, &decOk ));
- if(decOk){
- if ( dec.Degrees() < -90.0 || dec.Degrees() > 90.0 ){
- KMessageBox::sorry( 0, i18n( "The Declination value must be between -90.0 and 90.0." ), i18n( "Invalid Coordinate Data" ) );
- return;
- }
- editAstrometryOption(solver_args, argument, QString().setNum(dec.Degrees()));
- }
- }else{
- editAstrometryOption(solver_args, argument, lineEdit->text());
- }
-
- astrometryOptions.solverOptions->setText(solver_args.join(" "));
-
-
-}
-
-//This updates the telescope/image field scale in the astrometry options editor to match the currently connected devices.
-
-void Align::slotUpdateScaleInEditor(){
+QStringList Align::generateOptions(const QVariantMap & optionsMap)
+{
+ // -O overwrite
+ // -3 Expected RA
+ // -4 Expected DEC
+ // -5 Radius (deg)
+ // -L lower scale of image in arcminutes
+ // -H upper scale of image in arcmiutes
+ // -u aw set scale to be in arcminutes
+ // -W solution.wcs name of solution file
+ // apog1.jpg name of target file to analyze
+ //solve-field -O -3 06:40:51 -4 +09:49:53 -5 1 -L 40 -H 100 -u aw -W solution.wcs apod1.jpg
- QString options = astrometryOptions.solverOptions->text().simplified();
QStringList solver_args;
- solver_args = options.split(" ");
- QString fov_low,fov_high;
- QString units="aw";
- QComboBox *comboBox=astrometryOptions.unitSelector;
- if(comboBox->currentIndex()==0)
- units="dw";
- if(comboBox->currentIndex()==1)
- units="aw";
-
- generateFOV(fov_low,fov_high, units);
-
- astrometryOptions.scaleL->setText(fov_low);
- astrometryOptions.scaleH->setText(fov_high);
+ // Start with always-used arguments
+ solver_args << "-O" << "--no-plots";
- editAstrometryOption(solver_args, "-L", fov_low);
- editAstrometryOption(solver_args, "-H", fov_high);
-
- astrometryOptions.solverOptions->setText(solver_args.join(" "));
-
-}
+ // Now go over boolean options
-//This updates the RA and DEC position in the astrometry options editor to match the current telescope position.
+ // noverify
+ if (optionsMap.contains("noverify"))
+ solver_args << "--no-verify";
-void Align::slotUpdatePositionInEditor(){
+ // noresort
+ if (optionsMap.contains("resort"))
+ solver_args << "--resort";
- QString options = astrometryOptions.solverOptions->text().simplified();
- QStringList solver_args;
- solver_args = options.split(" ");
+ // fits2fits
+ if (optionsMap.contains("nofits2fits"))
+ solver_args << "--no-fits2fits";
- raBox->setText(ScopeRAOut->text());
- decBox->setText(ScopeDecOut->text());
- astrometryOptions.estRA->setText(ScopeRAOut->text());
- astrometryOptions.estDec->setText(ScopeDecOut->text());
+ // downsample
+ if (optionsMap.contains("downsample"))
+ solver_args << "--downsample" << QString::number(optionsMap.value("downsample", 2).toInt());
- bool raOk=false;
- dms ra( astrometryOptions.estRA->createDms( false, &raOk ));
- if(raOk)
- editAstrometryOption(solver_args, "-3", QString().setNum(ra.Degrees()));
+ // image scale low
+ if (optionsMap.contains("scaleL"))
+ solver_args << "-L" << QString::number(optionsMap.value("scaleL").toDouble());
- bool decOk=false;
- dms dec( astrometryOptions.estDec->createDms( true, &decOk ));
- if(decOk)
- editAstrometryOption(solver_args, "-4", QString().setNum(dec.Degrees()));
+ // image scale high
+ if (optionsMap.contains("scaleH"))
+ solver_args << "-H" << QString::number(optionsMap.value("scaleH").toDouble());
- astrometryOptions.solverOptions->setText(solver_args.join(" "));
-}
+ // image scale units
+ if (optionsMap.contains("scaleUnits"))
+ solver_args << "-u" << optionsMap.value("scaleUnits").toString();
-//This will reset the options in the astrometry options editor to the original options before editing.
+ // RA
+ if (optionsMap.contains("ra"))
+ solver_args << "-3" << QString::number(optionsMap.value("ra").toDouble());
-void Align::slotResetOptionsInEditor(){
+ // DE
+ if (optionsMap.contains("de"))
+ solver_args << "-4" << QString::number(optionsMap.value("de").toDouble());
- astrometryOptions.solverOptions->setText(solverOptions->text().simplified());
- slotUpdateAstrometryOptionEditor(solverOptions->text().simplified());
-}
+ // Radius
+ if (optionsMap.contains("radius"))
+ solver_args << "-5" << QString::number(optionsMap.value("radius").toDouble());
-//This will replace the options in the astrometry options editor to the default options set.
+ // Custom
+ if (optionsMap.contains("custom"))
+ solver_args << optionsMap.value("custom").toString();
-void Align::slotDefaultEditorOptions(){
-
- double ra=0,dec=0;
- QString ra_dms, dec_dms;
- QStringList solver_args;
-
- currentTelescope->getEqCoords(&ra, &dec);
-
- QString fov_low,fov_high;
- generateFOV(fov_low,fov_high,"aw");
-
- getFormattedCoords(ra, dec, ra_dms, dec_dms);
-
- solver_args << "--no-verify" << "--no-plots" << "--resort" << "--no-fits2fits"
- << "--downsample" << "2" << "-O" << "-L"
- << fov_low << "-H" << fov_high << "-u" << "aw"
- << "-3" << "0" << "-4" << "0" << "-5" << "30";
-
- slotUpdateAstrometryOptionEditor(solver_args.join(" "));
- astrometryOptions.solverOptions->setText(solver_args.join(" "));
-
- slotUpdatePositionInEditor();
-}
-
-//This will attempt to remove options that have additional arguments, if none is found, it will just remove the option.
-//If the option is not found, it does nothing
-
-void Align::removeAstrometryOption(QStringList &solver_args,QString option){
- if(option=="")
- return;
- int index=solver_args.indexOf(option);
- if(index!=-1){
- if(index!=solver_args.count()-1){
- QString nextValue=solver_args.at(index+1);
- if(!nextValue.startsWith('-'))
- solver_args.removeAt(index+1);
- }
- solver_args.removeAt(index);
- }
-}
-
-//This will attempt to edit the arguments of options that have additional arguments, if none is found, it will insert it.
-//If the option is not found, it does nothing
-
-void Align::editAstrometryOption(QStringList &solver_args,QString option, QString argument){
- if(argument==""||option=="")
- return;
- int index=solver_args.indexOf(option);
- if(index!=-1){
- if(index!=solver_args.count()-1){
- QString nextValue=solver_args.at(index+1);
- if(!nextValue.startsWith('-'))
- solver_args.replace(index+1, argument);
- else
- solver_args.insert(index+1, argument);
- }
- }
-}
-
-//This respond to checkbox clicks in the astrometry options editor to either add or remove options in the solver arguments.
-
-void Align::slotToggleAstrometryOptions(){
- QString options = astrometryOptions.solverOptions->text().simplified();
- QStringList solver_args;
- solver_args = options.split(" ");
-
- QString units="aw";
- QComboBox *comboBox=astrometryOptions.unitSelector;
- if(comboBox->currentIndex()==0)
- units="dw";
- if(comboBox->currentIndex()==1)
- units="aw";
-
- QObject *object=sender();
- if(object){
- if(object==comboBox){
- editAstrometryOption(solver_args,"-u", units);
- }else{
- QCheckBox *checkBox=(QCheckBox *)object;
- if(checkBox==astrometryOptions.checkPosition){
- if(!checkBox->isChecked()){
- removeAstrometryOption(solver_args,"-3");
- removeAstrometryOption(solver_args,"-4");
- removeAstrometryOption(solver_args,"-5");
- } else{
- bool raOk(false), decOk(false);
- dms ra( astrometryOptions.estRA->createDms( false, &raOk ));
- dms dec( astrometryOptions.estDec->createDms( true, &decOk ));
- if(raOk && decOk){
- if(solver_args.indexOf("-3")==-1){
- solver_args.append("-3");
- solver_args.append(QString().setNum(ra.Degrees()));
- }
- if(solver_args.indexOf("-4")==-1){
- solver_args.append("-4");
- solver_args.append(QString().setNum(dec.Degrees()));
- }
- if(solver_args.indexOf("-5")==-1){
- solver_args.append("-5");
- solver_args.append(astrometryOptions.estRadius->text());
- }
- }
- }
- } else if(checkBox==astrometryOptions.checkScale){
- if(!checkBox->isChecked()){
- removeAstrometryOption(solver_args,"-L");
- removeAstrometryOption(solver_args,"-H");
- removeAstrometryOption(solver_args,"-u");
- } else{
- if(solver_args.indexOf("-L")==-1){
- solver_args.append("-L");
- solver_args.append(astrometryOptions.scaleL->text());
- }
- if(solver_args.indexOf("-H")==-1){
- solver_args.append("-H");
- solver_args.append(astrometryOptions.scaleH->text());
- }
- if(solver_args.indexOf("-u")==-1){
- solver_args.append("-u");
- solver_args.append(units);
- }
- }
- } else if(checkBox==astrometryOptions.checkDownSample){
- QString argument="--downsample";
- int index=-1;
- index = solver_args.indexOf(argument);
- if(checkBox->isChecked() && index==-1){
- solver_args.append(argument);
- solver_args.append(astrometryOptions.downSampleValue->text());
- }
- if(!checkBox->isChecked()){
- removeAstrometryOption(solver_args,argument);
- }
- } else{
- //This case governs all the simple options at the top.
-
- QString argument=checkBox->text();
- argument.remove(QChar('&'), Qt::CaseInsensitive);//This is needed because the labels have ampersands in them for keyboard shortcuts.
-
- int index=-1;
- index = solver_args.indexOf(argument);
- if(checkBox->isChecked() && index==-1)
- solver_args.prepend(argument);
- if(!checkBox->isChecked() && index!=-1)
- solver_args.removeAt(index);
- }
- }
- astrometryOptions.solverOptions->setText(solver_args.join(" "));
- }
+ return solver_args;
}
//This will generate the high and low scale of the imager field size based on the stated units.
-void Align::generateFOV(QString &fov_low, QString &fov_high, QString units)
+void Align::generateFOVBounds(double fov_h, double fov_v, QString &fov_low, QString &fov_high)
{
double fov_lower, fov_upper;
// let's stretch the boundaries by 5%
- fov_lower = ((fov_x < fov_y) ? (fov_x * 0.95) : (fov_y * 0.95));
- fov_upper = ((fov_x > fov_y) ? (fov_x * 1.05) : (fov_y * 1.05));
-
- if(units=="dw")
- {
- fov_lower /=60;
- fov_upper /=60;
- }
+ fov_lower = ((fov_h < fov_v) ? (fov_h * 0.95) : (fov_v * 0.95));
+ fov_upper = ((fov_h > fov_v) ? (fov_h * 1.05) : (fov_v * 1.05));
//No need to do anything if they are aw, since that is the default
- fov_low = QString("%1").arg(fov_lower);
- fov_high = QString("%1").arg(fov_upper);
+ fov_low = QString::number(fov_lower);
+ fov_high = QString::number(fov_upper);
}
-
void Align::generateArgs()
{
// -O overwrite
@@ -1014,93 +764,78 @@ void Align::generateArgs()
// -u aw set scale to be in arcminutes
// -W solution.wcs name of solution file
// apog1.jpg name of target file to analyze
- //solve-field -O -3 06:40:51 -4 +09:49:53 -5 1 -L 40 -H 100 -u aw -W solution.wcs apod1.jpg
+ //solve-field -O -3 06:40:51 -4 +09:49:53 -5 1 -L 40 -H 100 -u aw -W solution.wcs apod1.jpg
- double ra=0,dec=0;
- QString ra_dms, dec_dms;
- QStringList solver_args;
+ QVariantMap optionsMap;
- currentTelescope->getEqCoords(&ra, &dec);
+ if (Options::astrometryUseNoVerify())
+ optionsMap["noverify"] = true;
- QString fov_low,fov_high;
+ if (Options::astrometryUseResort())
+ optionsMap["resort"] = true;
+ if (Options::astrometryUseNoFITS2FITS())
+ optionsMap["nofits2fits"] = true;
- getFormattedCoords(ra, dec, ra_dms, dec_dms);
+ if (Options::astrometryUseDownsample())
+ optionsMap["downsample"] = Options::astrometryDownsample();
- if (solverOptions->text().isEmpty())
+ if (Options::astrometryUseImageScale())
{
- generateFOV(fov_low,fov_high,"aw");
+ QString units = ImageScales[Options::astrometryImageScaleUnits()];
+ if (Options::astrometryAutoUpdateImageScale())
+ {
+ QString fov_low,fov_high;
+ double fov_w = fov_x;
+ double fov_h = fov_y;
- solver_args << "--no-verify" << "--no-plots" << "--resort" << "--no-fits2fits"
- << "--downsample" << "2" << "-O" << "-L" << fov_low << "-H" << fov_high << "-u" << "aw";
- }
- else
- {
- QString options = solverOptions->text().simplified();
- solver_args = options.split(" ");
+ if (units == "dw")
+ {
+ fov_w /= 60;
+ fov_h /= 60;
+ }
+ else if (units == "app")
+ {
+ fov_w = fov_pixscale;
+ fov_h = fov_pixscale;
+ }
+
+ generateFOVBounds(fov_w, fov_h, fov_low, fov_high);
- QString units="aw";
- int units_index = solver_args.indexOf("-u");
- if(units_index!=-1&&units_index!=solver_args.count()-1)
+ optionsMap["scaleL"] = fov_low;
+ optionsMap["scaleH"] = fov_high;
+ optionsMap["scaleUnits"] = units;
+ }
+ else
{
- if (solver_args.at(units_index+1)=="dw")
- units=solver_args.at(units_index+1);
+ optionsMap["scaleL"] = Options::astrometryImageScaleLow();
+ optionsMap["scaleH"] = Options::astrometryImageScaleHigh();
+ optionsMap["scaleUnits"] = units;
}
-
- generateFOV(fov_low,fov_high,units);
- int fov_low_index = solver_args.indexOf("-L");
- if (fov_low_index != -1)
- solver_args.replace(fov_low_index+1, fov_low);
- int fov_high_index = solver_args.indexOf("-H");
- if (fov_high_index != -1)
- solver_args.replace(fov_high_index+1, fov_high);
}
- if (raBox->isEmpty() == false && decBox->isEmpty() == false)
+ if (Options::astrometryUsePosition())
{
- bool raOk(false), decOk(false);
- dms ra( raBox->createDms( false, &raOk ) ); //false means expressed in hours
- dms dec( decBox->createDms( true, &decOk ) );
- int radius = 30;
- QString message;
+ double ra=0,dec=0;
+ currentTelescope->getEqCoords(&ra, &dec);
- if ( raOk && decOk )
- {
- //make sure values are in valid range
- if ( ra.Hours() < 0.0 || ra.Hours() > 24.0 )
- message = i18n( "The Right Ascension value must be between 0.0 and 24.0." );
- if ( dec.Degrees() < -90.0 || dec.Degrees() > 90.0 )
- message += '\n' + i18n( "The Declination value must be between -90.0 and 90.0." );
- if ( ! message.isEmpty() )
- {
- KMessageBox::sorry( 0, message, i18n( "Invalid Coordinate Data" ) );
- return;
- }
- }
-
- int ra_index = solver_args.indexOf("-3");
- if (ra_index == -1)
- solver_args << "-3" << QString().setNum(ra.Degrees());
- else
- solver_args.replace(ra_index+1, QString().setNum(ra.Degrees()));
+ optionsMap["ra"] = ra*15.0;
+ optionsMap["de"] = dec;
+ optionsMap["radius"] = Options::astrometryRadius();
+ }
- int de_index = solver_args.indexOf("-4");
- if (de_index == -1)
- solver_args << "-4" << QString().setNum(dec.Degrees());
- else
- solver_args.replace(de_index+1, QString().setNum(dec.Degrees()));
+ if (Options::astrometryCustomOptions().isEmpty() == false)
+ optionsMap["custom"] = Options::astrometryCustomOptions();
- int rad_index = solver_args.indexOf("-5");
- if (rad_index == -1)
- solver_args << "-5" << QString().setNum(radius);
- else
- solver_args.replace(rad_index+1, QString().setNum(radius));
- }
+ QStringList solverArgs = generateOptions(optionsMap);
- solverOptions->setText(solver_args.join(" "));
+ QString options = solverArgs.join(" ");
+ solverOptions->setText(options);
+ solverOptions->setToolTip(options);
}
+#if 0
void Align::checkLineEdits()
{
bool raOk(false), decOk(false);
@@ -1125,6 +860,7 @@ void Align::clearCoordBoxes()
generateArgs();
}
+#endif
bool Align::captureAndSolve()
{
@@ -1379,7 +1115,23 @@ void Align::startSolving(const QString &filename, bool isGenerated)
int rc = KMessageBox::questionYesNoCancel(0, i18n("No metadata is available in this image. Do you want to use the blind solver or the existing solver settings?"), i18n("Astrometry solver"),
blindItem, existingItem, KStandardGuiItem::cancel(), "blind_solver_or_existing_solver_option");
if (rc == KMessageBox::Yes)
- solverArgs << "--no-verify" << "--no-plots" << "--resort" << "--no-fits2fits" << "--downsample" << "2" << "-O";
+ {
+ QVariantMap optionsMap;
+
+ if (Options::astrometryUseNoVerify())
+ optionsMap["noverify"] = true;
+
+ if (Options::astrometryUseResort())
+ optionsMap["resort"] = true;
+
+ if (Options::astrometryUseNoFITS2FITS())
+ optionsMap["nofits2fits"] = true;
+
+ if (Options::astrometryUseDownsample())
+ optionsMap["downsample"] = Options::astrometryDownsample();
+
+ solverArgs = generateOptions(optionsMap);
+ }
else if (rc == KMessageBox::No)
solverArgs = options.split(" ");
else
@@ -1398,7 +1150,7 @@ void Align::startSolving(const QString &filename, bool isGenerated)
}
Options::setSolverType(solverTypeGroup->checkedId());
- Options::setSolverOptions(solverOptions->text());
+ //Options::setSolverOptions(solverOptions->text());
Options::setGuideScopeCCDs(guideScopeCCDs);
Options::setSolverAccuracyThreshold(accuracySpin->value());
Options::setAlignDarkFrame(alignDarkFrameCheck->isChecked());
@@ -1438,7 +1190,7 @@ void Align::solverFinished(double orientation, double ra, double dec, double pix
ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD);
targetChip->getBinning(&binx, &biny);
- if (Options::solverVerbose())
+ if (Options::astrometrySolverVerbose())
appendLogText(i18n("Solver RA (%1) DEC (%2) Orientation (%3) Pixel Scale (%4)", QString::number(ra, 'g' , 5), QString::number(dec, 'g' , 5),
QString::number(orientation, 'g' , 5), QString::number(pixscale, 'g' , 5)));
@@ -1474,7 +1226,7 @@ void Align::solverFinished(double orientation, double ra, double dec, double pix
solverFOV->setCenter(alignCoord);
solverFOV->setRotation(sOrientation);
- solverFOV->setImageDisplay(Options::solverOverlay());
+ solverFOV->setImageDisplay(Options::astrometrySolverOverlay());
QString ra_dms, dec_dms;
getFormattedCoords(alignCoord.ra().Hours(), alignCoord.dec().Degrees(), ra_dms, dec_dms);
@@ -1482,7 +1234,7 @@ void Align::solverFinished(double orientation, double ra, double dec, double pix
SolverRAOut->setText(ra_dms);
SolverDecOut->setText(dec_dms);
- if (Options::solverWCS())
+ if (Options::astrometrySolverWCS())
{
INumberVectorProperty *ccdRotation = currentCCD->getBaseDevice()->getNumber("CCD_ROTATION");
if (ccdRotation)
@@ -1692,8 +1444,16 @@ void Align::processTelescopeNumber(INumberVectorProperty *coord)
case IPS_OK:
{
// Update the boxes as the mount just finished slewing
- if (slew_dirty && Options::solverUpdateCoords())
- copyCoordsToBoxes();
+ if (slew_dirty && Options::astrometryAutoUpdatePosition())
+ {
+ opsAstrometry->estRA->setText(ra_dms);
+ opsAstrometry->estDec->setText(dec_dms);
+
+ Options::setAstrometryPositionRA(coord->np[0].value*15);
+ Options::setAstrometryPositionDE(coord->np[1].value);
+
+ generateArgs();
+ }
if (slew_dirty && pahStage == PAH_FIND_CP)
{
@@ -1893,8 +1653,9 @@ void Align::processTelescopeNumber(INumberVectorProperty *coord)
}
- if (!strcmp(coord->name, "TELESCOPE_INFO"))
- syncTelescopeInfo();
+ // N.B. EkosManager already mananges TELESCOPE_INFO, why here again?
+ //if (!strcmp(coord->name, "TELESCOPE_INFO"))
+ //syncTelescopeInfo();
}
@@ -2455,6 +2216,14 @@ void Align::setBinningIndex(int binIndex)
binningCombo->setCurrentIndex(binIndex);
binningCombo->blockSignals(false);
}
+
+ // Need to calculate FOV and args for APP
+ if (Options::astrometryImageScaleUnits() == OpsAstrometry::SCALE_ARCSECPERPIX)
+ {
+ calculateFOV();
+ generateArgs();
+ }
+
}
void Align::setSolverArguments(const QString & value)
@@ -2463,13 +2232,14 @@ void Align::setSolverArguments(const QString & value)
}
void Align::setSolverSearchCoords(double ra, double dec)
-{
+{
dms RA, DEC;
RA.setH(ra);
DEC.setD(dec);
- raBox->setText(RA.toHMSString());
- decBox->setText(DEC.toDMSString());
+ //TODO
+ //raBox->setText(RA.toHMSString());
+ //decBox->setText(DEC.toDMSString());
}
void Align::setUseOAGT(bool enabled)
@@ -2586,12 +2356,24 @@ QStringList Align::getSolverOptionsFromFITS(const QString &filename)
QString fov_low,fov_high;
QStringList solver_args;
- // If existing options have no-fits2fits then we use it, otherwise we discard it
- // as no-fits2fits is only works for astrometry.net v0.67 or less
- if (solverOptions->text().contains("no-fits2fits"))
- solver_args << "--no-verify" << "--no-plots" << "--resort" << "--no-fits2fits" << "--downsample" << "2" << "-O";
- else
- solver_args << "--no-verify" << "--no-plots" << "--resort" << "--downsample" << "2" << "-O";
+ QVariantMap optionsMap;
+
+ if (Options::astrometryUseNoVerify())
+ optionsMap["noverify"] = true;
+
+ if (Options::astrometryUseResort())
+ optionsMap["resort"] = true;
+
+ if (Options::astrometryUseNoFITS2FITS())
+ optionsMap["nofits2fits"] = true;
+
+ if (Options::astrometryUseDownsample())
+ optionsMap["downsample"] = Options::astrometryDownsample();
+
+ if (Options::astrometryCustomOptions().isEmpty() == false)
+ optionsMap["custom"] = Options::astrometryCustomOptions();
+
+ solver_args = generateOptions(optionsMap);
if (fits_open_image(&fptr, filename.toLatin1(), READONLY, &status))
{
@@ -2680,8 +2462,11 @@ QStringList Align::getSolverOptionsFromFITS(const QString &filename)
fits_fov_y /= 60.0;
// let's stretch the boundaries by 5%
- fov_lower = ((fits_fov_x < fits_fov_y) ? (fits_fov_x *0.95) : (fits_fov_y *0.95));
- fov_upper = ((fits_fov_x > fits_fov_y) ? (fits_fov_x * 1.05) : (fits_fov_y * 1.05));
+ fov_lower = qMin(fits_fov_x, fits_fov_y);
+ fov_upper = qMax(fits_fov_x, fits_fov_y);
+
+ fov_lower *= 0.95;
+ fov_upper *= 1.05;
fov_low = QString::number(fov_lower);
fov_high = QString::number(fov_upper);
@@ -3300,8 +3085,12 @@ void Align::setMountStatus(ISD::Telescope::TelescopeStatus newState)
break;
case ISD::Telescope::MOUNT_TRACKING:
- solveB->setEnabled(true);
- loadSlewB->setEnabled(true);
+ if (pi->isAnimated() == false)
+ {
+ solveB->setEnabled(true);
+ loadSlewB->setEnabled(true);
+ }
+
PAHFirstCaptureB->setEnabled(true);
PAHSecondCaptureB->setEnabled(true);
PAHThirdCaptureB->setEnabled(true);
diff --git a/kstars/ekos/align/align.h b/kstars/ekos/align/align.h
index 33098689e..9d9af317c 100644
--- a/kstars/ekos/align/align.h
+++ b/kstars/ekos/align/align.h
@@ -37,6 +37,8 @@ class AstrometryParser;
class OnlineAstrometryParser;
class OfflineAstrometryParser;
class RemoteAstrometryParser;
+class OpsAstrometry;
+class OpsAlign;
/**
*@class Align
@@ -67,6 +69,9 @@ public:
typedef enum { PAH_IDLE, PAH_FIRST_CAPTURE, PAH_FIND_CP, PAH_FIRST_ROTATE, PAH_SECOND_CAPTURE, PAH_SECOND_ROTATE, PAH_THIRD_CAPTURE, PAH_STAR_SELECT, PAH_PRE_REFRESH, PAH_REFRESH, PAH_ERROR } PAHStage;
typedef enum { NORTH_HEMISPHERE, SOUTH_HEMISPHERE } HemisphereType;
+ // Image Scales
+ const QStringList ImageScales = { "dw", "aw", "app" };
+
enum CircleSolution { NO_CIRCLE_SOLUTION, ONE_CIRCLE_SOLUTION, TWO_CIRCLE_SOLUTION, INFINITE_CIRCLE_SOLUTION };
/** @defgroup AlignDBusInterface Ekos DBus Interface - Align Module
@@ -174,9 +179,7 @@ public:
/**
* @brief Generate arguments we pass to the online and offline solvers. Keep user own arguments in place.
*/
- void generateArgs();
-
- void generateFOV(QString &fov_low, QString &fov_high, QString units);
+ void generateArgs();
/**
* @brief Does our parser exist in the system?
@@ -198,6 +201,22 @@ public:
*/
FOV *fov();
+ /**
+ * @brief getFOVScale Returns calculated FOV values
+ * @param fov_w FOV width in arcmins
+ * @param fov_h FOV height in arcmins
+ * @param fov_scale FOV scale in arcsec per pixel
+ */
+ void getFOVScale(double &fov_w, double & fov_h, double &fov_scale);
+
+ /**
+ * @brief generateOptions Generate astrometry.net option given the supplied map
+ * @param optionsMap List of key=value pairs for all astrometry.net options
+ * @return String List of valid astrometry.net options
+ */
+ static QStringList generateOptions(const QVariantMap & optionsMap);
+ static void generateFOVBounds(double fov_h, double fov_v, QString &fov_low, QString &fov_high);
+
public slots:
@@ -303,19 +322,12 @@ public slots:
void setMountStatus(ISD::Telescope::TelescopeStatus newState);
void slotEditOptions();
- void slotUpdateLineEditOptions();
- void slotToggleAstrometryOptions();
- void slotUpdateAstrometryOptionEditor(QString text);
- void slotUpdateScaleInEditor();
- void slotUpdatePositionInEditor();
- void slotResetOptionsInEditor();
- void slotDefaultEditorOptions();
private slots:
/* Solver Options */
- void checkLineEdits();
- void copyCoordsToBoxes();
- void clearCoordBoxes();
+ //void checkLineEdits();
+ //void copyCoordsToBoxes();
+ //void clearCoordBoxes();
/* Polar Alignment */
void measureAltError();
@@ -452,7 +464,7 @@ private:
//bool isFocusBusy;
// FOV
- double ccd_hor_pixel, ccd_ver_pixel, focal_length, aperture, fov_x, fov_y;
+ double ccd_hor_pixel, ccd_ver_pixel, focal_length, aperture, fov_x, fov_y, fov_pixscale;
int ccd_width, ccd_height;
// Keep track of solver results
@@ -562,9 +574,9 @@ private:
// Which hemisphere are we located on?
HemisphereType hemisphere;
-
- void removeAstrometryOption(QStringList &solver_args,QString option);
- void editAstrometryOption(QStringList &solver_args, QString option, QString argument);
+ // Astrometry Options
+ OpsAstrometry *opsAstrometry;
+ OpsAlign *opsAlign;
};
}
diff --git a/kstars/ekos/align/align.ui b/kstars/ekos/align/align.ui
index fb4eca2d6..0649103b8 100644
--- a/kstars/ekos/align/align.ui
+++ b/kstars/ekos/align/align.ui
@@ -6,8 +6,8 @@
00
- 576
- 491
+ 600
+ 468
@@ -493,25 +493,6 @@
-
-
-
- Exposure duration in seconds
-
-
- 0.100000000000000
-
-
- 60.000000000000000
-
-
- 0.500000000000000
-
-
- 3.000000000000000
-
-
-
@@ -519,50 +500,6 @@
-
-
-
-
- 0
- 0
-
-
-
-
- 22
- 22
-
-
-
-
- 22
- 22
-
-
-
- Clear RA & DEC values and reset solver options
-
-
-
-
-
-
- 22
- 22
-
-
-
-
-
-
-
- estimated RA of target center to limit the solver's search area
-
-
- RA:
-
-
-
@@ -573,30 +510,25 @@
-
-
+
+
+
+
+
-
+ Exposure duration in seconds
-
- Bin:
+
+ 0.100000000000000
-
-
-
-
-
- estimated DEC of target center to limit the solver's search area
+
+ 60.000000000000000
-
- DE:
+
+ 0.500000000000000
-
-
-
-
-
-
+
+ 3.000000000000000
@@ -610,35 +542,13 @@
-
-
-
-
-
-
-
- 22
- 22
-
-
-
-
- 22
- 22
-
-
+
+
- Show in FITS Viewer
-
-
-
-
-
-
-
-
+
+ Bin:
@@ -664,14 +574,8 @@
-
-
-
-
- 0
- 0
-
-
+
+ 22
@@ -685,17 +589,11 @@
- Fill RA & DEC values from telescope coordinates and update options
+ Show in FITS Viewer
-
-
- 22
- 22
-
-
@@ -719,6 +617,9 @@
Additional options to be the solver
+
+ false
+
@@ -1633,14 +1534,6 @@
-
-
- dmsBox
- QLineEdit
- widgets/dmsbox.h
- 1
-
- solveBloadSlewB
@@ -1663,9 +1556,6 @@
alignDarkFrameChecktoggleFullScreenBbinningCombo
- raBox
- decBox
- clearBoxesBsolverOptionsonlineSolverRofflineSolverR
diff --git a/kstars/ekos/align/astrometryoptions.ui b/kstars/ekos/align/astrometryoptions.ui
deleted file mode 100644
index 16f1c2790..000000000
--- a/kstars/ekos/align/astrometryoptions.ui
+++ /dev/null
@@ -1,696 +0,0 @@
-
-
- astrometryoptions
-
-
-
- 0
- 0
- 740
- 326
-
-
-
- Astrometry Options Editor
-
-
- <html><head/><body><p>The DEC of the Estimated Telescope/Image Field Position in dd:mm:ss notation</p></body></html>
-
-
-
-
-
- Basic Options
-
-
-
-
-
- 0
-
-
-
-
- <html><head/><body><p>This option should <span style=" font-weight:600;">ONLY</span> be checked if your astrometry.net version is 0.67 or earlier. Uncheck for any versions greater than 0.67</p></body></html>
-
-
- --no-fits2fits
-
-
-
-
-
-
- <html><head/><body><p>Check this option if your image does not have much nebulosity. If it does have strong nebulosity, uncheck it.</p></body></html>
-
-
- --resort
-
-
- true
-
-
-
-
-
-
- <html><head/><body><p>This will prevent the solver from looking at an already existing WCS Header before blindly trying to solve the image. It is recommended to keep it checked.</p></body></html>
-
-
- --no-verify
-
-
- true
-
-
-
-
-
-
- false
-
-
- <html><head/><body><p>Prevents creation of unnecessary files unused by Ekos.</p></body></html>
-
-
- --no-plots
-
-
- true
-
-
-
-
-
-
- false
-
-
-
- 50
- 16777215
-
-
-
- <html><head/><body><p>Overwrite already generated files. It must be checked to prevent solver failure.</p></body></html>
-
-
- -O
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
- Qt::Horizontal
-
-
-
-
-
-
- 10
-
-
-
-
- Imaging Options
-
-
-
-
-
- 0
-
-
-
-
- false
-
-
-
- 100
- 0
-
-
-
-
- 100
- 16777215
-
-
-
- <html><head/><body><p>Downsample the image to shrink its size and speed up the solver.</p></body></html>
-
-
- downsample
-
-
-
-
-
-
-
- 70
- 0
-
-
-
-
- 70
- 16777215
-
-
-
- <html><head/><body><p>Downsample factor</p></body></html>
-
-
- 2
-
-
-
-
-
-
-
-
- <html><head/><body><p>Downsample the image to shrink its size and speed up the solver.</p></body></html>
-
-
- Down Sample Image
-
-
- true
-
-
-
-
-
-
- <html><head/><body><p>Set image scale to speed up solver as it does not have to search index files of different image scales.</p></body></html>
-
-
- Image Scale Bounds
-
-
- true
-
-
-
-
-
-
- 0
-
-
- 0
-
-
-
-
-
- 70
- 0
-
-
-
-
- 70
- 16777215
-
-
-
- <html><head/><body><p>The high end of the imager scale, calculated as a little bigger than the longer dimension of the image.</p></body></html>
-
-
-
-
-
-
- <html><head/><body><p>The high end of the imager scale, calculated as a little bigger than the longer dimension of the image.</p></body></html>
-
-
- High
-
-
-
-
-
-
- <html><head/><body><p>The lower end of the imager scale, calculated as a little smaller than the shorter dimension of the image.</p></body></html>
-
-
- Low
-
-
-
-
-
-
- false
-
-
-
- 30
- 16777215
-
-
-
- <html><head/><body><p>The high end of the imager scale, calculated as a little bigger than the longer dimension of the image.</p></body></html>
-
-
- H
-
-
-
-
-
-
- false
-
-
-
- 30
- 16777215
-
-
-
- <html><head/><body><p>The lower end of the imager scale, calculated as a little smaller than the shorter dimension of the image.</p></body></html>
-
-
- L
-
-
-
-
-
-
-
- 70
- 0
-
-
-
-
- 70
- 16777215
-
-
-
- <html><head/><body><p>The lower end of the imager scale, calculated as a little smaller than the shorter dimension of the image.</p></body></html>
-
-
-
-
-
-
- false
-
-
-
- 30
- 16777215
-
-
-
- <html><head/><body><p>The units of the imager scale bounds above.</p><p>dw: degree width</p><p>aw: arcminute width</p></body></html>
-
-
- u
-
-
-
-
-
-
- <html><head/><body><p>The units of the imager scale bounds above.</p><p>dw: degree width</p><p>aw: arcminute width</p></body></html>
-
-
- units
-
-
-
-
-
-
-
- 110
- 16777215
-
-
-
- <html><head/><body><p>The units of the imager scale bounds above.</p><p>dw: degree width</p><p>aw: arcminute width</p></body></html>
-
-
- 0
-
-
-
- dw
-
-
-
-
- aw
-
-
-
-
-
-
-
-
-
-
- 22
- 22
-
-
-
-
- 22
- 22
-
-
-
- <html><head/><body><p>Update Image Scale Bounds from the currently active camera & telescope combination.</p></body></html>
-
-
-
-
-
-
-
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
- Position Options
-
-
-
-
-
- 0
-
-
- 0
-
-
-
-
- false
-
-
-
- 30
- 16777215
-
-
-
- <html><head/><body><p>The RA of the Estimated Telescope/Image Field Position in hh:mm:ss notation</p></body></html>
-
-
- 3
-
-
-
-
-
-
- <html><head/><body><p>The DEC of the Estimated Telescope/Image Field Position in dd:mm:ss notation</p></body></html>
-
-
- DEC
-
-
-
-
-
-
- false
-
-
-
- 30
- 16777215
-
-
-
- <html><head/><body><p>The DEC of the Estimated Telescope/Image Field Position in dd:mm:ss notation</p></body></html>
-
-
- 4
-
-
-
-
-
-
- true
-
-
-
- 70
- 0
-
-
-
-
- 70
- 16777215
-
-
-
- <html><head/><body><p>The DEC of the Estimated Telescope/Image Field Position in dd:mm:ss notation</p></body></html>
-
-
-
-
-
-
- <html><head/><body><p>The RA of the Estimated Telescope/Image Field Position in hh:mm:ss notation</p></body></html>
-
-
- RA
-
-
-
-
-
-
- true
-
-
-
- 70
- 0
-
-
-
-
- 70
- 16777215
-
-
-
- <html><head/><body><p>The RA of the Estimated Telescope/Image Field Position in hh:mm:ss notation</p></body></html>
-
-
-
-
-
-
-
- 70
- 0
-
-
-
-
- 70
- 16777215
-
-
-
- <html><head/><body><p>The Search Radius for the Estimated Telescope/Image Field Position in degrees.</p></body></html>
-
-
- 30
-
-
-
-
-
-
- false
-
-
-
- 30
- 16777215
-
-
-
- <html><head/><body><p>The Search Radius for the Estimated Telescope/Image Field Position in degrees.</p></body></html>
-
-
- 5
-
-
-
-
-
-
- <html><head/><body><p>The Search Radius for the Estimated Telescope/Image Field Position in degrees.</p></body></html>
-
-
- Radius
-
-
-
-
-
-
-
-
- <html><head/><body><p>Set estimated position to speed up astrometry solver as it does not have to search in other areas of the sky.</p></body></html>
-
-
- Estimated
-Position
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 22
- 22
-
-
-
-
- 22
- 22
-
-
-
- <html><head/><body><p>Update coordinates to the current telescope position</p></body></html>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Qt::Vertical
-
-
-
- 20
- 20
-
-
-
-
-
-
-
- <html><head/><body><p>You can directly enter the Solver Arguments on this line. If the argument is recognized, it will automatically update the boxes above as you type. You can also enter options that are not included above.</p></body></html>
-
-
-
-
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset|QDialogButtonBox::RestoreDefaults
-
-
-
-
-
-
-
- dmsBox
- QLineEdit
- widgets/dmsbox.h
- 1
-
-
-
-
-
- buttonBox
- accepted()
- astrometryoptions
- accept()
-
-
- 414
- 309
-
-
- 414
- 164
-
-
-
-
- buttonBox
- rejected()
- astrometryoptions
- reject()
-
-
- 414
- 309
-
-
- 414
- 164
-
-
-
-
-
diff --git a/kstars/ekos/align/offlineastrometryparser.cpp b/kstars/ekos/align/offlineastrometryparser.cpp
index 225e731a0..6096d43f5 100644
--- a/kstars/ekos/align/offlineastrometryparser.cpp
+++ b/kstars/ekos/align/offlineastrometryparser.cpp
@@ -87,11 +87,12 @@ bool OfflineAstrometryParser::astrometryNetOK()
solverOK = solver.exists() && solver.isFile();
}
else{
- QFileInfo solver(Options::astrometrySolver());
+ QFileInfo solver(Options::astrometrySolverBinary());
solverOK = solver.exists() && solver.isFile();
}
- if(Options::wcsIsInternal()){
+ if(Options::astrometryWCSIsInternal())
+ {
QFileInfo wcsinfo(QCoreApplication::applicationDirPath()+"/astrometry/bin/wcsinfo");
wcsinfoOK = wcsinfo.exists() && wcsinfo.isFile();
}else{
@@ -210,7 +211,7 @@ bool OfflineAstrometryParser::startSovler(const QString &filename, const QStrin
QStringList solverArgs = args;
// Add parity option if none is give and we already know parity before
- if (parity.isEmpty() == false && args.contains("parity") == false)
+ if (Options::astrometryDetectParity() && parity.isEmpty() == false && args.contains("parity") == false)
solverArgs << "--parity" << parity;
QString solutionFile = QDir::tempPath() + "/solution.wcs";
solverArgs << "-W" << solutionFile << filename;
@@ -240,13 +241,13 @@ bool OfflineAstrometryParser::startSovler(const QString &filename, const QStrin
if(Options::astrometrySolverIsInternal())
solverPath=QCoreApplication::applicationDirPath()+"/astrometry/bin/solve-field";
else
- solverPath=Options::astrometrySolver();
+ solverPath=Options::astrometrySolverBinary();
solver.start(solverPath, solverArgs);
align->appendLogText(i18n("Starting solver..."));
- if (Options::solverVerbose())
+ if (Options::astrometrySolverVerbose())
{
QString command = solverPath + " " + solverArgs.join(" ");
align->appendLogText(command);
@@ -283,7 +284,7 @@ void OfflineAstrometryParser::solverComplete(int exist_status)
QString wcsPath;
- if(Options::wcsIsInternal())
+ if(Options::astrometryWCSIsInternal())
wcsPath = QCoreApplication::applicationDirPath()+"/astrometry/bin/wcsinfo";
else
wcsPath = Options::astrometryWCSInfo();
@@ -339,7 +340,7 @@ void OfflineAstrometryParser::wcsinfoComplete(int exist_status)
void OfflineAstrometryParser::logSolver()
{
- if (Options::solverVerbose())
+ if (Options::astrometrySolverVerbose())
align->appendLogText(solver.readAll().trimmed());
}
diff --git a/kstars/ekos/align/onlineastrometryparser.cpp b/kstars/ekos/align/onlineastrometryparser.cpp
index 3253b0fb9..885cd020e 100644
--- a/kstars/ekos/align/onlineastrometryparser.cpp
+++ b/kstars/ekos/align/onlineastrometryparser.cpp
@@ -202,7 +202,7 @@ void OnlineAstrometryParser::uploadFile()
uploadReq.insert("radius", radius);
if (downsample_factor != 0)
uploadReq.insert("downsample_factor", downsample_factor);
- if (parity != -1)
+ if (Options::astrometryDetectParity() && parity != -1)
uploadReq.insert("parity", parity);
QJsonObject json = QJsonObject::fromVariantMap(uploadReq);
@@ -311,7 +311,7 @@ void OnlineAstrometryParser::onResult(QNetworkReply* reply)
QVariant json_result = json_doc.toVariant();
QVariantMap result = json_result.toMap();
- if (Options::solverVerbose())
+ if (Options::astrometrySolverVerbose())
align->appendLogText(json_doc.toJson(QJsonDocument::Compact));
switch (workflowStage)
@@ -327,7 +327,7 @@ void OnlineAstrometryParser::onResult(QNetworkReply* reply)
sessionKey = result["session"].toString();
- if (Options::solverVerbose())
+ if (Options::astrometrySolverVerbose())
align->appendLogText(i18n("Authentication to astrometry.net is successful. Session: %1", sessionKey));
emit authenticateFinished();
diff --git a/kstars/ekos/align/opsalign.cpp b/kstars/ekos/align/opsalign.cpp
new file mode 100644
index 000000000..afff82e23
--- /dev/null
+++ b/kstars/ekos/align/opsalign.cpp
@@ -0,0 +1,91 @@
+/* Astrometry.net Options Editor
+ Copyright (C) 2017 Jasem Mutlaq
+ Copyright (C) 2017 Robert Lancaster
+
+ 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
+
+#include "fov.h"
+#include "opsalign.h"
+#include "kstars.h"
+#include "align.h"
+#include "Options.h"
+
+namespace Ekos
+{
+
+OpsAlign::OpsAlign(Align *parent) : QWidget( KStars::Instance() )
+{
+ setupUi(this);
+
+ alignModule = parent;
+
+ //Get a pointer to the KConfigDialog
+ m_ConfigDialog = KConfigDialog::exists( "alignsettings" );
+
+ connect( m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL( clicked() ), SLOT( slotApply() ) );
+ connect( m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL( clicked() ), SLOT( slotApply() ) );
+
+#ifdef Q_OS_OSX
+connect(kcfg_AstrometrySolverIsInternal, SIGNAL(clicked()), this, SLOT(toggleSolverInternal()));
+kcfg_AstrometrySolverIsInternal->setToolTip(i18n("Internal or External Plate Solver?"));
+if(Options::astrometrySolverIsInternal())
+ kcfg_AstrometrySolverBinary->setEnabled(false);
+
+connect(kcfg_AstrometryConfFileIsInternal, SIGNAL(clicked()), this, SLOT(toggleConfigInternal()));
+kcfg_AstrometryConfFileIsInternal->setToolTip(i18n("Internal or External astrometry.cfg?"));
+if(Options::astrometryConfFileIsInternal())
+ kcfg_AstrometryConfFile->setEnabled(false);
+
+connect(kcfg_wcsIsInternal, SIGNAL(clicked()), this, SLOT(toggleWCSInternal()));
+kcfg_AstrometryWCSIsInternal->setToolTip(i18n("Internal or External wcsinfo?"));
+if(Options::wcsIsInternal())
+ kcfg_AstrometryWCSInfo->setEnabled(false);
+#else
+kcfg_AstrometrySolverIsInternal->setVisible(false);
+kcfg_AstrometryConfFileIsInternal->setVisible(false);
+kcfg_AstrometryWCSIsInternal->setVisible(false);
+#endif
+}
+
+OpsAlign::~OpsAlign() {}
+
+void OpsAlign::toggleSolverInternal()
+{
+ kcfg_AstrometrySolverBinary->setEnabled(!kcfg_AstrometrySolverIsInternal->isChecked());
+ if(kcfg_AstrometrySolverIsInternal->isChecked())
+ kcfg_AstrometrySolverBinary->setText("*Internal Solver*");
+ else
+ kcfg_AstrometrySolverBinary->setText("/usr/local/bin/solve-field");
+}
+
+void OpsAlign::toggleConfigInternal()
+{
+ kcfg_AstrometryConfFile->setEnabled(!kcfg_AstrometryConfFileIsInternal->isChecked());
+ if(kcfg_AstrometryConfFileIsInternal->isChecked())
+ kcfg_AstrometryConfFile->setText("*Internal astrometry.cfg*");
+ else
+ kcfg_AstrometryConfFile->setText("/etc/astrometry.cfg");
+}
+
+void OpsAlign::toggleWCSInternal()
+{
+ kcfg_AstrometryWCSInfo->setEnabled(!kcfg_AstrometryWCSIsInternal->isChecked());
+ if(kcfg_AstrometryWCSIsInternal->isChecked())
+ kcfg_AstrometryWCSInfo->setText("*Internal wcsinfo*");
+ else
+ kcfg_AstrometryWCSInfo->setText("/usr/local/bin/wcsinfo");
+}
+
+void OpsAlign::slotApply()
+{
+ if (alignModule->fov())
+ alignModule->fov()->setImageDisplay(kcfg_AstrometrySolverWCS->isChecked());
+}
+
+}
diff --git a/kstars/ekos/align/opsalign.h b/kstars/ekos/align/opsalign.h
new file mode 100644
index 000000000..b365fccb3
--- /dev/null
+++ b/kstars/ekos/align/opsalign.h
@@ -0,0 +1,48 @@
+/* Astrometry.net Options Editor
+ Copyright (C) 2017 Jasem Mutlaq
+ Copyright (C) 2017 Robert Lancaster
+
+ 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.
+*/
+
+#ifndef OPSALIGN_H
+#define OPSALIGN_H
+
+#include
+
+#include "ui_opsalign.h"
+
+class KConfigDialog;
+
+namespace Ekos
+{
+
+class Align;
+
+class OpsAlign : public QWidget, public Ui::OpsAlign
+{
+ Q_OBJECT
+
+public:
+ explicit OpsAlign(Align *parent);
+ ~OpsAlign();
+
+protected:
+
+private slots:
+ void toggleSolverInternal();
+ void toggleConfigInternal();
+ void toggleWCSInternal();
+ void slotApply();
+
+private:
+ KConfigDialog *m_ConfigDialog;
+ Align *alignModule;
+};
+
+}
+
+#endif // OpsAlign_H
diff --git a/kstars/ekos/align/opsalign.ui b/kstars/ekos/align/opsalign.ui
new file mode 100644
index 000000000..bed648a88
--- /dev/null
+++ b/kstars/ekos/align/opsalign.ui
@@ -0,0 +1,207 @@
+
+
+ OpsAlign
+
+
+
+ 0
+ 0
+ 422
+ 124
+
+
+
+ Form
+
+
+
+
+
+
+
+ Astrometry.net solve-field binary
+
+
+
+
+
+
+
+
+
+ Astrometry.net configuration file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ API Key:
+
+
+
+
+
+
+ Astrometry.net configuration file
+
+
+
+
+
+
+
+
+
+ config:
+
+
+
+
+
+
+ API URL:
+
+
+
+
+
+
+ Astrometry.net wcsinfo binary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ solver:
+
+
+
+
+
+
+ wcsinfo:
+
+
+
+
+
+
+ Astrometry.net configuration file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Use JPEG format, instead of FITS, to upload images to the online astrometry.net service
+
+
+ Upload JPG
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+ enable World Coordinate System (WCS). WCS is used to encode RA/DEC coordinates in captured CCD images.
+
+
+ WCS
+
+
+
+
+
+
+ Log verbose solver output
+
+
+
+
+
+ Verbose
+
+
+
+
+
+
+ Display received FITS images unto solver FOV rectangle in the sky map
+
+
+ Overlay
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 3
+
+
+
+
+
+
+
+
+
diff --git a/kstars/ekos/align/opsastrometry.cpp b/kstars/ekos/align/opsastrometry.cpp
new file mode 100644
index 000000000..e9768df83
--- /dev/null
+++ b/kstars/ekos/align/opsastrometry.cpp
@@ -0,0 +1,156 @@
+/* Astrometry.net Options Editor
+ Copyright (C) 2017 Jasem Mutlaq
+ Copyright (C) 2017 Robert Lancaster
+
+ 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
+
+#include "opsastrometry.h"
+#include "kstars.h"
+#include "align.h"
+#include "Options.h"
+
+namespace Ekos
+{
+
+OpsAstrometry::OpsAstrometry(Align *parent) : QWidget( KStars::Instance() )
+{
+ setupUi(this);
+
+ alignModule = parent;
+
+ //Get a pointer to the KConfigDialog
+ m_ConfigDialog = KConfigDialog::exists( "alignsettings" );
+
+ dms ra, de;
+ ra.setD(Options::astrometryPositionRA());
+ de.setD(Options::astrometryPositionDE());
+
+ estRA->setText(ra.toHMSString());
+ estDec->setText(de.toDMSString());
+
+ imageWarningLabel->setHidden(kcfg_AstrometryAutoUpdateImageScale->isChecked());
+ positionWarningLabel->setHidden(kcfg_AstrometryAutoUpdatePosition->isChecked());
+
+ connect(kcfg_AstrometryAutoUpdateImageScale, SIGNAL(toggled(bool)), imageWarningLabel, SLOT(setHidden(bool)));
+ connect(kcfg_AstrometryAutoUpdatePosition, SIGNAL(toggled(bool)), positionWarningLabel, SLOT(setHidden(bool)));
+
+ connect( m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL( clicked() ), SLOT( slotApply() ) );
+ connect( m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL( clicked() ), SLOT( slotApply() ) );
+
+ connect(updateScale, SIGNAL(clicked()), this, SLOT(slotUpdateScale()));
+ connect(updatePosition, SIGNAL(clicked()), this, SLOT(slotUpdatePosition()));
+ updateScale->setIcon(QIcon::fromTheme("edit-copy", QIcon(":/icons/breeze/default/edit-copy.svg")));
+ updateScale->setAttribute(Qt::WA_LayoutUsesWidgetRect);
+ updatePosition->setIcon(QIcon::fromTheme("edit-copy", QIcon(":/icons/breeze/default/edit-copy.svg")));
+ updatePosition->setAttribute(Qt::WA_LayoutUsesWidgetRect);
+}
+
+OpsAstrometry::~OpsAstrometry() {}
+
+void OpsAstrometry::showEvent(QShowEvent *)
+{
+ dms ra, de;
+ ra.setD(Options::astrometryPositionRA());
+ de.setD(Options::astrometryPositionDE());
+
+ estRA->setText(ra.toHMSString());
+ estDec->setText(de.toDMSString());
+}
+
+//This updates the telescope/image field scale in the astrometry options editor to match the currently connected devices.
+void OpsAstrometry::slotUpdateScale()
+{
+ double fov_w, fov_h, fov_pixscale;
+
+ // Values in arcmins. Scale in arcsec per pixel
+ alignModule->getFOVScale(fov_w, fov_h, fov_pixscale);
+
+ switch (kcfg_AstrometryImageScaleUnits->currentIndex())
+ {
+ case SCALE_DEGREES:
+ fov_w /= 60;
+ fov_h /= 60;
+ kcfg_AstrometryImageScaleLow->setValue(qMin(fov_w, fov_h));
+ kcfg_AstrometryImageScaleHigh->setValue(qMax(fov_w, fov_h));
+ break;
+
+ case SCALE_ARCMINUTES:
+ kcfg_AstrometryImageScaleLow->setValue(qMin(fov_w, fov_h));
+ kcfg_AstrometryImageScaleHigh->setValue(qMax(fov_w, fov_h));
+ break;
+
+ case SCALE_ARCSECPERPIX:
+ kcfg_AstrometryImageScaleLow->setValue(fov_pixscale);
+ kcfg_AstrometryImageScaleHigh->setValue(fov_pixscale);
+ break;
+
+ default:
+ return;
+ }
+}
+
+//This updates the RA and DEC position in the astrometry options editor to match the current telescope position.
+void OpsAstrometry::slotUpdatePosition()
+{
+ estRA->setText(alignModule->ScopeRAOut->text());
+ estDec->setText(alignModule->ScopeDecOut->text());
+}
+
+void OpsAstrometry::slotApply()
+{
+ bool raOK=false, deOK=false;
+ dms RA = estRA->createDms(false, &raOK);
+ dms DE = estDec->createDms(true, &deOK);
+
+ if (raOK && deOK)
+ {
+ Options::setAstrometryPositionRA(RA.Degrees());
+ Options::setAstrometryPositionDE(DE.Degrees());
+ }
+
+ QVariantMap optionsMap;
+
+ if (kcfg_AstrometryUseNoVerify->isChecked())
+ optionsMap["noverify"] = true;
+
+ if (kcfg_AstrometryUseResort->isChecked())
+ optionsMap["resort"] = true;
+
+ if (kcfg_AstrometryUseNoFITS2FITS->isChecked())
+ optionsMap["nofits2fits"] = true;
+
+ if (kcfg_AstrometryUseImageScale->isChecked())
+ {
+ optionsMap["scaleL"] = kcfg_AstrometryImageScaleLow->value();
+ optionsMap["scaleH"] = kcfg_AstrometryImageScaleHigh->value();
+ optionsMap["scaleUnits"] = kcfg_AstrometryImageScaleUnits->currentText();
+ }
+
+ if (kcfg_AstrometryUsePosition->isChecked())
+ {
+ optionsMap["ra"] = RA.Degrees();
+ optionsMap["de"] = DE.Degrees();
+ optionsMap["radius"] = kcfg_AstrometryRaduis->value();
+ }
+
+ if (kcfg_AstrometryUseDownsample->isChecked())
+ optionsMap["downsample"] = kcfg_AstrometryDownsample->value();
+
+ if (kcfg_AstrometryCustomOptions->text().isEmpty() == false)
+ optionsMap["custom"] = kcfg_AstrometryCustomOptions->text();
+
+
+ QStringList solverArgs = Align::generateOptions(optionsMap);
+
+ QString options = solverArgs.join(" ");
+ alignModule->solverOptions->setText(options);
+ alignModule->solverOptions->setToolTip(options);
+}
+
+}
diff --git a/kstars/ekos/align/opsastrometry.h b/kstars/ekos/align/opsastrometry.h
new file mode 100644
index 000000000..cec37c8cb
--- /dev/null
+++ b/kstars/ekos/align/opsastrometry.h
@@ -0,0 +1,51 @@
+/* Astrometry.net Options Editor
+ Copyright (C) 2017 Jasem Mutlaq
+ Copyright (C) 2017 Robert Lancaster
+
+ 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.
+*/
+
+#ifndef OPSASTROMETRY_H
+#define OPSASTROMETRY_H
+
+#include
+
+#include "ui_opsastrometry.h"
+
+class KConfigDialog;
+
+namespace Ekos
+{
+
+class Align;
+
+class OpsAstrometry : public QWidget, public Ui::OpsAstrometry
+{
+ Q_OBJECT
+
+public:
+
+ enum { SCALE_DEGREES, SCALE_ARCMINUTES, SCALE_ARCSECPERPIX };
+
+ explicit OpsAstrometry(Align *parent);
+ ~OpsAstrometry();
+
+protected:
+ void showEvent(QShowEvent *);
+
+private slots:
+ void slotUpdatePosition();
+ void slotUpdateScale();
+ void slotApply();
+
+private:
+ KConfigDialog *m_ConfigDialog;
+ Align *alignModule;
+};
+
+}
+
+#endif // OPSASTROMETRY_H
diff --git a/kstars/ekos/align/opsastrometry.ui b/kstars/ekos/align/opsastrometry.ui
new file mode 100644
index 000000000..6a82eed22
--- /dev/null
+++ b/kstars/ekos/align/opsastrometry.ui
@@ -0,0 +1,741 @@
+
+
+ OpsAstrometry
+
+
+
+ 0
+ 0
+ 426
+ 379
+
+
+
+ Form
+
+
+
+
+
+ Basic Options
+
+
+
+
+
+ 0
+
+
+
+
+ <html><head/><body><p>This option should <span style=" font-weight:600;">ONLY</span> be checked if your astrometry.net version is 0.67 or earlier. Uncheck for any versions greater than 0.67</p></body></html>
+
+
+ --no-fits2fits
+
+
+
+
+
+
+ <html><head/><body><p>Check this option if your image does not have much nebulosity. If it does have strong nebulosity, uncheck it.</p></body></html>
+
+
+ --resort
+
+
+ true
+
+
+
+
+
+
+ <html><head/><body><p>This will prevent the solver from looking at an already existing WCS Header before blindly trying to solve the image. It is recommended to keep it checked.</p></body></html>
+
+
+ --no-verify
+
+
+ false
+
+
+
+
+
+
+ <html><head/><body><p>Detect parity and reuse it to speed up solver.</p></body></html>
+
+
+ Parity
+
+
+
+
+
+
+ false
+
+
+ <html><head/><body><p>Prevents creation of unnecessary files unused by Ekos.</p></body></html>
+
+
+ --no-plots
+
+
+ false
+
+
+
+
+
+
+ false
+
+
+
+ 50
+ 16777215
+
+
+
+ <html><head/><body><p>Overwrite already generated files. It must be checked to prevent solver failure.</p></body></html>
+
+
+ -O
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+ Imaging Options
+
+
+
+
+
+ <p>The units of the imager scale bounds above.</p>
+<ul>
+<li>dw: degree width</li>
+<li>aw: arcminute width</li>
+<li>app: arcsecs per pixel</li>
+</ul>
+
+
+ units
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+ 22
+ 22
+
+
+
+
+ 22
+ 22
+
+
+
+ <html><head/><body><p>Update Image Scale Bounds from the currently active camera & telescope combination.</p></body></html>
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+ 30
+ 16777215
+
+
+
+ <html><head/><body><p>The high end of the imager scale, calculated as a little bigger than the longer dimension of the image.</p></body></html>
+
+
+ H
+
+
+
+
+
+
+
+ 110
+ 16777215
+
+
+
+ <p>The units of the imager scale bounds above.</p>
+<ul>
+<li>dw: degree width</li>
+<li>aw: arcminute width</li>
+<li>app: arcsecs per pixel</li>
+</ul>
+
+
+ 0
+
+
+
+ dw
+
+
+
+
+ aw
+
+
+
+
+ app
+
+
+
+
+
+
+
+ 2
+
+
+ 16
+
+
+ 2
+
+
+
+
+
+
+ <html><head/><body><p>Downsample the image to shrink its size and speed up the solver.</p></body></html>
+
+
+ Down Sample
+
+
+ false
+
+
+
+
+
+
+ <html><head/><body><p>Set image scale to speed up solver as it does not have to search index files of different image scales.</p></body></html>
+
+
+ Use Scale
+
+
+ false
+
+
+
+
+
+
+ false
+
+
+
+ 30
+ 16777215
+
+
+
+ <html><head/><body><p>The lower end of the imager scale, calculated as a little smaller than the shorter dimension of the image.</p></body></html>
+
+
+ L
+
+
+
+
+
+
+ 3
+
+
+ 0.001000000000000
+
+
+ 999.000000000000000
+
+
+ 0.001000000000000
+
+
+
+
+
+
+ false
+
+
+ <html><head/><body><p>Downsample the image to shrink its size and speed up the solver.</p></body></html>
+
+
+ downsample
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+ 3
+
+
+ 0.001000000000000
+
+
+ 999.000000000000000
+
+
+ 0.001000000000000
+
+
+
+
+
+
+ <html><head/><body><p>The high end of the imager scale, calculated as a little bigger than the longer dimension of the image.</p></body></html>
+
+
+ High
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+ Automatically update image scale values when CCD and/or Mount parameters are updated.
+
+
+ Auto Update
+
+
+
+
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+
+ 22
+ 22
+
+
+
+
+ 22
+ 22
+
+
+
+ <html><head/><body><nobr>Image Scale Auto Update is turned off!</nobr></body></html>
+
+
+
+
+
+ :/icons/breeze/default/security-medium.svg
+
+
+ true
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+ false
+
+
+
+ 30
+ 16777215
+
+
+
+ <html><head/><body><p>The units of the imager scale bounds above.</p><p>dw: degree width</p><p>aw: arcminute width</p></body></html>
+
+
+ u
+
+
+
+
+
+
+ <html><head/><body><p>The lower end of the imager scale, calculated as a little smaller than the shorter dimension of the image.</p></body></html>
+
+
+ Low
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
+
+ Position Options
+
+
+
+
+
+ <html><head/><body><p>The RA of the Estimated Telescope/Image Field Position in hh:mm:ss notation</p></body></html>
+
+
+ RA
+
+
+
+
+
+
+ true
+
+
+ <html><head/><body><p>The RA of the Estimated Telescope/Image Field Position in hh:mm:ss notation</p></body></html>
+
+
+
+
+
+
+
+ 22
+ 22
+
+
+
+
+ 22
+ 22
+
+
+
+ <html><head/><body><p>Update coordinates to the current telescope position</p></body></html>
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+ 30
+ 16777215
+
+
+
+ <html><head/><body><p>The Search Radius for the Estimated Telescope/Image Field Position in degrees.</p></body></html>
+
+
+ 5
+
+
+
+
+
+
+ false
+
+
+
+ 30
+ 16777215
+
+
+
+ <html><head/><body><p>The RA of the Estimated Telescope/Image Field Position in hh:mm:ss notation</p></body></html>
+
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.000000000000000
+
+
+ 360.000000000000000
+
+
+ 30.000000000000000
+
+
+
+
+
+
+ false
+
+
+
+ 30
+ 16777215
+
+
+
+ <html><head/><body><p>The DEC of the Estimated Telescope/Image Field Position in dd:mm:ss notation</p></body></html>
+
+
+ 4
+
+
+
+
+
+
+ true
+
+
+
+ 70
+ 0
+
+
+
+ <html><head/><body><p>The DEC of the Estimated Telescope/Image Field Position in dd:mm:ss notation</p></body></html>
+
+
+
+
+
+
+ <html><head/><body><p>The Search Radius for the Estimated Telescope/Image Field Position in degrees.</p></body></html>
+
+
+ Radius
+
+
+
+
+
+
+ <html><head/><body><p>The DEC of the Estimated Telescope/Image Field Position in dd:mm:ss notation</p></body></html>
+
+
+ DEC
+
+
+
+
+
+
+
+
+ Automatically update position coordinates when mount comples slewing.
+
+
+ Auto Update
+
+
+
+
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+
+ 22
+ 22
+
+
+
+
+ 22
+ 22
+
+
+
+ <html><head/><body><nobr>Position Auto Update is turned off!</nobr></body></html>
+
+
+
+
+
+ :/icons/breeze/default/security-medium.svg
+
+
+ true
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+ <html><head/><body><p>Set estimated position to speed up astrometry solver as it does not have to search in other areas of the sky.</p></body></html>
+
+
+ Use Position
+
+
+ false
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+ label_14
+ estRA
+ lineEdit_44
+ lineEdit_47
+ kcfg_AstrometryRaduis
+ lineEdit_48
+ estDec
+ label_8
+ label_15
+ kcfg_AstrometryUsePosition
+ label
+ updatePosition
+ horizontalSpacer_2
+
+
+
+
+
+
+
+ Custom:
+
+
+
+
+
+
+ <html><head/><body><p>Additional optional astrometry.net options</p></body></html>
+
+
+
+
+
+
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+ dmsBox
+ QLineEdit
+ widgets/dmsbox.h
+ 1
+
+
+
+
+
+
+
diff --git a/kstars/ekos/align/remoteastrometryparser.cpp b/kstars/ekos/align/remoteastrometryparser.cpp
index 071d51b96..4c8ad2bde 100644
--- a/kstars/ekos/align/remoteastrometryparser.cpp
+++ b/kstars/ekos/align/remoteastrometryparser.cpp
@@ -63,7 +63,7 @@ bool RemoteAstrometryParser::startSovler(const QString &filename, const QString
QStringList solverArgs = args;
// Add parity option if none is give and we already know parity before
- if (parity.isEmpty() == false && args.contains("parity") == false)
+ if (Options::astrometryDetectParity() && parity.isEmpty() == false && args.contains("parity") == false)
solverArgs << "--parity" << parity;
for (int i=0; i < solverSettings->ntp; i++)
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index db31c5569..db39fec22 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -1159,19 +1159,19 @@ void EkosManager::processNewNumber(INumberVectorProperty *nvp)
if (guideProcess)
{
guideProcess->setTelescope(managedDevices[KSTARS_TELESCOPE]);
- guideProcess->syncTelescopeInfo();
+ //guideProcess->syncTelescopeInfo();
}
if (alignProcess)
{
alignProcess->setTelescope(managedDevices[KSTARS_TELESCOPE]);
- alignProcess->syncTelescopeInfo();
+ //alignProcess->syncTelescopeInfo();
}
if (mountProcess)
{
mountProcess->setTelescope(managedDevices[KSTARS_TELESCOPE]);
- mountProcess->syncTelescopeInfo();
+ //mountProcess->syncTelescopeInfo();
}
return;
@@ -1232,19 +1232,19 @@ void EkosManager::processNewProperty(INDI::Property* prop)
if (guideProcess)
{
guideProcess->setTelescope(managedDevices[KSTARS_TELESCOPE]);
- guideProcess->syncTelescopeInfo();
+ //guideProcess->syncTelescopeInfo();
}
if (alignProcess)
{
alignProcess->setTelescope(managedDevices[KSTARS_TELESCOPE]);
- alignProcess->syncTelescopeInfo();
+ //alignProcess->syncTelescopeInfo();
}
if (mountProcess)
{
mountProcess->setTelescope(managedDevices[KSTARS_TELESCOPE]);
- mountProcess->syncTelescopeInfo();
+ //mountProcess->syncTelescopeInfo();
}
return;
@@ -2184,10 +2184,23 @@ void EkosManager::setTarget(SkyObject *o)
void EkosManager::showEkosOptions()
{
+ QWidget *currentWidget = toolsWidget->currentWidget();
+
+ if (alignProcess && alignProcess == currentWidget)
+ {
+ KConfigDialog::showDialog( "alignsettings" );
+ return;
+ }
+
+ if (guideProcess && guideProcess == currentWidget)
+ {
+ KConfigDialog::showDialog( "guidesettings" );
+ return;
+ }
+
if (ekosOptionsWidget == NULL)
optionsB->click();
-
- if (ekosOptionsWidget && KConfigDialog::showDialog( "settings" ))
+ else if (KConfigDialog::showDialog( "settings" ))
{
KConfigDialog *cDialog = KConfigDialog::exists("settings");
cDialog->setCurrentPage(ekosOptionsWidget);
diff --git a/kstars/ekos/opsekos.cpp b/kstars/ekos/opsekos.cpp
index cf16d7669..61c89b954 100644
--- a/kstars/ekos/opsekos.cpp
+++ b/kstars/ekos/opsekos.cpp
@@ -27,7 +27,6 @@
#include "ksuserdb.h"
#include "ekos/auxiliary/darklibrary.h"
#include "kspaths.h"
-#include "fov.h"
OpsEkos::OpsEkos()
: QTabWidget( KStars::Instance() )
@@ -37,27 +36,6 @@ OpsEkos::OpsEkos()
//Get a pointer to the KConfigDialog
m_ConfigDialog = KConfigDialog::exists( "settings" );
-#ifdef Q_OS_OSX
-connect(kcfg_astrometrySolverIsInternal, SIGNAL(clicked()), this, SLOT(toggleSolverInternal()));
-kcfg_astrometrySolverIsInternal->setToolTip(i18n("Internal or External Plate Solver?"));
-if(Options::astrometrySolverIsInternal())
- kcfg_astrometrySolver->setEnabled(false);
-
-connect(kcfg_astrometryConfFileIsInternal, SIGNAL(clicked()), this, SLOT(toggleConfigInternal()));
-kcfg_astrometryConfFileIsInternal->setToolTip(i18n("Internal or External astrometry.cfg?"));
-if(Options::astrometryConfFileIsInternal())
- kcfg_astrometryConfFile->setEnabled(false);
-
-connect(kcfg_wcsIsInternal, SIGNAL(clicked()), this, SLOT(toggleWCSInternal()));
-kcfg_wcsIsInternal->setToolTip(i18n("Internal or External wcsinfo?"));
-if(Options::wcsIsInternal())
- kcfg_astrometryWCSInfo->setEnabled(false);
-#else
-kcfg_astrometrySolverIsInternal->setVisible(false);
-kcfg_astrometryConfFileIsInternal->setVisible(false);
-kcfg_wcsIsInternal->setVisible(false);
-#endif
-
connect( m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL( clicked() ), SLOT( slotApply() ) );
connect( m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL( clicked() ), SLOT( slotApply() ) );
@@ -75,47 +53,6 @@ kcfg_wcsIsInternal->setVisible(false);
OpsEkos::~OpsEkos() {}
-void OpsEkos::toggleSolverInternal()
-{
- kcfg_astrometrySolver->setEnabled(!kcfg_astrometrySolverIsInternal->isChecked());
- if(kcfg_astrometrySolverIsInternal->isChecked())
- kcfg_astrometrySolver->setText("*Internal Solver*");
- else
- kcfg_astrometrySolver->setText("/usr/local/bin/solve-field");
-}
-
-void OpsEkos::toggleConfigInternal()
-{
- kcfg_astrometryConfFile->setEnabled(!kcfg_astrometryConfFileIsInternal->isChecked());
- if(kcfg_astrometryConfFileIsInternal->isChecked())
- kcfg_astrometryConfFile->setText("*Internal astrometry.cfg*");
- else
- kcfg_astrometryConfFile->setText("/etc/astrometry.cfg");
-}
-
-void OpsEkos::toggleWCSInternal()
-{
- kcfg_astrometryWCSInfo->setEnabled(!kcfg_wcsIsInternal->isChecked());
- if(kcfg_wcsIsInternal->isChecked())
- kcfg_astrometryWCSInfo->setText("*Internal wcsinfo*");
- else
- kcfg_astrometryWCSInfo->setText("/usr/local/bin/wcsinfo");
-}
-
-void OpsEkos::slotApply()
-{
- EkosManager *ekosManager = KStars::Instance()->ekosManager();
-
- if (ekosManager)
- {
- Ekos::Align *alignModule = ekosManager->alignModule();
-
- if (alignModule && alignModule->fov())
- alignModule->fov()->setImageDisplay(kcfg_SolverWCS->isChecked());
- }
-
-}
-
void OpsEkos::clearAll()
{
if (darkFramesModel->rowCount() == 0)
diff --git a/kstars/ekos/opsekos.h b/kstars/ekos/opsekos.h
index 6d076a9d3..6071fcfb7 100644
--- a/kstars/ekos/opsekos.h
+++ b/kstars/ekos/opsekos.h
@@ -33,12 +33,6 @@ public:
~OpsEkos();
private slots:
-
- void slotApply();
- void toggleSolverInternal();
- void toggleConfigInternal();
- void toggleWCSInternal();
-
void clearAll();
void clearRow();
void openDarksFolder();
diff --git a/kstars/ekos/opsekos.ui b/kstars/ekos/opsekos.ui
index 6ab54da0c..9e2cfbde0 100644
--- a/kstars/ekos/opsekos.ui
+++ b/kstars/ekos/opsekos.ui
@@ -6,8 +6,8 @@
00
- 361
- 321
+ 353
+ 179
@@ -298,212 +298,6 @@
-
-
- Astrometry
-
-
-
-
-
-
-
- Astrometry.net solve-field binary
-
-
-
-
-
-
-
-
-
- Astrometry.net configuration file
-
-
-
-
-
-
-
-
-
- Use JPEG format, instead of FITS, to upload images to the online astrometry.net service
-
-
- Use JPG for upload
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
- API Key:
-
-
-
-
-
-
- Astrometry.net configuration file
-
-
-
-
-
-
-
-
-
- config:
-
-
-
-
-
-
- API URL:
-
-
-
-
-
-
- Astrometry.net wcsinfo binary
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- solver:
-
-
-
-
-
-
- wcsinfo:
-
-
-
-
-
-
- Astrometry.net configuration file
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Automatically update the solver's RA & Declination coordinates after telescope slew is completed.
-
-
- Automatically update the solver's RA & Declination coordinates after telescope slew is completed.
-
-
- Update Coords
-
-
-
-
-
-
- enable World Coordinate System (WCS). WCS is used to encode RA/DEC coordinates in captured CCD images.
-
-
- WCS
-
-
-
-
-
-
- Log verbose solver output
-
-
-
-
-
- Verbose
-
-
-
-
-
-
- Display received FITS images unto solver FOV rectangle in the sky map
-
-
- Overlay
-
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
-
- Qt::Vertical
-
-
-
- 20
- 269
-
-
-
-
-
- Dark Library
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index 140ec41fc..558b8d0c9 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -1348,57 +1348,19 @@
false
-
-
-
- Path to astrometry.net solver location.
- /usr/bin/solve-field
-
-
-
- false
-
-
-
- Path to astrometry.net wcsinfo location.
- /usr/bin/wcsinfo
-
-
-
- false
-
-
-
- Path to astrometry.net file location.
- /etc/astrometry.cfg
-
-
-
- false
-
-
-
- Key to access astrometry.net online web services. You must register with astrometry.net to obtain a key.
- iczikaqstszeptgs
-
-
-
- http://nova.astrometry.net
-
-
-
- true
-
-
-
- 1
-
-
-
-
-
-
-
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
@@ -1568,24 +1530,16 @@
Set binning index of CCD camera while in alignment mode. Default values 0-3 corresponding to 1x1 to 4x4 binning
- 1
-
-
-
- Automatically update the solver RA and Declination coordinates after telescope slew is completed.
- true
+ 0
-
+ Display detailed verbose messages of the astrometry solver process while in progress.false0
-
-
-
-
+
@@ -1593,11 +1547,11 @@
0
-
+ false
-
+ false
@@ -1613,6 +1567,109 @@
1500
+
+
+ true
+
+
+
+ true
+
+
+
+ true
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+ 1
+
+
+
+ true
+
+
+
+ 2
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+ 30
+
+
+
+ true
+
+
+
+
+
+
+ Path to astrometry.net solver location.
+ /usr/bin/solve-field
+
+
+
+ false
+
+
+
+ Path to astrometry.net wcsinfo location.
+ /usr/bin/wcsinfo
+
+
+
+ false
+
+
+
+ Path to astrometry.net file location.
+ /etc/astrometry.cfg
+
+
+
+ false
+
+
+
+ Key to access astrometry.net online web services. You must register with astrometry.net to obtain a key.
+ iczikaqstszeptgs
+
+
+
+ http://nova.astrometry.net
+
+
+
+ true
+
From null at kde.org Fri Feb 24 09:59:33 2017
From: null at kde.org (Jasem Mutlaq)
Date: Fri, 24 Feb 2017 09:59:33 +0000
Subject: [kstars] kstars: This patch will fix numerous minor OS X issues and
will also add some new functionality to OS X with the Astrometry Conf File
Editor and to all operating systems with the addition of the Astrometry
Index File Configuration Pane.
Message-ID:
Git commit 4b63e3ca3b93a04a9b187db6e4417c475545001d by Jasem Mutlaq, on behalf of Robert Lancaster.
Committed on 24/02/2017 at 09:55.
Pushed by mutlaqja into branch 'master'.
This patch will fix numerous minor OS X issues and will also add some new functionality to OS X with the Astrometry Conf File Editor and to all operating systems with the addition of the Astrometry Index File Configuration Pane.
1. Adds the Astrometry Index File Configuration Pane. For now, it just displays what indexes are installed and makes recommendations based on your CCD. It also gives you a link to the folder so that you can see where to add the index files you need. In the future I would like to make this an interface for downloading index files you need and possibly temporarily disabling ones that are installed but that you don’t need right now.
2. Adds the Astrometry.cfg editor for OS X only. For now, all it does is to load the file into a plain text editor, then allows you to make changes and save them. Later it might be good to change this to make it more user friendly. But this does add a decent amount of additional capability already.
3. Fixes the INDI drivers default directory on OS X. (When not using the Internal Indiserver)
4. Fixes the constellation art problem.
5. Changes the server for the GSC zip file download since the other one was not as reliable and slower.
6. Fixes a bug that could cause problems if you exited the KStars setup wizard without setting the geolocation.
7. Makes the Astrometry options a QT Tool window on OS X.
Jasem: I made a few modifications to this patch in the GUI and also in implementation. No more update button, it will update on show event. I added an introductory paragraph with icons for each index state instead of having tooltip explanation.
I fixed one issue with math since it was not marking some index files that were required. Change FOV display to match what align module is showing. Prevented new pages from apeparing in Windows since they cannot use offline solver.
CCMAIL:kstars-devel at kde.org
M +4 -0 kstars/CMakeLists.txt
M +5 -2 kstars/auxiliary/kswizard.cpp
M +17 -0 kstars/ekos/align/align.cpp
M +4 -0 kstars/ekos/align/align.h
A +88 -0 kstars/ekos/align/opsastrometrycfg.cpp [License: UNKNOWN] *
A +36 -0 kstars/ekos/align/opsastrometrycfg.h [License: UNKNOWN] *
A +65 -0 kstars/ekos/align/opsastrometrycfg.ui
A +181 -0 kstars/ekos/align/opsastrometryindexfiles.cpp [License: UNKNOWN] *
A +39 -0 kstars/ekos/align/opsastrometryindexfiles.h [License: UNKNOWN] *
A +685 -0 kstars/ekos/align/opsastrometryindexfiles.ui
M +1 -1 kstars/indi/opsindi.cpp
M +0 -4 kstars/skycomponents/constellationartcomponent.cpp
The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.
https://commits.kde.org/kstars/4b63e3ca3b93a04a9b187db6e4417c475545001d
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index ad318fb5d..975bf6b19 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -132,6 +132,8 @@ if (INDI_FOUND)
ekos/align/opsekos.ui
ekos/align/opsastrometry.ui
ekos/align/opsalign.ui
+ ekos/align/opsastrometrycfg.ui
+ ekos/align/opsastrometryindexfiles.ui
# Focus
ekos/focus/focus.ui
# Mount
@@ -180,6 +182,8 @@ if (INDI_FOUND)
ekos/align/astrometryparser.cpp
ekos/align/opsastrometry.cpp
ekos/align/opsalign.cpp
+ ekos/align/opsastrometrycfg.cpp
+ ekos/align/opsastrometryindexfiles.cpp
ekos/align/offlineastrometryparser.cpp
ekos/align/onlineastrometryparser.cpp
ekos/align/remoteastrometryparser.cpp
diff --git a/kstars/auxiliary/kswizard.cpp b/kstars/auxiliary/kswizard.cpp
index c8b836f0e..4d3d995dd 100644
--- a/kstars/auxiliary/kswizard.cpp
+++ b/kstars/auxiliary/kswizard.cpp
@@ -31,6 +31,8 @@
#include "geolocation.h"
#include "widgets/dmsbox.h"
+#include "Options.h"
+
namespace {
bool hasPrefix(QString str, QString prefix) {
if( prefix.isEmpty() )
@@ -286,7 +288,8 @@ void KSWizard::slotDownload() {
void KSWizard::slotFinishWizard(){
- if(KStars::Instance())
+ Options::setRunStartupWizard(false);
+ if(KStars::Instance()&&geo())
KStars::Instance()->updateLocationFromWizard(*(geo()));
delete this;
}
@@ -347,7 +350,7 @@ void KSWizard::slotInstallGSC(){
downloadGSC->setWorkingDirectory(location);
connect(downloadGSC, SIGNAL(finished(int)), this, SLOT(slotExtractGSC()));
connect(downloadGSC, SIGNAL(finished(int)), this, SLOT(downloadGSC.deleteLater()));
- downloadGSC->start("curl", QStringList() << "-o" << "gsc.zip" << "http://mactelescope.com/gsc.zip" );
+ downloadGSC->start("curl", QStringList() << "-L" << "-o" << "gsc.zip" << "http://www.indilib.org/jdownloads/Mac/gsc.zip" );
data->GSCFeedback->setText("downloading GSC . . .");
downloadMonitor=new QTimer(this);
diff --git a/kstars/ekos/align/align.cpp b/kstars/ekos/align/align.cpp
index 4732a6fa2..19dabe526 100644
--- a/kstars/ekos/align/align.cpp
+++ b/kstars/ekos/align/align.cpp
@@ -40,6 +40,8 @@
#include "remoteastrometryparser.h"
#include "opsastrometry.h"
#include "opsalign.h"
+#include "opsastrometrycfg.h"
+#include "opsastrometryindexfiles.h"
#include
@@ -148,11 +150,26 @@ Align::Align()
editOptionsB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
KConfigDialog* dialog = new KConfigDialog(this, "alignsettings", Options::self());
+#ifdef Q_OS_OSX
+ dialog->setWindowFlags(Qt::Tool| Qt::WindowStaysOnTopHint);
+#endif
+
opsAlign = new OpsAlign(this);
dialog->addPage(opsAlign, i18n("Astrometry.net"));
opsAstrometry = new OpsAstrometry(this);
dialog->addPage(opsAstrometry, i18n("Solver Options"));
+
+#ifdef Q_OS_OSX
+ opsAstrometryCfg = new OpsAstrometryCfg(this);
+ dialog->addPage(opsAstrometryCfg, i18n("Astrometry.cfg"));
+#endif
+
+ #ifndef Q_OS_WIN
+ opsAstrometryIndexFiles = new OpsAstrometryIndexFiles(this);
+ dialog->addPage(opsAstrometryIndexFiles, i18n("Astrometry Index Files"));
+ #endif
+
connect(editOptionsB, SIGNAL(clicked()), dialog, SLOT(show()));
diff --git a/kstars/ekos/align/align.h b/kstars/ekos/align/align.h
index a94b0bc75..1031fda64 100644
--- a/kstars/ekos/align/align.h
+++ b/kstars/ekos/align/align.h
@@ -37,6 +37,8 @@ class OfflineAstrometryParser;
class RemoteAstrometryParser;
class OpsAstrometry;
class OpsAlign;
+class OpsAstrometryCfg;
+class OpsAstrometryIndexFiles;
/**
*@class Align
@@ -574,6 +576,8 @@ private:
// Astrometry Options
OpsAstrometry *opsAstrometry;
OpsAlign *opsAlign;
+ OpsAstrometryCfg *opsAstrometryCfg;
+ OpsAstrometryIndexFiles *opsAstrometryIndexFiles;
};
}
diff --git a/kstars/ekos/align/opsastrometrycfg.cpp b/kstars/ekos/align/opsastrometrycfg.cpp
new file mode 100644
index 000000000..6a9a9fd05
--- /dev/null
+++ b/kstars/ekos/align/opsastrometrycfg.cpp
@@ -0,0 +1,88 @@
+#include "opsastrometrycfg.h"
+#include "ui_opsastrometrycfg.h"
+#include
+#include "kstars.h"
+#include "align.h"
+#include "Options.h"
+#include
+
+namespace Ekos
+{
+
+OpsAstrometryCfg::OpsAstrometryCfg(Align *parent) : QDialog( KStars::Instance() )
+{
+ setupUi(this);
+
+ alignModule = parent;
+
+ //Get a pointer to the KConfigDialog
+ m_ConfigDialog = KConfigDialog::exists( "alignsettings" );
+
+ connect( m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL( clicked() ), SLOT( slotApply() ) );
+ connect( m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL( clicked() ), SLOT( slotApply() ) );
+ connect( astrometryCFGDisplay, SIGNAL( textChanged() ), SLOT( slotCFGEditorUpdated()));
+
+
+ connect(loadCFG, SIGNAL(clicked()), this, SLOT(slotLoadCFG()));
+
+ slotLoadCFG();
+}
+
+OpsAstrometryCfg::~OpsAstrometryCfg() {}
+
+void OpsAstrometryCfg::slotLoadCFG(){
+ QString confPath;
+
+ if(Options::astrometryConfFileIsInternal())
+ confPath = QCoreApplication::applicationDirPath()+"/astrometry/bin/astrometry.cfg";
+ else
+ confPath = Options::astrometryConfFile();
+
+ QFile confFile(confPath);
+
+ astrometryCFGLocation->setText(confPath);
+
+ if (confFile.open(QIODevice::ReadOnly) == false)
+ {
+ KMessageBox::error(0, i18n("Astrometry configuration file corrupted or missing: %1\nPlease set the configuration file full path in INDI options.", Options::astrometryConfFile()));
+ return;
+ }
+
+ QTextStream in(&confFile);
+
+ currentCFGText = in.readAll();
+
+ astrometryCFGDisplay->setPlainText(currentCFGText);
+
+ confFile.close();
+}
+
+void OpsAstrometryCfg::slotApply(){
+ if(currentCFGText!=astrometryCFGDisplay->toPlainText()){
+ QString confPath;
+
+ if(Options::astrometryConfFileIsInternal())
+ confPath = QCoreApplication::applicationDirPath()+"/astrometry/bin/astrometry.cfg";
+ else
+ confPath = Options::astrometryConfFile();
+
+ QFile confFile(confPath);
+ if (confFile.open(QIODevice::WriteOnly) == false)
+ KMessageBox::error(0, i18n("Internal Astrometry Configuration File Write Error."));
+ else{
+ QTextStream out(&confFile);
+ out << astrometryCFGDisplay->toPlainText();
+ confFile.close();
+ KMessageBox::error(0, i18n("Astrometry.cfg successfully saved!"));
+ currentCFGText=astrometryCFGDisplay->toPlainText();
+ }
+ }
+
+}
+void OpsAstrometryCfg::slotCFGEditorUpdated(){
+ if(currentCFGText!=astrometryCFGDisplay->toPlainText())
+ m_ConfigDialog->button(QDialogButtonBox::Apply)->setEnabled(true);
+}
+
+
+}
diff --git a/kstars/ekos/align/opsastrometrycfg.h b/kstars/ekos/align/opsastrometrycfg.h
new file mode 100644
index 000000000..7e2d82f34
--- /dev/null
+++ b/kstars/ekos/align/opsastrometrycfg.h
@@ -0,0 +1,36 @@
+#ifndef OPSASTROMETRYCFG_H
+#define OPSASTROMETRYCFG_H
+
+#include
+#include "ui_opsastrometrycfg.h"
+
+class KConfigDialog;
+
+namespace Ekos
+{
+
+class Align;
+
+class OpsAstrometryCfg : public QDialog, public Ui::OpsAstrometryCfg
+{
+ Q_OBJECT
+
+public:
+ explicit OpsAstrometryCfg(Align *parent);
+ ~OpsAstrometryCfg();
+
+private slots:
+ void slotLoadCFG();
+ void slotApply();
+ void slotCFGEditorUpdated();
+
+
+private:
+ KConfigDialog *m_ConfigDialog;
+ Align *alignModule;
+ QString currentCFGText;
+};
+
+}
+
+#endif // OPSASTROMETRYCFG_H
diff --git a/kstars/ekos/align/opsastrometrycfg.ui b/kstars/ekos/align/opsastrometrycfg.ui
new file mode 100644
index 000000000..7c7f87b15
--- /dev/null
+++ b/kstars/ekos/align/opsastrometrycfg.ui
@@ -0,0 +1,65 @@
+
+
+ OpsAstrometryCfg
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+ Dialog
+
+
+
+
+
+
+
+ <html><head/><body><p>This is the absolute location of the Astrometry.cfg file on the filesystem.</p></body></html>
+
+
+ Astrometry.cfg Location:
+
+
+
+
+
+
+ false
+
+
+ false
+
+
+ <html><head/><body><p>This is the absolute location of the Astrometry.cfg file on the filesystem.</p></body></html>
+
+
+
+
+
+
+ <html><head/><body><p>This button will let you reload the Astrometry.cfg file in the event that something was changed ouside of KStars.</p></body></html>
+
+
+ ReLoad
+
+
+
+
+
+
+
+
+ <html><head/><body><p>In this space you can edit the Astrometry.cfg file. When you finish, you can hit "Apply" or "Ok" to save your changes. </p></body></html>
+
+
+
+
+
+
+
+
diff --git a/kstars/ekos/align/opsastrometryindexfiles.cpp b/kstars/ekos/align/opsastrometryindexfiles.cpp
new file mode 100644
index 000000000..086ed0de2
--- /dev/null
+++ b/kstars/ekos/align/opsastrometryindexfiles.cpp
@@ -0,0 +1,181 @@
+#include "opsastrometryindexfiles.h"
+#include "ui_opsastrometryindexfiles.h"
+
+#include
+#include "kstars.h"
+#include "align.h"
+#include "Options.h"
+#include
+
+namespace Ekos
+{
+
+OpsAstrometryIndexFiles::OpsAstrometryIndexFiles(Align *parent) : QDialog( KStars::Instance() )
+{
+ setupUi(this);
+
+ alignModule = parent;
+
+ //Get a pointer to the KConfigDialog
+ // m_ConfigDialog = KConfigDialog::exists( "alignsettings" );
+ connect(openIndexFileDirectory, SIGNAL(clicked()), this, SLOT(slotOpenIndexFileDirectory()));
+
+ astrometryIndex[2.8] = "00";
+ astrometryIndex[4.0] = "01";
+ astrometryIndex[5.6] = "02";
+ astrometryIndex[8] = "03";
+ astrometryIndex[11] = "04";
+ astrometryIndex[16] = "05";
+ astrometryIndex[22] = "06";
+ astrometryIndex[30] = "07";
+ astrometryIndex[42] = "08";
+ astrometryIndex[60] = "09";
+ astrometryIndex[85] = "10";
+ astrometryIndex[120] = "11";
+ astrometryIndex[170] = "12";
+ astrometryIndex[240] = "13";
+ astrometryIndex[340] = "14";
+ astrometryIndex[480] = "15";
+ astrometryIndex[680] = "16";
+ astrometryIndex[1000] = "17";
+ astrometryIndex[1400] = "18";
+ astrometryIndex[2000] = "19";
+}
+
+OpsAstrometryIndexFiles::~OpsAstrometryIndexFiles(){}
+
+void OpsAstrometryIndexFiles::showEvent(QShowEvent *)
+{
+ slotUpdate();
+}
+
+void OpsAstrometryIndexFiles::slotUpdate()
+{
+ double fov_w, fov_h, fov_pixscale;
+
+ // Values in arcmins. Scale in arcsec per pixel
+ alignModule->getFOVScale(fov_w, fov_h, fov_pixscale);
+
+ double fov_check = qMax(fov_w, fov_h);
+
+ FOVOut->setText(QString("%1' x %2'").arg(QString::number(fov_w, 'f', 2)).arg(QString::number(fov_h, 'f', 2)));
+
+ QString astrometryDataDir;
+
+ if (getAstrometryDataDir(astrometryDataDir) == false)
+ return;
+
+ indexLocation->setText(astrometryDataDir);
+
+ QStringList nameFilter("*.fits");
+ QDir directory(astrometryDataDir);
+ QStringList indexList = directory.entryList(nameFilter);
+
+ foreach(QString indexName, indexList){
+ indexName=indexName.replace("-","_").left(10);
+ QCheckBox *indexCheckBox = findChild(indexName);
+ if(indexCheckBox)
+ indexCheckBox->setChecked(true);
+ }
+
+ QList checkboxes = findChildren();
+
+ foreach(QCheckBox *checkBox, checkboxes)
+ {
+ checkBox->setIcon(QIcon(":/icons/breeze/default/security-low.svg"));
+ checkBox->setToolTip(i18n("Optional"));
+ checkBox->setEnabled(false); //This is for now, until we get a downloader set up.
+ }
+
+ float last_skymarksize = 2;
+ foreach(float skymarksize, astrometryIndex.keys())
+ {
+ if( (skymarksize >= 0.40 * fov_check && skymarksize <= 0.9 * fov_check)
+ || (fov_check > last_skymarksize && fov_check < skymarksize))
+ {
+ QString indexName1="index_41" + astrometryIndex.value(skymarksize);
+ QString indexName2="index_42" + astrometryIndex.value(skymarksize);
+ QCheckBox *indexCheckBox1 = findChild(indexName1);
+ QCheckBox *indexCheckBox2 = findChild(indexName2);
+ if(indexCheckBox1)
+ {
+ indexCheckBox1->setIcon(QIcon(":/icons/breeze/default/security-high.svg"));
+ indexCheckBox1->setToolTip(i18n("Required"));
+ }
+ if(indexCheckBox2)
+ {
+ indexCheckBox2->setIcon(QIcon(":/icons/breeze/default/security-high.svg"));
+ indexCheckBox2->setToolTip(i18n("Required"));
+ }
+
+ }
+ else if (skymarksize >= 0.10 * fov_check && skymarksize <= fov_check)
+ {
+ QString indexName1="index_41" + astrometryIndex.value(skymarksize);
+ QString indexName2="index_42" + astrometryIndex.value(skymarksize);
+ QCheckBox *indexCheckBox1 = findChild(indexName1);
+ QCheckBox *indexCheckBox2 = findChild(indexName2);
+ if(indexCheckBox1)
+ {
+ indexCheckBox1->setIcon(QIcon(":/icons/breeze/default/security-medium.svg"));
+ indexCheckBox1->setToolTip(i18n("Recommended"));
+ }
+ if(indexCheckBox2)
+ {
+ indexCheckBox2->setIcon(QIcon(":/icons/breeze/default/security-medium.svg"));
+ indexCheckBox2->setToolTip(i18n("Recommended"));
+ }
+ }
+
+ last_skymarksize = skymarksize;
+ }
+
+}
+
+void OpsAstrometryIndexFiles::slotOpenIndexFileDirectory(){
+ QString astrometryDataDir;
+ if (getAstrometryDataDir(astrometryDataDir) == false)
+ return;
+ QUrl path = QUrl::fromLocalFile(astrometryDataDir);
+ QDesktopServices::openUrl(path);
+}
+
+bool OpsAstrometryIndexFiles::getAstrometryDataDir(QString &dataDir)
+{
+ QString confPath;
+
+ if(Options::astrometryConfFileIsInternal())
+ confPath = QCoreApplication::applicationDirPath()+"/astrometry/bin/astrometry.cfg";
+ else
+ confPath = Options::astrometryConfFile();
+
+ QFile confFile(confPath);
+
+ if (confFile.open(QIODevice::ReadOnly) == false)
+ {
+ KMessageBox::error(0, i18n("Astrometry configuration file corrupted or missing: %1\nPlease set the configuration file full path in INDI options.", Options::astrometryConfFile()));
+ return false;
+ }
+
+ QTextStream in(&confFile);
+ QString line;
+ while ( !in.atEnd() )
+ {
+ line = in.readLine();
+ if (line.isEmpty() || line.startsWith("#"))
+ continue;
+
+ line = line.trimmed();
+ if (line.startsWith("add_path"))
+ {
+ dataDir = line.mid(9).trimmed();
+ return true;
+ }
+ }
+
+ KMessageBox::error(0, i18n("Unable to find data dir in astrometry configuration file."));
+ return false;
+}
+
+
+}
diff --git a/kstars/ekos/align/opsastrometryindexfiles.h b/kstars/ekos/align/opsastrometryindexfiles.h
new file mode 100644
index 000000000..53784608d
--- /dev/null
+++ b/kstars/ekos/align/opsastrometryindexfiles.h
@@ -0,0 +1,39 @@
+#ifndef OPSASTROMETRYINDEXFILES_H
+#define OPSASTROMETRYINDEXFILES_H
+
+#include
+#include "ui_opsastrometryindexfiles.h"
+
+
+class KConfigDialog;
+
+namespace Ekos
+{
+
+class Align;
+
+class OpsAstrometryIndexFiles : public QDialog, public Ui::OpsAstrometryIndexFiles
+{
+ Q_OBJECT
+
+public:
+ explicit OpsAstrometryIndexFiles(Align *parent);
+ ~OpsAstrometryIndexFiles();
+
+protected:
+ void showEvent(QShowEvent *);
+
+public slots:
+ void slotUpdate();
+ void slotOpenIndexFileDirectory();
+
+private:
+ KConfigDialog *m_ConfigDialog;
+ Align *alignModule;
+ bool getAstrometryDataDir(QString &dataDir);
+ QMap astrometryIndex;
+};
+
+}
+
+#endif // OPSASTROMETRYINDEXFILES_H
diff --git a/kstars/ekos/align/opsastrometryindexfiles.ui b/kstars/ekos/align/opsastrometryindexfiles.ui
new file mode 100644
index 000000000..b064c0c46
--- /dev/null
+++ b/kstars/ekos/align/opsastrometryindexfiles.ui
@@ -0,0 +1,685 @@
+
+
+ OpsAstrometryIndexFiles
+
+
+
+ 0
+ 0
+ 361
+ 629
+
+
+
+ Dialog
+
+
+
+
+
+ li
+{
+background: url(:/icons/breeze/default/security-high.svg) no-repeat left top;
+}
+
+
+ <html><head/><body><p><span style=" font-weight:600;">Offline</span> astrometry.net solver require index files in order to solve an image. The following list provides a complete list of the index files, along with recommended index files to install given current CCD Field of View. Installed index files are checked. Next to each index file is an icon that represents the following:</p></body></html>
+
+
+ true
+
+
+
+
+
+
+
+
+ false
+
+
+
+ 32
+ 32
+
+
+
+
+ 32
+ 32
+
+
+
+ <html><head/><body><p>This index file is required and must be installed for the solver to work correctly.</p></body></html>
+
+
+
+
+
+ :/icons/breeze/default/security-high.svg
+
+
+ true
+
+
+
+
+
+
+ <html><head/><body><p>This index file is required and must be installed for the solver to work correctly.</p></body></html>
+
+
+ Required
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 13
+ 20
+
+
+
+
+
+
+
+ false
+
+
+
+ 32
+ 32
+
+
+
+
+ 32
+ 32
+
+
+
+ <html><head/><body><p>This index file is recommeneded. Installing the index file might help in improving the solver.</p></body></html>
+
+
+
+
+
+ :/icons/breeze/default/security-medium.svg
+
+
+ true
+
+
+
+
+
+
+ <html><head/><body><p>This index file is recommeneded. Installing the index file might help in improving the solver.</p></body></html>
+
+
+ Recommended
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 13
+ 20
+
+
+
+
+
+
+
+ false
+
+
+
+ 32
+ 32
+
+
+
+
+ 32
+ 32
+
+
+
+ <html><head/><body><p>This index file is not required.</p></body></html>
+
+
+
+
+
+ :/icons/breeze/default/security-low.svg
+
+
+ true
+
+
+
+
+
+
+ <html><head/><body><p>This index file is not required.</p></body></html>
+
+
+ Optional
+
+
+
+
+
+
+
+
+
+
+ <html><head/><body><p>This displays the path to the folder for the Astrometry Index Files on your computer.</p></body></html>
+
+
+ Index Files Location:
+
+
+
+
+
+
+ false
+
+
+ <html><head/><body><p>This displays the path to the folder for the Astrometry Index Files on your computer.</p></body></html>
+
+
+
+
+
+
+ <html><head/><body><p>This button will open the Astrometry Index File folder on your filesystem so that you can see where it is located and copy files into it if needed.</p></body></html>
+
+
+ Open
+
+
+
+
+
+
+ <html><head/><body><p>This displays the current CCD field of view that will be used to calculate which index files are needed.</p></body></html>
+
+
+ Current CCD FOV:
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Index Files
+
+
+
+
+
+ index-4218.fits
+
+
+
+
+
+
+ index-4206-*.fits
+
+
+
+
+
+
+ 8' - 11'
+
+
+
+
+
+
+ 240' - 340'
+
+
+
+
+
+
+ 85' - 120'
+
+
+
+
+
+
+ index-4201-*.fits
+
+
+
+
+
+
+ index-4111.fits
+
+
+
+
+
+
+ 1000' - 1400'
+
+
+
+
+
+
+ index-4208.fits
+
+
+
+
+
+
+ index-4207-*.fits
+
+
+
+
+
+
+ 60' - 85'
+
+
+
+
+
+
+ index-4113.fits
+
+
+
+
+
+
+ index-4213.fits
+
+
+
+
+
+
+ 30' - 42'
+
+
+
+
+
+
+ 120' - 170'
+
+
+
+
+
+
+ 16' - 22'
+
+
+
+
+
+
+ index-4214.fits
+
+
+
+
+
+
+ 5.6' - 8.0'
+
+
+
+
+
+
+ 480' - 680'
+
+
+
+
+
+
+ index-4108.fits
+
+
+
+
+
+
+ index-4205-*.fits
+
+
+
+
+
+
+ index-4212.fits
+
+
+
+
+
+
+ index-4115.fits
+
+
+
+
+
+
+ index-4110.fits
+
+
+
+
+
+
+ index-4217.fits
+
+
+
+
+
+
+ index-4119.fits
+
+
+
+
+
+
+ 340' - 480'
+
+
+
+
+
+
+ index-4204-*.fits
+
+
+
+
+
+
+ 2.8' - 4.0'
+
+
+
+
+
+
+ index-4109.fits
+
+
+
+
+
+
+ Tycho2 Catalog
+
+
+
+
+
+
+ 1400' - 2000'
+
+
+
+
+
+
+ 22' - 30'
+
+
+
+
+
+
+ 42' - 60'
+
+
+
+
+
+
+ index-4210.fits
+
+
+
+
+
+
+ 680' - 1000'
+
+
+
+
+
+
+ index-4107.fits
+
+
+
+
+
+
+ index-4200-*.fits
+
+
+
+
+
+
+ index-4211.fits
+
+
+
+
+
+
+ index-4203-*.fits
+
+
+
+
+
+
+ index-4114.fits
+
+
+
+
+
+
+ index-4215.fits
+
+
+
+
+
+
+ index-4112.fits
+
+
+
+
+
+
+ index-4216.fits
+
+
+
+
+
+
+ SkyMark Diameters
+
+
+
+
+
+
+ index-4209.fits
+
+
+
+
+
+
+ index-4202-*.fits
+
+
+
+
+
+
+ 2.0' - 2.8'
+
+
+
+
+
+
+ index-4116.fits
+
+
+
+
+
+
+ 170' - 240'
+
+
+
+
+
+
+ index-4117.fits
+
+
+
+
+
+
+ index-4219.fits
+
+
+
+
+
+
+ 2Mass Catalog
+
+
+
+
+
+
+ 11' - 16'
+
+
+
+
+
+
+ index-4118.fits
+
+
+
+
+
+
+ 4.0' - 5.6'
+
+
+
+
+
+
+ (Narrow/Medium Fields)
+
+
+
+
+
+
+ (Wide Fields)
+
+
+
+
+
+
+ (arcminutes)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/kstars/indi/opsindi.cpp b/kstars/indi/opsindi.cpp
index 26e9b789c..f01c1436e 100644
--- a/kstars/indi/opsindi.cpp
+++ b/kstars/indi/opsindi.cpp
@@ -95,7 +95,7 @@ void OpsINDI::toggleDriversInternal()
if(kcfg_indiDriversAreInternal->isChecked())
kcfg_indiDriversDir->setText("*Internal INDI Drivers*");
else
- kcfg_indiDriversDir->setText("/usr/local/bin/");
+ kcfg_indiDriversDir->setText("/usr/local/share/indi/");
}
void OpsINDI::saveFITSDirectory()
diff --git a/kstars/skycomponents/constellationartcomponent.cpp b/kstars/skycomponents/constellationartcomponent.cpp
index 93fadc9ed..5635e0b21 100644
--- a/kstars/skycomponents/constellationartcomponent.cpp
+++ b/kstars/skycomponents/constellationartcomponent.cpp
@@ -50,11 +50,7 @@ void ConstellationArtComponent::deleteData()
void ConstellationArtComponent::loadData(){
if(m_ConstList.isEmpty()) {
QSqlDatabase skydb = QSqlDatabase::addDatabase("QSQLITE", "skycultures");
- #ifdef Q_OS_OSX
- QString dbfile = KSPaths::locate(QStandardPaths::GenericDataLocation, "/skycultures/skycultures.sqlite");
- #else
QString dbfile = KSPaths::locate(QStandardPaths::GenericDataLocation, "skycultures.sqlite");
- #endif
skydb.setDatabaseName(dbfile);
if (skydb.open() == false)
From aacid at kde.org Sun Feb 26 00:01:40 2017
From: aacid at kde.org (Albert Astals Cid)
Date: Sun, 26 Feb 2017 00:01:40 -0000
Subject: Review Request 121609: Fix build error
In-Reply-To: <20141220085126.31947.91012@probe.kde.org>
References: <20141220085126.31947.91012@probe.kde.org>
Message-ID: <20170226000140.3284.148@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121609/#review102620
-----------------------------------------------------------
Patch doesn't apply anymore.
Given it hasn't been commited for 2 years i guess the compile trouble was fixed? If noone disagrees i'll discard it in two weeks.
- Albert Astals Cid
On Dec. 20, 2014, 8:51 a.m., Vijay Dhameliya wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121609/
> -----------------------------------------------------------
>
> (Updated Dec. 20, 2014, 8:51 a.m.)
>
>
> Review request for KStars and Jasem Mutlaq.
>
>
> Repository: kstars
>
>
> Description
> -------
>
> Added Parts to CMakeLists.txt to fix error: /usr/bin/ld: cannot find -lKF5::Parts
>
>
> Diffs
> -----
>
> CMakeLists.txt ea65686
>
> Diff: https://git.reviewboard.kde.org/r/121609/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Vijay Dhameliya
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From aacid at kde.org Sun Feb 26 00:42:36 2017
From: aacid at kde.org (Albert Astals Cid)
Date: Sun, 26 Feb 2017 00:42:36 -0000
Subject: Review Request 114631: [GCI] Added labels for the current currsor
position coordinates.
In-Reply-To: <20131223183755.18783.84047@probe.kde.org>
References: <20131223183755.18783.84047@probe.kde.org>
Message-ID: <20170226004236.3284.20319@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114631/#review102636
-----------------------------------------------------------
Patch doesn't apply.
Will discard in two weeks since it seems it was not that useful since it was not commited in 3 years.
- Albert Astals Cid
On Dec. 23, 2013, 6:37 p.m., Mihail Ivchenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/114631/
> -----------------------------------------------------------
>
> (Updated Dec. 23, 2013, 6:37 p.m.)
>
>
> Review request for KStars.
>
>
> Repository: kstars
>
>
> Description
> -------
>
> Added labels for the current currsor position coordinates.
> GCI task: http://www.google-melange.com/gci/task/view/google/gci2013/6422575311749120
>
>
> Diffs
> -----
>
> kstars/kstarsactions.cpp 1ed783e
> kstars/kstarsinit.cpp a4393e6
>
> Diff: https://git.reviewboard.kde.org/r/114631/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Mihail Ivchenko
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From aacid at kde.org Sun Feb 26 00:52:42 2017
From: aacid at kde.org (Albert Astals Cid)
Date: Sun, 26 Feb 2017 00:52:42 -0000
Subject: Review Request 111172: Compiling a regular expression takes the
most amount of time. Hence, we should do that only once.
In-Reply-To: <20130622111911.28524.51981@vidsolbach.de>
References: <20130622111911.28524.51981@vidsolbach.de>
Message-ID: <20170226005242.3284.3877@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/111172/#review102645
-----------------------------------------------------------
Patch doesn't apply
- Albert Astals Cid
On June 22, 2013, 11:19 a.m., Aneesh Dogra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/111172/
> -----------------------------------------------------------
>
> (Updated June 22, 2013, 11:19 a.m.)
>
>
> Review request for KStars and Henry de Valence.
>
>
> Repository: kstars
>
>
> Description
> -------
>
> Summary describes it all.
>
>
> Diffs
> -----
>
> kstars/data/scripts/supernova_updates_parser.py 552e428
>
> Diff: https://git.reviewboard.kde.org/r/111172/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Aneesh Dogra
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From lionaneesh at gmail.com Sun Feb 26 00:53:22 2017
From: lionaneesh at gmail.com (Aneesh Dogra)
Date: Sun, 26 Feb 2017 00:53:22 -0000
Subject: Review Request 110971: Disable "Automatically select coordinate
grid"
when the user manually toggles equatorial or horizontal coordinate grids.
In-Reply-To: <20130613132605.24124.14533@vidsolbach.de>
References: <20130613132605.24124.14533@vidsolbach.de>
Message-ID: <20170226005322.3284.61355@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/110971/
-----------------------------------------------------------
(Updated Feb. 26, 2017, 12:53 a.m.)
Status
------
This change has been marked as submitted.
Review request for KStars.
Bugs: 321027
http://bugs.kde.org/show_bug.cgi?id=321027
Repository: kstars
Description
-------
I think if the user is asking to display the equatorial/horizontal grid we should just disable "Automatically select coordinate grid" and do what he wants. I don't really think disabling the buttons or showing the user a warning of some sort is the correct solution to this issue. Its like saying "Hey user you asked Kstars to automatically set the coordinate grids for you, but now you are yourself fiddling with the settings, that's not good, please go do 1, 2, 3". I am open to discussions, though. Thanks for taking time to review this.
Diffs
-----
kstars/kstarsactions.cpp 1ed783e
Diff: https://git.reviewboard.kde.org/r/110971/diff/
Testing
-------
Thanks,
Aneesh Dogra
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From aacid at kde.org Sun Feb 26 00:54:07 2017
From: aacid at kde.org (Albert Astals Cid)
Date: Sun, 26 Feb 2017 00:54:07 -0000
Subject: Review Request 110987: Add a private method centerOnPlanet in
SkyMap to encapsulate all the common code in [key_0..key_9].
In-Reply-To: <20130613074129.3070.49950@vidsolbach.de>
References: <20130613074129.3070.49950@vidsolbach.de>
Message-ID: <20170226005407.3284.66199@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/110987/#review102646
-----------------------------------------------------------
Doesn't apply anymore
- Albert Astals Cid
On June 13, 2013, 7:41 a.m., Aneesh Dogra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/110987/
> -----------------------------------------------------------
>
> (Updated June 13, 2013, 7:41 a.m.)
>
>
> Review request for KStars.
>
>
> Repository: kstars
>
>
> Description
> -------
>
> Encapsulation patch.
>
>
> Diffs
> -----
>
> kstars/skymap.h dd67cd8
> kstars/skymapevents.cpp 9cfbb8d
>
> Diff: https://git.reviewboard.kde.org/r/110987/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Aneesh Dogra
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mutlaqja at ikarustech.com Sun Feb 26 06:30:48 2017
From: mutlaqja at ikarustech.com (Jasem Mutlaq)
Date: Sun, 26 Feb 2017 06:30:48 -0000
Subject: Review Request 121609: Fix build error
In-Reply-To: <20170226000140.3284.148@mimi.kde.org>
References: <20170226000140.3284.148@mimi.kde.org>
Message-ID: <20170226063048.3284.16455@mimi.kde.org>
> On Feb. 26, 2017, 12:01 a.m., Albert Astals Cid wrote:
> > Patch doesn't apply anymore.
> >
> > Given it hasn't been commited for 2 years i guess the compile trouble was fixed? If noone disagrees i'll discard it in two weeks.
Yes you can go ahead and discard all those you marked recently.
- Jasem
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121609/#review102620
-----------------------------------------------------------
On Dec. 20, 2014, 8:51 a.m., Vijay Dhameliya wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121609/
> -----------------------------------------------------------
>
> (Updated Dec. 20, 2014, 8:51 a.m.)
>
>
> Review request for KStars and Jasem Mutlaq.
>
>
> Repository: kstars
>
>
> Description
> -------
>
> Added Parts to CMakeLists.txt to fix error: /usr/bin/ld: cannot find -lKF5::Parts
>
>
> Diffs
> -----
>
> CMakeLists.txt ea65686
>
> Diff: https://git.reviewboard.kde.org/r/121609/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Vijay Dhameliya
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From vijay.atwork13 at gmail.com Sun Feb 26 11:14:53 2017
From: vijay.atwork13 at gmail.com (Vijay Dhameliya)
Date: Sun, 26 Feb 2017 11:14:53 -0000
Subject: Review Request 121609: Fix build error
In-Reply-To: <20141220085126.31947.91012@probe.kde.org>
References: <20141220085126.31947.91012@probe.kde.org>
Message-ID: <20170226111453.3284.76986@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121609/
-----------------------------------------------------------
(Updated Feb. 26, 2017, 11:14 a.m.)
Status
------
This change has been discarded.
Review request for KStars and Jasem Mutlaq.
Repository: kstars
Description
-------
Added Parts to CMakeLists.txt to fix error: /usr/bin/ld: cannot find -lKF5::Parts
Diffs
-----
CMakeLists.txt ea65686
Diff: https://git.reviewboard.kde.org/r/121609/diff/
Testing
-------
Thanks,
Vijay Dhameliya
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From lionaneesh at gmail.com Sun Feb 26 11:19:01 2017
From: lionaneesh at gmail.com (Aneesh Dogra)
Date: Sun, 26 Feb 2017 11:19:01 -0000
Subject: Review Request 110987: Add a private method centerOnPlanet in
SkyMap to encapsulate all the common code in [key_0..key_9].
In-Reply-To: <20130613074129.3070.49950@vidsolbach.de>
References: <20130613074129.3070.49950@vidsolbach.de>
Message-ID: <20170226111901.3284.36489@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/110987/
-----------------------------------------------------------
(Updated Feb. 26, 2017, 11:19 a.m.)
Status
------
This change has been discarded.
Review request for KStars.
Repository: kstars
Description
-------
Encapsulation patch.
Diffs
-----
kstars/skymap.h dd67cd8
kstars/skymapevents.cpp 9cfbb8d
Diff: https://git.reviewboard.kde.org/r/110987/diff/
Testing
-------
Thanks,
Aneesh Dogra
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From lionaneesh at gmail.com Sun Feb 26 11:19:08 2017
From: lionaneesh at gmail.com (Aneesh Dogra)
Date: Sun, 26 Feb 2017 11:19:08 -0000
Subject: Review Request 111172: Compiling a regular expression takes the
most amount of time. Hence, we should do that only once.
In-Reply-To: <20130622111911.28524.51981@vidsolbach.de>
References: <20130622111911.28524.51981@vidsolbach.de>
Message-ID: <20170226111908.3284.93428@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/111172/
-----------------------------------------------------------
(Updated Feb. 26, 2017, 11:19 a.m.)
Status
------
This change has been discarded.
Review request for KStars and Henry de Valence.
Repository: kstars
Description
-------
Summary describes it all.
Diffs
-----
kstars/data/scripts/supernova_updates_parser.py 552e428
Diff: https://git.reviewboard.kde.org/r/111172/diff/
Testing
-------
Thanks,
Aneesh Dogra
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From ematirov at gmail.com Sun Feb 26 11:19:16 2017
From: ematirov at gmail.com (Mihail Ivchenko)
Date: Sun, 26 Feb 2017 11:19:16 -0000
Subject: Review Request 114631: [GCI] Added labels for the current currsor
position coordinates.
In-Reply-To: <20131223183755.18783.84047@probe.kde.org>
References: <20131223183755.18783.84047@probe.kde.org>
Message-ID: <20170226111916.3284.47975@mimi.kde.org>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114631/
-----------------------------------------------------------
(Updated Feb. 26, 2017, 11:19 a.m.)
Status
------
This change has been discarded.
Review request for KStars.
Repository: kstars
Description
-------
Added labels for the current currsor position coordinates.
GCI task: http://www.google-melange.com/gci/task/view/google/gci2013/6422575311749120
Diffs
-----
kstars/kstarsactions.cpp 1ed783e
kstars/kstarsinit.cpp a4393e6
Diff: https://git.reviewboard.kde.org/r/114631/diff/
Testing
-------
Thanks,
Mihail Ivchenko
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From null at kde.org Mon Feb 27 07:32:20 2017
From: null at kde.org (Jasem Mutlaq)
Date: Mon, 27 Feb 2017 07:32:20 +0000
Subject: [kstars] kstars: Since several people have had problems with the
default directories for indiserver, astrometry, xplanet,
etc on OS X when they build KStars themselves,
I thought I would write some code to fix the problem.
Message-ID:
Git commit 090bc4101b8fa0f7cb9029ac288471fc2cf320d5 by Jasem Mutlaq, on behalf of Robert Lancaster.
Committed on 27/02/2017 at 07:29.
Pushed by mutlaqja into branch 'master'.
Since several people have had problems with the default directories for indiserver, astrometry, xplanet, etc on OS X when they build KStars themselves, I thought I would write some code to fix the problem.
Note that the problem has only been experienced by people who build kstars themselves and either don’t have all the internal content in their app or they delete their kstarsrc file without deleting their data directory.
In both of these situations they end up with a problem because the defaults in options are for Linux and are not correct on OS X. If the user doesn’t run the code that copies the data directory or the user doesn’t toggle the internal checkboxes in the options,
then the Linux defaults are written to the kstarsrc file instead of the defaults for OS X.
So I worked this evening to try to come up with a way that the default paths that do not rely on the internal structure of the app, but instead use the default locations of the external packages on OS X could be written to the user’s kstarsrc file by default.
Note that this change will not affect the majority of users who will probably be installing kstars from the dmg and won’t have a data directory yet, so they will still get everything set to internal which will work just fine for them.
This change should mainly just affect people building kstars themselves from source. Of course, for those people, they will still need to install all of these items to their proper locations.
CCMAIL:kstars-devel at kde.org
M +63 -0 kstars/auxiliary/ksutils.cpp
M +2 -0 kstars/auxiliary/ksutils.h
M +3 -3 kstars/ekos/align/opsalign.cpp
M +2 -6 kstars/indi/opsindi.cpp
M +7 -5 kstars/kstars.kcfg
M +1 -1 kstars/xplanet/opsxplanet.cpp
https://commits.kde.org/kstars/090bc4101b8fa0f7cb9029ac288471fc2cf320d5
diff --git a/kstars/auxiliary/ksutils.cpp b/kstars/auxiliary/ksutils.cpp
index a347808a3..b9c7cdbdc 100644
--- a/kstars/auxiliary/ksutils.cpp
+++ b/kstars/auxiliary/ksutils.cpp
@@ -631,6 +631,63 @@ QString constGenetiveToAbbrev( const QString &genetive_ ) {
void Logging::Disabled(QtMsgType, const QMessageLogContext &, const QString &)
{
}
+ /**
+ This method provides a centralized location for the default paths to important external files used in the Options
+ on different operating systems. Note that on OS X, if the user builds the app without indi, astrometry, and xplanet internally
+ then the options below will be used. If the user drags the app from a dmg and has to install the KStars data directory,
+ then most of these paths will be overwritten since it is preferrred to use the internal versions.
+ **/
+
+ QString getDefaultPath(QString option)
+ {
+ if(option=="indiServer")
+ {
+ #ifdef Q_OS_OSX
+ return "/usr/local/bin/indiserver";
+ #endif
+ return "/usr/bin/indiserver";
+ }
+ else if (option=="indiDriversDir")
+ {
+ #ifdef Q_OS_OSX
+ return "/usr/local/share/indi";
+ #elif defined(Q_OS_LINUX)
+ return "/usr/share/indi";
+ #else
+ return QStandardPaths::locate(QStandardPaths::GenericDataLocation, "indi", QStandardPaths::LocateDirectory);
+ #endif
+ }
+ else if(option=="AstrometrySolverBinary")
+ {
+ #ifdef Q_OS_OSX
+ return "/usr/local/bin/solve-field";
+ #endif
+ return "/usr/bin/solve-field";
+ }
+ else if(option=="AstrometryWCSInfo")
+ {
+ #ifdef Q_OS_OSX
+ return "/usr/local/bin/wcsinfo";
+ #endif
+ return "/usr/bin/wcsinfo";
+ }
+ else if(option=="AstrometryConfFile")
+ {
+ #ifdef Q_OS_OSX
+ return "/usr/local/etc/astrometry.cfg";
+ #endif
+ return "/etc/astrometry.cfg";
+ }
+ else if(option=="XplanetPath")
+ {
+ #ifdef Q_OS_OSX
+ return "/usr/local/bin/xplanet";
+ #endif
+ return "/usr/bin/xplanet";
+ }
+
+ return QString();
+ }
#ifdef Q_OS_OSX
bool copyDataFolderFromAppBundleIfNeeded() //The method returns true if the data directory is good to go.
@@ -647,12 +704,18 @@ bool copyDataFolderFromAppBundleIfNeeded() //The method returns true if the dat
//This sets some important OS X options.
Options::setIndiServerIsInternal(true);
+ Options::setIndiServer("*Internal INDI Server*");
Options::setIndiDriversAreInternal(true);
+ Options::setIndiDriversDir("*Internal INDI Drivers*");
Options::setAstrometrySolverIsInternal(true);
+ Options::setAstrometrySolverBinary("*Internal Solver*");
Options::setAstrometryConfFileIsInternal(true);
+ Options::setAstrometryConfFile("*Internal astrometry.cfg*");
Options::setAstrometryWCSIsInternal(true);
+ Options::setAstrometryWCSInfo("*Internal wcsinfo*");
Options::setAstrometryUseNoFITS2FITS(false);
Options::setXplanetIsInternal(true);
+ Options::setXplanetPath("*Internal XPlanet*");
Options::setRunStartupWizard( false ); //don't run on startup because we are doing it now.
diff --git a/kstars/auxiliary/ksutils.h b/kstars/auxiliary/ksutils.h
index fdfe78747..9b3c845e7 100644
--- a/kstars/auxiliary/ksutils.h
+++ b/kstars/auxiliary/ksutils.h
@@ -224,6 +224,8 @@ namespace KSUtils {
};
+ QString getDefaultPath(QString option);
+
#ifdef Q_OS_OSX
bool copyDataFolderFromAppBundleIfNeeded();//The boolean returns true if the data folders are good to go.
void configureDefaultAstrometry();
diff --git a/kstars/ekos/align/opsalign.cpp b/kstars/ekos/align/opsalign.cpp
index dbb77ce51..7bf725234 100644
--- a/kstars/ekos/align/opsalign.cpp
+++ b/kstars/ekos/align/opsalign.cpp
@@ -67,7 +67,7 @@ void OpsAlign::toggleSolverInternal()
if(kcfg_AstrometrySolverIsInternal->isChecked())
kcfg_AstrometrySolverBinary->setText("*Internal Solver*");
else
- kcfg_AstrometrySolverBinary->setText("/usr/local/bin/solve-field");
+ kcfg_AstrometrySolverBinary->setText(KSUtils::getDefaultPath("AstrometrySolverBinary"));
}
void OpsAlign::toggleConfigInternal()
@@ -76,7 +76,7 @@ void OpsAlign::toggleConfigInternal()
if(kcfg_AstrometryConfFileIsInternal->isChecked())
kcfg_AstrometryConfFile->setText("*Internal astrometry.cfg*");
else
- kcfg_AstrometryConfFile->setText("/etc/astrometry.cfg");
+ kcfg_AstrometryConfFile->setText(KSUtils::getDefaultPath("AstrometryConfFile"));
}
void OpsAlign::toggleWCSInternal()
@@ -85,7 +85,7 @@ void OpsAlign::toggleWCSInternal()
if(kcfg_AstrometryWCSIsInternal->isChecked())
kcfg_AstrometryWCSInfo->setText("*Internal wcsinfo*");
else
- kcfg_AstrometryWCSInfo->setText("/usr/local/bin/wcsinfo");
+ kcfg_AstrometryWCSInfo->setText(KSUtils::getDefaultPath("AstrometryWCSInfo"));
}
void OpsAlign::slotApply()
diff --git a/kstars/indi/opsindi.cpp b/kstars/indi/opsindi.cpp
index f01c1436e..73207534c 100644
--- a/kstars/indi/opsindi.cpp
+++ b/kstars/indi/opsindi.cpp
@@ -82,11 +82,7 @@ void OpsINDI::toggleINDIInternal()
if(kcfg_indiServerIsInternal->isChecked())
kcfg_indiServer->setText("*Internal INDI Server*");
else
- #ifdef Q_OS_OSX
- kcfg_indiServer->setText("/usr/local/bin/indiserver");
- #else
- kcfg_indiServer->setText("/usr/bin/indiserver");
- #endif
+ kcfg_indiServer->setText(KSUtils::getDefaultPath("indiServer"));
}
void OpsINDI::toggleDriversInternal()
@@ -95,7 +91,7 @@ void OpsINDI::toggleDriversInternal()
if(kcfg_indiDriversAreInternal->isChecked())
kcfg_indiDriversDir->setText("*Internal INDI Drivers*");
else
- kcfg_indiDriversDir->setText("/usr/local/share/indi/");
+ kcfg_indiDriversDir->setText(KSUtils::getDefaultPath("indiDriversDir"));
}
void OpsINDI::saveFITSDirectory()
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index a76f5e96c..911b6fece 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -2,6 +2,7 @@
+ ksutils.h
@@ -182,7 +183,7 @@
PATH to indiserver binary
- /usr/bin/indiserver
+ KSUtils::getDefaultPath("indiServer")
@@ -191,6 +192,7 @@
PATH to indi drivers directory
+ KSUtils::getDefaultPath("indiDriversDir")
@@ -978,7 +980,7 @@
Xplanet binary path
-
+ KSUtils::getDefaultPath("XplanetPath")
@@ -1637,7 +1639,7 @@
Path to astrometry.net solver location.
- /usr/bin/solve-field
+ KSUtils::getDefaultPath("AstrometrySolverBinary")
@@ -1646,7 +1648,7 @@
Path to astrometry.net wcsinfo location.
- /usr/bin/wcsinfo
+ KSUtils::getDefaultPath("AstrometryWCSInfo")
@@ -1655,7 +1657,7 @@
Path to astrometry.net file location.
- /etc/astrometry.cfg
+ KSUtils::getDefaultPath("AstrometryConfFile")
diff --git a/kstars/xplanet/opsxplanet.cpp b/kstars/xplanet/opsxplanet.cpp
index e56262627..2e7dc3a4c 100644
--- a/kstars/xplanet/opsxplanet.cpp
+++ b/kstars/xplanet/opsxplanet.cpp
@@ -108,7 +108,7 @@ void OpsXplanet::toggleXPlanetInternal()
if(kcfg_xplanetIsInternal->isChecked())
kcfg_XplanetPath->setText("*Internal XPlanet*");
else
- kcfg_XplanetPath->setText("/usr/local/bin/xplanet");
+ kcfg_XplanetPath->setText(KSUtils::getDefaultPath("XplanetPath"));
}
void OpsXplanet::slotUpdateWidgets( bool on ) {
From mutlaqja at ikarustech.com Tue Feb 28 10:50:00 2017
From: mutlaqja at ikarustech.com (Jasem Mutlaq)
Date: Tue, 28 Feb 2017 13:50:00 +0300
Subject: KStars 2.7.5 is released for MacOS and Windows
Message-ID:
Folks,
I'm quite excited that we finally have a MacOS release so today I've
released KStars 2.7.5 for Windows and OSX (KStars for Ubuntu is built
almost daily).
Find details in my blog here:
http://knro.blogspot.com/2017/02/kstars-275-is-released-for-macos-and.html
--
Best Regards,
Jasem Mutlaq
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From afedoskin3 at gmail.com Mon Feb 13 15:33:47 2017
From: afedoskin3 at gmail.com (Artem Fedoskin)
Date: Mon, 13 Feb 2017 15:33:47 -0000
Subject: Rotation of projection plane
Message-ID:
Dear contributors and users of KStars,
At the moment I am working on "Automatic mode" for KStars Lite (that is, a
mode in which Sky Map is controlled by accelerometer and magnetometer of
your smartphone). I built Java backend for getting data from sensors data
but I have the following problem:
Imagine you a pointing to the Moon (a center of your screen is pointing to
the Moon). If you will rotate the screen of you phone around the Moon
without rotating the whole Sky Map the image will stay same. The goal is to
rotate the Sky Map so that your smartphone still points to the Moon but all
other parts of Sky Map will change according to rotation (imagine of your
smartphone as a window to the sky or simply check Google Skymap in Play
Store).
Right now I am getting the following when I rotate SkyMapLite according to
roll data from sensors. As you can see, current projection system is not
rotated therefore objects that should be drawn are hidden and ground
polygon isn't drawn correctly ( I guess in case of ground I will simply
disable its rectangle form and draw the whole thing in Automatic mode).
http://imgur.com/a/QCFxc
[image: Inline image 1]
What I have already tried is the following - http://math.stackexchange
.com/questions/270194/how-to-find-the-vertices-angle-after-rotation I am
calculating new coordinates according to formulas in Projector::
checkVisibility( SkyPoint *p ) but it doesn't work. Any ideas how should I
calculate new points?
You can check "Automatic mode" by building KStars Lite using the following
script https://github.com/knro/build_kstarslite/.
My another small question is - should we set slewing to false in "Automatic
mode"? With slewing set to "on" it will be just like controlling Sky Map
with touch screen and won't be that spectacular as a lot of objects are
hidden. But on the other hand it will make automatic mode much smoother on
low-end devices.
Regards, Artem
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kstars_lite_rotation.png
Type: image/png
Size: 78949 bytes
Desc: not available
URL: