Reload image when header is updated

This commit is contained in:
2025-04-09 14:58:23 +02:00
parent 90026f931f
commit 8178efdafd
7 changed files with 17 additions and 0 deletions
+10
View File
@@ -294,6 +294,16 @@ void ImageRingList::setMarked()
setFilesPrivate(files); setFilesPrivate(files);
} }
void ImageRingList::reloadImage()
{
if(*m_currImage)
{
int index = (*m_currImage)->info().index;
(*m_currImage)->release();
(*m_currImage)->load(index, m_loadPool);
}
}
void ImageRingList::setLiveMode(bool live) void ImageRingList::setLiveMode(bool live)
{ {
m_liveMode = live; m_liveMode = live;
+1
View File
@@ -109,6 +109,7 @@ public slots:
void prevSubImage(); void prevSubImage();
void nextSubImage(); void nextSubImage();
void setMarked(); void setMarked();
void reloadImage();
protected: protected:
void setFilesPrivate(const QStringList files, const QString &currentFile = QString()); void setFilesPrivate(const QStringList files, const QString &currentFile = QString());
QList<ImagePtr>::iterator increment(QList<ImagePtr>::iterator iter); QList<ImagePtr>::iterator increment(QList<ImagePtr>::iterator iter);
+1
View File
@@ -166,6 +166,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
connect(m_ringList, &ImageRingList::pixmapLoaded, histogram, &Histogram::imageLoaded); connect(m_ringList, &ImageRingList::pixmapLoaded, histogram, &Histogram::imageLoaded);
#ifdef PLATESOLVER #ifdef PLATESOLVER
connect(m_ringList, &ImageRingList::pixmapLoaded, _plateSolving, &PlateSolving::imageLoaded); connect(m_ringList, &ImageRingList::pixmapLoaded, _plateSolving, &PlateSolving::imageLoaded);
connect(_plateSolving, &PlateSolving::headerUpdated, m_ringList, &ImageRingList::reloadImage);
#endif #endif
connect(m_image, &ImageScrollArea::fileDropped, this, static_cast<void (MainWindow::*)(const QString &)>(&MainWindow::loadFile)); connect(m_image, &ImageScrollArea::fileDropped, this, static_cast<void (MainWindow::*)(const QString &)>(&MainWindow::loadFile));
+1
View File
@@ -44,6 +44,7 @@ PlateSolving::PlateSolving(QWidget *parent)
connect(_solver, &Solver::solvingDone, this, &PlateSolving::solvingDone); connect(_solver, &Solver::solvingDone, this, &PlateSolving::solvingDone);
connect(_solver, &Solver::extractionDone, this, &PlateSolving::extractionDone); connect(_solver, &Solver::extractionDone, this, &PlateSolving::extractionDone);
connect(_solver, &Solver::logOutput, [this](const QString &log){ _ui->log->appendPlainText(log); }); connect(_solver, &Solver::logOutput, [this](const QString &log){ _ui->log->appendPlainText(log); });
connect(_solver, &Solver::headerUpdated, this, &PlateSolving::headerUpdated);
} }
PlateSolving::~PlateSolving() PlateSolving::~PlateSolving()
+2
View File
@@ -32,6 +32,8 @@ public slots:
void updateHeader(); void updateHeader();
void imageLoaded(Image *image); void imageLoaded(Image *image);
void settings(); void settings();
signals:
void headerUpdated(const QString &path);
private: private:
Ui::PlateSolving *_ui; Ui::PlateSolving *_ui;
}; };
+1
View File
@@ -188,6 +188,7 @@ bool Solver::updateHeader(QString &error)
modify.updateKeyword("EQUINOX", 2000, QByteArray("Equinox of coordinates")); modify.updateKeyword("EQUINOX", 2000, QByteArray("Equinox of coordinates"));
bool ret = file.modifyFITSRecords(&modify); bool ret = file.modifyFITSRecords(&modify);
if(!ret)error = tr("Failed to update file header"); if(!ret)error = tr("Failed to update file header");
else emit headerUpdated(_path);
return ret; return ret;
} }
+1
View File
@@ -46,6 +46,7 @@ public slots:
signals: signals:
void solvingDone(); void solvingDone();
void extractionDone(); void extractionDone();
void headerUpdated(const QString &path);
void logOutput(const QString &log); void logOutput(const QString &log);
}; };