Skip to content

Commit

Permalink
Fixed: SANSRunWindow interferes with Facility selection. re #2856
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders-Markvardsen committed Apr 17, 2012
1 parent e9dffef commit aa31a12
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ void SANSRunWindow::connectAnalysDetSignals()

connect(m_uiForm.inst_opt, SIGNAL(currentIndexChanged(int)), this,
SLOT(handleInstrumentChange()));

connect(m_uiForm.transFit_ck, SIGNAL(stateChanged(int)), this, SLOT(updateTransInfo(int)));
updateTransInfo(m_uiForm.transFit_ck->state());

Expand Down Expand Up @@ -604,6 +605,11 @@ void SANSRunWindow::trimPyMarkers(QString & txt)
*/
bool SANSRunWindow::loadUserFile()
{
const std::string facility = ConfigService::Instance().getFacility().name();
if (facility != "ISIS"){
return false;
}

QString filetext = m_uiForm.userfile_edit->text().trimmed();
if( filetext.isEmpty() )
{
Expand Down Expand Up @@ -2412,16 +2418,23 @@ void SANSRunWindow::handleShowMaskButtonClick()
m_uiForm.showMaskBtn->setEnabled(true);
m_uiForm.showMaskBtn->setText("Display mask");
}


/** Update the GUI and the Python objects with the instrument selection
* @throw runtime_error if the instrument doesn't have exactly two detectors
*/
void SANSRunWindow::handleInstrumentChange()
{
const std::string facility = ConfigService::Instance().getFacility().name();
if (facility != "ISIS"){
QMessageBox::critical(this, "Unsupported facility", "Only the ISIS facility is supported by this interface.\nSelect ISIS as your default facility to continue.");
QMessageBox::critical(this, "Unsupported facility", QString("Only the ISIS facility is supported by this interface.\n")
+ "Select ISIS as your default facility in View->Preferences...->Mantid to continue.");
return;
}

// need this if facility changed to force update of technique at this point
m_uiForm.inst_opt->setTechniques(m_uiForm.inst_opt->getTechniques());

//set up the required Python objects and delete what's out of date (perhaps everything is cleaned here)
const QString instClass(getInstrumentClass());
QString pyCode("if i.ReductionSingleton().get_instrument() != '");
Expand Down

0 comments on commit aa31a12

Please sign in to comment.