Mantid
Loading...
Searching...
No Matches
SequentialFitDialog.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9#include "MantidAPI/Axis.h"
13#include "MantidAPI/Run.h"
14#include "MantidAPI/TableRow.h"
15#include "MantidAPI/TextAxis.h"
24
25#include <Poco/ActiveResult.h>
26
27#include <QCoreApplication>
28#include <QFileDialog>
29#include <QInputDialog>
30#include <QMessageBox>
31#include <QUrl>
32
33namespace MantidQt {
34using API::HelpWindow;
35
36namespace {
37Mantid::Kernel::Logger g_log("SequentialFitDialog");
38}
39
40namespace MantidWidgets {
41
46 : MantidDialog(fitBrowser), m_fitBrowser(fitBrowser) {
47 ui.setupUi(this);
48
49 connect(ui.btnAddFile, SIGNAL(clicked()), this, SLOT(addFile()));
50 connect(ui.btnAddWorkspace, SIGNAL(clicked()), this, SLOT(addWorkspace()));
51 connect(ui.btnDelete, SIGNAL(clicked()), this, SLOT(removeItem()));
52
53 connect(ui.btnFit, SIGNAL(clicked()), this, SLOT(accept()));
54 connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
55 connect(ui.btnHelp, SIGNAL(clicked()), this, SLOT(helpClicked()));
56 connect(ui.ckbLogPlot, SIGNAL(toggled(bool)), this, SLOT(plotAgainstLog(bool)));
57 connect(ui.ckCreateOutput, SIGNAL(toggled(bool)), ui.ckOutputCompMembers, SLOT(setEnabled(bool)));
58 connect(ui.ckCreateOutput, SIGNAL(toggled(bool)), ui.ckConvolveMembers, SLOT(setEnabled(bool)));
59 connect(ui.ckCreateOutput, SIGNAL(toggled(bool)), ui.ckOutputSpecParams, SLOT(setEnabled(bool)));
60
61 ui.cbLogValue->setEditable(true);
62 ui.ckbLogPlot->setChecked(true);
63 ui.sbPeriod->setValue(1);
64
66
67 connect(fitBrowser, SIGNAL(functionChanged()), this, SLOT(functionChanged()));
68
69 // When a fit is completed finishHandle is called which emits needShowPlot
70 if (mantidui != nullptr) {
71 connect(this, SIGNAL(needShowPlot(Ui::SequentialFitDialog *, MantidQt::MantidWidgets::FitPropertyBrowser *)),
72 mantidui,
73 SLOT(showSequentialPlot(Ui::SequentialFitDialog *, MantidQt::MantidWidgets::FitPropertyBrowser *)));
74 }
75 connect(ui.tWorkspaces, SIGNAL(cellChanged(int, int)), this, SLOT(spectraChanged(int, int)));
76 connect(ui.tWorkspaces, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
78} // namespace MantidWidgets
79
82 new SelectWorkspacesDialog(this, "MatrixWorkspace", "", QAbstractItemView::ExtendedSelection);
83 if (dlg->exec() == QDialog::Accepted) {
85 }
86}
87
88bool SequentialFitDialog::addWorkspaces(const QStringList &wsNames) {
89 if (wsNames.isEmpty())
90 return false;
91 int row = ui.tWorkspaces->rowCount();
92 ui.tWorkspaces->model()->insertRows(row, wsNames.size());
93 int wi = m_fitBrowser->workspaceIndex();
94 QAbstractItemModel *model = ui.tWorkspaces->model();
95 foreach (QString wsName, wsNames) {
96 model->setData(model->index(row, 0, QModelIndex()), wsName);
97
98 if (row == 0) {
99 ui.ckbLogPlot->setChecked(validateLogs(wsName));
100 }
101
102 // disable the period cell
103 model->setData(model->index(row, 1, QModelIndex()), "");
104 QTableWidgetItem *item = ui.tWorkspaces->item(row, 1);
105 if (item) {
106 item->setBackground(QColor(Qt::lightGray));
107 item->setFlags(Qt::NoItemFlags);
108 }
109
110 if (ui.ckbLogPlot->isChecked()) {
111 // set spectrum number corresponding to the workspace index
112 Mantid::API::MatrixWorkspace_sptr ws = std::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
113 Mantid::API::AnalysisDataService::Instance().retrieve(wsName.toStdString()));
114 int spec = -1;
115 if (ws) {
116 const auto y = ws->getAxis(1);
117 if (y->isSpectra()) {
118 spec = y->spectraNo(wi);
119 }
120 }
121 // model->setData(model->index(row,2,QModelIndex()),spec);
122 setSpectrum(row, spec);
123 if (row == 0) {
124 ui.sbSpectrum->setValue(spec);
125 }
126
127 // set workspace index
128 // model->setData(model->index(row,3,QModelIndex()),wi);
129 setWSIndex(row, wi);
130 }
131 ++row;
132 }
133 ui.tWorkspaces->resizeRowsToContents();
134 ui.tWorkspaces->resizeColumnsToContents();
135 return true;
136}
137
139 QFileDialog dlg(this);
140 dlg.setFileMode(QFileDialog::ExistingFiles);
141 const std::vector<std::string> &searchDirs = Mantid::Kernel::ConfigService::Instance().getDataSearchDirs();
142 QString dir;
143 if (searchDirs.empty()) {
144 dir = "";
145 } else {
146 dir = QString::fromStdString(searchDirs.front());
147 }
148 dlg.setDirectory(dir);
149 if (dlg.exec()) {
150 QStringList fileNames;
151 fileNames = dlg.selectedFiles();
152 if (fileNames.isEmpty())
153 return;
154 fileNames.sort();
155
156 int row = ui.tWorkspaces->rowCount();
157 ui.tWorkspaces->model()->insertRows(row, fileNames.size());
158 // int wi = m_fitBrowser->workspaceIndex();
159 QAbstractItemModel *model = ui.tWorkspaces->model();
160 foreach (QString fileName, fileNames) {
161 model->setData(model->index(row, 0, QModelIndex()), fileName); // file name
162 model->setData(model->index(row, 1, QModelIndex()),
163 ui.sbPeriod->value()); // period
164 model->setData(model->index(row, 2, QModelIndex()),
165 ui.sbSpectrum->value()); // spectrum
166 model->setData(model->index(row, 3, QModelIndex()), ""); // ws index
167 QTableWidgetItem *item = ui.tWorkspaces->item(row, 3);
168 if (item) {
169 item->setBackground(QColor(Qt::lightGray));
170 item->setFlags(Qt::NoItemFlags);
171 }
172 ++row;
173 }
174 ui.tWorkspaces->resizeRowsToContents();
175 ui.tWorkspaces->resizeColumnsToContents();
176 }
177}
178
180 QList<QTableWidgetSelectionRange> ranges = ui.tWorkspaces->selectedRanges();
181 while (!ranges.empty()) {
182 ui.tWorkspaces->model()->removeRows(ranges[0].topRow(), ranges[0].rowCount());
183 ranges = ui.tWorkspaces->selectedRanges();
184 }
185}
186
187bool SequentialFitDialog::validateLogs(const QString &wsName) {
188 Mantid::API::MatrixWorkspace_sptr ws = std::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
189 Mantid::API::AnalysisDataService::Instance().retrieve(wsName.toStdString()));
190 if (ws) {
191 const std::vector<Mantid::Kernel::Property *> logs = ws->run().getLogData();
192 QStringList logNames;
193 // add the option that displays workspace names
194 logNames << "SourceName";
195 for (auto log : logs) {
198 if (!p)
199 continue;
200 logNames << QString::fromStdString(log->name());
201 }
202 int n = ui.cbLogValue->count();
203 // if the ws has no logs - do not include it
204 if (logNames.empty()) {
205 return false;
206 }
207 // if the log value combo box is empty fill it in with the log names from ws
208 if (n == 0) {
209 ui.cbLogValue->insertItems(0, logNames);
210 } else { // keep only those logs which are included in both ui.cbLogValue
211 // and logNames
212 QStringList namesToRemove;
213 for (int i = 0; i < n; ++i) {
214 QString logName = ui.cbLogValue->itemText(i);
215 if (!logNames.contains(logName)) {
216 namesToRemove << logName;
217 }
218 }
219 foreach (QString logName, namesToRemove) {
220 int i = ui.cbLogValue->findText(logName);
221 if (i >= 0) {
222 ui.cbLogValue->removeItem(i);
223 }
224 }
225 if (ui.cbLogValue->count() == 0) {
226 QMessageBox::warning(m_fitBrowser, QCoreApplication::applicationName() + " Warning",
227 "The list of the log names is empty:\n"
228 "The selected workspaces do not have common logs");
229 return false;
230 }
231 }
232 }
233 return true;
234}
235
236bool SequentialFitDialog::isFile(int row) const {
237 QTableWidgetItem *item = ui.tWorkspaces->item(row, 3);
238 return !item || item->flags().testFlag(Qt::ItemIsEnabled) == false;
239}
240
241bool SequentialFitDialog::isValidRangeFormat(const QString &range) const {
242 // Check if range contains exactly one colon
243 int colonCount = range.count(':');
244 if (colonCount != 1) {
245 return false;
246 }
247
248 // Split by colon and validate both parts
249 QStringList parts = range.split(':');
250 if (parts.size() != 2) {
251 return false;
252 }
253
254 QString start = parts[0].trimmed();
255 QString end = parts[1].trimmed();
256
257 // Check that both parts are not empty
258 if (start.isEmpty() || end.isEmpty()) {
259 return false;
260 }
261
262 // Validate that both parts are numeric
263 bool startOk, endOk;
264 double startVal = start.toDouble(&startOk);
265 double endVal = end.toDouble(&endOk);
266
267 if (!startOk || !endOk) {
268 return false;
269 }
270
271 // Check that start <= end
272 if (startVal > endVal) {
273 return false;
274 }
275
276 return true;
277}
278
284QString SequentialFitDialog::getIndex(int row) const {
285 QString index;
286 QString spectrum = ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(row, 2)).toString();
287 QString wsIndex = ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(row, 3)).toString();
288 QString range = ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(row, 4)).toString();
289
290 if (!isValidRangeFormat(range)) {
291 g_log.error() << "Invaild range please use the format start:end." << std::endl;
292 return "";
293 }
294
295 if (isFile(row)) {
296 // if it is a file the ndex can be either spectrum or a range of values
297 // range takes priority over spectrum
298 if (!range.isEmpty()) {
299 index = "v" + range;
300 } else {
301 index = "sp" + spectrum;
302 }
303 } else {
304 Mantid::API::MatrixWorkspace_sptr ws = std::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
305 Mantid::API::AnalysisDataService::Instance().retrieve(name(row).toStdString()));
306 Mantid::API::Axis *y = ws->getAxis(1);
307
308 // if it is a single workspace index can only be a range since we are doing
309 // a multiple fitting
310 if (rowCount() == 1 && range.isEmpty()) {
311 index = QString("v%1:%2").arg((*y)(0)).arg((*y)(y->length() - 1));
312 } else {
313 if (!range.isEmpty()) {
314 index = "v" + range;
315 } else {
316 index = "i" + wsIndex;
317 }
318 }
319 }
320
321 return index;
322}
323
325 QStringList inputStr;
326 for (int i = 0; i < ui.tWorkspaces->rowCount(); ++i) {
327 QString wsName = ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(i, 0)).toString();
328 auto index = getIndex(i);
329 if (index.isEmpty())
330 return;
331 QString parStr = wsName + "," + index;
332 if (isFile(i)) { // add the period
333 parStr += QString(",") + ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(i, 1)).toString();
334 }
335 inputStr << parStr;
336 }
337 std::string funStr;
338 if (m_fitBrowser->m_compositeFunction->nFunctions() > 1) {
339 funStr = m_fitBrowser->m_compositeFunction->asString();
340 } else {
341 funStr = (m_fitBrowser->m_compositeFunction->getFunction(0))->asString();
342 }
343
346 m_outputName += "_res";
347 }
348
349 Mantid::API::IAlgorithm_sptr alg = Mantid::API::AlgorithmManager::Instance().create("PlotPeakByLogValue");
350 alg->initialize();
351 std::string inputStdStr = inputStr.join(";").toStdString();
352 alg->setPropertyValue("Input", inputStdStr);
353 alg->setProperty("WorkspaceIndex", m_fitBrowser->workspaceIndex());
354 // Create an array property of start and end X times, each pair startX[i]
355 // endX[i] will be used for the ith fit.
356 // At the moment we read the startX and endX from the single entry in the fit
357 // browser - and duplicate it for each input
358 auto nInputs = rowCount();
359 auto startX = m_fitBrowser->startX();
360 auto endX = m_fitBrowser->endX();
361 alg->setProperty("StartX", std::vector<double>(nInputs, startX));
362 alg->setProperty("EndX", std::vector<double>(nInputs, endX));
363 alg->setPropertyValue("OutputWorkspace", m_outputName);
364 alg->setPropertyValue("Function", funStr);
365 alg->setProperty("CreateOutput", ui.ckCreateOutput->isChecked());
366 alg->setProperty("OutputCompositeMembers", ui.ckOutputCompMembers->isChecked());
367 alg->setProperty("ConvolveMembers", ui.ckConvolveMembers->isChecked());
368 alg->setProperty("Output2D", ui.ckOutputSpecParams->isChecked());
369 alg->setProperty("AppendIdxToOutputName", true);
370 if (ui.ckbLogPlot->isChecked()) {
371 std::string logName = ui.cbLogValue->currentText().toStdString();
372 alg->setPropertyValue("LogValue", logName);
373 observeFinish(alg);
374 } else if (nInputs > 1) {
375 alg->setPropertyValue("LogValue", "SourceName");
376 } else {
377 observeFinish(alg);
378 }
379 alg->setPropertyValue("Minimizer", m_fitBrowser->minimizer());
380 alg->setPropertyValue("CostFunction", m_fitBrowser->costFunction());
381 alg->setProperty("MaxIterations", m_fitBrowser->maxIterations());
382 if (ui.rbIndividual->isChecked()) {
383 alg->setPropertyValue("FitType", "Individual");
384 }
386 alg->setProperty("EvaluationType", "Histogram");
387 }
388
389 bool passWSIndexToFunction = ui.ckbPassWS->isChecked();
390 alg->setProperty("PassWSIndexToFunction", passWSIndexToFunction);
391
392 auto errors = alg->validateInputs();
393
394 if (!errors.empty()) {
395 for (const auto &[key, error] : errors) {
396 g_log.error() << error << std::endl;
397 }
398 return;
399 }
400
401 alg->executeAsync();
402 QDialog::accept();
403}
404
406 QStringList names;
407 for (size_t i = 0; i < m_fitBrowser->m_compositeFunction->nParams(); ++i) {
408 names << QString::fromStdString(m_fitBrowser->m_compositeFunction->parameterName(i));
409 }
410 ui.cbParameter->clear();
411 ui.cbParameter->insertItems(0, names);
412}
413
415
421
427 auto wsName = m_outputName;
428 if (!Mantid::API::AnalysisDataService::Instance().doesExist(wsName)) {
429 return;
430 }
431 Mantid::API::ITableWorkspace_sptr ws = std::dynamic_pointer_cast<Mantid::API::ITableWorkspace>(
432 Mantid::API::AnalysisDataService::Instance().retrieve(wsName));
433 if (!ws) {
434 return;
435 }
436 auto columnNames = ws->getColumnNames();
437
438 size_t rowNo = 0;
439 if (rowCount() > 1 && columnNames[0] == "SourceName") {
440 // first column contains ws names (only if the log value is SourceName)
441 // otherwise, the first column contains the values of the log value and
442 // cannot compare workspace names
443 auto firstColumn = ws->getColumn(0);
444 for (size_t i = 0; i < ws->rowCount(); ++i) {
445 if (firstColumn->cell<std::string>(i) == m_fitBrowser->workspaceName()) {
446 rowNo = i;
447 break;
448 }
449 }
450 } else {
451 // first column contains log names or axis-1
453 if (index < ws->rowCount()) {
454 rowNo = index;
455 }
456 }
457
458 Mantid::API::TableRow row = ws->getRow(rowNo);
459 // results parameter table contains parameter value followed by its error so
460 // increment by 2 for each value. Ignore first and last column in row as they
461 // contain name and chi-squared. Also ignore columns that aren't fitting parameters.
462 for (size_t col = 1; col < columnNames.size() - 1; col += 2) {
463 auto value = row.Double(col);
464 auto error = row.Double(col + 1);
465 auto paramName = columnNames[col];
466 // In case of a single function Fit doesn't create a CompositeFunction
467 if (m_fitBrowser->count() == 1) {
468 paramName.insert(0, "f0.");
469 }
470 if (m_fitBrowser->compositeFunction()->hasParameter(paramName)) {
471 size_t paramIndex = m_fitBrowser->compositeFunction()->parameterIndex(paramName);
472
473 m_fitBrowser->compositeFunction()->setParameter(paramIndex, value);
474 m_fitBrowser->compositeFunction()->setError(paramIndex, error);
475 }
476 }
479}
480
481void SequentialFitDialog::helpClicked() { HelpWindow::showAlgorithm(QStringLiteral("PlotPeakByLogValue")); }
482
491 if (!ui.ckbLogPlot->isChecked())
492 return;
493 QTableWidgetItem *item = ui.tWorkspaces->item(row, 3);
494 if (!item)
495 return;
496 if ((col == 2 || col == 3) && item->flags().testFlag(Qt::ItemIsEnabled) == true) { // it's a workspace
497 QString wsName = ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(row, 0)).toString();
499 try {
500 ws = std::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
501 Mantid::API::AnalysisDataService::Instance().retrieve(wsName.toStdString()));
502 } catch (...) { //
503 return;
504 }
505 if (!ws)
506 return;
507 int wi = ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(row, 3)).toInt();
508 int spec = ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(row, 2)).toInt();
509 Mantid::API::Axis *y = ws->getAxis(1);
510 if (wi >= 0 && wi < static_cast<int>(ws->getNumberHistograms())) {
511 // this prevents infinite loops
512 if (!y->isSpectra() || y->spectraNo(wi) == spec)
513 return;
514 } else {
515 // return to the previous state
516 col = 2;
517 }
518 if (col == 3) // changed workspace index
519 {
520 try {
521 spec = y->spectraNo(wi);
522 // ui.tWorkspaces->model()->setData(ui.tWorkspaces->model()->index(row,2),spec);
523 setSpectrum(row, spec);
524 } catch (...) {
525 // return to the previous state
526 col = 2;
527 }
528 }
529 if (col == 2) // changed spectrum number
530 {
531 for (int i = 0; i < static_cast<int>(y->length()); ++i) {
532 if ((*y)(i) == spec) {
533 // ui.tWorkspaces->model()->setData(ui.tWorkspaces->model()->index(row,3),i);
534 setWSIndex(row, i);
535 return;
536 }
537 }
538 try {
539 // ui.tWorkspaces->model()->setData(ui.tWorkspaces->model()->index(row,2),(*y)(0));
540 setSpectrum(row, int((*y)(0)));
541 } catch (...) {
542 }
543 }
544 }
545}
546
547void SequentialFitDialog::setSpectrum(int row, int spec) {
548 ui.tWorkspaces->model()->setData(ui.tWorkspaces->model()->index(row, 2), spec);
549}
550
551void SequentialFitDialog::setWSIndex(int row, int wi) {
552 ui.tWorkspaces->model()->setData(ui.tWorkspaces->model()->index(row, 3), wi);
553}
554
555int SequentialFitDialog::rowCount() const { return ui.tWorkspaces->rowCount(); }
556
557int SequentialFitDialog::defaultSpectrum() const { return ui.sbSpectrum->value(); }
558
559QString SequentialFitDialog::name(int row) const {
560 return ui.tWorkspaces->model()->data(ui.tWorkspaces->model()->index(row, 0)).toString();
561}
562
563void SequentialFitDialog::setRange(int row, double from, double to) {
564 QString range = QString::number(from) + ":" + QString::number(to);
565 ui.tWorkspaces->model()->setData(ui.tWorkspaces->model()->index(row, 3), range);
566}
567
569 // ui.btnAddFile->setEnabled(yes);
570 // ui.btnAddWorkspace->setEnabled(yes);
571 // ui.btnDelete->setEnabled(yes);
572 ui.lblLogValue->setVisible(yes);
573 ui.cbLogValue->setVisible(yes);
574 ui.lblPeriod->setVisible(yes);
575 ui.sbPeriod->setVisible(yes);
576 ui.lblSpectrum->setVisible(yes);
577 ui.sbSpectrum->setVisible(yes);
578 // if (yes)
579 //{// plot agains log value
580 // ui.tWorkspaces->showColumn(3);
581 // ui.tWorkspaces->horizontalHeaderItem(2)->setData(Qt::DisplayRole,"Spectrum");
582 // int spec = defaultSpectrum();
583 // for(int row = 0; row < rowCount(); ++row)
584 // {
585 // setSpectrum(row,spec);
586 // }
587 //}
588 // else
589 //{// plot against "spectra" axis values
590 // if (rowCount() == 1)
591 // {
592 // ui.tWorkspaces->hideColumn(3);
593 // ui.tWorkspaces->horizontalHeaderItem(2)->setData(Qt::DisplayRole,"Range");
594 // Mantid::API::MatrixWorkspace_sptr ws =
595 // std::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
596 // Mantid::API::AnalysisDataService::Instance().retrieve(name(0).toStdString())
597 // );
598 // Mantid::API::Axis* y = ws->getAxis(1);
599 // setRange(0,(*y)(0),(*y)(y->length()-1));
600 // }
601 //}
602}
603
608 ui.btnDelete->setEnabled(ui.tWorkspaces->selectionModel()->hasSelection());
609}
610} // namespace MantidWidgets
611} // namespace MantidQt
std::string name
Definition Run.cpp:60
double value
The value of the point.
Definition FitMW.cpp:51
double error
std::map< DeltaEMode::Type, std::string > index
static void showAlgorithm(const std::string &name=std::string(), const int version=-1)
Class FitPropertyBrowser implements QtPropertyBrowser to display and control fitting function paramet...
void updateParameters()
Update the function parameters.
bool isHistogramFit() const
Get "HistogramFit" option.
std::shared_ptr< Mantid::API::CompositeFunction > compositeFunction() const
Get Composite Function.
std::string workspaceName() const
Get the input workspace name.
int maxIterations() const
Get the max number of iterations.
std::string minimizer(bool withProperties=false) const
Get the minimizer.
PropertyHandler * getHandler() const
Get handler to the root composite function.
virtual std::string outputName() const
Get the output name.
std::shared_ptr< Mantid::API::CompositeFunction > m_compositeFunction
A copy of the edited function.
std::string costFunction() const
Get the cost function.
void updateErrors()
Set all parameter error values in the manager.
This is a dialog for selecting workspaces.
QStringList getSelectedNames() const
Return the selected names.
SequentialFitDialog(FitPropertyBrowser *fitBrowser, QObject *mantidui)
Default constructor.
void addWorkspace()
Add a workspace to the data list.
void getFitResults()
Set the parameters to the fit outcome.
void needShowPlot(Ui::SequentialFitDialog *, MantidQt::MantidWidgets::FitPropertyBrowser *)
This signal is fired from finishHandle running in the algorithm's thread and caught by showPlot slot ...
bool isFile(int row) const
Return true if data source in a row is a file (rather than a workspace)
void accept() override
Start the fit and close dialog.
void setRange(int row, double from, double to)
void selectionChanged()
called when selection in the workspace table changes
void functionChanged()
Actions in response to change of function.
void finishHandle(const Mantid::API::IAlgorithm *alg) override
Called when the fit is finished.
Ui::SequentialFitDialog ui
The form generated with Qt Designer.
FitPropertyBrowser * m_fitBrowser
Pointer to the calling fit browser.
bool validateLogs(const QString &wsName)
Checks that the logs in workspace wsName are consistent with logs of other workspaces.
void setWSIndex(int row, int wi)
set workspace index for workspace/file in row row
bool isValidRangeFormat(const QString &range) const
Return true if the range format is valid.
void setSpectrum(int row, int spec)
set spectrum value for workspace/file in row row
bool addWorkspaces(const QStringList &wsNames)
Add a list of workspace names to the data list Returns false if neither of the workspaces can be load...
void spectraChanged(int row, int col)
called when spectra or workspace index change
void populateParameters()
Populate parameter combo box with possible parameter names.
void observeFinish(const IAlgorithm_const_sptr &alg)
Connect to algorithm alg and observe its finish notification.
Class to represent the axis of a workspace.
Definition Axis.h:30
virtual specnum_t spectraNo(const std::size_t &index) const
Get the spectrum number.
Definition Axis.cpp:60
IAlgorithm is the interface implemented by the Algorithm base class.
Definition IAlgorithm.h:45
TableRow represents a row in a TableWorkspace.
Definition TableRow.h:39
double & Double(size_t col)
Returns a reference to the element in position col if its type is double.
Definition TableRow.h:137
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition Logger.h:51
void error(const std::string &msg)
Logs at error level.
Definition Logger.cpp:108
A specialised Property class for holding a series of time-value pairs.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Kernel::Logger g_log("DetermineSpinStateOrder")