#include "CUDATemporalAveragingFilterWidget.h"

CUDATemporalAveragingFilterWidget::CUDATemporalAveragingFilterWidget(QWidget *parent) :
	QWidget(parent)
{
	setupUi(this);

	connect(this->m_RangeDataFramesSlider, SIGNAL(valueChanged(int)), this, SLOT(RangeDataSliderValueChanged(int)));
	connect(this->m_RGBDataFramesSlider, SIGNAL(valueChanged(int)), this, SLOT(RGBDataSliderValueChanged(int)));

	m_RangeDataFramesSlider->setMinimum(1);
	m_RangeDataFramesSlider->setMaximum(1000);

	m_RGBDataFramesSlider->setMinimum(1);
	m_RGBDataFramesSlider->setMaximum(1000);

	connect(this->m_RangeCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(RangeDataCheckBoxChanged(bool)));
	connect(this->m_RGBCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(RGBDataCheckBoxChanged(bool)));
	
	this->m_RangeCheckBox->setChecked(true);
	this->m_RGBCheckBox->setChecked(false);
}


CUDATemporalAveragingFilterWidget::~CUDATemporalAveragingFilterWidget()
{
}


//----------------------------------------------------------------------------
void
CUDATemporalAveragingFilterWidget::RangeDataSliderValueChanged(int value)
{		
	m_NumRangeDataFramesLabel->setText(QString::number(value));
	emit NumRangeDataFramesChanged((unsigned int)value);
}


//----------------------------------------------------------------------------
void
CUDATemporalAveragingFilterWidget::RGBDataSliderValueChanged(int value)
{		
	m_NumRGBDataFramesLabel->setText(QString::number(value));
	emit NumRGBDataFramesChanged((unsigned int)value);
}


//----------------------------------------------------------------------------
void
CUDATemporalAveragingFilterWidget::ChangeRangeDataSliderValue(int Value)
{
	m_RangeDataFramesSlider->setValue(Value);
	m_NumRangeDataFramesLabel->setText(QString::number(Value));
}

//----------------------------------------------------------------------------
void
CUDATemporalAveragingFilterWidget::ChangeRGBDataSliderValue(int Value)
{
	m_RGBDataFramesSlider->setValue(Value);
	m_NumRGBDataFramesLabel->setText(QString::number(Value));
}

