diff --git a/Code/Mantid/DataHandling/src/LoadRKH.cpp b/Code/Mantid/DataHandling/src/LoadRKH.cpp index e0f4798f172d356527a8ce3aa5aaeb172bc0b20a..32bdd6e45e8fbc6334407c23e2bc57377e817380 100644 --- a/Code/Mantid/DataHandling/src/LoadRKH.cpp +++ b/Code/Mantid/DataHandling/src/LoadRKH.cpp @@ -20,9 +20,12 @@ DECLARE_ALGORITHM(LoadRKH) * Initialise the algorithm */ void LoadRKH::init() -{ - declareProperty(new API::FileProperty("Filename","", API::FileProperty::Load), - "Name of the RKH file to load" ); +{ + std::vector<std::string> exts; + exts.push_back(".txt"); + exts.push_back(".Q"); + declareProperty(new API::FileProperty("Filename","", API::FileProperty::Load, exts), + "Name of the RKH file to load"); declareProperty( new API::WorkspaceProperty<>("OutputWorkspace", "", Kernel::Direction::Output), "The name to use for the output workspace" ); diff --git a/Code/Mantid/DataHandling/src/SaveRKH.cpp b/Code/Mantid/DataHandling/src/SaveRKH.cpp index 4e9204375d45ca836a8efc8c04448723df90c1bc..920c9bcb12e411dc25ef8f4dd92b96a5f4c77570 100644 --- a/Code/Mantid/DataHandling/src/SaveRKH.cpp +++ b/Code/Mantid/DataHandling/src/SaveRKH.cpp @@ -38,7 +38,10 @@ void SaveRKH::init() declareProperty( new API::WorkspaceProperty<>("InputWorkspace", "", Kernel::Direction::Input), "The name of the workspace to save"); - declareProperty(new API::FileProperty("Filename", "", API::FileProperty::Save), + std::vector<std::string> exts; + exts.push_back(".txt"); + exts.push_back(".Q"); + declareProperty(new API::FileProperty("Filename", "", API::FileProperty::Save, exts), "The name to use when saving the file"); declareProperty("Append",true,"If true and Filename already exists, append, else overwrite"); } diff --git a/Code/Mantid/PythonAPI/scripts/SANS/SANSInsts.py b/Code/Mantid/PythonAPI/scripts/SANS/SANSInsts.py index f1caa2626589b94023027fab981db430dbe0b76d..112631d463c7656b1a97b7e23546c20e89535b8c 100644 --- a/Code/Mantid/PythonAPI/scripts/SANS/SANSInsts.py +++ b/Code/Mantid/PythonAPI/scripts/SANS/SANSInsts.py @@ -423,6 +423,10 @@ class ISISInstrument(Instrument): if b.correction_file == '' and a.correction_file != '': b.correction_file = a.correction_file != '' + def detector_file(self, det_name): + det = ReductionSingleton().instrument.getDetector(det_name) + return det.correction_file + class LOQ(ISISInstrument): diff --git a/Code/Mantid/PythonAPI/scripts/SANS/SANSReduction.py b/Code/Mantid/PythonAPI/scripts/SANS/SANSReduction.py index bb1c25b5fdf9fe2a40f7dca0f679349e5596a4d0..f1061a39d19a0255419d187a1b4a011adb0f7fe6 100644 --- a/Code/Mantid/PythonAPI/scripts/SANS/SANSReduction.py +++ b/Code/Mantid/PythonAPI/scripts/SANS/SANSReduction.py @@ -764,7 +764,7 @@ def Mask(details): det_type = detname[0] if INSTRUMENT.isDetectorName(det_type) : spectra = detname[1] - if INSTRUMENT.isHighAngleDetector(type) : + if INSTRUMENT.isHighAngleDetector(det_type) : SPECMASKSTRING_F += ',' + spectra else: SPECMASKSTRING_R += ',' + spectra diff --git a/Code/qtiplot/MantidQt/CustomInterfaces/inc/SANSRunWindow.h b/Code/qtiplot/MantidQt/CustomInterfaces/inc/SANSRunWindow.h index 68a15ed62e03cc62b5f0a36faba7486dd0d1e3d1..841854af42de2adc4b9ab2cabef09ae5a4f60147 100644 --- a/Code/qtiplot/MantidQt/CustomInterfaces/inc/SANSRunWindow.h +++ b/Code/qtiplot/MantidQt/CustomInterfaces/inc/SANSRunWindow.h @@ -202,7 +202,7 @@ private slots: /// Called when the show mask button has been clicked void handleShowMaskButtonClick(); ///Handle the change in instrument - void handleInstrumentChange(int); + void handleInstrumentChange(const int index); ///Record if that user has changed the default filename void setUserFname(); /// Update the centre finding progress diff --git a/Code/qtiplot/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp b/Code/qtiplot/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp index 23511be57abd40fe623d8f130454a693f06ef42f..39e1a43da00eaa245d401a5f9616ec6242c8730b 100644 --- a/Code/qtiplot/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp +++ b/Code/qtiplot/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp @@ -604,9 +604,9 @@ bool SANSRunWindow::loadUserFile() m_uiForm.trans_monitor->setText(runReduceScriptFunction( "printParameter('INSTRUMENT.incid_mon_4_trans_calc'),")); m_uiForm.monitor_interp->setChecked(runReduceScriptFunction( - "printParameter('INSTRUMENT.is_interpolating_norm'),") == "True"); + "printParameter('INSTRUMENT.is_interpolating_norm')").trimmed() == "True"); m_uiForm.trans_interp->setChecked( - runReduceScriptFunction("printParameter('INSTRUMENT.use_interpol_trans_calc'),") == "True"); + runReduceScriptFunction("printParameter('INSTRUMENT.use_interpol_trans_calc'),").trimmed() == "True"); //Direct efficiency correction m_uiForm.direct_file->setText(runReduceScriptFunction("printParameter('DIRECT_BEAM_FILE_R'),")); @@ -659,7 +659,7 @@ bool SANSRunWindow::loadUserFile() m_uiForm.phi_min->setText(runReduceScriptFunction("printParameter('PHIMIN')")); m_uiForm.phi_max->setText(runReduceScriptFunction("printParameter('PHIMAX')")); - if ( runReduceScriptFunction("printParameter('PHIMIRROR')") == "True" ) + if ( runReduceScriptFunction("printParameter('PHIMIRROR')").trimmed() == "True" ) { m_uiForm.mirror_phi->setChecked(true); } @@ -2049,7 +2049,7 @@ void SANSRunWindow::handleInstrumentChange(int index) fillDetectNames(m_uiForm.detbank_sel); QString detect = runReduceScriptFunction( - "printParameter('INSTRUMENT.cur_detector().name()')"); + "printParameter('INSTRUMENT.cur_detector().name()')").trimmed(); int ind = m_uiForm.detbank_sel->findText(detect); if( ind >= 0 && ind < 2 ) { @@ -2077,8 +2077,8 @@ void SANSRunWindow::handleInstrumentChange(int index) //File extensions m_uiForm.file_opt->clear(); - m_uiForm.file_opt->addItem("raw", QVariant(".raw")); m_uiForm.file_opt->addItem("nexus", QVariant(".nxs")); + m_uiForm.file_opt->addItem("raw", QVariant(".raw")); } m_cfg_loaded = false; @@ -2268,8 +2268,8 @@ void SANSRunWindow::updateTransInfo(int state) { if( state == Qt::Checked ) { - m_uiForm.trans_min->setText(runReduceScriptFunction("printParameter('TRANS_WAV1_FULL'),")); - m_uiForm.trans_max->setText(runReduceScriptFunction("printParameter('TRANS_WAV2_FULL'),")); + m_uiForm.trans_min->setText(runReduceScriptFunction("printParameter('TRANS_WAV1_FULL'),").trimmed()); + m_uiForm.trans_max->setText(runReduceScriptFunction("printParameter('TRANS_WAV2_FULL'),").trimmed()); } } /** Record the output workspace name, if there is no output diff --git a/Code/qtiplot/MantidQt/MantidWidgets/inc/SaveWorkspaces.h b/Code/qtiplot/MantidQt/MantidWidgets/inc/SaveWorkspaces.h index e4a3708b057e33730a7e54c752bd4fee2ec212ea..0304d3af107399eca54b3874090f1e6cf68e787a 100644 --- a/Code/qtiplot/MantidQt/MantidWidgets/inc/SaveWorkspaces.h +++ b/Code/qtiplot/MantidQt/MantidWidgets/inc/SaveWorkspaces.h @@ -77,6 +77,7 @@ namespace MantidQt private slots: void saveSel(); + void setFileName(int row); void saveFileBrowse(); }; diff --git a/Code/qtiplot/MantidQt/MantidWidgets/src/SaveWorkspaces.cpp b/Code/qtiplot/MantidQt/MantidWidgets/src/SaveWorkspaces.cpp index b7625ea1d9ae1b62f1943556a31abda0fdb4eb64..5d5dbd93d3603c3f0ea83d5a3e75d978ef87e960 100644 --- a/Code/qtiplot/MantidQt/MantidWidgets/src/SaveWorkspaces.cpp +++ b/Code/qtiplot/MantidQt/MantidWidgets/src/SaveWorkspaces.cpp @@ -94,6 +94,7 @@ void SaveWorkspaces::setupLine2(QHBoxLayout * const lineTwo, const QHash<const Q } //allow users to select more than one workspace in the list m_workspaces->setSelectionMode(QAbstractItemView::ExtendedSelection); + connect(m_workspaces, SIGNAL(currentRowChanged(int)), this, SLOT(setFileName(int))); QPushButton *save = new QPushButton("Save"); connect(save, SIGNAL(clicked()), this, SLOT(saveSel())); @@ -211,9 +212,10 @@ QString SaveWorkspaces::saveList(const QList<QListWidgetItem*> & wspaces, const outFile += exten; } saveCommands += outFile + "'"; - if (toAppend) + if ( algorithm != "SaveCSV" ) { - saveCommands += ", Append=True"; + saveCommands += ", Append="; + saveCommands += toAppend ? "True" : "False"; } //finally finish the algorithm call saveCommands += ")\n"; @@ -247,7 +249,7 @@ void SaveWorkspaces::saveSel() { QString saveCommands; for(SavFormatsConstIt i = m_savFormats.begin(); i != m_savFormats.end(); ++i) - {//the key a pointer to the check box that the user may have clicked + {//the key to a pointer to the check box that the user may have clicked if (i.key()->isChecked()) {//we need to save in this format @@ -274,6 +276,12 @@ void SaveWorkspaces::saveSel() }//end loop over formats emit runAsPythonScript(saveCommands); } +/** Sets the filename to the name of the selected workspace +*/ +void SaveWorkspaces::setFileName(int row) +{ + m_fNameEdit->setText(m_workspaces->item(row)->text()); +} /** Raises a browse dialog and inserts the selected file into the * save text edit box, outfile_edit */ @@ -297,4 +305,4 @@ void SaveWorkspaces::saveFileBrowse() QString directory = QFileInfo(oFile).path(); prevValues.setValue("dir", directory); } -} \ No newline at end of file +}