void VESPERS2DScanConfigurationView::onCCDDetectorChanged(int id) { config_->setCCDDetector(id); if (config_->ccdDetector() != VESPERS::NoCCD){ QString path; QString name = config_->ccdFileName().isEmpty() ? scanName_->text() : config_->ccdFileName(); if (config_->ccdDetector() == VESPERS::Roper) path = VESPERSBeamline::vespers()->roperCCD()->ccdFilePath(); else if (config_->ccdDetector() == VESPERS::Mar) path = VESPERSBeamline::vespers()->marCCD()->ccdFilePath(); else if (config_->ccdDetector() == VESPERS::Pilatus) path = VESPERSBeamline::vespers()->pilatusCCD()->ccdFilePath(); config_->setCCDFileName(name); ccdText_->setText(QString("Path: %1\nName: %2").arg(path).arg(name)); checkCCDFileNames(name); } ccdTextBox_->setVisible(config_->ccdDetector() != VESPERS::NoCCD); configureCCDButton_->setDisabled(config_->ccdDetector() == VESPERS::NoCCD); }
void VESPERS2DScanConfigurationView::onCCDDetectorChanged(int id) { configuration_->setCCDDetector(ccdComboBox_->itemData(id).toInt()); if (configuration_->ccdDetector() != VESPERS::NoCCD){ QString path; QString name = configuration_->ccdFileName().isEmpty() ? scanName_->text() : configuration_->ccdFileName(); if (configuration_->ccdDetector() == VESPERS::Roper) path = VESPERSBeamline::vespers()->vespersRoperCCD()->ccdFilePath(); else if (configuration_->ccdDetector() == VESPERS::Mar) path = VESPERSBeamline::vespers()->vespersMarCCD()->ccdFilePath(); else if (configuration_->ccdDetector() == VESPERS::Pilatus) path = VESPERSBeamline::vespers()->vespersPilatusAreaDetector()->ccdFilePath(); configuration_->setCCDFileName(name); ccdText_->setText(QString("Path: %1\nName: %2").arg(path).arg(name)); checkCCDFileNames(name); } onScanNameEdited(); ccdTextBox_->setVisible(configuration_->ccdDetector() != VESPERS::NoCCD); }
void VESPERS2DScanConfigurationView::onScanNameEdited() { QString name = scanName_->text(); configuration_->setName(name); configuration_->setUserScanName(name); if (configuration_->ccdDetector() != VESPERS::NoCCD){ QString path; if (configuration_->ccdDetector() == VESPERS::Roper) path = VESPERSBeamline::vespers()->vespersRoperCCD()->ccdFilePath(); else if (configuration_->ccdDetector() == VESPERS::Mar) path = VESPERSBeamline::vespers()->vespersMarCCD()->ccdFilePath(); else if (configuration_->ccdDetector() == VESPERS::Pilatus) path = VESPERSBeamline::vespers()->vespersPilatusAreaDetector()->ccdFilePath(); ccdText_->setText(QString("Path: %1\nName: %2").arg(path).arg(name)); configuration_->setCCDFileName(name); checkCCDFileNames(name); } if (configuration_->ccdDetector() == VESPERS::Pilatus && name.contains(" ")){ QPalette palette = scanName_->palette(); palette.setColor(QPalette::Base, Qt::red); scanName_->setPalette(palette); } else scanName_->setPalette(this->palette()); }
void VESPERS2DScanConfigurationView::onScanNameEdited() { QString name = scanName_->text(); config_->setName(name); config_->setUserScanName(name); if (config_->ccdDetector() != VESPERS::NoCCD){ QString path; if (config_->ccdDetector() == VESPERS::Roper) path = VESPERSBeamline::vespers()->roperCCD()->ccdFilePath(); else if (config_->ccdDetector() == VESPERS::Mar) path = VESPERSBeamline::vespers()->marCCD()->ccdFilePath(); else if (config_->ccdDetector() == VESPERS::Pilatus) path = VESPERSBeamline::vespers()->pilatusCCD()->ccdFilePath(); ccdText_->setText(QString("Path: %1\nName: %2").arg(path).arg(name)); config_->setCCDFileName(name); checkCCDFileNames(name); } }