ccpn.ui.gui package

Subpackages

Submodules

ccpn.ui.gui.Gui module

Module Documentation here

class ccpn.ui.gui.Gui.Gui(application)[source]

Bases: ccpn.ui.Ui.Ui

Top class for the GUI interface

echoCommands(commands: List[str])[source]

Echo commands strings, one by one, to logger and store them in internal list for perusal

getByGid(gid)[source]
initialize(mainWindow)[source]

UI operations done after every project load/create

loadData(*paths, pathFilter=None) list[source]

Loads data from paths; query if none supplied Optionally filter for dataFormat(s) :param *paths: argument list of path’s (str or Path instances) :param pathFilter: keyword argument: list/tuple of dataFormat strings :returns list of loaded objects

loadProject(path=None) Optional[ccpn.core.Project.Project][source]

Loads project defined by path :return a Project instance or None

loadSpectra(*paths) list[source]

Load all the spectra found in paths. Query in case path is empty.

Parameters

paths – list of paths

:return a list of Spectra instances

newProject(name: str = 'default') Optional[ccpn.core.Project.Project][source]

Create a new project instance with name. :return a Project instance or None

saveProject() bool[source]

Save project. :return True if successful

saveProjectAs(newPath=None, overwrite: bool = False) bool[source]

Opens save Project to newPath. Optionally open file dialog. :param newPath: new path to save project (str | Path instance) :param overwrite: flag to indicate overwriting of existing path :return True if successful

startUi()[source]

Start the UI

class ccpn.ui.gui.Gui.MainWindow(project: ccpn.core.Project.Project, wrappedData: ApiWindow)[source]

Bases: ccpn.ui._implementation.Window.Window, ccpn.ui.gui.lib.GuiMainWindow.GuiMainWindow

GUI main window, corresponds to OS window

class ccpn.ui.gui.Gui.SideWindow(project: ccpn.core.Project.Project, wrappedData: ApiWindow)[source]

Bases: ccpn.ui._implementation.Window.Window, ccpn.ui.gui.lib.GuiWindow.GuiWindow

GUI side window, corresponds to OS window

class ccpn.ui.gui.Gui.SpectrumDisplayNd(project: ccpn.core.Project.Project, wrappedData: ApiBoundDisplay)[source]

Bases: ccpn.ui._implementation.SpectrumDisplay.SpectrumDisplay, ccpn.ui.gui.modules.SpectrumDisplayNd.SpectrumDisplayNd

ND bound display

class ccpn.ui.gui.Gui.Strip1d(project: ccpn.core.Project.Project, wrappedData: ApiBoundStrip)[source]

Bases: ccpn.ui._implementation.Strip.Strip, ccpn.ui.gui.lib.GuiStrip1d.GuiStrip1d

1D strip

class ccpn.ui.gui.Gui.StripDisplay1d(project: ccpn.core.Project.Project, wrappedData: ApiBoundDisplay)[source]

Bases: ccpn.ui._implementation.SpectrumDisplay.SpectrumDisplay, ccpn.ui.gui.modules.SpectrumDisplay1d.SpectrumDisplay1d

1D bound display

ccpn.ui.gui.Gui.StripDisplayNd

alias of ccpn.ui.gui.Gui.SpectrumDisplayNd

class ccpn.ui.gui.Gui.StripNd(project: ccpn.core.Project.Project, wrappedData: ApiBoundStrip)[source]

Bases: ccpn.ui._implementation.Strip.Strip, ccpn.ui.gui.lib.GuiStripNd.GuiStripNd

ND strip

ccpn.ui.gui.Gui.qtMessageHandler(*errors)[source]

ccpn.ui.gui.GuiBase module

This file contains Framework-related Gui methods; A first step towards separating them from the Framework class

class ccpn.ui.gui.GuiBase.GuiBase[source]

Bases: object

Just methods taken from Framework for now

ccpn.ui.gui.Layout module

This Module is used to save and restore the gui state of the program. There are several Try except due to the fragility of Pyqtgraph layouts (containairs) and nested hierarchy of docks/areas etc.. The state is saved in a Json file. The default file is autogenerated when firing the program. It gets auto

ccpn.ui.gui.Layout.getLayoutFile(application)[source]
ccpn.ui.gui.Layout.isLayoutFile(filePath)[source]
ccpn.ui.gui.Layout.restoreLayout(mainWindow, layout, restoreSpectrumDisplay=False)[source]
ccpn.ui.gui.Layout.saveLayoutToJson(mainWindow, jsonFilePath=None)[source]
Parameters
  • mainWindow

  • jsonFilePath – User defined file path where to save the layout. Default is in .ccpn/layout/v3Layout.json

Returns

None

ccpn.ui.gui.Layout.updateSavedLayout(mainWindow)[source]

Updates the application.layout Dict :param mainWindow: needed to get application :return: an up to date layout dictionary with the current state of GuiModules

ccpn.ui.gui.LayoutManager module

Layout class and routines for saving/restoring module layouts

There are several Try except due to the fragility of Pyqtgraph layouts (containers) and nested hierarchy of docks/areas etc. The state is saved in a Json file.

Original code by Luca Mureddu Fully refactored by Geerten Vuister; second version for 3.1.0 release

IN_PROGRESS

class ccpn.ui.gui.LayoutManager.LayoutManager(**kwargs)[source]

Bases: ccpn.util.traits.CcpNmrJson.CcpNmrJson

Class that maintains layout settings and save/restore functionality

SpectrumDisplays

Fixing default_value problem

WARNING
classVersion = 3.1
fileNames

Fixing default_value problem

guiModules

Fixing default_value problem

layoutState

Fixing default_value problem

property path

- None, immutable - Path of layout json file in the current project

restoreState(path=None)[source]

Restore the settings from json-file path (defaults to the one in Project/state and use this to restore the mainWindow state

saveState(path=None)[source]

get the state of mainWindow and save to json-file

ccpn.ui.gui.guiSettings module

Settings used in gui modules, widgets and popups

class ccpn.ui.gui.guiSettings.ColourDict(*args, **kwargs)[source]

Bases: dict

Singleton Class to store colours;

setColourScheme(colourScheme)[source]
class ccpn.ui.gui.guiSettings.FontSettings(preferences)[source]

Bases: object

generateFonts(fontName, fontString)[source]
getFont(name='defaultFont', size='MEDIUM', bold=False, italic=False)[source]
class ccpn.ui.gui.guiSettings.FontSizes(value)[source]

Bases: ccpn.util.LabelledEnum.LabelledEnum

An enumeration.

HUGE = 2.0
LARGE = 1.25
MAXIMUM = 3.0
MEDIUM = 1.0
MINIMUM = 0.25
SMALL = 0.75
TINY = 0.5
VLARGE = 1.5
class ccpn.ui.gui.guiSettings.ZPlaneNavigationModes(value)[source]

Bases: ccpn.util.LabelledEnum.LabelledEnum

An enumeration.

INSTRIP = 2
PERSPECTRUMDISPLAY = 0
PERSTRIP = 1
ccpn.ui.gui.guiSettings.getColourScheme()[source]

Get the current colourScheme

Returns

colourScheme

ccpn.ui.gui.guiSettings.getColours()[source]

Return colour for the different schemes :return: colourDict

ccpn.ui.gui.guiSettings.setColourScheme(colourScheme)[source]

Set the current colourScheme