-
Notifications
You must be signed in to change notification settings - Fork 5
/
RunWidget.py
67 lines (52 loc) · 1.83 KB
/
RunWidget.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# -*- coding: utf-8 -*-
from __future__ import print_function
"""Sidebar for plugins. The sidebar comprises of actions.
Currently mode, connect and settings are defined.
"""
__author__ = "Aviral Goel"
__credits__ = ["Upi Lab"]
__license__ = "GPL3"
__version__ = "1.0.0"
__maintainer__ = "Aviral Goel"
__email__ = "goel.aviral@gmail.com"
__status__ = "Development"
import sys
import os
import SettingsDialog
from PyQt4 import QtGui, Qt
from PyQt4.QtGui import QWidget
from PyQt4.QtGui import QScrollArea
from PyQt4.QtGui import QGridLayout
from PyQt4.QtGui import QSplitter
class RunWidget(QSplitter):
def __init__(self, modelRoot, *args, **kwargs):
super(RunWidget, self).__init__(None)
self.modelRoot = modelRoot
layout = QGridLayout()
self.setLayout(layout)
self.plotWidgetContainer = None
def setChildWidget(self, widget, wrap, row, col, rowspan = 1, colspan = 1):
if wrap:
scrollArea = QScrollArea()
scrollArea.setWidget(widget)
scrollArea.setWidgetResizable(True);
self.layout().addWidget(scrollArea, row, col, rowspan, colspan)
else:
self.addWidget(widget)
# self.layout().addWidget(widget, row, col, rowspan, colspan)
def setPlotWidgetContainer(self, widget):
self.plotWidgetContainer = widget
def setModelRoot(self, *args):
pass
def getMenus(self, *args):
return []
def setDataRoot(self, *args):
pass
def updatePlots(self):
self.plotWidgetContainer.updatePlots()
def rescalePlots(self):
self.plotWidgetContainer.rescalePlots()
def extendXAxes(self, xlim):
self.plotWidgetContainer.extendXAxes(xlim)
def plotAllData(self):
self.plotWidgetContainer.plotAllData()