Mantid
Loading...
Searching...
No Matches
FindFilesWorker.h
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 +
7#pragma once
8
10
11#include <QObject>
12#include <QRunnable>
13#include <QString>
14#include <qmetatype.h>
15#include <string>
16#include <vector>
17
18namespace MantidQt {
19namespace API {
20
29 std::string searchText;
35 std::string algorithmName;
37 std::string algorithmProperty;
39 std::vector<std::string> extensions;
40};
41
50 std::string error;
52 std::vector<std::string> filenames;
54 std::string valueForProperty;
55};
56
60class EXPORT_OPT_MANTIDQT_COMMON FindFilesWorker : public QObject, public QRunnable {
61 Q_OBJECT
62
63public:
66
67signals:
70 void finished(const FindFilesSearchResults & /*_t1*/);
71
72public slots:
73 void disconnectWorker();
74
75protected:
77 virtual void run() override;
78
79private:
81 void finishSearching(const FindFilesSearchResults &result);
82
85 std::pair<std::vector<std::string>, std::string> getFilesFromAlgorithm();
87 FindFilesSearchResults createFindFilesSearchResult(const std::string &error,
88 const std::vector<std::string> &filenames,
89 const std::string &valueForProperty);
92};
93
94} // namespace API
95} // namespace MantidQt
96
97// Add to Qt's meta type system. This allows the type
98// to be passed between signals & slots
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
double error
Definition: IndexPeaks.cpp:133
A class to allow the asynchronous finding of files.
FindFilesSearchParameters m_parameters
Struct to hold the parameters of the search.
void finished(const FindFilesSearchResults &)
Signal emitted after the search is finished, regardless of whether any file was found.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
POD struct to hold details about the parameters of a file search.
bool isForRunFiles
Whether the search is for experimental run data.
std::string algorithmName
The name of the algorithm to load files with.
std::vector< std::string > extensions
any additional extensions that we want to consider
bool isOptional
Whether the search is optional (i.e. a failed search means no error).
std::string algorithmProperty
The name of the property on the algorithm to use for searching.
std::string searchText
The text to use as a hint to search for files.
POD struct to hold details about the results of a file search.
std::vector< std::string > filenames
A list of filenames that matched the search hint.
std::string valueForProperty
The value to set the algorithm property to.
std::string error
A string repsresenting the error message. Empty if the search succeded.