Compare commits

...

2 Commits

Author SHA1 Message Date
nou 7c4118b0b6 Fix bug in script solver 2025-04-10 00:34:14 +02:00
nou 8178efdafd Reload image when header is updated 2025-04-09 14:58:23 +02:00
8 changed files with 19 additions and 2 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 -1
View File
@@ -241,7 +241,7 @@ void ScriptEngine::setStartingSolution(const QJSValue &solution)
if(solution.isObject()) if(solution.isObject())
{ {
if(solution.hasProperty("ra") && solution.hasProperty("dec") && solution.property("ra").isNumber() && solution.property("dec").isNumber()) if(solution.hasProperty("ra") && solution.hasProperty("dec") && solution.property("ra").isNumber() && solution.property("dec").isNumber())
_solver->setSearchPosition(solution.property("ra").toNumber(), solution.property("dec").toNumber()); _solver->setSearchPosition(solution.property("ra").toNumber() / 15.0, solution.property("dec").toNumber());
if(solution.hasProperty("pixscale") && solution.property("pixscale").isNumber()) if(solution.hasProperty("pixscale") && solution.property("pixscale").isNumber())
{ {
+2 -1
View File
@@ -41,7 +41,7 @@ bool Solver::loadImage(const QString &path)
_loaded = false; _loaded = false;
std::shared_ptr<RawImage> image; std::shared_ptr<RawImage> image;
ImageInfoData info; ImageInfoData info;
if(::loadImage(path, info, image, true)) if(::loadImage(path, info, image, 0, true))
{ {
return loadImage(image, path); return loadImage(image, path);
} }
@@ -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);
}; };