Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
c2487706
Commit
c2487706
authored
3 years ago
by
Srikanth Ravipati
Browse files
Options
Downloads
Patches
Plain Diff
Added memorywidget to workbench as a plugin
parent
bbf89ec3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qt/applications/workbench/workbench/plugins/memorywidget.py
+50
-0
50 additions, 0 deletions
qt/applications/workbench/workbench/plugins/memorywidget.py
with
50 additions
and
0 deletions
qt/applications/workbench/workbench/plugins/memorywidget.py
0 → 100644
+
50
−
0
View file @
c2487706
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantid workbench.
#
#
from
qtpy.QtWidgets
import
QVBoxLayout
from
..plugins.base
import
PluginWidget
from
mantidqt.widgets.memorywidget.memoryview
import
MemoryView
from
mantidqt.widgets.memorywidget.memorypresenter
import
MemoryPresenter
class
MemoryWidget
(
PluginWidget
):
"""
Widget to display system memory usage
"""
def
__init__
(
self
,
parent
,
view
=
None
):
super
(
MemoryWidget
,
self
).
__init__
(
parent
)
self
.
view
=
view
if
view
else
MemoryView
(
self
)
self
.
presenter
=
MemoryPresenter
(
self
.
view
)
layout
=
QVBoxLayout
()
self
.
view
.
memory_bar
.
setMinimumHeight
(
30
)
layout
.
addWidget
(
self
.
view
.
memory_bar
)
self
.
setLayout
(
layout
)
self
.
setWindowTitle
(
self
.
get_plugin_title
())
# The following are chosen as a good value after
# testing how it looks for different values
self
.
setMinimumHeight
(
50
)
self
.
setMaximumHeight
(
55
)
# ----------------- Plugin API --------------------
def
get_plugin_title
(
self
):
return
"
System Memory Usage
"
def
readSettings
(
self
,
_
):
pass
def
writeSettings
(
self
,
_
):
pass
def
register_plugin
(
self
,
menu
=
None
):
self
.
main
.
add_dockwidget
(
self
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment