Mantid
Loading...
Searching...
No Matches
CatalogSearch.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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
9#include "DllOption.h"
14#include "ui_CatalogSearch.h"
15
16#include <QCalendarWidget>
17
18namespace MantidQt {
19namespace MantidWidgets {
29 Q_OBJECT
30
31public:
33 CatalogSearch(QWidget *parent = nullptr);
35 ~CatalogSearch() override;
36
37private:
39 virtual void initLayout();
41 void emboldenTableHeaders(QTableWidget *table);
43 void setupTable(QTableWidget *table, const size_t &numOfRows, const size_t &numOfColumns);
45 void populateTable(QTableWidget *table, const Mantid::API::ITableWorkspace_sptr &workspace);
47 void clearSearch(QTableWidget *table, const std::string &workspace);
49 void clearSearchFrame();
51 void clearSearchResultFrame();
53 void clearDataFileFrame();
55 int headerIndexByName(QTableWidget *table, const std::string &searchFor);
57 void saveSettings();
59 void loadSettings();
60
62 // Methods for: "Catalog Search"
64
65 void dateSelected(const std::string &buttonName);
67 void populateInstrumentBox();
69 void populateInvestigationTypeBox();
71 const std::map<std::string, std::string> getSearchFields();
73 bool validateDates();
74
76 // Methods for: "Search results"
78
80 void populateResultTable(int sort_section, Qt::SortOrder sort_order);
82 std::string selectedInvestigationSession();
83
85 // Methods for: "Datafile information"
87
89 void populateDataFileTable();
91 void addCheckBoxColumn(QTableWidget *table);
94 const std::vector<std::pair<int64_t, std::string>> selectedDataFileNames();
97 void updateDataFileLabels(QTableWidgetItem *item);
100 std::unordered_set<std::string> getDataFileExtensions(const Mantid::API::Column_sptr &column);
102 void populateDataFileType(const std::unordered_set<std::string> &extensions);
105 void disableDownloadButtonIfArchives(int row);
106
107private slots:
109 void onFacilityLogin();
111 void helpClicked();
113 void showCatalogSearch();
116 void showSearchResults();
118 void showDataFileInfo();
119
121 // SLOTS for: "Catalog Search"
123
125 void openCalendar();
127 void dateSelected(QDate date);
129 void advancedSearchChecked();
131 void searchClicked();
134 void showErrorLabels(std::map<std::string, std::string> &errors);
136 void hideErrorLabels();
138 void onReset();
141 void openFacilitySelection();
142
144 // SLOTS for: "Search results"
146
148 void nextPageClicked();
149 void prevPageClicked();
151 void goToInputPage();
154 void investigationSelected(QTableWidgetItem *item);
155
157 // SLOTS for: "Datafile information"
159
161 void disableDatafileButtons();
163 void doFilter(const int &index);
165 void downloadDataFiles();
167 void loadDataFiles();
169 void selectAllDataFiles(const bool &toggled);
171 void dataFileCheckboxSelected(QTableWidgetItem *item);
173 void dataFileRowSelected();
176 void sortByFileSize(int column);
177
178private:
184 Ui::CatalogSearch m_icatUiForm;
187 QCalendarWidget *m_calendar;
196 // Ensure tooltip uses visible color on current OS
197 void correctedToolTip(const std::string &toolTip, QLabel *label);
198};
199} // namespace MantidWidgets
200} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
This class defines the interface and functionality for the cataloging system within Mantid.
Definition: CatalogSearch.h:28
CatalogSelector * m_catalogSelector
Access methods of catalog selector GUI, e.g. selected facilities.
CatalogHelper * m_icatHelper
The helper class that accesses ICAT algorithmic functionality.
QString m_dateButtonName
The name of the date button the user pressed to open the calendar.
QCalendarWidget * m_calendar
The calendar widget that will allow the user to select start and end date/times.
QString m_downloadSaveDir
The directory to save the downloaded dataFiles.
Ui::CatalogSearch m_icatUiForm
The form generated by QT Designer.
~CatalogSearch() override
Destructor.
void dateSelected(const std::string &buttonName)
int m_currentPageNumber
The current page the user is on in the results window. Used for paging.
CheckboxHeader * m_customHeader
The custom table header with checkbox functionality.
This class subclasses and overwrites QHeaderView methods to enable checkboxes to exist in the table h...
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< Column > Column_sptr
Definition: Column.h:228
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace