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