void BioXASSSRLMonochromatorEnergyCalibrationView::setMono(BioXASSSRLMonochromator *newMono)
{
	if (mono_ != newMono) {

		if (mono_ && mono_->energyControl()) {
			disconnect( mono_->energyControl(), 0, this, 0 );
		}

		mono_ = newMono;

		if (mono_ && mono_->energyControl()) {
			connect( mono_->energyControl(), SIGNAL(movingChanged(bool)), this, SLOT(updateCalibrateButton()) );
			connect( mono_->energyControl(), SIGNAL(calibrationStarted()), this, SLOT(onCalibrationStarted()) );
			connect( mono_->energyControl(), SIGNAL(calibrationFailed(int)), this, SLOT(onCalibrationFailed()) );
			connect( mono_->energyControl(), SIGNAL(calibrationSucceeded()), this, SLOT(onCalibrationSucceeded()) );
		}

		update();

		emit monoChanged(mono_);
	}
Пример #2
0
void BioXASPersistentView::setMono(BioXASSSRLMonochromator *newMono)
{
	if (mono_ != newMono) {

		if (mono_) {
			energyEditor_->setControl(0);
			regionEditor_->setControl(0);
			braggEditor_->setControl(0);
		}

		mono_ = newMono;

		if (mono_) {
			energyEditor_->setControl(mono_->energyControl());
			regionEditor_->setControl(mono_->regionControl());
			braggEditor_->setControl(mono_->braggMotor());
		}

		emit monoChanged(mono_);
	}
}
void BioXASSSRLMonochromatorConfigurationView::setMono(BioXASSSRLMonochromator *newMono)
{
	if (mono_ != newMono) {

		if (mono_)
			disconnect( mono_, 0, this, 0 );

		mono_ = newMono;

		if (mono_) {
			connect( mono_, SIGNAL(verticalChanged(CLSMAXvMotor*)), this, SLOT(updateHeightEditor()) );
			connect( mono_, SIGNAL(lateralChanged(CLSMAXvMotor*)), this, SLOT(updateLateralEditor()) );
			connect( mono_, SIGNAL(paddleChanged(BioXASMAXvMotor*)), this, SLOT(updatePaddleEditor()) );
			connect( mono_, SIGNAL(regionChanged(AMControl*)), this, SLOT(updateRegionEditor()) );
			connect( mono_, SIGNAL(regionChanged(AMControl*)), this, SLOT(updateRegionStatusView()) );
		}

		refresh();

		emit monoChanged(mono_);
	}
}
void BioXASSSRLMonochromatorEnergyView::setMono(BioXASSSRLMonochromator *newControl)
{
    if (mono_ != newControl) {

        if (mono_)
            disconnect( mono_, 0, this, 0 );

        mono_ = newControl;

        if (mono_) {
            connect( mono_, SIGNAL(stepEnergyChanged(BioXASSSRLMonochromatorEnergyControl*)), this, SLOT(updateStepEnergyEditor()) );
            connect( mono_, SIGNAL(encoderEnergyChanged(BioXASSSRLMonochromatorEnergyControl*)), this, SLOT(updateEncoderEnergyEditor()) );
            connect( mono_, SIGNAL(stepBraggChanged(BioXASMAXvMotor*)), this, SLOT(updateStepBraggEditor()) );
            connect( mono_, SIGNAL(encoderBraggChanged(BioXASMAXvMotor*)), this, SLOT(updateEncoderBraggEditor()) );
            connect( mono_, SIGNAL(m1MirrorPitchControlChanged(AMControl*)), this, SLOT(updateMirrorPitchEditor()) );
            connect( mono_, SIGNAL(braggChanged(BioXASMAXvMotor*)), this, SLOT(updateBraggConfigurationView()) );
        }

        refresh();

        emit monoChanged(mono_);
    }
}
void BioXASSSRLMonochromatorConfigurationView::setMono(BioXASSSRLMonochromator *newMono)
{
	if (mono_ != newMono) {

		if (mono_) {

			// Clear UI elements.

			upperSlitEditor_->setControl(0);
			lowerSlitEditor_->setControl(0);
			heightEditor_->setControl(0);
			lateralEditor_->setControl(0);
			paddleEditor_->setControl(0);
			crystal1PitchEditor_->setControl(0);
			crystal1RollEditor_->setControl(0);
			crystal2PitchEditor_->setControl(0);
			crystal2RollEditor_->setControl(0);

			regionEditor_->setControl(0);
			regionStatusWidget_->setRegionControl(0);

			stepEnergyEditor_->setControl(0);
			encoderEnergyEditor_->setControl(0);
			stepBraggEditor_->setControl(0);
			encoderBraggEditor_->setControl(0);
			m1PitchEditor_->setControl(0);

			braggConfigWidget_->setBraggMotor(0);
		}

		mono_ = newMono;

		if (mono_) {

			// Update UI elements.

			upperSlitEditor_->setControl(mono_->upperSlitControl());
			lowerSlitEditor_->setControl(mono_->lowerSlitControl());
			heightEditor_->setControl(mono_->verticalMotor());
			lateralEditor_->setControl(mono_->lateralMotor());
			paddleEditor_->setControl(mono_->paddleControl());
			crystal1PitchEditor_->setControl(mono_->crystal1PitchMotor());
			crystal1RollEditor_->setControl(mono_->crystal1RollMotor());
			crystal2PitchEditor_->setControl(mono_->crystal2PitchMotor());
			crystal2RollEditor_->setControl(mono_->crystal2RollMotor());

			regionEditor_->setControl(mono_->regionControl());
			regionStatusWidget_->setRegionControl(mono_->regionControl());

			stepEnergyEditor_->setControl(mono_->stepEnergyControl());
			encoderEnergyEditor_->setControl(mono_->encoderEnergyControl());
			stepBraggEditor_->setControl(mono_->stepBraggControl());
			encoderBraggEditor_->setControl(mono_->encoderBraggControl());
			m1PitchEditor_->setControl(mono_->m1MirrorPitchControl());

			braggConfigWidget_->setBraggMotor(mono_->braggMotor());
		}

		emit monoChanged(mono_);
	}
}