1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
#ifndef STELLARBATCHSOLVER_H
#define STELLARBATCHSOLVER_H
//Qt includes
#include <QMainWindow>
#include <QApplication>
#include <QDir>
//includes from this project
#include "structuredefinitions.h"
#include "ssolverutils/fileio.h"
#include "stellarsolver.h"
#include "wcsdata.h"
namespace Ui {
class StellarBatchSolver;
}
// This is a struct with the estimated Image Scales
typedef struct ImageScale
{
double scale_low;
double scale_high;
ScaleUnits scale_units;
} ImageScale;
typedef struct Image
{
QString fileName;
FITSImage::Statistic stats;
bool hasSolved = false;
FITSImage::Solution solution;
bool hasExtracted = false;
bool hasHFRData = false;
QList<FITSImage::Star> stars;
QList<fileio::Record> m_HeaderRecords;
QImage rawImage;
bool hasWCSData = false;
WCSData wcsData;
uint8_t *m_ImageBuffer { nullptr };
FITSImage::wcs_point *searchPosition { nullptr };
ImageScale *searchScale{ nullptr };
}Image;
class StellarBatchSolver : public QMainWindow
{
Q_OBJECT
public:
explicit StellarBatchSolver();
public slots:
void addImages();
void loadImage(int num);
void removeSelectedImage();
void removeImage(int index);
void removeAllImages();
void resetImages();
void addIndexDirectory();
void selectOutputDirectory();
void logOutput(QString text);
void displayImage();
void clearLog();
void startProcessing();
void abortProcessing();
void clearCurrentImageBuffer();
void processImage(int num);
void solveImage();
void solverComplete();
void extractImage();
void extractorComplete();
void finishProcessing();
void saveImage();
void saveStarList();
void processNextImage();
private:
Ui::StellarBatchSolver *ui;
StellarSolver stellarSolver;
QList<Image> images;
int currentRow = -1;
QStringList indexFileDirectories = StellarSolver::getDefaultIndexFolderPaths();
QString outputDirectory;
QString dirPath = QDir::homePath();
bool aborted = false;
Image *currentImage = nullptr;
int currentImageNum = -1;
int currentProgress = 0;
bool solvingBlind = false;
signals:
};
#endif // STELLARBATCHSOLVER_H
|