Skip to content
Snippets Groups Projects
Commit c2487706 authored by Srikanth Ravipati's avatar Srikanth Ravipati
Browse files

Added memorywidget to workbench as a plugin

parent bbf89ec3
No related branches found
No related tags found
No related merge requests found
# 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment