Esempio n. 1
0
    def __init__(self, title="OSCI"):
        super(SignalDock, self).__init__(title)

        self.view = ChartView(orientation=ChartView.CARTESIAN)
        self.addWidget(self.view)

        self.timeline = InteractiveVerticalLine()
        self.view.addItem(self.timeline)
Esempio n. 2
0
class SignalDock(Dock):
    def __init__(self, title="OSCI"):
        super(SignalDock, self).__init__(title)

        self.view = ChartView(orientation=ChartView.CARTESIAN)
        self.addWidget(self.view)

        self.timeline = InteractiveVerticalLine()
        self.view.addItem(self.timeline)

    def receiveTime(self, e):
        self.timeline.setX(e.position.x())
Esempio n. 3
0
        """
        # sys.stderr.write('\r')
        QApplication.exit()

    signal.signal(signal.SIGINT, sigint_handler)

    CONFIG.debug_layout = True

    qapp = QApplication([])

    # call the python loop periodically to catch interrupts from shell
    timer = QTimer()
    timer.start(1000)
    timer.timeout.connect(lambda: None)

    view = ChartView(orientation=ChartView.CARTESIAN)
    view.show()
    view.title = "A Title"

    # A line chart_tests item (again)
    l = LineChartItem()
    x = np.arange(-30, 300, 0.2, dtype=np.float)
    y = np.sin(2 * np.pi * 3 / float(max(x) - min(x)) * x)
    l.plot(y, x, "a sine")

    sec = SecondaryHorizontalAxis(x + 0.24, x * 2e14 - 12.67567)
    view.addSecondaryHorizontalAxis(sec)

    sec_vertical = SecondaryVerticalAxis(y, y * 10)
    view.centralWidget.addSecondaryVerticalAxis(sec_vertical)
Esempio n. 4
0
    def sigint_handler(signum, frame):
        """ Install handler for the SIGINT signal. To kill app through shell.

        :param signum:
        :param frame:
        :return:
        """
        # sys.stderr.write('\r')
        QApplication.exit()

    signal.signal(signal.SIGINT, sigint_handler)

    qapp = QApplication([])

    # call the python loop periodically to catch interrupts from shell
    timer = QTimer()
    timer.start(1000)
    timer.timeout.connect(lambda: None)

    view = ChartView(orientation=ChartView.CARTESIAN)
    view.resize(800, 400)

    l = LineChartItem()
    x = np.arange(-30, 300, 0.2, dtype=np.float)
    y = np.sin(2 * np.pi * 3 / float(max(x) - min(x)) * x)
    l.plot(y, x, "a sine")
    view.addItem(l)

    view.autoRange()
    view.show()
    qapp.exec_()
Esempio n. 5
0
        :param frame:
        :return:
        """
        # sys.stderr.write('\r')
        QApplication.exit()

    signal.signal(signal.SIGINT, sigint_handler)

    qapp = QApplication([])

    # call the python loop periodically to catch interrupts from shell
    timer = QTimer()
    timer.start(1000)
    timer.timeout.connect(lambda: None)

    view = ChartView(orientation=ChartView.CARTESIAN)
    view.setWindowTitle("ROI Test")
    view.resize(500, 500)
    view.setAspectRatio(1.0)
    view.centralWidget.area.setRange(QRectF(-7, -7, 14, 14))
    # view.visibleRegion()
    view.show()

    roi = RectangularRegion(1, 0, 2, 1, 0.)
    roi.addHandle(ResizeHandle(position=HandlePosition.TOP))
    roi.addHandle(ResizeHandle(position=HandlePosition.LEFT))
    roi.addHandle(ResizeHandle(position=HandlePosition.BOTTOM))
    roi.addHandle(ResizeHandle(position=HandlePosition.RIGHT))
    roi.addHandle(
        RotateHandle(position=HandlePosition.RIGHT | HandlePosition.TOP))
    view.addItem(roi)
        :param frame:
        :return:
        """
        # sys.stderr.write('\r')
        QApplication.exit()

    signal.signal(signal.SIGINT, sigint_handler)

    qapp = QApplication([])

    # call the python loop periodically to catch interrupts from shell
    timer = QTimer()
    timer.start(1000)
    timer.timeout.connect(lambda: None)

    view = ChartView(orientation=ChartView.CARTESIAN)
    view.resize(600, 600)
    view.show()

    # A line chart_tests item (again)
    l = LineChartItem()
    x = np.arange(-30, 300, 0.2, dtype=np.float)
    y = np.sin(2 * np.pi * 3 / float(max(x) - min(x)) * x)
    l.plot(y, x, "a sine")
    view.addItem(l)

    ivline = InteractiveVerticalLine()
    ivline.setX(5, "Current Timestamp", Qt.darkGreen)
    view.addItem(ivline)

    # # Set legend visible
Esempio n. 7
0
    def __init__(self, title="OSCI"):
        super(SignalDock, self).__init__(title)

        self.view = ChartView(orientation=ChartView.CARTESIAN)
        self.addWidget(self.view)
Esempio n. 8
0
_log.setLevel(logging.DEBUG)


class AWidget(QObject):
    def __init__(self, parent=None):
        super(AWidget, self).__init__(parent)

    def report(self, e=InteractiveChangeEvent):
        _log.debug(e.position)


if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    qapp = QApplication([])

    view = ChartView(orientation=ChartView.CARTESIAN)
    view.resize(600, 600)
    view.show()

    # A line chart item (again)
    l = LineChartItem()
    x = np.arange(-30, 300, 0.2, dtype=np.float)
    y = np.sin(2 * np.pi * 3 / float(max(x) - min(x)) * x)
    l.plot(y, x, "a sine")
    view.addItem(l)

    ivline = InteractiveVerticalLine()
    ivline.setX(5, "Current Timestamp", Qt.darkGreen)
    view.addItem(ivline)

    # # Set legend visible
Esempio n. 9
0
        :param frame:
        :return:
        """
        # sys.stderr.write('\r')
        QApplication.exit()

    signal.signal(signal.SIGINT, sigint_handler)

    qapp = QApplication([])

    # call the python loop periodically to catch interrupts from shell
    timer = QTimer()
    timer.start(1000)
    timer.timeout.connect(lambda: None)

    view = ChartView(orientation=ChartView.CARTESIAN)
    view.resize(800, 400)

    # A line chart_tests item (again)
    l = LineChartItem()
    x = np.arange(-30, 300, 0.2, dtype=np.float)
    y = np.sin(2 * np.pi * 3 / float(max(x) - min(x)) * x)
    l.plot(y, x, "a sine")

    view.addItem(l)
    view.autoRange()

    # Set legend visible
    view.setLegendVisible(True, ChartView.BOTTOM_LEFT)

    view.title = "A new title"
Esempio n. 10
0
from qplotutils.chart.items import LineChartItem, HLine, VLine

__author__ = "Philipp Baust"
__copyright__ = "Copyright 2017, Philipp Baust"
__credits__ = []
__license__ = "MIT"
__version__ = "0.0.1"
__maintainer__ = "Philipp Baust"
__email__ = "*****@*****.**"
__status__ = "Development"

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    qapp = QApplication([])

    view = ChartView(orientation=ChartView.CARTESIAN)
    view.show()

    # A line chart item (again)
    l = LineChartItem()
    x = np.arange(-30, 300, 0.2, dtype=np.float)
    y = np.sin(2 * np.pi * 3 / float(max(x) - min(x)) * x)
    l.plot(y, x, "a sine")

    sec = SecondaryHorizontalAxis(x + 0.24, x * 2e14 - 12.67567)
    view.centralWidget.addSecondaryHorizontalAxis(sec)

    view.addItem(l)
    view.autoRange()

    # Add a horizontal line
Esempio n. 11
0
        :param frame:
        :return:
        """
        # sys.stderr.write('\r')
        QApplication.exit()

    signal.signal(signal.SIGINT, sigint_handler)

    qapp = QApplication([])

    # call the python loop periodically to catch interrupts from shell
    timer = QTimer()
    timer.start(1000)
    timer.timeout.connect(lambda: None)

    view = ChartView(orientation=ChartView.CARTESIAN)
    view.resize(800, 400)
    view.show()

    # A line chart_tests item (again)
    l = LineChartItem()
    x = np.arange(-30, 300, 0.2, dtype=np.float)
    y = np.sin(2 * np.pi * 3 / float(max(x) - min(x)) * x)
    l.plot(y, x, "a sine")

    view.addItem(l)
    view.autoRange()

    # Add a horizontal line
    h = HLine()
    h.setY(0.1, "A Hline", QColor(Qt.green))