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

sets enginx default instr when different default instr selected

Refs #14006
parent 15930c9f
No related branches found
No related tags found
No related merge requests found
...@@ -198,8 +198,11 @@ private: ...@@ -198,8 +198,11 @@ private:
/// instrument selected (ENGIN-X, etc.) /// instrument selected (ENGIN-X, etc.)
std::string m_currentInst; std::string m_currentInst;
/// the instrument selection has changed (slot) /// User select instrument
void userSelectInstrument(); void userSelectInstrument(const QString &prefix);
/// setting the instrument prefix ahead of the run number
void setPrefix(std::string prefix);
// plot data representation type selected // plot data representation type selected
int static m_currentType; int static m_currentType;
...@@ -227,7 +230,6 @@ private: ...@@ -227,7 +230,6 @@ private:
/// presenter as in the model-view-presenter /// presenter as in the model-view-presenter
boost::scoped_ptr<IEnggDiffractionPresenter> m_presenter; boost::scoped_ptr<IEnggDiffractionPresenter> m_presenter;
}; };
} // namespace CustomInterfaces } // namespace CustomInterfaces
......
...@@ -76,6 +76,9 @@ void EnggDiffractionViewQtGUI::initLayout() { ...@@ -76,6 +76,9 @@ void EnggDiffractionViewQtGUI::initLayout() {
m_uiTabSettings.setupUi(wSettings); m_uiTabSettings.setupUi(wSettings);
m_ui.tabMain->addTab(wSettings, QString("Settings")); m_ui.tabMain->addTab(wSettings, QString("Settings"));
QComboBox *inst = m_ui.comboBox_instrument;
m_currentInst = inst->currentText().toStdString();
setPrefix(m_currentInst);
readSettings(); readSettings();
// basic UI setup, connect signals, etc. // basic UI setup, connect signals, etc.
...@@ -177,12 +180,6 @@ void EnggDiffractionViewQtGUI::doSetupGeneralWidgets() { ...@@ -177,12 +180,6 @@ void EnggDiffractionViewQtGUI::doSetupGeneralWidgets() {
// change instrument // change instrument
connect(m_ui.comboBox_instrument, SIGNAL(currentIndexChanged(int)), this, connect(m_ui.comboBox_instrument, SIGNAL(currentIndexChanged(int)), this,
SLOT(instrumentChanged(int))); SLOT(instrumentChanged(int)));
// signal/slot connections to respond to changes in instrument selection combo
// boxes
connect(m_ui.comboBox_instrument, SIGNAL(instrumentChanged(int)), this,
SLOT(userSelectInstrument()));
connect(m_ui.pushButton_help, SIGNAL(released()), this, SLOT(openHelpWin())); connect(m_ui.pushButton_help, SIGNAL(released()), this, SLOT(openHelpWin()));
// note connection to the parent window, otherwise an empty frame window // note connection to the parent window, otherwise an empty frame window
// may remain open and visible after this close // may remain open and visible after this close
...@@ -744,15 +741,21 @@ void EnggDiffractionViewQtGUI::instrumentChanged(int /*idx*/) { ...@@ -744,15 +741,21 @@ void EnggDiffractionViewQtGUI::instrumentChanged(int /*idx*/) {
m_presenter->notify(IEnggDiffractionPresenter::InstrumentChange); m_presenter->notify(IEnggDiffractionPresenter::InstrumentChange);
} }
void EnggDiffractionViewQtGUI::userSelectInstrument() { void EnggDiffractionViewQtGUI::userSelectInstrument(const QString &prefix) {
// Set file browsing to current instrument // Set file browsing to current instrument
auto prefix = QString::fromStdString(m_currentInst); setPrefix(prefix.toStdString());
m_uiTabFocus.lineEdit_run_num->setInstrumentOverride(prefix); }
m_uiTabFocus.lineEdit_texture_run_num->setInstrumentOverride(prefix);
m_uiTabFocus.lineEdit_cropped_run_num->setInstrumentOverride(prefix); void EnggDiffractionViewQtGUI::setPrefix(std::string prefix) {
QString prefixInput = QString::fromStdString(prefix);
// focus tab
m_uiTabFocus.lineEdit_run_num->setInstrumentOverride(prefixInput);
m_uiTabFocus.lineEdit_texture_run_num->setInstrumentOverride(prefixInput);
m_uiTabFocus.lineEdit_cropped_run_num->setInstrumentOverride(prefixInput);
m_uiTabCalib.lineEdit_new_ceria_num->setInstrumentOverride(prefix); // calibration tab
m_uiTabCalib.lineEdit_new_vanadium_num->setInstrumentOverride(prefix); m_uiTabCalib.lineEdit_new_ceria_num->setInstrumentOverride(prefixInput);
m_uiTabCalib.lineEdit_new_vanadium_num->setInstrumentOverride(prefixInput);
} }
void EnggDiffractionViewQtGUI::closeEvent(QCloseEvent *event) { void EnggDiffractionViewQtGUI::closeEvent(QCloseEvent *event) {
......
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