diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionQtGUI.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionQtGUI.ui index 3bc59afc5ef14034d0d902da5fed1be17bc2050a..857a5a65389c1db51940fb9d800f6f6b2a84eb6e 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionQtGUI.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionQtGUI.ui @@ -84,6 +84,19 @@ </item> <item row="0" column="0"> <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>138</width> + <height>20</height> + </size> + </property> + </spacer> + </item> <item> <widget class="QLabel" name="label"> <property name="text"> @@ -100,19 +113,6 @@ </item> </widget> </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>138</width> - <height>20</height> - </size> - </property> - </spacer> - </item> </layout> </item> </layout> diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionQtTabCalib.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionQtTabCalib.ui index f1287f0255b5f07a4e725f0b63a76a8f3a056cf0..266eb21efff5c08628721f6bc011ad9c278cb1ae 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionQtTabCalib.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionQtTabCalib.ui @@ -115,10 +115,18 @@ </spacer> </item> <item row="1" column="2" colspan="3"> - <widget class="QLineEdit" name="lineEdit_ceria_num"/> + <widget class="QLineEdit" name="lineEdit_ceria_num"> + <property name="text"> + <string>241391</string> + </property> + </widget> </item> <item row="0" column="2" colspan="3"> - <widget class="QLineEdit" name="lineEdit_vanadium_num"/> + <widget class="QLineEdit" name="lineEdit_vanadium_num"> + <property name="text"> + <string>236516</string> + </property> + </widget> </item> <item row="2" column="1" colspan="4"> <widget class="QLineEdit" name="lineEdit_current_calib_path"/> @@ -158,7 +166,11 @@ </widget> </item> <item row="0" column="1" colspan="2"> - <widget class="QLineEdit" name="lineEdit_new_van_num"/> + <widget class="QLineEdit" name="lineEdit_new_vanadium_num"> + <property name="text"> + <string>236516</string> + </property> + </widget> </item> <item row="1" column="0"> <widget class="QLabel" name="label_3"> @@ -168,7 +180,11 @@ </widget> </item> <item row="1" column="1" colspan="2"> - <widget class="QLineEdit" name="lineEdit_new_ceria_num"/> + <widget class="QLineEdit" name="lineEdit_new_ceria_num"> + <property name="text"> + <string>241391</string> + </property> + </widget> </item> <item row="2" column="0" colspan="2"> <spacer name="horizontalSpacer"> @@ -184,7 +200,7 @@ </spacer> </item> <item row="2" column="2"> - <widget class="QPushButton" name="pushButton_calib"> + <widget class="QPushButton" name="pushButton_new_calib"> <property name="text"> <string>Calibrate</string> </property> diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h index 7635712d0f079d0bf73b632e2d33b3990e9a5b60..b0cfed61f75402123989493e30862bd97d8ac6a8 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h @@ -80,6 +80,7 @@ public: private slots: /// for buttons, do calibrate and similar void loadCalibrationClicked(); + void calibrateClicked(); // slots of the settings tab/section of the interface void browseInputDirCalib(); @@ -90,7 +91,7 @@ private slots: // slots of the calibration tab/section of the interface // slots of the general part of the interface - void instrumentChanged(); + void instrumentChanged(int idx); // show the standard Mantid help window with this interface's help void openHelpWin(); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionViewQtGUI.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionViewQtGUI.cpp index e99dfc3649000ab2000010c0eee790bcbae84750..8387de1a32045612985828207728c4637c6f45f3 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionViewQtGUI.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionViewQtGUI.cpp @@ -42,7 +42,7 @@ void EnggDiffractionViewQtGUI::initLayout() { m_ui.tabMain->addTab(wCalib, QString("Calibration")); QWidget *wSettings = new QWidget(m_ui.tabMain); m_uiTabSettings.setupUi(wSettings); - m_ui.tabMain->addTab(wSettings, QString("Setup")); + m_ui.tabMain->addTab(wSettings, QString("Settings")); readSettings(); @@ -61,7 +61,27 @@ void EnggDiffractionViewQtGUI::initLayout() { m_presenter->notify(IEnggDiffractionPresenter::Start); } -void EnggDiffractionViewQtGUI::doSetupTabCalib() {} +void EnggDiffractionViewQtGUI::doSetupTabCalib() { + const std::string vanadiumRun = "236516"; + const std::string ceriaRun = "241391"; + + // line edits with calibration parameters + m_uiTabCalib.lineEdit_vanadium_num->setText( + QString::fromStdString(vanadiumRun)); + m_uiTabCalib.lineEdit_ceria_num->setText(QString::fromStdString(ceriaRun)); + + m_uiTabCalib.lineEdit_new_vanadium_num->setText( + QString::fromStdString(vanadiumRun)); + m_uiTabCalib.lineEdit_new_ceria_num->setText( + QString::fromStdString(ceriaRun)); + + // push button signals/slots + connect(m_uiTabCalib.pushButton_load_calib, SIGNAL(released()), this, + SLOT(loadCalibrationClicked())); + + connect(m_uiTabCalib.pushButton_new_calib, SIGNAL(released()), this, + SLOT(calibrateClicked())); +} void EnggDiffractionViewQtGUI::doSetupTabSettings() { QString path = @@ -79,6 +99,16 @@ void EnggDiffractionViewQtGUI::doSetupTabSettings() { templ.append("template_ENGINX_241391_236516_North_and_South_banks.par"); m_calibSettings.m_templateGSAS_PRM = templ.toString(); + // line edits that display paths and the like + m_uiTabSettings.lineEdit_input_dir_calib->setText( + QString::fromStdString(m_calibSettings.m_inputDirCalib)); + m_uiTabSettings.lineEdit_input_dir_raw->setText( + QString::fromStdString(m_calibSettings.m_inputDirRaw)); + m_uiTabSettings.lineEdit_pixel_calib_filename->setText( + QString::fromStdString(m_calibSettings.m_pixelCalibFilename)); + m_uiTabSettings.lineEdit_template_gsas_prm->setText( + QString::fromStdString(m_calibSettings.m_templateGSAS_PRM)); + // push button signals/slots connect(m_uiTabSettings.pushButton_browse_input_dir_calib, SIGNAL(released()), this, SLOT(browseInputDirCalib())); @@ -127,7 +157,28 @@ std::string EnggDiffractionViewQtGUI::getRBNumber() const { return "not available"; } -void EnggDiffractionViewQtGUI::loadCalibrationClicked() {} +void EnggDiffractionViewQtGUI::loadCalibrationClicked() { + QString prevPath = QString::fromStdString(m_calibSettings.m_inputDirCalib); + if (prevPath.isEmpty()) { + prevPath = + MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory(); + } + QString dir = QFileDialog::getExistingDirectory( + this, tr("Open Directory"), prevPath, + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + + if (dir.isEmpty()) { + return; + } + + MantidQt::API::AlgorithmInputHistory::Instance().setPreviousDirectory(dir); + + m_presenter->notify(IEnggDiffractionPresenter::LoadExistingCalib); +} + +void EnggDiffractionViewQtGUI::calibrateClicked() { + m_presenter->notify(IEnggDiffractionPresenter::CalcCalib); +} void EnggDiffractionViewQtGUI::browseInputDirCalib() { QString prevPath = QString::fromStdString(m_calibSettings.m_inputDirCalib); @@ -190,8 +241,8 @@ void EnggDiffractionViewQtGUI::browsePixelCalibFilename() { void EnggDiffractionViewQtGUI::browseTemplateGSAS_PRM() { const QString iparStr = QString("GSAS instrument parameters file " - "(*.prm *.par *.tiff *.ipar *.iparam);;" - "Other extensions/all files (*.*)"); + "(*.prm *.par *.tiff *.ipar *.iparam);;" + "Other extensions/all files (*.*)"); QString prevPath = QString::fromStdString(m_calibSettings.m_templateGSAS_PRM); QString path(QFileDialog::getOpenFileName( @@ -204,7 +255,7 @@ void EnggDiffractionViewQtGUI::browseTemplateGSAS_PRM() { m_calibSettings.m_templateGSAS_PRM = path.toStdString(); } -void EnggDiffractionViewQtGUI::instrumentChanged() { +void EnggDiffractionViewQtGUI::instrumentChanged(int /*idx*/) { QComboBox *inst = m_ui.comboBox_instrument; if (!inst) return; diff --git a/Code/Mantid/docs/source/interfaces/Engineering_Diffraction.rst b/Code/Mantid/docs/source/interfaces/Engineering_Diffraction.rst index 42f77cd178b7f175ca2bb72093226d55fb40c311..17cf877ef3440286d3b7bf8a5c969156154f9f90 100644 --- a/Code/Mantid/docs/source/interfaces/Engineering_Diffraction.rst +++ b/Code/Mantid/docs/source/interfaces/Engineering_Diffraction.rst @@ -1,5 +1,5 @@ -Tomographic Reconstruction -========================== +Engineering Diffraction +======================= .. contents:: Table of Contents :local: