Skip to content
Snippets Groups Projects
Commit e17dc5f6 authored by Shahroz Ahmed's avatar Shahroz Ahmed
Browse files

fixes bug when file selected after multi-run entered

refs #15906
parent acc7125d
No related branches found
No related tags found
No related merge requests found
...@@ -340,7 +340,7 @@ private: ...@@ -340,7 +340,7 @@ private:
int static m_currentRunMode; int static m_currentRunMode;
/// indentifier for fitting multi-run or single run input /// indentifier for fitting multi-run or single run input
bool m_fittingMutliRunMode; bool static m_fittingMutliRunMode;
// vector holding directory of focused bank file // vector holding directory of focused bank file
std::vector<std::string> static m_fitting_runno_dir_vec; std::vector<std::string> static m_fitting_runno_dir_vec;
......
...@@ -34,7 +34,7 @@ DECLARE_SUBWINDOW(EnggDiffractionViewQtGUI) ...@@ -34,7 +34,7 @@ DECLARE_SUBWINDOW(EnggDiffractionViewQtGUI)
const double EnggDiffractionViewQtGUI::g_defaultRebinWidth = -0.0005; const double EnggDiffractionViewQtGUI::g_defaultRebinWidth = -0.0005;
int EnggDiffractionViewQtGUI::m_currentType = 0; int EnggDiffractionViewQtGUI::m_currentType = 0;
int EnggDiffractionViewQtGUI::m_currentRunMode = 0; int EnggDiffractionViewQtGUI::m_currentRunMode = 0;
bool m_fittingMutliRunMode = false; bool EnggDiffractionViewQtGUI::m_fittingMutliRunMode = false;
int EnggDiffractionViewQtGUI::m_currentCropCalibBankName = 0; int EnggDiffractionViewQtGUI::m_currentCropCalibBankName = 0;
std::vector<std::string> EnggDiffractionViewQtGUI::m_fitting_runno_dir_vec; std::vector<std::string> EnggDiffractionViewQtGUI::m_fitting_runno_dir_vec;
...@@ -716,14 +716,19 @@ void EnggDiffractionViewQtGUI::setBankDir(int idx) { ...@@ -716,14 +716,19 @@ void EnggDiffractionViewQtGUI::setBankDir(int idx) {
void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI:: void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI::
listViewFittingRun() { listViewFittingRun() {
/// shahroz
auto listView = m_uiTabFitting.listWidget_fitting_run_num;
auto currentRow = listView->currentRow();
auto item = listView->item(currentRow);
QString itemText = item->text();
setfittingRunNo(itemText); if (m_fittingMutliRunMode) {
fittingRunNoChanged(); auto listView = m_uiTabFitting.listWidget_fitting_run_num;
auto currentRow = listView->currentRow();
auto item = listView->item(currentRow);
QString itemText = item->text();
std::string text = itemText.toStdString();
std::string ttext = text + "";
setfittingRunNo(itemText);
fittingRunNoChanged();
}
} }
std::string EnggDiffractionViewQtGUI::fittingRunNoFactory(std::string bank, std::string EnggDiffractionViewQtGUI::fittingRunNoFactory(std::string bank,
...@@ -1165,6 +1170,7 @@ void EnggDiffractionViewQtGUI::browseTextureDetGroupingFile() { ...@@ -1165,6 +1170,7 @@ void EnggDiffractionViewQtGUI::browseTextureDetGroupingFile() {
} }
void EnggDiffractionViewQtGUI::browseFitFocusedRun() { void EnggDiffractionViewQtGUI::browseFitFocusedRun() {
m_fittingMutliRunMode = false;
QString prevPath = QString::fromStdString(m_focusDir); QString prevPath = QString::fromStdString(m_focusDir);
if (prevPath.isEmpty()) { if (prevPath.isEmpty()) {
prevPath = prevPath =
...@@ -1429,12 +1435,11 @@ void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI:: ...@@ -1429,12 +1435,11 @@ void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI::
} }
} }
// set the directory here to the first in the vector if its not empty // set the directory here to the first in the vector if its not empty
// if (!m_fitting_runno_dir_vec.empty()) { if (!m_fitting_runno_dir_vec.empty()) {
// QString firstDir = QString::fromStdString(m_fitting_runno_dir_vec[0]); QString firstDir = QString::fromStdString(m_fitting_runno_dir_vec[0]);
// setfittingRunNo(firstDir); setfittingRunNo(firstDir);
//} else } else if (fittingRunNo().empty()) {
if (fittingRunNo().empty()) {
userWarning("Invalid Input", "Invalid directory or run number given. " userWarning("Invalid Input", "Invalid directory or run number given. "
"Please try again"); "Please try again");
} }
...@@ -1508,8 +1513,8 @@ void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI::enableMultiRun( ...@@ -1508,8 +1513,8 @@ void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI::enableMultiRun(
emit setBank(); emit setBank();
} else { } else {
throw std::invalid_argument("Invalid Run Number, the multi-run number " userWarning("Invalid Run Number", "the multi-run number "
"provided is invalid. Please try again"); "provided is invalid. Please try again");
} }
} }
...@@ -1577,9 +1582,8 @@ void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI::addRunNoItem( ...@@ -1577,9 +1582,8 @@ void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI::addRunNoItem(
QString::fromStdString(currentRun)); QString::fromStdString(currentRun));
} }
m_uiTabFitting.listWidget_fitting_run_num->setEnabled(true);
if (multiRun) { if (multiRun) {
m_uiTabFitting.listWidget_fitting_run_num->setEnabled(true);
auto currentIndex = auto currentIndex =
m_uiTabFitting.listWidget_fitting_run_num->currentRow(); m_uiTabFitting.listWidget_fitting_run_num->currentRow();
if (currentIndex == -1) if (currentIndex == -1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment