updated widgets
This commit is contained in:
parent
f630734453
commit
cf312e7bac
@ -1,4 +1,4 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
|
|
||||||
__all__ = ['BusyCursor']
|
__all__ = ['BusyCursor']
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from . import VerticalLabel
|
from . import VerticalLabel
|
||||||
|
|
||||||
__all__ = ['CheckTable']
|
__all__ = ['CheckTable']
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
import pyqtgraph.functions as functions
|
from .. import functions as functions
|
||||||
|
|
||||||
__all__ = ['ColorButton']
|
__all__ = ['ColorButton']
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
import pyqtgraph.parametertree as ptree
|
from .. import parametertree as ptree
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from pyqtgraph.pgcollections import OrderedDict
|
from ..pgcollections import OrderedDict
|
||||||
import pyqtgraph.functions as fn
|
from .. import functions as fn
|
||||||
|
|
||||||
__all__ = ['ColorMapWidget']
|
__all__ = ['ColorMapWidget']
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from pyqtgraph.SignalProxy import SignalProxy
|
from ..SignalProxy import SignalProxy
|
||||||
|
|
||||||
|
|
||||||
class ComboBox(QtGui.QComboBox):
|
class ComboBox(QtGui.QComboBox):
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
import pyqtgraph.parametertree as ptree
|
from .. import parametertree as ptree
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from pyqtgraph.pgcollections import OrderedDict
|
from ..pgcollections import OrderedDict
|
||||||
import pyqtgraph as pg
|
from .. import functions as fn
|
||||||
|
|
||||||
__all__ = ['DataFilterWidget']
|
__all__ = ['DataFilterWidget']
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ class RangeFilterItem(ptree.types.SimpleParameter):
|
|||||||
return mask
|
return mask
|
||||||
|
|
||||||
def describe(self):
|
def describe(self):
|
||||||
return "%s < %s < %s" % (pg.siFormat(self['Min'], suffix=self.units), self.fieldName, pg.siFormat(self['Max'], suffix=self.units))
|
return "%s < %s < %s" % (fn.siFormat(self['Min'], suffix=self.units), self.fieldName, fn.siFormat(self['Max'], suffix=self.units))
|
||||||
|
|
||||||
class EnumFilterItem(ptree.types.SimpleParameter):
|
class EnumFilterItem(ptree.types.SimpleParameter):
|
||||||
def __init__(self, name, opts):
|
def __init__(self, name, opts):
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from pyqtgraph.pgcollections import OrderedDict
|
from ..pgcollections import OrderedDict
|
||||||
import types, traceback
|
import types, traceback
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtCore, QtGui
|
from ..Qt import QtCore, QtGui
|
||||||
|
|
||||||
__all__ = ['FeedbackButton']
|
__all__ = ['FeedbackButton']
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
__all__ = ['FileDialog']
|
__all__ = ['FileDialog']
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from .GraphicsView import GraphicsView
|
from .GraphicsView import GraphicsView
|
||||||
from pyqtgraph.graphicsItems.GradientEditorItem import GradientEditorItem
|
from ..graphicsItems.GradientEditorItem import GradientEditorItem
|
||||||
import weakref
|
import weakref
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from pyqtgraph.Qt import QtGui
|
from ..Qt import QtGui
|
||||||
from pyqtgraph.graphicsItems.GraphicsLayout import GraphicsLayout
|
from ..graphicsItems.GraphicsLayout import GraphicsLayout
|
||||||
from .GraphicsView import GraphicsView
|
from .GraphicsView import GraphicsView
|
||||||
|
|
||||||
__all__ = ['GraphicsLayoutWidget']
|
__all__ = ['GraphicsLayoutWidget']
|
||||||
|
@ -5,23 +5,22 @@ Copyright 2010 Luke Campagnola
|
|||||||
Distributed under MIT/X11 license. See license.txt for more infomation.
|
Distributed under MIT/X11 license. See license.txt for more infomation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pyqtgraph.Qt import QtCore, QtGui
|
from ..Qt import QtCore, QtGui, USE_PYSIDE
|
||||||
import pyqtgraph as pg
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from pyqtgraph.Qt import QtOpenGL
|
from ..Qt import QtOpenGL
|
||||||
HAVE_OPENGL = True
|
HAVE_OPENGL = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAVE_OPENGL = False
|
HAVE_OPENGL = False
|
||||||
|
|
||||||
from pyqtgraph.Point import Point
|
from ..Point import Point
|
||||||
import sys, os
|
import sys, os
|
||||||
from .FileDialog import FileDialog
|
from .FileDialog import FileDialog
|
||||||
from pyqtgraph.GraphicsScene import GraphicsScene
|
from ..GraphicsScene import GraphicsScene
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pyqtgraph.functions as fn
|
from .. import functions as fn
|
||||||
import pyqtgraph.debug as debug
|
from .. import debug as debug
|
||||||
import pyqtgraph
|
from .. import getConfigOption
|
||||||
|
|
||||||
__all__ = ['GraphicsView']
|
__all__ = ['GraphicsView']
|
||||||
|
|
||||||
@ -73,7 +72,7 @@ class GraphicsView(QtGui.QGraphicsView):
|
|||||||
QtGui.QGraphicsView.__init__(self, parent)
|
QtGui.QGraphicsView.__init__(self, parent)
|
||||||
|
|
||||||
if useOpenGL is None:
|
if useOpenGL is None:
|
||||||
useOpenGL = pyqtgraph.getConfigOption('useOpenGL')
|
useOpenGL = getConfigOption('useOpenGL')
|
||||||
|
|
||||||
self.useOpenGL(useOpenGL)
|
self.useOpenGL(useOpenGL)
|
||||||
|
|
||||||
@ -108,7 +107,7 @@ class GraphicsView(QtGui.QGraphicsView):
|
|||||||
|
|
||||||
## Workaround for PySide crash
|
## Workaround for PySide crash
|
||||||
## This ensures that the scene will outlive the view.
|
## This ensures that the scene will outlive the view.
|
||||||
if pyqtgraph.Qt.USE_PYSIDE:
|
if USE_PYSIDE:
|
||||||
self.sceneObj._view_ref_workaround = self
|
self.sceneObj._view_ref_workaround = self
|
||||||
|
|
||||||
## by default we set up a central widget with a grid layout.
|
## by default we set up a central widget with a grid layout.
|
||||||
@ -138,7 +137,7 @@ class GraphicsView(QtGui.QGraphicsView):
|
|||||||
"""
|
"""
|
||||||
self._background = background
|
self._background = background
|
||||||
if background == 'default':
|
if background == 'default':
|
||||||
background = pyqtgraph.getConfigOption('background')
|
background = getConfigOption('background')
|
||||||
brush = fn.mkBrush(background)
|
brush = fn.mkBrush(background)
|
||||||
self.setBackgroundBrush(brush)
|
self.setBackgroundBrush(brush)
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ Widget displaying an image histogram along with gradient editor. Can be used to
|
|||||||
This is a wrapper around HistogramLUTItem
|
This is a wrapper around HistogramLUTItem
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from .GraphicsView import GraphicsView
|
from .GraphicsView import GraphicsView
|
||||||
from pyqtgraph.graphicsItems.HistogramLUTItem import HistogramLUTItem
|
from ..graphicsItems.HistogramLUTItem import HistogramLUTItem
|
||||||
|
|
||||||
__all__ = ['HistogramLUTWidget']
|
__all__ = ['HistogramLUTWidget']
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['JoystickButton']
|
__all__ = ['JoystickButton']
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
|
|
||||||
__all__ = ['LayoutWidget']
|
__all__ = ['LayoutWidget']
|
||||||
class LayoutWidget(QtGui.QWidget):
|
class LayoutWidget(QtGui.QWidget):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE
|
from ..Qt import QtGui, QtCore, USE_PYSIDE
|
||||||
import matplotlib
|
import matplotlib
|
||||||
|
|
||||||
if USE_PYSIDE:
|
if USE_PYSIDE:
|
||||||
|
@ -6,7 +6,7 @@ Distributed under MIT/X11 license. See license.txt for more infomation.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from .GraphicsView import GraphicsView
|
from .GraphicsView import GraphicsView
|
||||||
import pyqtgraph.graphicsItems.MultiPlotItem as MultiPlotItem
|
from ..graphicsItems import MultiPlotItem as MultiPlotItem
|
||||||
|
|
||||||
__all__ = ['MultiPlotWidget']
|
__all__ = ['MultiPlotWidget']
|
||||||
class MultiPlotWidget(GraphicsView):
|
class MultiPlotWidget(GraphicsView):
|
||||||
@ -42,4 +42,4 @@ class MultiPlotWidget(GraphicsView):
|
|||||||
self.mPlotItem.close()
|
self.mPlotItem.close()
|
||||||
self.mPlotItem = None
|
self.mPlotItem = None
|
||||||
self.setParent(None)
|
self.setParent(None)
|
||||||
GraphicsView.close(self)
|
GraphicsView.close(self)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
import pyqtgraph as pg
|
from .. import functions as fn
|
||||||
|
|
||||||
__all__ = ['PathButton']
|
__all__ = ['PathButton']
|
||||||
|
|
||||||
|
|
||||||
@ -20,10 +21,10 @@ class PathButton(QtGui.QPushButton):
|
|||||||
|
|
||||||
|
|
||||||
def setBrush(self, brush):
|
def setBrush(self, brush):
|
||||||
self.brush = pg.mkBrush(brush)
|
self.brush = fn.mkBrush(brush)
|
||||||
|
|
||||||
def setPen(self, pen):
|
def setPen(self, pen):
|
||||||
self.pen = pg.mkPen(pen)
|
self.pen = fn.mkPen(pen)
|
||||||
|
|
||||||
def setPath(self, path):
|
def setPath(self, path):
|
||||||
self.path = path
|
self.path = path
|
||||||
|
@ -5,9 +5,9 @@ Copyright 2010 Luke Campagnola
|
|||||||
Distributed under MIT/X11 license. See license.txt for more infomation.
|
Distributed under MIT/X11 license. See license.txt for more infomation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pyqtgraph.Qt import QtCore, QtGui
|
from ..Qt import QtCore, QtGui
|
||||||
from .GraphicsView import *
|
from .GraphicsView import *
|
||||||
from pyqtgraph.graphicsItems.PlotItem import *
|
from ..graphicsItems.PlotItem import *
|
||||||
|
|
||||||
__all__ = ['PlotWidget']
|
__all__ = ['PlotWidget']
|
||||||
class PlotWidget(GraphicsView):
|
class PlotWidget(GraphicsView):
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
|
|
||||||
__all__ = ['ProgressDialog']
|
__all__ = ['ProgressDialog']
|
||||||
class ProgressDialog(QtGui.QProgressDialog):
|
class ProgressDialog(QtGui.QProgressDialog):
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
from pyqtgraph.Qt import QtCore, QtGui
|
from ..Qt import QtCore, QtGui
|
||||||
try:
|
try:
|
||||||
from pyqtgraph.Qt import QtOpenGL
|
from ..Qt import QtOpenGL
|
||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
HAVE_OPENGL = True
|
HAVE_OPENGL = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAVE_OPENGL = False
|
HAVE_OPENGL = False
|
||||||
|
|
||||||
import pyqtgraph.functions as fn
|
from .. import functions as fn
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
class RawImageWidget(QtGui.QWidget):
|
class RawImageWidget(QtGui.QWidget):
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE
|
from ..Qt import QtGui, QtCore, USE_PYSIDE
|
||||||
if not USE_PYSIDE:
|
if not USE_PYSIDE:
|
||||||
import sip
|
import sip
|
||||||
import pyqtgraph.multiprocess as mp
|
from .. import multiprocess as mp
|
||||||
import pyqtgraph as pg
|
|
||||||
from .GraphicsView import GraphicsView
|
from .GraphicsView import GraphicsView
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import mmap, tempfile, ctypes, atexit, sys, random
|
import mmap, tempfile, ctypes, atexit, sys, random
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from .PlotWidget import PlotWidget
|
from .PlotWidget import PlotWidget
|
||||||
from .DataFilterWidget import DataFilterParameter
|
from .DataFilterWidget import DataFilterParameter
|
||||||
from .ColorMapWidget import ColorMapParameter
|
from .ColorMapWidget import ColorMapParameter
|
||||||
import pyqtgraph.parametertree as ptree
|
from .. import parametertree as ptree
|
||||||
import pyqtgraph.functions as fn
|
from .. import functions as fn
|
||||||
|
from .. import getConfigOption
|
||||||
|
from ..graphicsItems.TextItem import TextItem
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from pyqtgraph.pgcollections import OrderedDict
|
from ..pgcollections import OrderedDict
|
||||||
import pyqtgraph as pg
|
|
||||||
|
|
||||||
__all__ = ['ScatterPlotWidget']
|
__all__ = ['ScatterPlotWidget']
|
||||||
|
|
||||||
@ -48,9 +49,9 @@ class ScatterPlotWidget(QtGui.QSplitter):
|
|||||||
self.ctrlPanel.addWidget(self.ptree)
|
self.ctrlPanel.addWidget(self.ptree)
|
||||||
self.addWidget(self.plot)
|
self.addWidget(self.plot)
|
||||||
|
|
||||||
bg = pg.mkColor(pg.getConfigOption('background'))
|
bg = fn.mkColor(getConfigOption('background'))
|
||||||
bg.setAlpha(150)
|
bg.setAlpha(150)
|
||||||
self.filterText = pg.TextItem(border=pg.getConfigOption('foreground'), color=bg)
|
self.filterText = TextItem(border=getConfigOption('foreground'), color=bg)
|
||||||
self.filterText.setPos(60,20)
|
self.filterText.setPos(60,20)
|
||||||
self.filterText.setParentItem(self.plot.plotItem)
|
self.filterText.setParentItem(self.plot.plotItem)
|
||||||
|
|
||||||
@ -193,7 +194,7 @@ class ScatterPlotWidget(QtGui.QSplitter):
|
|||||||
imax = int(xy[ax].max()) if len(xy[ax]) > 0 else 0
|
imax = int(xy[ax].max()) if len(xy[ax]) > 0 else 0
|
||||||
for i in range(imax+1):
|
for i in range(imax+1):
|
||||||
keymask = xy[ax] == i
|
keymask = xy[ax] == i
|
||||||
scatter = pg.pseudoScatter(xy[1-ax][keymask], bidir=True)
|
scatter = fn.pseudoScatter(xy[1-ax][keymask], bidir=True)
|
||||||
if len(scatter) == 0:
|
if len(scatter) == 0:
|
||||||
continue
|
continue
|
||||||
smax = np.abs(scatter).max()
|
smax = np.abs(scatter).max()
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from pyqtgraph.python2_3 import asUnicode
|
from ..python2_3 import asUnicode
|
||||||
from pyqtgraph.SignalProxy import SignalProxy
|
from ..SignalProxy import SignalProxy
|
||||||
|
|
||||||
import pyqtgraph.functions as fn
|
from .. import functions as fn
|
||||||
from math import log
|
from math import log
|
||||||
from decimal import Decimal as D ## Use decimal to avoid accumulating floating-point errors
|
from decimal import Decimal as D ## Use decimal to avoid accumulating floating-point errors
|
||||||
from decimal import *
|
from decimal import *
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from pyqtgraph.python2_3 import asUnicode
|
from ..python2_3 import asUnicode
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
try:
|
try:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
from weakref import *
|
from weakref import *
|
||||||
|
|
||||||
__all__ = ['TreeWidget', 'TreeWidgetItem']
|
__all__ = ['TreeWidget', 'TreeWidgetItem']
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from pyqtgraph.Qt import QtCore, QtGui
|
from ..Qt import QtCore, QtGui
|
||||||
from pyqtgraph.ptime import time
|
from ..ptime import time
|
||||||
import pyqtgraph as pg
|
from .. import functions as fn
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
__all__ = ['ValueLabel']
|
__all__ = ['ValueLabel']
|
||||||
@ -67,7 +67,7 @@ class ValueLabel(QtGui.QLabel):
|
|||||||
avg = self.averageValue()
|
avg = self.averageValue()
|
||||||
val = self.values[-1][1]
|
val = self.values[-1][1]
|
||||||
if self.siPrefix:
|
if self.siPrefix:
|
||||||
return pg.siFormat(avg, suffix=self.suffix)
|
return fn.siFormat(avg, suffix=self.suffix)
|
||||||
else:
|
else:
|
||||||
return self.formatStr.format(value=val, avgValue=avg, suffix=self.suffix)
|
return self.formatStr.format(value=val, avgValue=avg, suffix=self.suffix)
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pyqtgraph.Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore
|
||||||
|
|
||||||
__all__ = ['VerticalLabel']
|
__all__ = ['VerticalLabel']
|
||||||
#class VerticalLabel(QtGui.QLabel):
|
#class VerticalLabel(QtGui.QLabel):
|
||||||
|
Loading…
Reference in New Issue
Block a user