Example #1
0
void VESPERSMotorView::setControl(AMControl *control)
{
	// Disconnect everything first before starting over.
	hideAndDisconnect();

	control_ = control;
	type_ = Full;
	lowLimit_ = 0;
	highLimit_ = 0;
	if (QString::compare(control_->units(), "") == 0){

		units_->setText("mm");
		jogUnits_->setText("mm");
	}
	else{

		units_->setText(control_->units());
		jogUnits_->setText(control_->units());
	}
	title_->setText(control_->name());
	setpoint_->setText(QString::number(control_->value(), 'f', 3));
	jog_->setText(QString::number(0, 'f', 3));

	connect(stop_, SIGNAL(clicked()), control_, SLOT(stop()));
	connect(control_, SIGNAL(connected(bool)), this, SLOT(setEnabled(bool)));
	connect(control_, SIGNAL(unitsChanged(QString)), units_, SLOT(setText(QString)));
	connect(control_, SIGNAL(unitsChanged(QString)), jogUnits_, SLOT(setText(QString)));
	connect(control_, SIGNAL(setpointChanged(double)), this, SLOT(updateSetpoint(double)));
	connect(((AMPVwStatusControl *)control_)->movingPV(), SIGNAL(valueChanged(int)), this, SLOT(updateStatus(int)));

	connect(setpoint_, SIGNAL(returnPressed()), this, SLOT(move()));
	connect(jogLeft_, SIGNAL(clicked()), this, SLOT(jogLeft()));
	connect(jogRight_, SIGNAL(clicked()), this, SLOT(jogRight()));

	delete this->layout();

	QGridLayout *layout = new QGridLayout;
	layout->addWidget(title_, 0, 0, 1, 6);
	layout->addWidget(stop_, 1, 0);
	layout->addWidget(status_, 1, 1, 1, 5, Qt::AlignCenter);
	layout->addWidget(setpointLabel_, 2, 0, Qt::AlignRight);
	layout->addWidget(setpoint_, 2, 1, 1, 5);
	layout->addWidget(units_, 2, 5);
	layout->addWidget(jogLabel_, 3, 0, Qt::AlignRight);
	layout->addWidget(jogLeft_, 3, 1);
	layout->addWidget(jog_, 3, 2, 1, 3);
	layout->addWidget(jogUnits_, 3, 4);
	layout->addWidget(jogRight_, 3, 5);

	setpoint_->show();
	setpointLabel_->show();
	jogLabel_->show();
	jogLeft_->show();
	jog_->show();
	jogRight_->show();
	units_->show();
	jogUnits_->show();

	setLayout(layout);
}
Example #2
0
void VESPERSMotorView::hideAndDisconnect()
{
	// If no control has been set yet, then don't touch connections that don't exist.
	if (control_){

		disconnect(stop_, SIGNAL(clicked()), control_, SLOT(stop()));
		disconnect(control_, SIGNAL(connected(bool)), this, SLOT(setEnabled(bool)));
		disconnect(control_, SIGNAL(unitsChanged(QString)), units_, SLOT(setText(QString)));
		disconnect(control_, SIGNAL(unitsChanged(QString)), jogUnits_, SLOT(setText(QString)));
		disconnect(control_, SIGNAL(setpointChanged(double)), this, SLOT(updateSetpoint(double)));
		disconnect(((AMPVwStatusControl *)control_)->movingPV(), SIGNAL(valueChanged(int)), this, SLOT(updateStatus(int)));

		if (type_ == Full){

			disconnect(setpoint_, SIGNAL(returnPressed()), this, SLOT(move()));
			disconnect(jogLeft_, SIGNAL(clicked()), this, SLOT(jogLeft()));
			disconnect(jogRight_, SIGNAL(clicked()), this, SLOT(jogRight()));
			setpoint_->hide();
			setpointLabel_->hide();
			jogLabel_->hide();
			jog_->hide();
			jogLeft_->hide();
			jogRight_->hide();
			units_->hide();
			jogUnits_->hide();
		}
		else if (type_ == Simple){

			disconnect(firstSetpointButton_, SIGNAL(clicked()), this, SLOT(moveToFirstSetpoint()));
			disconnect(secondSetpointButton_, SIGNAL(clicked()), this, SLOT(moveToSecondSetpoint()));
			firstSetpointButton_->hide();
			secondSetpointButton_->hide();
		}
	}
}
Example #3
0
/*!
    Associates the QGeoMapData instance \a mapData with this map object.

    This will create an appropriate QGeoMapObjectInfo instance for
    this QGeoMapObject and will connect the appropriate signals to it
    so that it can be kept up to date.
    \since 1.1
*/
void QGeoMapObject::setMapData(QGeoMapData *mapData)
{
    if (d_ptr->mapData == mapData)
        return;

    if (d_ptr->info) {
        delete d_ptr->info;
        d_ptr->info = 0;
    }

    d_ptr->mapData = mapData;
    if (!d_ptr->mapData)
        return;

    d_ptr->info = mapData->createMapObjectInfo(this);

    if (!d_ptr->info)
        return;

    connect(d_ptr->mapData,
            SIGNAL(windowSizeChanged(QSizeF)),
            d_ptr->info,
            SLOT(windowSizeChanged(QSizeF)));
    connect(d_ptr->mapData,
            SIGNAL(zoomLevelChanged(qreal)),
            d_ptr->info,
            SLOT(zoomLevelChanged(qreal)));
    connect(d_ptr->mapData,
            SIGNAL(centerChanged(QGeoCoordinate)),
            d_ptr->info,
            SLOT(centerChanged(QGeoCoordinate)));

    connect(this,
            SIGNAL(zValueChanged(int)),
            d_ptr->info,
            SLOT(zValueChanged(int)));
    connect(this,
            SIGNAL(visibleChanged(bool)),
            d_ptr->info,
            SLOT(visibleChanged(bool)));
    connect(this,
            SIGNAL(selectedChanged(bool)),
            d_ptr->info,
            SLOT(selectedChanged(bool)));
    connect(this,
            SIGNAL(originChanged(QGeoCoordinate)),
            d_ptr->info,
            SLOT(originChanged(QGeoCoordinate)));
    connect(this,
            SIGNAL(transformTypeChanged(QGeoMapObject::TransformType)),
            d_ptr->info,
            SLOT(transformTypeChanged(QGeoMapObject::TransformType)));
    connect(this,
            SIGNAL(unitsChanged(QGeoMapObject::CoordinateUnit)),
            d_ptr->info,
            SLOT(unitsChanged(QGeoMapObject::CoordinateUnit)));

    d_ptr->info->init();
}
Example #4
0
void MangoDownloader::setUnits(const QString &units)
{
    if (m_units == units)
        return;
    m_units = units;
    emit unitsChanged();
}
Example #5
0
AMMotorGroupAxis::AMMotorGroupAxis(AMMotorGroupMotion* translationalMotion,
								   AMMotorGroupMotion* rotationalMotion,
								   QObject* parent)
	: QObject(parent)
{

	translationalMotion_ = translationalMotion;
	rotationalMotion_ = rotationalMotion;

	if(translationalMotion_) {
		translationalMotion_->setParent(this);
	}

	if(translationalMotion_ && translationalMotion_->motor()) {

		connect(translationalMotion_->motor(), SIGNAL(connected(bool)),
				this, SLOT(onTranslationConnectedStateChanged(bool)));

		connect(translationalMotion_->motor(), SIGNAL(error(int)),
				this, SLOT(onTranslationMotorError(int)));

		connect(translationalMotion_->motor(), SIGNAL(movingChanged(bool)),
				this, SLOT(onTranslationMovingStateChanged(bool)));

		connect(translationalMotion_->motor(), SIGNAL(unitsChanged(QString)),
				this, SLOT(onTranslationPositionUnitsChanged(QString)));

		connect(translationalMotion_->motor(), SIGNAL(valueChanged(double)),
				this, SLOT(onTranslationPositionValueChanged(double)));
	}
void QQmlNetwork::setUnits(const QString &units)
{
    if (m_units == units)
        return;
    m_units = units;
    emit unitsChanged();
}
Example #7
0
CLSIonChamber::CLSIonChamber(const QString &name, const QString &description, const QString &countsPV, const QString &voltagePV, const QString &sensitivityName, const QString &sensitivityUnits, QObject *parent)
	: AMIonChamber(name, description, parent)
{
	connected_ = false;

	counts_ = new AMReadOnlyPVControl(name+" counts", countsPV, this);
	voltage_ = new AMReadOnlyPVControl(name+" voltage", voltagePV, this);
	sensitivity_ = new CLSSR570(sensitivityName, sensitivityUnits, this);

	connect(counts_, SIGNAL(valueChanged(double)), this, SIGNAL(countsChanged()));
	connect(counts_, SIGNAL(valueChanged(double)), this, SIGNAL(countsChanged(double)));

	connect(voltage_, SIGNAL(valueChanged(double)), this, SIGNAL(voltageChanged()));
	connect(voltage_, SIGNAL(valueChanged(double)), this, SIGNAL(voltageChanged(double)));

	connect(counts_, SIGNAL(valueChanged(double)), this, SIGNAL(readingsChanged()));
	connect(voltage_, SIGNAL(valueChanged(double)), this, SIGNAL(readingsChanged()));

	connect(sensitivity_, SIGNAL(sensitivityChanged()), this, SIGNAL(sensitivityChanged()));
	connect(sensitivity_, SIGNAL(valueChanged(int)), this, SIGNAL(sensitivityValueChanged(int)));
	connect(sensitivity_, SIGNAL(valueIndexChanged(int)), this, SIGNAL(sensitivityValueIndexChanged(int)));
	connect(sensitivity_, SIGNAL(unitsChanged(QString)), this, SIGNAL(sensitivityUnitsChanged(QString)));
	connect(sensitivity_, SIGNAL(minimumSensitivity(bool)), this, SIGNAL(minimumSensitivity(bool)));
	connect(sensitivity_, SIGNAL(maximumSensitivity(bool)), this, SIGNAL(maximumSensitivity(bool)));

	connect(counts_, SIGNAL(connected(bool)), this, SLOT(onConnectedChanged()));
	connect(voltage_, SIGNAL(connected(bool)), this, SLOT(onConnectedChanged()));
	connect(sensitivity_, SIGNAL(connected(bool)), this, SLOT(onConnectedChanged()));
}
void QPolygonOffset::setUnits(float units)
{
    Q_D(QPolygonOffset);
    if (d->m_units != units) {
        d->m_units = units;
        emit unitsChanged(d->m_units);
    }
}
Example #9
0
void CLSValueEditor::setUnits(const QString &newUnits)
{
	if (units_ != newUnits) {
		units_ = newUnits;
		updateValueLabel();

		emit unitsChanged(units_);
	}
}
void AMExtendedControlEditor::setControl(AMControl *newControl)
{
	if (control_ != newControl) {

		if (control_) {

			// Disconnect from control.

			disconnect( control_, 0, this, 0 );
			disconnect( dialog_, 0, control_, 0 );

			control_ = 0;

			// Clear the frame title.

			if (!titleSetManually_)
				setTitleText("");
		}

		control_ = newControl;

		if (control_) {

			// Set the frame title.

			if (!titleSetManually_) {
				if (control_->description().isEmpty())
					setTitleText(control_->name());
				else
					setTitleText(control_->description());
			}

			// Set control values
			precision_ = control_->displayPrecision();
			maxValue_ = control_->maximumValue();
			minValue_ = control_->minimumValue();

			// Make connections.
			connect(control_, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged(double)));
			connect(control_, SIGNAL(unitsChanged(QString)), this, SLOT(onUnitsChanged(QString)));
			connect(control_, SIGNAL(connected(bool)), this, SLOT(onConnectedChanged()) );
			connect(control_, SIGNAL(movingChanged(bool)), this, SLOT(onMotion(bool)));
			connect(control_, SIGNAL(enumChanged()), this, SLOT(onControlEnumChanged()));
			connect(control_, SIGNAL(moveStarted()), this, SLOT(onControlMoveStarted()));

			if(!configureOnly_)
				connect(dialog_, SIGNAL(doubleValueSelected(double)), control_, SLOT(move(double)));
			else
				connect(dialog_, SIGNAL(doubleValueSelected(double)), this, SLOT(onNewSetpoint(double)));
		}

		onConnectedChanged();

		emit controlChanged(control_);
	}
}
Example #11
0
void VESPERSMotorView::setControl(AMControl *control, double firstSetpoint, double secondSetpoint, QString firstLabel, QString secondLabel)
{
	// Disconnect everything first before starting over.
	hideAndDisconnect();

	control_ = control;
	type_ = Simple;
	lowLimit_ = 0;
	highLimit_ = 0;
	units_->setText(control_->units());
	title_->setText(control_->name());
	firstSetpointButton_->setText(firstLabel);
	secondSetpointButton_->setText(secondLabel);
	firstSetpoint_ = firstSetpoint;
	secondSetpoint_ = secondSetpoint;

	connect(stop_, SIGNAL(clicked()), control_, SLOT(stop()));
	connect(control_, SIGNAL(connected(bool)), this, SLOT(setEnabled(bool)));
	connect(control_, SIGNAL(unitsChanged(QString)), units_, SLOT(setText(QString)));
	connect(control_, SIGNAL(unitsChanged(QString)), jogUnits_, SLOT(setText(QString)));
	connect(control_, SIGNAL(setpointChanged(double)), this, SLOT(updateSetpoint(double)));
	connect(((AMPVwStatusControl *)control_)->movingPV(), SIGNAL(valueChanged(int)), this, SLOT(updateStatus(int)));

	connect(firstSetpointButton_, SIGNAL(clicked()), this, SLOT(moveToFirstSetpoint()));
	connect(secondSetpointButton_, SIGNAL(clicked()), this, SLOT(moveToSecondSetpoint()));

//	this->layout()->deleteLater();
	delete this->layout();

	QGridLayout *layout = new QGridLayout;
	layout->addWidget(title_, 0, 0, 1, 4);
	layout->addWidget(stop_, 1, 0);
	layout->addWidget(status_, 1, 1, 1, 3, Qt::AlignCenter);
	layout->addWidget(firstSetpointButton_, 2, 0, 1, 2, Qt::AlignCenter);
	layout->addWidget(secondSetpointButton_, 2, 2, 1, 2, Qt::AlignCenter);

	firstSetpointButton_->show();
	secondSetpointButton_->show();

	setLayout(layout);
}
Example #12
0
void STVariable::setUnits(const QString &units)
{
    if (units_ != units) {
        units_ = units;

        if (units_ != "")
            hasUnits_ = true;
        else
            hasUnits_ = false;

        emit unitsChanged(units_);
    }
}
Example #13
0
/*!
    Sets the coordinate units of the object to \a unit.

    Note that setting this property will reset the transformType property to
    the default for the units given. For PixelUnit, this is ExactTransform,
    and for all others, BilinearTransform.
    \since 1.2
*/
void QGeoMapObject::setUnits(const CoordinateUnit &unit)
{
    if (unit == d_ptr->units)
        return;

    d_ptr->units = unit;

    if (unit == QGeoMapObject::PixelUnit)
        setTransformType(QGeoMapObject::ExactTransform);
    else
        setTransformType(QGeoMapObject::BilinearTransform);

    emit unitsChanged(unit);
}