schrodinger.trajectory.trajectory_gui_dir.snapshot_panel module

class schrodinger.trajectory.trajectory_gui_dir.snapshot_panel.FrameListItem(value: int)

Bases: PyQt6.QtWidgets.QListWidgetItem

Frame list item is checkable, selectable, and enabled.

__init__(value: int)

Constructor.

Parameters

value – The frame number representing this list widget item.

property visible
Return type

bool

Returns

True if frame item is visible.

property frame_number
Return type

int

Returns

The frame number representing this list widget item.

class schrodinger.trajectory.trajectory_gui_dir.snapshot_panel.FrameRangeValidator(parent=None)

Bases: PyQt6.QtGui.QRegularExpressionValidator

Frame range validator. Valid values are like this – 1 1,2,3 1,2,3-5,5 3-5 1-5,3,5,6-7 Validator also ensures that maximum number is within the range of maximum possible allowed value.

LIST_SEPARATOR = ','
RANGE_SEPARATOR = '-'
__init__(parent=None)

Construct frame range validator object.

Parameters

parent (QtWidgets.QWidget) – Parent widget.

property max_frame_value
Return type

int

Returns

Return maximum possible frame value.

setMaxFrame(max_frame_value: int)

Set maximum frame number allowed.

Parameters

max_frame_value – Maximum allowed value to be used by validator for validation.

validate(in_str: str, pos: int)

Provides a range checking of frame numbers.

Parameters
  • in_str – Input string entered by user.

  • pos – Cursor position in the input editor.

Return type

enum(QtGui.QValidator.State)

Returns

State defined by QtGui.QValidator.State enum.

getRange(token: str)

Return a tuple of number based on range token.

Parameters

token – Token to be parsed to get range.

Return type

tuple(int, int) or None

Returns

Return a tuple of start and end number. If pattern is 1-5-6, then it is not allowed and returns None.

isRangeToken(token: str)

Return True if token is a range token (e.g. ‘5-10’)

Parameters

token – Token to be checked if it is range token or not.

Return type

bool

Returns

True if token is a range token. If token value is ‘1-‘, ‘1-5-6’ then we consider that as a valid range token because it is likely user is about to edit the text in the text edit box.

getTokens(expr: str)

Split text and return tokens which would be either number or x-y form.

Param

Frame range or list expression.

Return type

list(str)

Returns

List of frame number or frame range tokens.

class schrodinger.trajectory.trajectory_gui_dir.snapshot_panel.SnapshotPanel(player, parent=None)

Bases: schrodinger.ui.qt.appframework2.af2.App

Trajectory snapshot panel class for trajectory frames viewing.

It provides ability to display multiple frames in the workspace from a single trajectory.

Variables
  • modeChanged (QtCore.pyqtSignal) – A signal emitted when panel activates frame snapshots viewing. True if snapshot mode activated, otherwise False.

  • closed (QtCore.pyqtSignal) – A signal emitted when panel is closed.

  • visiblityChanged – A signal emitted when panel is displayed or hidden. - True if snapshot panel is visible, otherwise False.

  • atomsColorChanged (QtCore.pyqtSignal) – A signal emitted when atoms color changes as a result of turning on show color gradient option.

atomsColorChanged emitted when:

  • Workspace structure which is updated.

  • Change type

  • Notify about change

  • Notify about id map (always -1)

  • Notify if only bonds changed(always False)

DEFAULT_STEP_SIZE = 10
MIN_STEP_SIZE = 1
modeChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

closed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

visibilityChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

atomsColorChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

setPanelOptions()

Configure the panel by setting instance variables here. Always call the parent method. Panel options:

self.maestro_dockable - whether this panel should be dockable in the

Maestro main window. Setting to false will prevent the panel from docking regardless of Maestro preference. When setting it to true, if Maestro Preference allows docking of panels, it will dock the panel on the right-hand side of the main window if “Location” is set to “Main window”, or a floating window if “Location” is set to “Floating window”. Default is False.

self.title - string to display in the window title bar

self.ui - a Ui_Form instance defining the main ui, default None

self.allowed_run_modes - subset of [MODE_MAESTRO, MODE_STANDALONE,

MODE_SUBPANEL, MODE_CANVAS] defining how the panel may be run. Default is all.

self.help_topic - string defining the help topic. Default ‘’

self.input_selector_options - dict of options for the common input

selector widget. Default is an empty dict, meaning do not add an input selector

self.add_main_layout_stretch - bool of whether to add a stretch to the

main layout under the main ui (if self.ui exists). Default is True

__init__(player, parent=None)
Parameters
  • player (playertoolbar.TrajectoryPlayer) – Player toolbar

  • parent (QtWidgets.QWidget) – Parent widget.

setup()
updateTrajectoryDependentOptions()

Update panel using entry trajectory data.

isApplyTimeBasedGradient()
Returns

True if show time based color gradient option checked.

useShowHideAtomsAsl()
Returns

True if show/hide atoms asl should be applied.

Return type

bool

useTrajectorySettings()
Returns

True if trajectory settings should be used.

Return type

bool

useCustomSettings()
Returns

True if custom settings should be used.

Return type

bool

updatePanel()

Update panels component based on current selected options.

property is_display_snapshot_active
Return type

bool

Returns

True if display snapshot mode button is turned on.

closeEvent(close_event: PyQt6.QtGui.QCloseEvent)

Overridden base class method to ensure that panel exits from snapshot model if it was in that mode.

Parameters

close_event – Qt close event.

showEvent(show_event: PyQt6.QtGui.QShowEvent)

Overridden base class method to ensure that panel notifies its visibility state change.

Parameters

show_event – Qt show event.

hideEvent(hide_event: PyQt6.QtGui.QHideEvent)

Overridden base class method to ensure that panel notifies its visibility state change.

Parameters

hide_event – Qt hide event.

exitDisplaySnapshotMode()

Exit from display snapshot mode.

Enable player toolbar.

enterDisplaySnapshotMode()

Slot which gets called when user clicks on add snapshot button. It builds a structure based on selected frames and settings. Disable player toolbar.

setEnabledCurrentFrameOptions(enable: bool)

Enable/disable current workspace frame option based on enable flag.

updateCurrentFrameLabel()

Update current frame number label.

property list_widget_item_count
Return type

int

Returns

Total frames listed in the frame list widget.

aboutToQuitMaestro()

When Maestro is about to quit, this function gets called.