Add actions for peak and star find
This commit is contained in:
+32
-4
@@ -62,12 +62,30 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),
|
||||
selectMenu->addAction(tr("Unmark and next"), this, SLOT(unmarkAndNext()), Qt::Key_X);
|
||||
menuBar()->addMenu(selectMenu);
|
||||
|
||||
QMenu *statsMenu = new QMenu(tr("Statistic"), this);
|
||||
QAction *statsAction = new QAction(tr("Image statistics"), this);
|
||||
QMenu *analyzeMenu = new QMenu(tr("Analyze"), this);
|
||||
QActionGroup *analyzeGroup = new QActionGroup(this);
|
||||
connect(analyzeGroup, &QActionGroup::triggered, [](QAction* action) {
|
||||
static QAction* lastAction = nullptr;
|
||||
if(action == lastAction)
|
||||
{
|
||||
action->setChecked(false);
|
||||
lastAction = nullptr;
|
||||
}
|
||||
else
|
||||
lastAction = action;
|
||||
});
|
||||
|
||||
QAction *statsAction = analyzeGroup->addAction(tr("Image statistics"));
|
||||
QAction *peakAction = analyzeGroup->addAction(tr("Peak finder"));
|
||||
QAction *starAction = analyzeGroup->addAction("Star finder");
|
||||
statsAction->setCheckable(true);
|
||||
peakAction->setCheckable(true);
|
||||
starAction->setCheckable(true);
|
||||
connect(statsAction, SIGNAL(toggled(bool)), this, SLOT(imageStats(bool)));
|
||||
statsMenu->addAction(statsAction);
|
||||
menuBar()->addMenu(statsMenu);
|
||||
connect(peakAction, SIGNAL(toggled(bool)), this, SLOT(peakFinder(bool)));
|
||||
connect(starAction, SIGNAL(toggled(bool)), this, SLOT(starFinder(bool)));
|
||||
analyzeMenu->addActions({statsAction, peakAction, starAction});
|
||||
menuBar()->addMenu(analyzeMenu);
|
||||
|
||||
m_database = new Database(this);
|
||||
if(!m_database->init())
|
||||
@@ -252,6 +270,16 @@ void MainWindow::imageStats(bool imageStats)
|
||||
m_ringList->setCalculateStats(imageStats);
|
||||
}
|
||||
|
||||
void MainWindow::peakFinder(bool findPeaks)
|
||||
{
|
||||
m_ringList->setFindPeaks(findPeaks);
|
||||
}
|
||||
|
||||
void MainWindow::starFinder(bool findStars)
|
||||
{
|
||||
m_ringList->setFindStars(findStars);
|
||||
}
|
||||
|
||||
void MainWindow::updateWindowTitle()
|
||||
{
|
||||
ImagePtr ptr = m_ringList->currentImage();
|
||||
|
||||
Reference in New Issue
Block a user