Ejemplo n.º 1
0
def test_Spectrum(withGUI):  # with convenience functions
    import parseq_XES_scan as myapp

    myapp.make_pipeline(withGUI)
    myapp.load_test_data()

    if withGUI:
        from silx.gui import qt
        from parseq.gui.dataTreeModelView import DataTreeView
        MyTreeView = DataTreeView

        app = qt.QApplication(sys.argv)
        node = list(csi.nodes.values())[-1]
        view1 = MyTreeView(node)

        if "qt5" in qt.BINDING.lower():
            from modeltest import ModelTest
            ModelTest(csi.model, view1)

        view1.setWindowTitle("Spectra Tree Model")
        # select the 1st item (it is a group)
        view1.setCurrentIndex(csi.model.index(0))

        view1.show()
        app.exec_()
Ejemplo n.º 2
0
def test(withGUI=True, withTestData=True):
    myapp.make_pipeline(withGUI)

    if withTestData:
        myapp.load_test_data()

    if withGUI:
        node0 = list(csi.nodes.values())[0]
        node0.fileNameFilters = ['*.fio', '*.h5', '*.dat']

        from silx.gui import qt
        from parseq.gui.mainWindow import MainWindowParSeq
        app = qt.QApplication(sys.argv)
        mainWindow = MainWindowParSeq()
        mainWindow.dataChanged()
        mainWindow.show()

        node0.widget.tree.setFocus()  # important
        node0.widget.tree.setCurrentIndex(csi.model.index(0))

        from modeltest import ModelTest
        node0.widget.files.ModelTest = ModelTest

        app.exec_()
    else:
        import matplotlib.pyplot as plt
        for data in csi.dataRootItem.get_items():
            plt.plot(data.r, data.ft)
        plt.show()
Ejemplo n.º 3
0
def test():
    myapp.make_pipeline(withGUI=True)
    myapp.load_test_data()

    app = qt.QApplication(sys.argv)
    mainWindow = CombineSpectraWidget()
    mainWindow.setWindowTitle("Combine")
    mainWindow.show()
    app.exec_()
Ejemplo n.º 4
0
def test():
    myapp.make_pipeline(withGUI=True)

    app = qt.QApplication(sys.argv)
    node = list(csi.nodes.values())[0]
    nodeWidget = NodeWidget(node)
    nodeWidget.splitter.setSizes([1, 1, 1, 1])

    # load test data
    myapp.load_test_data()
    nodeWidget.tree.dataChanged()
    # select the 1st item (it is a group)
    nodeWidget.tree.setCurrentIndex(csi.model.index(0))

    nodeWidget.show()
    app.exec_()
Ejemplo n.º 5
0
def test():
    myapp.make_pipeline(withGUI=True)
    myapp.load_test_data()

    app = qt.QApplication(sys.argv)
    dataCollection = dict(base=['aa', 'bb'],
                          energy=[8000.5, 9000.1],
                          DCM=['Si111', 'Si111'],
                          FWHM=[0.1, 0.2])
    # dataCollection = OrderedDict()
    mainWindow = CalibrateEnergyWidget(dataCollection=dataCollection)
    mainWindow.resize(0, 0)

    mainWindow.setWindowTitle("Calibrate energy")
    mainWindow.show()
    app.exec_()
Ejemplo n.º 6
0
def test():
    myapp.make_pipeline(withGUI=True)
    myapp.load_test_data()

    csi.selectedItems[:] = []
    csi.selectedTopItems[:] = []
    group = csi.dataRootItem.get_groups()[0]
    items = group.get_items()
    csi.selectedItems.extend(items)
    csi.selectedTopItems.extend([group])

    app = qt.QApplication(sys.argv)
    dia = LineProps(None, list(csi.nodes.values())[-1])
    dia.show()
    app.exec_()

    if dia.result() == qt.QDialog.Accepted:
        lineProps = dia.setLineOptions()
        print(lineProps)
        time.sleep(3)