Ejemplo n.º 1
0
    def updateDetails(self):
        self.wDeta.clear()

        for pathId in range(len(self.paths)):
            icolor = self.colors[pathId % len(self.colors)]
            path = self.paths[pathId]

            # for filename in self.paths:
            pen = pg.mkPen(color=(icolor, 8),
                           width=2,
                           style=QtCore.Qt.CustomDashLine)
            pen.setDashPattern(self.dashPatterns[pathId %
                                                 len(self.dashPatterns)])

            legendArea = DockArea()
            dInfo = Dock("", size=(250, 900))

            legendArea.addDock(dInfo, 'bottom')

            firstTitle = True
            layoutLegend = QtGui.QFormLayout()
            for entry in self.dataDeta[pathId]:
                if len(entry) == 2 and entry[1]:
                    if entry[0] == "Run command":
                        runCmd = QtGui.QLineEdit(str(entry[1]))
                        runCmd.setReadOnly(True)
                        layoutLegend.addRow("<b>" + entry[0] + "</b>: ",
                                            runCmd)
                    else:
                        layoutLegend.addRow("<b>" + entry[0] + "</b>: ",
                                            QtGui.QLabel(entry[1]))
                elif len(entry) == 1:
                    if len(entry[0]) >= 1 and entry[0][0] == '*':
                        e = entry[0].replace("*", "")
                        layoutLegend.addRow("<b><u>" + e + ":<u></b>",
                                            QtGui.QLabel(""))
                    else:
                        if not firstTitle:
                            line = QtGui.QFrame()
                            line.setFrameShape(QtGui.QFrame.HLine)
                            line.setFrameShadow(QtGui.QFrame.Sunken)
                            layoutLegend.addRow(line)
                        firstTitle = False
                        layoutLegend.addRow("<h3><u>" + entry[0] + "<u></h3>",
                                            QtGui.QLabel(""))

            wCur = QtGui.QWidget()
            wCur.setLayout(layoutLegend)

            sCur = QtGui.QScrollArea()
            sCur.setWidget(wCur)
            sCur.setWidgetResizable(True)
            dInfo.addWidget(sCur)

            self.wDeta.addTab(legendArea, self.dataName[pathId])
Ejemplo n.º 2
0
def createFileSystemModel(dirPath):
	model = QtGui.QFileSystemModel()
	model.setReadOnly(True)
	model.setRootPath(dirPath)
	model.setFilter(QtCore.QDir.NoDotAndDotDot | QtCore.QDir.AllDirs | QtCore.QDir.AllEntries | QtCore.QDir.Files)
	model.setNameFilters(['*.perf', '*.dat', '*.txt', '*.data'])
	model.setNameFilterDisables(False)

	return model
Ejemplo n.º 3
0
def generatePannel(wBER, wFER, wBEFE, wThr, wDeta):
    if len(sys.argv) >= 2:
        os.chdir(sys.argv[1])
    else:
        os.chdir("./data/")

    model = QtGui.QFileSystemModel()
    model.setReadOnly(True)
    model.setRootPath(QtCore.QDir.currentPath())
    model.setNameFilters(['*.perf', '*.dat', '*.txt', '*.data'])
    model.setNameFilterDisables(False)

    view = AdvTreeView(wBER, wFER, wBEFE, wThr, wDeta)
    view.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
    view.setModel(model)
    view.hideColumn(1)
    view.hideColumn(2)
    view.hideColumn(3)
    view.setColumnWidth(30, 1)
    view.setRootIndex(model.index(QtCore.QDir.currentPath(), 0))
    view.setAnimated(True)
    view.setIconSize(QtCore.QSize(24, 24))

    return view
Ejemplo n.º 4
0
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import lib.pyqtgraph.pyqtgraph.console
import lib.pyqtgraph.pyqtgraph as pg
from lib.pyqtgraph.pyqtgraph.Qt import QtCore, QtGui
from lib.pyqtgraph.pyqtgraph.dockarea import *
import numpy as np
import fileExplorer

# uncomment those next lines to display the plot in black on white instead of white on black
# pg.setConfigOption('background', 'w')
# pg.setConfigOption('foreground', 'k')

app  = QtGui.QApplication(['PyBER plotter'])
win  = QtGui.QMainWindow()
area = DockArea()
win.setCentralWidget(area)
win.resize(1280,800)
win.setWindowTitle('PyBER plotter')
win.setWindowIcon(QtGui.QIcon('img/woody_ico.png'))

# Create docks, place them into the window one at a time.
# Note that size arguments are only a suggestion; docks will still have to
# fill the entire dock area and obey the limits of their internal widgets.
dFile = Dock("File explorer",               size=(275,400))
dDeta = Dock("Details",                     size=(275,400))
dBER  = Dock("Bit Error Rate (BER)",        size=(400,200))
dFER  = Dock("Frame Error Rate (FER)",      size=(400,200))
dBEFE = Dock("BE/FE",                       size=(400,125))
Ejemplo n.º 5
0
	def updateDetails(self):
		self.wDeta.clear()

		for pathId in range(len(self.paths)):
			icolor = self.colors[pathId % len(self.colors)]
			path   = self.paths[pathId]

			# for filename in self.paths:
			pen = pg.mkPen(color=(icolor,8), width=2, style=QtCore.Qt.CustomDashLine)
			pen.setDashPattern(self.dashPatterns[pathId % len(self.dashPatterns)])

			legendArea = DockArea()
			dInfo      = Dock("", size=(250,900))

			legendArea.addDock(dInfo, 'bottom')

			firstTitle   = True;
			layoutLegend = QtGui.QFormLayout()
			for entry in self.Curves[pathId].SimuHeader:
				if len(entry) == 3 and entry[1]:
					if entry[2] == 1:
						if not firstTitle:
							line = QtGui.QFrame()
							line.setFrameShape(QtGui.QFrame.HLine)
							line.setFrameShadow(QtGui.QFrame.Sunken)
							layoutLegend.addRow(line)
						firstTitle = False
						layoutLegend.addRow("<h3><u>" + entry[0] + "<u></h3>", QtGui.QLabel(""))

					elif entry[2] == 2:
						layoutLegend.addRow("<b><u>" + entry[0] + ":<u></b>", QtGui.QLabel(""))

					elif entry[2] == 3:
						layoutLegend.addRow("<b>" + entry[0] + "</b>: ", QtGui.QLabel(entry[1]))


			# Add an horizontal line to seperate
			line = QtGui.QFrame()
			line.setFrameShape(QtGui.QFrame.HLine)
			line.setFrameShadow(QtGui.QFrame.Plain)
			layoutLegend.addRow(line)
			layoutLegend.addRow("<h3><u>Metadata<u></h3>", QtGui.QLabel(""))

			for entry in self.Curves[pathId].Metadata:
				if entry == "doi":
					url = QtGui.QLineEdit("https://doi.org/" + self.Curves[pathId].Metadata[entry])
					url.setReadOnly(True)
					layoutLegend.addRow("<b>" + entry + "</b>: ", url)
				# if entry == "url":
				# 	url = QtGui.QLabel(str(self.Curves[pathId].Metadata[entry]))
				# 	url.setOpenExternalLinks(True)
				# 	url.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse)
				# 	layoutLegend.addRow("<b>" + entry + "</b>: ", url)
				# elif entry == "filename":
				# 	url = QtGui.QLabel(str(self.Curves[pathId].Metadata[entry]))
				# 	url.setOpenInternalLinks(True)
				# 	url.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse)
				# 	layoutLegend.addRow("<b>" + entry + "</b>: ", url)
				else:
					lineEdit = QtGui.QLineEdit(self.Curves[pathId].Metadata[entry])
					lineEdit.setReadOnly(True)
					layoutLegend.addRow("<b>" + entry + "</b>: ", lineEdit)

			wCur = QtGui.QWidget()
			wCur.setLayout(layoutLegend)

			sCur = QtGui.QScrollArea()
			sCur.setWidget(wCur)
			sCur.setWidgetResizable(True)
			dInfo.addWidget(sCur)

			self.wDeta.addTab(legendArea, self.dataName[pathId])
Ejemplo n.º 6
0
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import PyQt5
import lib.pyqtgraph.pyqtgraph.console
import lib.pyqtgraph.pyqtgraph as pg
from lib.pyqtgraph.pyqtgraph.Qt import QtCore, QtGui
from lib.pyqtgraph.pyqtgraph.dockarea import *
import numpy as np
import fileExplorer

# uncomment those next lines to display the plot in black on white instead of white on black
# pg.setConfigOption('background', 'w')
# pg.setConfigOption('foreground', 'k')

app = QtGui.QApplication(['PyBER Plotter'])
win = QtGui.QMainWindow()
area = DockArea()
win.setCentralWidget(area)
win.resize(1280, 800)
win.setWindowTitle('PyBER Plotter')
win.setWindowIcon(QtGui.QIcon('img/woody_ico.png'))

# Create docks, place them into the window one at a time.
# Note that size arguments are only a suggestion; docks will still have to
# fill the entire dock area and obey the limits of their internal widgets.
dFile = Dock("File explorer", size=(275, 400))
dDeta = Dock("Details", size=(275, 400))
dBER = Dock("Bit Error Rate (BER)", size=(400, 200))
dFER = Dock("Frame Error Rate (FER)", size=(400, 200))
dBEFE = Dock("BE/FE", size=(400, 125))