Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::CatalogSearch Class Reference

This class defines the interface and functionality for the cataloging system within Mantid. More...

#include <CatalogSearch.h>

Inheritance diagram for MantidQt::MantidWidgets::CatalogSearch:

Public Member Functions

 CatalogSearch (QWidget *parent=nullptr)
 Default constructor.
 
 ~CatalogSearch () override
 Destructor.
 

Private Slots

void advancedSearchChecked ()
 Show the advanced field when checked.
 
void dataFileCheckboxSelected (QTableWidgetItem *item)
 Select/Deselect row when a checkbox is selected.
 
void dataFileRowSelected ()
 Select/Deselect row & check-box when a row is selected.
 
void dateSelected (QDate date)
 Update text field when date is selected.
 
void disableDatafileButtons ()
 Disable load/download buttons if no datafile is selected.
 
void doFilter (const int &index)
 Performs filterDataFileType() for specified filer type.
 
void downloadDataFiles ()
 Downloads selected datFiles to a specified location.
 
void goToInputPage ()
 Populate's result table depending page number input by user.
 
void helpClicked ()
 When the help button is clicked.
 
void hideErrorLabels ()
 Hide the error message labels.
 
void investigationSelected (QTableWidgetItem *item)
 Checks that the investigation is selected and performs investigationClicked.
 
void loadDataFiles ()
 Loads the selected dataFiles into workspaces.
 
void nextPageClicked ()
 Populate the result table, and update the page number.
 
void onFacilityLogin ()
 When the facility login button is clicked.
 
void onReset ()
 Reset all fields when "Reset" is clicked.
 
void openCalendar ()
 Open the DateTime Calendar to select date.
 
void openFacilitySelection ()
 Enables user to select specific facilities that they want to search the catalogs of.
 
void prevPageClicked ()
 
void searchClicked ()
 When the "Search" button is clicked, display "Search results" frame.
 
void selectAllDataFiles (const bool &toggled)
 Selects/deselects ALL rows in dataFile table.
 
void showCatalogSearch ()
 When checked, show the Catalog search frame.
 
void showDataFileInfo ()
 When checked, show the data file info frame.
 
void showErrorLabels (std::map< std::string, std::string > &errors)
 Show the error message labels, including the error message on the tooltips.
 
void showSearchResults ()
 Shows/Hides the "Search results" frame when search results combo box is checked.
 
void sortByFileSize (int column)
 Sort table by file size when certain column is clicked (E.g.
 

Private Member Functions

void addCheckBoxColumn (QTableWidget *table)
 Add a row of checkboxes to the first column of a table.
 
void clearDataFileFrame ()
 Clear "dataFileFrame" when the user tries to search again.
 
void clearSearch (QTableWidget *table, const std::string &workspace)
 Removes data associated with previous search.
 
void clearSearchFrame ()
 Clear the "search" frame when an investigation has been selected.
 
void clearSearchResultFrame ()
 Clear the "search results" frame if no results are returned from search.
 
void correctedToolTip (const std::string &toolTip, QLabel *label)
 
void dateSelected (const std::string &buttonName)
 
void disableDownloadButtonIfArchives (int row)
 Disable the download button if user can access the files locally from the archives.
 
void emboldenTableHeaders (QTableWidget *table)
 Make the headers in the provided table bold.
 
std::unordered_set< std::string > getDataFileExtensions (const Mantid::API::Column_sptr &column)
 Obtain all file extensions from the provided column (dataFileResults -> File name).
 
const std::map< std::string, std::string > getSearchFields ()
 Obtain the users' text input for each search field.
 
int headerIndexByName (QTableWidget *table, const std::string &searchFor)
 Obtain the index of the column in a table that contains a specified name.
 
virtual void initLayout ()
 Initialise the layout.
 
void loadSettings ()
 Read settings from store.
 
void populateDataFileTable ()
 Populates the table from the results of investigationSelected();.
 
void populateDataFileType (const std::unordered_set< std::string > &extensions)
 Add the list of file extensions to the "Filter type..." drop-down.
 
void populateInstrumentBox ()
 Populate the instrument list-box.
 
void populateInvestigationTypeBox ()
 Populate the investigation type list-box.
 
void populateResultTable (int sort_section, Qt::SortOrder sort_order)
 Outputs the results of the query into a table.
 
void populateTable (QTableWidget *table, const Mantid::API::ITableWorkspace_sptr &workspace)
 Populate the provided table with data from the provided workspace.
 
void saveSettings ()
 Save the current state of ICAT for next time.
 
const std::vector< std::pair< int64_t, std::string > > selectedDataFileNames ()
 Obtain the file details (file ID and name) for the file to download.
 
std::string selectedInvestigationSession ()
 Obtain the sessionID for the selected investigation.
 
void setupTable (QTableWidget *table, const size_t &numOfRows, const size_t &numOfColumns)
 Setup table prior to adding data to it, such hiding vertical header.
 
void updateDataFileLabels (QTableWidgetItem *item)
 Updates the dataFile text boxes with relevant info about the selected dataFile.
 
bool validateDates ()
 Checks if start date is greater than end date.
 

Private Attributes

QCalendarWidget * m_calendar
 The calendar widget that will allow the user to select start and end date/times.
 
CatalogSelectorm_catalogSelector
 Access methods of catalog selector GUI, e.g. selected facilities.
 
int m_currentPageNumber
 The current page the user is on in the results window. Used for paging.
 
CheckboxHeaderm_customHeader
 The custom table header with checkbox functionality.
 
QString m_dateButtonName
 The name of the date button the user pressed to open the calendar.
 
QString m_downloadSaveDir
 The directory to save the downloaded dataFiles.
 
CatalogHelperm_icatHelper
 The helper class that accesses ICAT algorithmic functionality.
 
Ui::CatalogSearch m_icatUiForm
 The form generated by QT Designer.
 

Detailed Description

This class defines the interface and functionality for the cataloging system within Mantid.

Author
Jay Rainey
Date
08/10/2013

Definition at line 28 of file CatalogSearch.h.

Constructor & Destructor Documentation

◆ CatalogSearch()

MantidQt::MantidWidgets::CatalogSearch::CatalogSearch ( QWidget *  parent = nullptr)

Default constructor.

◆ ~CatalogSearch()

MantidQt::MantidWidgets::CatalogSearch::~CatalogSearch ( )
override

Destructor.

Member Function Documentation

◆ addCheckBoxColumn()

void MantidQt::MantidWidgets::CatalogSearch::addCheckBoxColumn ( QTableWidget *  table)
private

Add a row of checkboxes to the first column of a table.

◆ advancedSearchChecked

void MantidQt::MantidWidgets::CatalogSearch::advancedSearchChecked ( )
privateslot

Show the advanced field when checked.

◆ clearDataFileFrame()

void MantidQt::MantidWidgets::CatalogSearch::clearDataFileFrame ( )
private

Clear "dataFileFrame" when the user tries to search again.

◆ clearSearch()

void MantidQt::MantidWidgets::CatalogSearch::clearSearch ( QTableWidget *  table,
const std::string &  workspace 
)
private

Removes data associated with previous search.

◆ clearSearchFrame()

void MantidQt::MantidWidgets::CatalogSearch::clearSearchFrame ( )
private

Clear the "search" frame when an investigation has been selected.

◆ clearSearchResultFrame()

void MantidQt::MantidWidgets::CatalogSearch::clearSearchResultFrame ( )
private

Clear the "search results" frame if no results are returned from search.

◆ correctedToolTip()

void MantidQt::MantidWidgets::CatalogSearch::correctedToolTip ( const std::string &  toolTip,
QLabel *  label 
)
private

◆ dataFileCheckboxSelected

void MantidQt::MantidWidgets::CatalogSearch::dataFileCheckboxSelected ( QTableWidgetItem *  item)
privateslot

Select/Deselect row when a checkbox is selected.

◆ dataFileRowSelected

void MantidQt::MantidWidgets::CatalogSearch::dataFileRowSelected ( )
privateslot

Select/Deselect row & check-box when a row is selected.

◆ dateSelected() [1/2]

void MantidQt::MantidWidgets::CatalogSearch::dateSelected ( const std::string &  buttonName)
private

◆ dateSelected [2/2]

void MantidQt::MantidWidgets::CatalogSearch::dateSelected ( QDate  date)
privateslot

Update text field when date is selected.

◆ disableDatafileButtons

void MantidQt::MantidWidgets::CatalogSearch::disableDatafileButtons ( )
privateslot

Disable load/download buttons if no datafile is selected.

◆ disableDownloadButtonIfArchives()

void MantidQt::MantidWidgets::CatalogSearch::disableDownloadButtonIfArchives ( int  row)
private

Disable the download button if user can access the files locally from the archives.

◆ doFilter

void MantidQt::MantidWidgets::CatalogSearch::doFilter ( const int &  index)
privateslot

Performs filterDataFileType() for specified filer type.

◆ downloadDataFiles

void MantidQt::MantidWidgets::CatalogSearch::downloadDataFiles ( )
privateslot

Downloads selected datFiles to a specified location.

◆ emboldenTableHeaders()

void MantidQt::MantidWidgets::CatalogSearch::emboldenTableHeaders ( QTableWidget *  table)
private

Make the headers in the provided table bold.

◆ getDataFileExtensions()

std::unordered_set< std::string > MantidQt::MantidWidgets::CatalogSearch::getDataFileExtensions ( const Mantid::API::Column_sptr column)
private

Obtain all file extensions from the provided column (dataFileResults -> File name).

◆ getSearchFields()

const std::map< std::string, std::string > MantidQt::MantidWidgets::CatalogSearch::getSearchFields ( )
private

Obtain the users' text input for each search field.

◆ goToInputPage

void MantidQt::MantidWidgets::CatalogSearch::goToInputPage ( )
privateslot

Populate's result table depending page number input by user.

◆ headerIndexByName()

int MantidQt::MantidWidgets::CatalogSearch::headerIndexByName ( QTableWidget *  table,
const std::string &  searchFor 
)
private

Obtain the index of the column in a table that contains a specified name.

◆ helpClicked

void MantidQt::MantidWidgets::CatalogSearch::helpClicked ( )
privateslot

When the help button is clicked.

◆ hideErrorLabels

void MantidQt::MantidWidgets::CatalogSearch::hideErrorLabels ( )
privateslot

Hide the error message labels.

◆ initLayout()

virtual void MantidQt::MantidWidgets::CatalogSearch::initLayout ( )
privatevirtual

Initialise the layout.

◆ investigationSelected

void MantidQt::MantidWidgets::CatalogSearch::investigationSelected ( QTableWidgetItem *  item)
privateslot

Checks that the investigation is selected and performs investigationClicked.

◆ loadDataFiles

void MantidQt::MantidWidgets::CatalogSearch::loadDataFiles ( )
privateslot

Loads the selected dataFiles into workspaces.

◆ loadSettings()

void MantidQt::MantidWidgets::CatalogSearch::loadSettings ( )
private

Read settings from store.

◆ nextPageClicked

void MantidQt::MantidWidgets::CatalogSearch::nextPageClicked ( )
privateslot

Populate the result table, and update the page number.

◆ onFacilityLogin

void MantidQt::MantidWidgets::CatalogSearch::onFacilityLogin ( )
privateslot

When the facility login button is clicked.

◆ onReset

void MantidQt::MantidWidgets::CatalogSearch::onReset ( )
privateslot

Reset all fields when "Reset" is clicked.

◆ openCalendar

void MantidQt::MantidWidgets::CatalogSearch::openCalendar ( )
privateslot

Open the DateTime Calendar to select date.

◆ openFacilitySelection

void MantidQt::MantidWidgets::CatalogSearch::openFacilitySelection ( )
privateslot

Enables user to select specific facilities that they want to search the catalogs of.

◆ populateDataFileTable()

void MantidQt::MantidWidgets::CatalogSearch::populateDataFileTable ( )
private

Populates the table from the results of investigationSelected();.

◆ populateDataFileType()

void MantidQt::MantidWidgets::CatalogSearch::populateDataFileType ( const std::unordered_set< std::string > &  extensions)
private

Add the list of file extensions to the "Filter type..." drop-down.

◆ populateInstrumentBox()

void MantidQt::MantidWidgets::CatalogSearch::populateInstrumentBox ( )
private

Populate the instrument list-box.

◆ populateInvestigationTypeBox()

void MantidQt::MantidWidgets::CatalogSearch::populateInvestigationTypeBox ( )
private

Populate the investigation type list-box.

◆ populateResultTable()

void MantidQt::MantidWidgets::CatalogSearch::populateResultTable ( int  sort_section,
Qt::SortOrder  sort_order 
)
private

Outputs the results of the query into a table.

◆ populateTable()

void MantidQt::MantidWidgets::CatalogSearch::populateTable ( QTableWidget *  table,
const Mantid::API::ITableWorkspace_sptr workspace 
)
private

Populate the provided table with data from the provided workspace.

◆ prevPageClicked

void MantidQt::MantidWidgets::CatalogSearch::prevPageClicked ( )
privateslot

◆ saveSettings()

void MantidQt::MantidWidgets::CatalogSearch::saveSettings ( )
private

Save the current state of ICAT for next time.

◆ searchClicked

void MantidQt::MantidWidgets::CatalogSearch::searchClicked ( )
privateslot

When the "Search" button is clicked, display "Search results" frame.

◆ selectAllDataFiles

void MantidQt::MantidWidgets::CatalogSearch::selectAllDataFiles ( const bool &  toggled)
privateslot

Selects/deselects ALL rows in dataFile table.

◆ selectedDataFileNames()

const std::vector< std::pair< int64_t, std::string > > MantidQt::MantidWidgets::CatalogSearch::selectedDataFileNames ( )
private

Obtain the file details (file ID and name) for the file to download.

(Used in downloadDataFiles).

◆ selectedInvestigationSession()

std::string MantidQt::MantidWidgets::CatalogSearch::selectedInvestigationSession ( )
private

Obtain the sessionID for the selected investigation.

◆ setupTable()

void MantidQt::MantidWidgets::CatalogSearch::setupTable ( QTableWidget *  table,
const size_t &  numOfRows,
const size_t &  numOfColumns 
)
private

Setup table prior to adding data to it, such hiding vertical header.

◆ showCatalogSearch

void MantidQt::MantidWidgets::CatalogSearch::showCatalogSearch ( )
privateslot

When checked, show the Catalog search frame.

◆ showDataFileInfo

void MantidQt::MantidWidgets::CatalogSearch::showDataFileInfo ( )
privateslot

When checked, show the data file info frame.

◆ showErrorLabels

void MantidQt::MantidWidgets::CatalogSearch::showErrorLabels ( std::map< std::string, std::string > &  errors)
privateslot

Show the error message labels, including the error message on the tooltips.

◆ showSearchResults

void MantidQt::MantidWidgets::CatalogSearch::showSearchResults ( )
privateslot

Shows/Hides the "Search results" frame when search results combo box is checked.

◆ sortByFileSize

void MantidQt::MantidWidgets::CatalogSearch::sortByFileSize ( int  column)
privateslot

Sort table by file size when certain column is clicked (E.g.

"File size" row).

◆ updateDataFileLabels()

void MantidQt::MantidWidgets::CatalogSearch::updateDataFileLabels ( QTableWidgetItem *  item)
private

Updates the dataFile text boxes with relevant info about the selected dataFile.

◆ validateDates()

bool MantidQt::MantidWidgets::CatalogSearch::validateDates ( )
private

Checks if start date is greater than end date.

Member Data Documentation

◆ m_calendar

QCalendarWidget* MantidQt::MantidWidgets::CatalogSearch::m_calendar
private

The calendar widget that will allow the user to select start and end date/times.

Definition at line 187 of file CatalogSearch.h.

◆ m_catalogSelector

CatalogSelector* MantidQt::MantidWidgets::CatalogSearch::m_catalogSelector
private

Access methods of catalog selector GUI, e.g. selected facilities.

Definition at line 191 of file CatalogSearch.h.

◆ m_currentPageNumber

int MantidQt::MantidWidgets::CatalogSearch::m_currentPageNumber
private

The current page the user is on in the results window. Used for paging.

Definition at line 195 of file CatalogSearch.h.

◆ m_customHeader

CheckboxHeader* MantidQt::MantidWidgets::CatalogSearch::m_customHeader
private

The custom table header with checkbox functionality.

Definition at line 182 of file CatalogSearch.h.

◆ m_dateButtonName

QString MantidQt::MantidWidgets::CatalogSearch::m_dateButtonName
private

The name of the date button the user pressed to open the calendar.

Definition at line 180 of file CatalogSearch.h.

◆ m_downloadSaveDir

QString MantidQt::MantidWidgets::CatalogSearch::m_downloadSaveDir
private

The directory to save the downloaded dataFiles.

Definition at line 193 of file CatalogSearch.h.

◆ m_icatHelper

CatalogHelper* MantidQt::MantidWidgets::CatalogSearch::m_icatHelper
private

The helper class that accesses ICAT algorithmic functionality.

Definition at line 189 of file CatalogSearch.h.

◆ m_icatUiForm

Ui::CatalogSearch MantidQt::MantidWidgets::CatalogSearch::m_icatUiForm
private

The form generated by QT Designer.

Definition at line 184 of file CatalogSearch.h.


The documentation for this class was generated from the following file: