26template <
typename T>
void sortPair(std::pair<T, T> &pair) {
27 if (pair.first > pair.second) {
29 pair.first = pair.second;
35 return AnalysisDataService::Instance().doesExist(workspaceName);
40 return "The group workspace " +
group->getName() +
" is empty.";
44 if (it != std::cend(*
group))
45 return "The group workspace " +
group->getName() +
" contains an invalid workspace.";
68 if (field->text().trimmed().isEmpty()) {
89 QString text = field->text();
90 QValidator::State fieldState = field->validator()->validate(text, dummyPos);
92 if (fieldState == QValidator::Acceptable) {
112 if (workspaceSelector->currentText() ==
"") {
146 bool const autoLoad) {
147 if (!widget->
isValid(autoLoad)) {
163 if (range.second == range.first) {
168 if (range.second < range.first) {
187 if (!(rangeA.second < rangeB.first || rangeB.second < rangeA.first)) {
188 QString message = QString(
"The ranges must not overlap: [%1,%2], [%3,%4].")
211 const QString &innerName, std::pair<double, double> inner) {
215 if (inner.first < outer.first || inner.second > outer.second) {
216 addErrorMessage(outerName.toStdString() +
" must completely enclose " + innerName.toStdString() +
".");
238 addErrorMessage(
"The start of a binning range must be less than the end.");
258 addErrorMessage(
"Bin width must allow for even splitting of the range.");
278 std::stringstream msg;
279 msg <<
name.toStdString() <<
" (" <<
x <<
")"
280 <<
" should not be equal to " <<
y <<
".";
296 if (workspaceName.isEmpty()) {
301 if (!doesExistInADS(workspaceName.toStdString())) {
329 std::size_t
const &validSize) {
330 if (
workspace->getNumberHistograms() != validSize) {
358 std::size_t
const &validSize) {
359 if (
workspace->x(0).size() != validSize) {
376 if (checkWorkspaceType<WorkspaceGroup>(groupName, inputType,
"WorkspaceGroup", silent)) {
377 if (
auto const group = WorkspaceUtils::getADSWorkspace<WorkspaceGroup>(groupName.toStdString())) {
378 if (
auto const error = containsInvalidWorkspace(
group)) {
395 if (!silent && !
m_errorMessages.contains(QString::fromStdString(message)))
409 return "Please correct the following:\n" +
m_errorMessages.join(
"\n").toStdString();
427 if (errorLabel ==
nullptr)
432 QPalette palette = errorLabel->palette();
433 palette.setColor(errorLabel->foregroundRole(), Qt::red);
434 errorLabel->setPalette(palette);
436 errorLabel->setText(
"*");
438 errorLabel->setText(
"");
442 errorLabel->setVisible(!valid);
IPeaksWorkspace_sptr workspace
double lower
lower and upper bounds on the multiplier, if known
std::shared_ptr< const WorkspaceGroup > WorkspaceGroup_const_sptr
shared pointer to Mantid::API::WorkspaceGroup, pointer to const version
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::string to_string(const wide_integer< Bits, Signed > &n)