Ejemplo n.º 1
0
    def __init__(self, main_window, exp_number, scan_tuple_list, mask_det, mask_name, norm_type, num_pt_bg_left,
                 num_pt_bg_right, scale_factor=1.000):
        """

        :param main_window:
        :param exp_number:
        :param scan_tuple_list: list of tuples for scan as (scan number, pt number list, state as merged)
        :param mask_det:
        :param mask_name:
        :param norm_type: type of normalization
        :param num_pt_bg_left: number of Pt in the left
        :param num_pt_bg_right: number of Pt for background in the right
        """
        # start thread
        QThread.__init__(self)

        # check
        assert main_window is not None, 'Main window cannot be None'
        assert isinstance(exp_number, int), 'Experiment number must be an integer.'
        assert isinstance(scan_tuple_list, list), 'Scan (info) tuple list must be a list but not %s.' \
                                                  '' % str(type(scan_tuple_list))
        assert isinstance(mask_det, bool), 'Parameter mask_det must be a boolean but not %s.' \
                                           '' % str(type(mask_det))
        assert isinstance(mask_name, str), 'Name of mask must be a string but not %s.' % str(type(mask_name))
        assert isinstance(norm_type, str), 'Normalization type must be a string but not %s.' \
                                           '' % str(type(norm_type))
        assert isinstance(num_pt_bg_left, int) and num_pt_bg_left >= 0,\
            'Number of Pt at left for background {0} must be non-negative integers but not of type {1}.' \
            ''.format(num_pt_bg_left, type(num_pt_bg_left))
        assert isinstance(num_pt_bg_right, int) and num_pt_bg_right >= 0,\
            'Number of Pt at right for background {0} must be non-negative integers but not of type {1}.' \
            ''.format(num_pt_bg_right, type(num_pt_bg_right))

        # set values
        self._mainWindow = main_window
        self._expNumber = exp_number
        self._scanTupleList = scan_tuple_list[:]
        self._maskDetector = mask_det
        self._normalizeType = norm_type
        self._selectedMaskName = mask_name
        self._numBgPtLeft = num_pt_bg_left
        self._numBgPtRight = num_pt_bg_right
        self._scaleFactor = scale_factor

        # other about preprocessed options
        self._checkPreprocessedScans = True

        # link signals
        self.peakMergeSignal.connect(self._mainWindow.update_merge_value)
        self.mergeMsgSignal.connect(self._mainWindow.update_merge_message)

        return
Ejemplo n.º 2
0
 def __init__(self, parent):
     QThread.__init__(self, parent)
     self.mutex = QMutex()
     self.stopped = None
     self.results = None
     self.pathlist = None
     self.nb = None
     self.error_flag = None
     self.rootpath = None
     self.python_path = None
     self.hg_manifest = None
     self.include = None
     self.exclude = None
     self.texts = None
     self.text_re = None
     self.completed = None
     self.get_pythonpath_callback = None
Ejemplo n.º 3
0
    def __init__(self, main_window, exp_number, scan_number_list, md_file_list):
        """Initialization

        :param main_window:
        :param exp_number:
        :param scan_number_list: list of tuples for scan as (scan number, pt number list, state as merged)
        :param md_file_list:
        """
        # check
        assert main_window is not None, 'Main window cannot be None'
        assert isinstance(exp_number, int), 'Experiment number must be an integer.'
        assert isinstance(scan_number_list, list), 'Scan (info) tuple list {0} must be a list but not {1}.' \
                                                   ''.format(scan_number_list, type(scan_number_list))
        assert isinstance(md_file_list, list) or md_file_list is None, 'Output MDWorkspace file name list {0} ' \
                                                                       'must be either a list or None but not {1}.' \
                                                                       ''.format(md_file_list, type(md_file_list))

        if md_file_list is not None and len(scan_number_list) != len(md_file_list):
            raise RuntimeError('If MD file list is not None, then it must have the same size ({0}) as the '
                               'scans ({1}) to merge.'.format(len(md_file_list), len(scan_number_list)))

        # start thread
        QThread.__init__(self)

        # set values
        self._mainWindow = main_window
        self._expNumber = exp_number
        self._scanNumberList = scan_number_list[:]
        self._outputMDFileList = None
        if md_file_list is not None:
            self._outputMDFileList = md_file_list[:]

        # other about preprocessed options
        self._checkPreprocessedScans = False
        self._preProcessedDir = None
        self._redoMerge = True

        # link signals
        self.mergeMsgSignal.connect(self._mainWindow.update_merge_value)
        self.saveMsgSignal.connect(self._mainWindow.update_file_name)

        return
Ejemplo n.º 4
0
 def __init__(self, parent):
     QThread.__init__(self, parent)
     self.mutex = QMutex()
     self.stopped = None
     self.results = None
     self.pathlist = None
     self.total_matches = None
     self.error_flag = None
     self.rootpath = None
     self.python_path = None
     self.hg_manifest = None
     self.exclude = None
     self.texts = None
     self.text_re = None
     self.completed = None
     self.case_sensitive = True
     self.get_pythonpath_callback = None
     self.results = {}
     self.total_matches = 0
     self.is_file = False
Ejemplo n.º 5
0
 def __init__(self, port=7464):
     QThread.__init__(self)
     self.port = port
     self.server = None
     self.complete = False
Ejemplo n.º 6
0
 def __init__(self):
     QThread.__init__(self)
     self.notify_socket = None
Ejemplo n.º 7
0
 def __init__(self, port=7464):
     QThread.__init__(self)
     self.port = port
     self.server = None
     self.complete = False
Ejemplo n.º 8
0
 def __init__(self):
     QThread.__init__(self)
Ejemplo n.º 9
0
 def __init__(self):
     QThread.__init__(self)
     self.map_lock = QMutex()
     self.widget_map = dict()
Ejemplo n.º 10
0
 def __init__(self, layer_):
     QThread.__init__(self)
     self.layer_ = layer_
 def __init__(self, n):
     QThread.__init__(self)
     self.__n = n
Ejemplo n.º 12
0
 def __init__(self, parent, device_id, initialize=True):
     QThread.__init__(self, parent)
     self.parent = parent
     self.device_id = device_id
     self.initialize = initialize
Ejemplo n.º 13
0
 def __init__(self):
     QThread.__init__(self)
     self.notify_socket = None
Ejemplo n.º 14
0
 def __init__(self, parent):
     QThread.__init__(self, parent)
     self.mutex = QMutex()
     self.stopped = None
Ejemplo n.º 15
0
 def __init__(self):
     QThread.__init__(self)
     self.map_lock = QMutex()
     self.widget_map = dict()
Ejemplo n.º 16
0
 def __init__(self, s, parent=None):
     QThread.__init__(self, parent)
     self.s = s
     self.exiting = False
     super().__init__()
Ejemplo n.º 17
0
 def __init__(self):
     QThread.__init__(self)
Ejemplo n.º 18
0
 def __init__(self, parent=None, function=None, command=None, interval=1):
     QThread.__init__(self, parent)
     self.function = function
     self.command = command
     self.interval = interval
Ejemplo n.º 19
0
 def __init__(self, parent=None, function=None, filename=None, interval=1):
     QThread.__init__(self, parent)
     self.function = function
     self.filename = filename
     self.interval = interval
Ejemplo n.º 20
0
    def __init__(self,
                 main_window,
                 exp_number,
                 scan_tuple_list,
                 mask_det,
                 mask_name,
                 norm_type,
                 num_pt_bg_left,
                 num_pt_bg_right,
                 scale_factor=1.000):
        """

        :param main_window:
        :param exp_number:
        :param scan_tuple_list: list of tuples for scan as (scan number, pt number list, state as merged)
        :param mask_det:
        :param mask_name:
        :param norm_type: type of normalization
        :param num_pt_bg_left: number of Pt in the left
        :param num_pt_bg_right: number of Pt for background in the right
        """
        # start thread
        QThread.__init__(self)

        # check
        assert main_window is not None, 'Main window cannot be None'
        assert isinstance(exp_number,
                          int), 'Experiment number must be an integer.'
        assert isinstance(scan_tuple_list, list), 'Scan (info) tuple list must be a list but not %s.' \
                                                  '' % str(type(scan_tuple_list))
        assert isinstance(mask_det, bool), 'Parameter mask_det must be a boolean but not %s.' \
                                           '' % str(type(mask_det))
        assert isinstance(
            mask_name, str), 'Name of mask must be a string but not %s.' % str(
                type(mask_name))
        assert isinstance(norm_type, str), 'Normalization type must be a string but not %s.' \
                                           '' % str(type(norm_type))
        assert isinstance(num_pt_bg_left, int) and num_pt_bg_left >= 0,\
            'Number of Pt at left for background {0} must be non-negative integers but not of type {1}.' \
            ''.format(num_pt_bg_left, type(num_pt_bg_left))
        assert isinstance(num_pt_bg_right, int) and num_pt_bg_right >= 0,\
            'Number of Pt at right for background {0} must be non-negative integers but not of type {1}.' \
            ''.format(num_pt_bg_right, type(num_pt_bg_right))

        # set values
        self._mainWindow = main_window
        self._expNumber = exp_number
        self._scanTupleList = scan_tuple_list[:]
        self._maskDetector = mask_det
        self._normalizeType = norm_type
        self._selectedMaskName = mask_name
        self._numBgPtLeft = num_pt_bg_left
        self._numBgPtRight = num_pt_bg_right
        self._scaleFactor = scale_factor

        # other about preprocessed options
        self._checkPreprocessedScans = True

        # link signals
        self.peakMergeSignal.connect(self._mainWindow.update_merge_value)
        self.mergeMsgSignal.connect(self._mainWindow.update_merge_message)

        return
Ejemplo n.º 21
0
 def __init__(self, duration):
     QThread.__init__(self)
     self.duration = duration
Ejemplo n.º 22
0
 def __init__(self, image_view):
     QThread.__init__(self)
     self.image_view = image_view