コード例 #1
0
ファイル: MainController.py プロジェクト: kif/Py2DeX
    def __init__(self, app):
        self.splash_img = QtGui.QPixmap("UiFiles/splash.png")
        self.splash_screen = QtGui.QSplashScreen(
            self.splash_img, QtCore.Qt.WindowStaysOnTopHint)
        self.splash_screen.show()
        app.processEvents()
        time.sleep(1)
        app.processEvents()

        self.view = MainView()
        #create data
        self.img_data = ImgData()
        self.calibration_data = CalibrationData(self.img_data)
        self.mask_data = MaskData()
        self.spectrum_data = SpectrumData()
        self.phase_data = PhaseData()

        self.load_directories()
        #create controller
        self.calibration_controller = CalibrationController(
            self.working_dir, self.view.calibration_widget, self.img_data,
            self.mask_data, self.calibration_data)
        self.mask_controller = MaskController(self.working_dir,
                                              self.view.mask_widget,
                                              self.img_data, self.mask_data)
        self.integration_controller = IntegrationController(
            self.working_dir, self.view.integration_widget, self.img_data,
            self.mask_data, self.calibration_data, self.spectrum_data,
            self.phase_data)
        self.create_signals()
        self.set_title()
        self.raise_window()
        self.splash_screen.finish(self.view)
コード例 #2
0
    def __init__(self, working_dir, view=None, imgData=None, maskData=None):
        self.working_dir = working_dir
        if view == None:
            self.view = MaskView()
        else:
            self.view = view

        if imgData == None:
            self.img_data = ImgData()
        else:
            self.img_data = imgData

        if maskData == None:
            self.mask_data = MaskData()
        else:
            self.mask_data = maskData

        self.view.img_view.mouse_left_clicked.connect(self.process_click)

        self.state = None
        self.clicks = 0
        self.create_signals()

        self.rect = None
        self.circle = None
        self.polygon = None
        self.point = None

        self.raise_window()
コード例 #3
0
    def __init__(self):
        self.view = MainView()

        #create data
        self.img_data = ImgData()
        self.calibration_data = CalibrationData(self.img_data)
        self.mask_data = MaskData()
        self.spectrum_data = SpectrumData()
        self.phase_data = PhaseData()

        self.load_directories()
        #create controller
        self.calibration_controller = CalibrationController(
            self.working_dir, self.view.calibration_widget, self.img_data,
            self.calibration_data)
        self.mask_controller = MaskController(self.working_dir,
                                              self.view.mask_widget,
                                              self.img_data, self.mask_data)
        self.integration_controller = IntegrationController(
            self.working_dir, self.view.integration_widget, self.img_data,
            self.mask_data, self.calibration_data, self.spectrum_data,
            self.phase_data)

        self.create_signals()
        self.raise_window()
コード例 #4
0
ファイル: CombinedDataTest.py プロジェクト: kif/Py2DeX
 def setUp(self):
     self.img_data = ImgData()
     self.img_data.load('Data/Mg2SiO4_ambient_001.tif')
     self.calibration_data = CalibrationData(self.img_data)
     self.calibration_data.load('Data/calibration.poni')
     self.mask_data = MaskData()
     self.mask_data.load_mask('Data/test.mask')
     self.spectrum_data = SpectrumData()
コード例 #5
0
ファイル: IntegrationController.py プロジェクト: kif/Py2DeX
    def __init__(self,
                 working_dir,
                 view=None,
                 img_data=None,
                 mask_data=None,
                 calibration_data=None,
                 spectrum_data=None,
                 phase_data=None):
        self.working_dir = working_dir
        if view == None:
            self.view = IntegrationView()
        else:
            self.view = view

        if img_data == None:
            self.img_data = ImgData()
        else:
            self.img_data = img_data

        if mask_data == None:
            self.mask_data = MaskData()
        else:
            self.mask_data = mask_data

        if calibration_data == None:
            self.calibration_data = CalibrationData(self.img_data)
        else:
            self.calibration_data = calibration_data

        if spectrum_data == None:
            self.spectrum_data = SpectrumData()
        else:
            self.spectrum_data = spectrum_data

        if phase_data == None:
            self.phase_data = PhaseData()
        else:
            self.phase_data = phase_data

        self.create_sub_controller()

        self.view.setWindowState(self.view.windowState()
                                 & ~QtCore.Qt.WindowMinimized
                                 | QtCore.Qt.WindowActive)
        self.view.activateWindow()
        self.view.raise_()