Skip to content
Snippets Groups Projects
Commit 2d7527a2 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

Merge pull request #16232 from mantidproject/16227_Old_reflectometry_GUI_issues

Fix issues found during unscripted testing (Reflectometry)
parents 40eb597a a59f924b
No related branches found
No related tags found
No related merge requests found
......@@ -4,13 +4,13 @@
#include "MantidDataHandling/LoadTBL.h"
#include "MantidAPI/FileProperty.h"
#include "MantidAPI/RegisterFileLoader.h"
#include "MantidAPI/TableRow.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidKernel/Strings.h"
#include "MantidAPI/TableRow.h"
#include <fstream>
#include <boost/tokenizer.hpp>
#include <MantidKernel/StringTokenizer.h>
#include <boost/tokenizer.hpp>
// String utilities
#include <boost/algorithm/string.hpp>
......@@ -234,7 +234,9 @@ size_t LoadTBL::getCells(std::string line, std::vector<std::string> &cols,
csvParse(line, cols, quoteBounds, expectedCommas);
}
} else {
boost::split(cols, line, boost::is_any_of(","), boost::token_compress_off);
std::vector<std::vector<size_t>> quoteBounds;
findQuotePairs(line, quoteBounds);
csvParse(line, cols, quoteBounds, expectedCommas);
if (cols.size() > expectedCommas) {
for (size_t i = expectedCommas + 1; i < cols.size(); i++) {
cols[expectedCommas].append(
......
......@@ -280,8 +280,7 @@ public:
std::ofstream file(m_filename.c_str());
file << "Runs,Angle,QMin,QMax,Group,Options" << std::endl
<< "14456,0.7,1.443,8.992,1," << std::endl
<< "18553,0.3,1.233,4.388,3,ProcessingInstructions=\"1:2\""
<< ", Rebin=\"1.5,0.25,5.6\"" << std::endl;
<< "18553,0.3,1.233,4.388,3," << std::endl;
file.close();
Mantid::API::IAlgorithm_sptr alg =
Mantid::API::AlgorithmManager::Instance().create("LoadTBL");
......@@ -314,8 +313,6 @@ public:
TS_ASSERT_EQUALS(secondRow.cell<std::string>(0), "18553");
TS_ASSERT_EQUALS(secondRow.cell<std::string>(1), "0.3");
TS_ASSERT_EQUALS(secondRow.cell<std::string>(3), "4.388");
TS_ASSERT_EQUALS(secondRow.cell<std::string>(5),
"ProcessingInstructions=\"1:2\", Rebin=\"1.5,0.25,5.6\"");
TS_ASSERT_THROWS_NOTHING(Poco::File(m_abspath).remove());
}
......
......@@ -1195,7 +1195,7 @@ void GenericDataProcessorPresenter::clearSelected() {
m_model->setData(m_model->index(*row, i), "");
}
// 'Group' column
m_model->setData(m_model->index(*row, m_columns - 2), getUnusedGroup());
m_model->setData(m_model->index(*row, m_columns - 2), getUnusedGroup(ignore));
// 'Options' column
m_model->setData(m_model->index(*row, m_columns - 1), "");
}
......
# pylint: disable = too-many-lines, invalid-name, line-too-long, too-many-instance-attributes, too-many-branches,too-many-locals, too-many-nested-blocks
# pylint: disable = too-many-lines, invalid-name, line-too-long, too-many-instance-attributes, too-many-branches,too-many-locals, too-many-nested-blocks
try:
from mantidplot import *
......@@ -438,7 +438,7 @@ class ReflGui(QtGui.QMainWindow, ui_refl_window.Ui_windowRefl):
if bool(re.search('(raw)$', file_name, re.IGNORECASE)): # Filter to only display and map raw files.
title = (run_number + ': ' + description).strip()
self.SampleText.__icat_file_map[title] = (file_id, run_number, file_name)
self.__icat_file_map[title] = (file_id, run_number, file_name)
self.listMain.addItem(title)
self.listMain.sortItems()
del search_results
......@@ -886,7 +886,7 @@ class ReflGui(QtGui.QMainWindow, ui_refl_window.Ui_windowRefl):
if canMantidPlot:
# Get the existing graph if it exists
base_graph = self.__graphs.get(wksp[i], None)
base_graph = self.__graphs.get(wksp[0], None)
# Clear the window if we're the first of a new set of curves
clearWindow = (i == 0)
......@@ -900,7 +900,7 @@ class ReflGui(QtGui.QMainWindow, ui_refl_window.Ui_windowRefl):
titl = groupGet(ws_name_binned, 'samp', 'run_title')
if type(titl) == str:
base_graph.activeLayer().setTitle(titl)
base_graph.activeLayer().setAxisScale(Layer.Left, 1e-8, 100.0, Layer.Log10)
base_graph.activeLayer().setAxisScale(Layer.Left, _Imin * 0.1, _Imax * 10, Layer.Log10)
base_graph.activeLayer().setAxisScale(Layer.Bottom, Qmin * 0.9, Qmax * 1.1, Layer.Log10)
base_graph.activeLayer().setAutoScale()
......
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