Mantid
|
#include <ProjectSaveModel.h>
Public Member Functions | |
std::vector< std::string > | getAllPythonInterfaces () const |
Return the list of python interfaces that can be saved. More... | |
virtual size_t | getProjectSize (const std::vector< std::string > &wsNames) |
Find the size of a project from a list of workspace names. More... | |
std::vector< MantidQt::API::IProjectSerialisable * > | getUniqueWindows (const std::vector< std::string > &wsNames) const |
Get all window handles for a collection of workspace names. More... | |
std::vector< WindowInfo > | getWindowInformation (const std::vector< std::string > &wsNames, bool includeUnattached=false) const |
Get all window information for a collection of workspaces. More... | |
std::vector< std::string > | getWindowNames (const std::vector< std::string > &wsNames) const |
Get all window names for a collection of workspace names. More... | |
std::vector< MantidQt::API::IProjectSerialisable * > | getWindows (const std::string &wsName) const |
Get all window handles for this workspace. More... | |
std::vector< WorkspaceInfo > | getWorkspaceInformation () const |
Get all workspace information. More... | |
std::vector< std::string > | getWorkspaceNames () const |
Get all workspace names. More... | |
std::vector< Mantid::API::Workspace_sptr > | getWorkspaces () const |
Get all workspaces from the ADS. More... | |
bool | hasWindows (const std::string &ws) const |
Check if a workspace has any windows attached to it. More... | |
bool | needsSizeWarning (const std::vector< std::string > &wsNames) |
Check if the size of the project is > than the warning size. More... | |
ProjectSaveModel (const std::vector< MantidQt::API::IProjectSerialisable * > &windows, std::vector< std::string > activePythonInterfaces=std::vector< std::string >()) | |
Construct a new model instance with vector of window handles. More... | |
Private Member Functions | |
WindowInfo | makeWindowInfoObject (MantidQt::API::IProjectSerialisable *window) const |
WorkspaceInfo | makeWorkspaceInfoObject (const Mantid::API::Workspace_const_sptr &ws) const |
Create a workspace info object for this workspace. More... | |
Private Attributes | |
std::vector< std::string > | m_activePythonInterfaces |
std::vector< MantidQt::API::IProjectSerialisable * > | m_unattachedWindows |
std::unordered_map< std::string, std::vector< MantidQt::API::IProjectSerialisable * > > | m_workspaceWindows |
Map to hold which windows are associated with a workspace. More... | |
Definition at line 45 of file ProjectSaveModel.h.
ProjectSaveModel::ProjectSaveModel | ( | const std::vector< MantidQt::API::IProjectSerialisable * > & | windows, |
std::vector< std::string > | activePythonInterfaces = std::vector<std::string>() |
||
) |
Construct a new model instance with vector of window handles.
Construct a new model with a list of window handles.
windows | :: vector of handles to windows open in Mantid |
activePythonInterfaces | The list of active Python interfaces |
Definition at line 26 of file ProjectSaveModel.cpp.
References getWorkspaces(), m_unattachedWindows, and m_workspaceWindows.
std::vector< std::string > ProjectSaveModel::getAllPythonInterfaces | ( | ) | const |
Return the list of python interfaces that can be saved.
Get all workspace names in the model.
Definition at line 125 of file ProjectSaveModel.cpp.
References m_activePythonInterfaces.
Referenced by MantidQt::MantidWidgets::ProjectSavePresenter::ProjectSavePresenter().
|
virtual |
Find the size of a project from a list of workspace names.
Get the project size from a list of workspace names.
wsNames | List of workspace names to look up. |
Definition at line 244 of file ProjectSaveModel.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by needsSizeWarning().
std::vector< IProjectSerialisable * > ProjectSaveModel::getUniqueWindows | ( | const std::vector< std::string > & | wsNames | ) | const |
Get all window handles for a collection of workspace names.
Get unique windows for a list of workspace names.
wsNames | :: vector of workspace names to get associated windows for |
Definition at line 72 of file ProjectSaveModel.cpp.
References getWindows(), and rhs.
Referenced by getWindowInformation(), and getWindowNames().
std::vector< WindowInfo > ProjectSaveModel::getWindowInformation | ( | const std::vector< std::string > & | wsNames, |
bool | includeUnattached = false |
||
) | const |
Get all window information for a collection of workspaces.
Get window information for a selection of workspaces.
wsNames | :: vector of workspace names to find associated windows for |
includeUnattached | :: whether to append windows not attached to any workspace |
Definition at line 134 of file ProjectSaveModel.cpp.
References getUniqueWindows(), m_unattachedWindows, and makeWindowInfoObject().
Referenced by MantidQt::MantidWidgets::ProjectSavePresenter::excludeWindowsForUncheckedWorkspace(), MantidQt::MantidWidgets::ProjectSavePresenter::includeWindowsForCheckedWorkspace(), and MantidQt::MantidWidgets::ProjectSavePresenter::ProjectSavePresenter().
std::vector< std::string > ProjectSaveModel::getWindowNames | ( | const std::vector< std::string > & | wsNames | ) | const |
Get all window names for a collection of workspace names.
Get all unique window names for a list of workspaces.
wsNames | :: vector of workspace names to get associated window names for |
Definition at line 96 of file ProjectSaveModel.cpp.
References getUniqueWindows().
Referenced by MantidQt::MantidWidgets::ProjectSavePresenter::excludeWindowsForUncheckedWorkspace(), and MantidQt::MantidWidgets::ProjectSavePresenter::includeWindowsForCheckedWorkspace().
std::vector< IProjectSerialisable * > ProjectSaveModel::getWindows | ( | const std::string & | wsName | ) | const |
Get all window handles for this workspace.
Get windows which are associated with a given workspace name.
wsName | :: the name of the workspace to get window for |
Definition at line 59 of file ProjectSaveModel.cpp.
References hasWindows(), and m_workspaceWindows.
Referenced by getUniqueWindows(), and makeWorkspaceInfoObject().
std::vector< WorkspaceInfo > ProjectSaveModel::getWorkspaceInformation | ( | ) | const |
Get all workspace information.
Get workspace information for all workspaces.
Definition at line 166 of file ProjectSaveModel.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), and makeWorkspaceInfoObject().
Referenced by MantidQt::MantidWidgets::ProjectSavePresenter::ProjectSavePresenter().
std::vector< std::string > ProjectSaveModel::getWorkspaceNames | ( | ) | const |
Get all workspace names.
Get all workspace names in the model.
Definition at line 110 of file ProjectSaveModel.cpp.
References m_workspaceWindows.
Referenced by MantidQt::MantidWidgets::ProjectSavePresenter::ProjectSavePresenter().
std::vector< Workspace_sptr > ProjectSaveModel::getWorkspaces | ( | ) | const |
Get all workspaces from the ADS.
Definition at line 192 of file ProjectSaveModel.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by ProjectSaveModel().
bool ProjectSaveModel::hasWindows | ( | const std::string & | wsName | ) | const |
Check if a workspace has any windows attached to it.
Check is a workspace has any windows associated with it.
wsName | :: the name of workspace |
Definition at line 213 of file ProjectSaveModel.cpp.
References m_workspaceWindows.
Referenced by getWindows().
|
private |
Definition at line 153 of file ProjectSaveModel.cpp.
References MantidQt::API::WindowIcons::getIconID(), MantidQt::API::IProjectSerialisable::getWindowName(), MantidQt::API::IProjectSerialisable::getWindowType(), MantidQt::MantidWidgets::WindowInfo::icon_id, MantidQt::MantidWidgets::WindowInfo::name, and MantidQt::MantidWidgets::WindowInfo::type.
Referenced by getWindowInformation().
|
private |
Create a workspace info object for this workspace.
Definition at line 197 of file ProjectSaveModel.cpp.
References MantidQt::API::WorkspaceIcons::getIconID(), getWindows(), MantidQt::MantidWidgets::WorkspaceInfo::icon_id, MantidQt::MantidWidgets::WorkspaceInfo::name, MantidQt::MantidWidgets::WorkspaceInfo::numWindows, MantidQt::MantidWidgets::WorkspaceInfo::size, and MantidQt::MantidWidgets::WorkspaceInfo::type.
Referenced by getWorkspaceInformation().
bool ProjectSaveModel::needsSizeWarning | ( | const std::vector< std::string > & | wsNames | ) |
Check if the size of the project is > than the warning size.
Check if the project size will be larger than the warning size defined in mantid.properties.
wsNames | A vector of workspace names as strings. |
Definition at line 230 of file ProjectSaveModel.cpp.
References getProjectSize(), and Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by MantidQt::MantidWidgets::ProjectSavePresenter::needsSizeWarning().
|
private |
Definition at line 87 of file ProjectSaveModel.h.
Referenced by getAllPythonInterfaces().
|
private |
Definition at line 86 of file ProjectSaveModel.h.
Referenced by getWindowInformation(), and ProjectSaveModel().
|
private |
Map to hold which windows are associated with a workspace.
Definition at line 84 of file ProjectSaveModel.h.
Referenced by getWindows(), getWorkspaceNames(), hasWindows(), and ProjectSaveModel().