#include "FindSourcesDialog.qo.h"
#include <QDir>
#include <QDebug>
#include <QTime>
#include <QMessageBox>
#include <QFileSystemModel>
#include <imageanalysis/Regions/CasacRegionManager.h>
#include <imageanalysis/ImageAnalysis/ImageSourceFinder.h>
#include <tables/Tables.h>
#include <casa/Quanta/MVAngle.h>
#include <display/Display/Options.h>
#include <display/Fit/RegionBox.h>
#include <display/Fit/ColorComboDelegate.h>
#include <imageanalysis/ImageAnalysis/ImageStatsCalculator.h>
#include <limits>
using namespace casacore;
namespace casa {
const QStringList FindSourcesDialog::colorNames = QStringList()<<"yellow"<<"white"<<"red"<<
"green"<<"blue"<<"cyan"<<"magenta"<<"black";
FindSourcesDialog::FindSourcesDialog(QWidget *parent,
bool displayModeFunctionality)
: QDialog(parent), DEFAULT_KEY(-1),
SKY_CATALOG("skycatalog"), pixelRangeDialog(this) {
ui.setupUi(this);
currentRegionId = DEFAULT_KEY;
overlayColorName = "white";
pixelRangeDialog.setLineMode( true );
pixelRangeDialog.setTitle( "Intensity Minimum");
imageMode = true;
ui.imageRadioButton->setVisible( displayModeFunctionality );
ui.regionRadioButton->setVisible( displayModeFunctionality );
ui.colorLabel->setVisible( displayModeFunctionality );
ui.colorCombo->setVisible( displayModeFunctionality );
connect( ui.displayViewerCheckBox, SIGNAL(stateChanged(int)), this, SLOT(viewerDisplayChanged()));
if ( displayModeFunctionality ) {
QButtonGroup* buttonGroup = new QButtonGroup( this );
buttonGroup->addButton( ui.imageRadioButton );
buttonGroup->addButton( ui.regionRadioButton );
ui.imageRadioButton->setChecked( imageMode );
connect( ui.imageRadioButton, SIGNAL(toggled(bool)),this, SLOT(setImageMode(bool)));
colorDelegate = new ColorComboDelegate( this );
ui.colorCombo->setItemDelegate( colorDelegate );
colorDelegate->setSupportedColors( FindSourcesDialog::colorNames );
for ( int i = 0; i < colorNames.size(); i++ ) {
ui.colorCombo->addItem(colorNames[i]);
}
connect( ui.colorCombo, SIGNAL(currentIndexChanged(const QString&)),
this, SLOT(setOverlayColor(const QString&)));
setOverlayColor( colorNames[0] );
}
QTime time = QTime::currentTime();
qsrand((uInt)time.msec());