Commit 05fe66e9 authored by Doug Summers's avatar Doug Summers

Add alt to autofocus log lines (kstars log and autofocus log) in support of...

Add alt to autofocus log lines (kstars log and autofocus log) in support of temperature and elevation focus compensation analysis
parent e1740131
......@@ -2655,7 +2655,7 @@ void Focus::appendFocusLogText(const QString &lines)
if (m_FocusLogEnabled)
{
QTextStream header(&m_FocusLogFile);
header << "date, time, position, temperature, filter, HFR\n";
header << "date, time, position, temperature, filter, HFR, altitude\n";
header.flush();
}
else
......@@ -2992,14 +2992,15 @@ void Focus::setAutoFocusResult(bool status)
// this will help with setting up focus offsets and temperature compensation
qCInfo(KSTARS_EKOS_FOCUS) << "Autofocus values: position, " << currentPosition << ", temperature, "
<< lastFocusTemperature << ", filter, " << filter()
<< ", HFR, " << currentHFR;
<< ", HFR, " << currentHFR << ", altitude, " << mountAlt;
appendFocusLogText(QString("%1, %2, %3, %4\n")
appendFocusLogText(QString("%1, %2, %3, %4, %5\n")
.arg(QString::number(currentPosition))
.arg(QString::number(lastFocusTemperature, 'f', 1))
.arg(filter())
.arg(QString::number(currentHFR, 'f', 3)));
.arg(QString::number(currentHFR, 'f', 3))
.arg(QString::number(mountAlt, 'f', 1)));
}
// In case of failure, go back to last position if the focuser is absolute
......@@ -3244,6 +3245,16 @@ void Focus::setMountStatus(ISD::Telescope::Status newState)
}
}
void Focus::mountCoords(__attribute__ ((unused)) const QString &ra,
__attribute__ ((unused)) const QString &dec,
__attribute__ ((unused)) const QString &az,
const QString &alt,
__attribute__ ((unused)) int pierSide,
__attribute__ ((unused)) const QString &ha)
{
mountAlt = dms(alt, true).Degrees();
}
void Focus::removeDevice(ISD::GDInterface *deviceRemoved)
{
// Check in Focusers
......
......@@ -12,6 +12,7 @@
#include "ui_focus.h"
#include "ekos/ekos.h"
#include "ekos/auxiliary/filtermanager.h"
#include "ekos/mount/mount.h"
#include "fitsviewer/fitsviewer.h"
#include "indi/indiccd.h"
#include "indi/indifocuser.h"
......@@ -332,6 +333,10 @@ class Focus : public QWidget, public Ui::Focus
// Update Mount module status
void setMountStatus(ISD::Telescope::Status newState);
// Update Altitude From Mount
void mountCoords(const QString &ra, const QString &dec, const QString &az,
const QString &alt, int pierSide, const QString &ha);
/**
* @brief toggleVideo Turn on and off video streaming if supported by the camera.
* @param enabled Set to true to start video streaming, false to stop it if active.
......@@ -681,5 +686,8 @@ class Focus : public QWidget, public Ui::Focus
double observatoryTemperature { INVALID_VALUE };
double lastFocusTemperature { INVALID_VALUE };
TemperatureSource lastFocusTemperatureSource { NO_TEMPERATURE };
// Mount altitude value for logging
double mountAlt { INVALID_VALUE };
};
}
......@@ -3449,6 +3449,8 @@ void Manager::connectModules()
{
connect(mountProcess.get(), &Ekos::Mount::newStatus, focusProcess.get(), &Ekos::Focus::setMountStatus,
Qt::UniqueConnection);
connect(mountProcess.get(), &Ekos::Mount::newCoords, focusProcess.get(), &Ekos::Focus::mountCoords,
Qt::UniqueConnection);
}
// Focus <---> Observatory connections
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment