Ejemplo n.º 1
0
    void setMin(double min)
    {
        if (m_min == min)
            return;

        m_min = min;
        emit minChanged(min);
    }
void NonlinearPropertyUncertainty::setMin(double min)
{
    if (fabs(m_min - min) > DBL_EPSILON) {
        m_min = min;
        emit minChanged(m_min);
        emit wasModified();
    }
}
Ejemplo n.º 3
0
void ProcessModel::setMin(double arg)
{
    if (m_min == arg)
        return;

    m_min = arg;
    emit minChanged(arg);
    emit m_curve->changed();
}
Ejemplo n.º 4
0
/* Keep? */
VisionDialog::VisionDialog(QWidget *parent)
	: QDialog(parent)
	, ui(new Ui::VisionDialog)
	, m_configModel(new VisionConfigModel(this))
	, m_channelModel(new VisionChannelModel(this))
	, m_device(new Camera::Device(new Camera::UsbInputProvider))
{
	ui->setupUi(this);
	
	ui->configsList->setModel(m_configModel);
	ui->configsList->setRootIndex(m_configModel->index(m_configModel->rootPath()));
	ui->configsList->setItemDelegate(new ConfigItemDelegate(this));
	
	ui->channelsList->setModel(m_channelModel);
	ui->channelsList->setItemDelegate(new ChannelItemDelegate(m_channelModel, this));
	
	connect(&m_cameraTimer, SIGNAL(timeout()), SLOT(updateCamera()));
	m_cameraTimer.start(100);
	
  /* Need this? */
	Config startConfig;
	startConfig.beginGroup(CAMERA_GROUP);
	startConfig.setValue(CAMERA_NUM_CHANNELS_KEY, 1);
	startConfig.beginGroup((QString(CAMERA_CHANNEL_GROUP_PREFIX) + "0").toStdString());
	startConfig.setValue(CAMERA_CHANNEL_TYPE_KEY, CAMERA_CHANNEL_TYPE_HSV_KEY);
	startConfig.clearGroup();
	m_device->setConfig(startConfig);
	
	connect(ui->_th, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->_ts, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->_tv, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->_bh, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->_bs, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->_bv, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	
	connect(ui->visual, SIGNAL(minChanged(QColor)), SLOT(visualChanged()));
	connect(ui->visual, SIGNAL(maxChanged(QColor)), SLOT(visualChanged()));
	
	connect(ui->cv, SIGNAL(pressed(int, int)), SLOT(imagePressed(int, int)));
	
	connect(ui->channelsList->selectionModel(),
		SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
		SLOT(currentChannelChanged(const QModelIndex &, const QModelIndex &)));
	
	connect(ui->configsList->selectionModel(),
		SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
		SLOT(currentConfigChanged(const QModelIndex &, const QModelIndex &)));
		
	m_defaultConfigPath = m_configModel->filePath(m_configModel->defaultConfiguration());
}
Ejemplo n.º 5
0
void DoubleSlider::updateCurrentMin(double currentMin)
{
	if (currentMin >= _valueMin)
		_currentMin = currentMin;
		
	if (_currentMin > _currentMax)
	{
		this->updateCurrentMax(currentMin+1);
		emit maxChanged(_currentMax);
	}
	emit minChanged(_currentMin);
	this->updateMinPos();
	if(_minLabel)
		_minLabel->setText(QString::number(qRound(currentMin)));
	//updateLabels();
}
Ejemplo n.º 6
0
void DoubleSlider::updateCurrentMax(double currentMax)
{
	if (currentMax <= _valueMax)
		_currentMax = currentMax;
		
	if (_currentMax < _currentMin)
	{
		this->updateCurrentMin(currentMax-1);
		emit minChanged(_currentMin);
	}
	emit maxChanged(_currentMax);
		
	this->updateMaxPos();
	if(_maxLabel)
		_maxLabel->setText(QString::number(qRound(currentMax)));
	//updateLabels();
}
Ejemplo n.º 7
0
HsvChannelConfigWidget::HsvChannelConfigWidget(const QModelIndex &index, QWidget *parent)
	: ChannelConfigWidget(index, parent),
	ui(new Ui::HsvChannelConfigWidget),
	m_numpad(new NumpadDialog("Enter Value"))
{
	ui->setupUi(this);
	
	Config deviceConfig;
	deviceConfig.beginGroup(CAMERA_GROUP);
	deviceConfig.setValue(CAMERA_NUM_CHANNELS_KEY, 1);
	deviceConfig.beginGroup((QString(CAMERA_CHANNEL_GROUP_PREFIX) + "0").toStdString());
	deviceConfig.setValue(CAMERA_CHANNEL_TYPE_KEY, CAMERA_CHANNEL_TYPE_HSV_KEY);
	deviceConfig.clearGroup();
	ui->camera->setConfig(&deviceConfig);
	
	visual();
	
	connect(ui->manualButton, SIGNAL(clicked()), SLOT(manual()));
	connect(ui->visualButton, SIGNAL(clicked()), SLOT(visual()));
	
	connect(ui->th, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->ts, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->tv, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->bh, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->bs, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	connect(ui->bv, SIGNAL(textChanged(QString)), SLOT(manualEntry(QString)));
	
	connect(ui->visual, SIGNAL(minChanged(QColor)), SLOT(visualChanged()));
	connect(ui->visual, SIGNAL(maxChanged(QColor)), SLOT(visualChanged()));
	
	connect(ui->camera, SIGNAL(pressed(cv::Mat, int, int)), SLOT(imagePressed(cv::Mat, int, int)));
	
	connect(ui->done, SIGNAL(clicked()), SLOT(done()));
	
	ui->th->setInputProvider(m_numpad);
	ui->ts->setInputProvider(m_numpad);
	ui->tv->setInputProvider(m_numpad);
	ui->bh->setInputProvider(m_numpad);
	ui->bs->setInputProvider(m_numpad);
	ui->bv->setInputProvider(m_numpad);
  
  ui->camera->setTrackBlobs(true);
}