diff options
author | Alexander V. Wolf <alex.v.wolf@gmail.com> | 2022-01-26 04:21:21 +0700 |
---|---|---|
committer | Alexander V. Wolf <alex.v.wolf@gmail.com> | 2022-01-26 04:21:21 +0700 |
commit | bc3862ed1f3f1b3e9b0718f8e239a76e1b24012f (patch) | |
tree | 859168bb92389d1a3de05bb8d0a66d8f4c70bfd5 | |
parent | 2d0c197274faeb7b164e380fe7bca8c684f0af5f (diff) |
a tiny cosmetic fixes
-rw-r--r-- | src/gui/AstroCalcDialog.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/gui/AstroCalcDialog.cpp b/src/gui/AstroCalcDialog.cpp index aa3b29833b..f99c75c4fb 100644 --- a/src/gui/AstroCalcDialog.cpp +++ b/src/gui/AstroCalcDialog.cpp @@ -2396,12 +2396,11 @@ void AstroCalcDialog::generateLunarEclipses() visibilityConditionsStr = q_("Good visibility conditions for current location"); else visibilityConditionsStr = q_("Bad visibility conditions for current location"); - if (uMag < 1.0 && pMag < 0.7) - { - // Our rule of thumb is that a partial penumbral eclipse is detectable with - // the unaided eye if penumbral magnitude>0.7 - visibilityConditionsStr = q_("Not observable eclipse"); - } + + // Our rule of thumb is that a partial penumbral eclipse is detectable with + // the unaided eye if penumbral magnitude>0.7 + if (uMag < 1.0 && pMag < 0.7) visibilityConditionsStr = q_("Not observable eclipse"); + if (!sign) { elevationStr = dash; @@ -2414,8 +2413,7 @@ void AstroCalcDialog::generateLunarEclipses() // Saros numbers calculated here are matching well with NASA's Five Millennium Catalog of Lunar Eclipses // ln = Brown Lunation number : = 1 at the first New Moon of 1923 - double q = (JDmid-2423436.40347)/29.530588-0.25; - q = round(q); + double q = round((JDmid-2423436.40347)/29.530588-0.25); int ln = int(q) + 1 - 953; int nd = ln + 105; int s = 148 + 38 * nd; @@ -2433,15 +2431,10 @@ void AstroCalcDialog::generateLunarEclipses() sarosStr = QString("%1").arg(QString::number(saros)); gammaStr = QString("%1").arg(QString::number(gamma, 'f', 3)); pMagStr = QString("%1").arg(QString::number(pMag, 'f', 3)); - if (uMag<0.) - { uMagStr = dash; - } else - { uMagStr = QString("%1").arg(QString::number(uMag, 'f', 3)); - } ACLunarEclipseTreeWidgetItem* treeItem = new ACLunarEclipseTreeWidgetItem(ui->lunareclipseTreeWidget); treeItem->setText(LunarEclipseDate, QString("%1 %2").arg(localeMgr->getPrintableDateLocal(JDmid), localeMgr->getPrintableTimeLocal(JDmid))); // local date and time |