Commit c0b3764d authored by Jasem Mutlaq's avatar Jasem Mutlaq

Add button to toggle star detection display

parent eb3dc4d2
......@@ -1151,6 +1151,7 @@ void FITSView::toggleEQGrid()
if(image_frame)
updateFrame();
}
void FITSView::toggleObjects()
{
showObjects=!showObjects;
......@@ -1159,6 +1160,13 @@ void FITSView::toggleObjects()
}
void FITSView::toggleStars()
{
toggleStars(!markStars);
if(image_frame)
updateFrame();
}
void FITSView::togglePixelGrid()
{
showPixelGrid=!showPixelGrid;
......@@ -1442,6 +1450,9 @@ void FITSView::createFloatingToolBar()
action = floatingToolBar->addAction(QIcon::fromTheme("kstars_grid", QIcon(":/icons/breeze/default/kstars_grid.svg")), i18n("Show Equatorial Gridlines"), this, SLOT(toggleEQGrid()));
action->setCheckable(true);
action = floatingToolBar->addAction(QIcon::fromTheme("kstars_stars", QIcon(":/icons/breeze/default/kstars_stars.svg")), i18n("Detect Stars in Image"), this, SLOT(toggleStars()));
action->setCheckable(true);
action = floatingToolBar->addAction(QIcon::fromTheme("help-hint", QIcon(":/icons/breeze/default/help-hint.svg")), i18n("Show Objects in Image"), this, SLOT(toggleObjects()));
action->setCheckable(true);
......@@ -1522,3 +1533,19 @@ bool FITSView::isTelescopeActive()
return false;
#endif
}
void FITSView::setStarsEnabled(bool enable)
{
markStars = enable;
if (floatingToolBar)
{
foreach(QAction *action, floatingToolBar->actions())
{
if (action->text() == i18n("Detect Stars in Image"))
{
action->setChecked(markStars);
break;
}
}
}
}
......@@ -140,10 +140,7 @@ class FITSView : public QScrollArea
// Star Detection
int findStars(StarAlgorithm algorithm = ALGORITHM_CENTROID);
void toggleStars(bool enable);
void setStarsEnabled(bool enable)
{
markStars = enable;
}
void setStarsEnabled(bool enable);
// FITS Mode
void updateMode(FITSMode mode);
......@@ -195,6 +192,9 @@ protected:
void togglePixelGrid();
void toggleCrosshair();
// Stars
void toggleStars();
void centerTelescope();
void processPointSelection(int x, int y);
......@@ -235,11 +235,11 @@ protected:
double maxPixel, minPixel;
bool firstLoad;
bool markStars;
bool markStars=false;
bool showCrosshair=false;
bool showObjects=false;
bool showEQGrid=false;
bool showPixelGrid=false;
bool showPixelGrid=false;
bool starsSearched=false;
QPointF getPointForGridLabel();
......
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