Exemplo n.º 1
0
    def __init__(self, parent):

        self.parent = parent
        self.set_gui_title()
        self.set_gui_size()
        self.set_statusbar()
        self.set_main_table()
        self.set_stiching_table()
        self.set_reduced_table()
        self.set_export_stitching_settings()
        self.set_default_path()
        self.init_error_label_widgets()
        parent.allPlotAxis = AllPlotAxis()

        #enabled all widgets
        o_update_plot = UpdatePlotWidgetStatus(parent=parent)
        o_update_plot.disable_all()

        parent.ui.reductionTable.setCurrentCell(0,1)
        parent.ui.data_sequence_lineEdit.setFocus()	
        
        self.init_autopopulate_widgets()

        o_gui = GuiUtility(parent = self.parent)
        o_gui.init_widgets_value()
Exemplo n.º 2
0
    def __init__(self, parent):

        self.parent = parent
        self.set_gui_title()
        self.set_gui_size()
        self.set_statusbar()
        self.set_main_table()
        #self.set_context_menu()
        self.set_stiching_table()
        self.set_reduced_table()
        self.set_export_stitching_settings()
        self.set_default_path()
        #self.init_file_menu()
        self.init_error_label_widgets()
        parent.allPlotAxis = AllPlotAxis()

        #enabled all widgets
        o_update_plot = UpdatePlotWidgetStatus(parent=parent)
        o_update_plot.disable_all()

        ## start a separate thread for delayed actions
        #parent.trigger=DelayedTrigger()
        #parent.trigger.activate.connect(parent.processDelayedTrigger)
        #parent.trigger.start()

        parent.ui.reductionTable.setCurrentCell(0,1)
        parent.ui.reductionTable.setFocus()	
        
        self.init_autopopulate_widgets()
 def launch_update_of_plot(self):
     _row_selected = self.row_selected
     _is_data_selected = self.is_data_tab_selected()
     if self.is_row_selected_checked(_row_selected):
         DisplayPlots(parent=self.parent,
                      row=self.row_selected,
                      is_data=self.is_data_tab_selected())
     else:
         update_obj = UpdatePlotWidgetStatus(parent=self.parent)
         update_obj.disable_all()
         ClearPlots(self.parent,
                    is_data=_is_data_selected,
                    is_norm=not (_is_data_selected),
                    all_plots=True)
    def launch_update_of_plot(self):
        _row_selected = self.row_selected
        _is_data_selected = self.is_data_tab_selected()
        if self.is_row_selected_checked(_row_selected):
            DisplayPlots(parent = self.parent,
                         row = self.row_selected,
                         is_data = self.is_data_tab_selected())
        else:
            update_obj = UpdatePlotWidgetStatus(parent = self.parent)
	    update_obj.disable_all()
            ClearPlots(self.parent,
                       is_data = _is_data_selected,
                       is_norm = not(_is_data_selected),
                       all_plots = True)
Exemplo n.º 5
0
    def __init__(
        self,
        parent=None,
        row=-1,
        is_data=True,
        plot_yt=True,
        plot_yi=True,
        plot_it=True,
        plot_ix=True,
        plot_stitched=False,
        refresh_reduction_table=True,
    ):
        if row == -1:
            return

        self.parent = parent
        is_norm = not is_data
        self.is_data = is_data

        if is_data:
            col = 0
        else:
            col = 1
        self.row = row
        self.col = col

        _data = self.parent.big_table_data[row, col]

        if _data is None:
            ClearPlots(
                self.parent,
                is_data=is_data,
                is_norm=not is_data,
                plot_yt=plot_yt,
                plot_yi=plot_yi,
                plot_it=plot_it,
                plot_ix=plot_ix,
                stitched=plot_stitched,
            )
            return
        self._data = _data

        if not _data.new_detector_geometry_flag:
            self.xlim = 303
            self.ylim = 255

        # if self.parent.retain_all:
        # _active_data.all_plot_axis.yi_view_interval = self.parent.global_yi_view_interval
        # _active_data.all_plot_axis.yt_view_interval = self.parent.global_yt_view_interval
        # _active_data.all_plot_axis.it_view_interval = self.parent.global_it_view_interval
        # _active_data.all_plot_axis.ix_view_interval = self.parent.global_ix_view_interval
        # _active_data.all_plot_axis.yi_data_interval = self.parent.global_yi_view_interval
        # _active_data.all_plot_axis.yt_data_interval = self.parent.global_yt_view_interval
        # _active_data.all_plot_axis.it_data_interval = self.parent.global_it_view_interval
        # _active_data.all_plot_axis.ix_data_interval = self.parent.global_ix_view_interval

        # _active_data = self._data
        # _data.active_data = _active_data
        # parent.bigTableData[row,col] = _data

        if _data.tof_range_auto_flag:
            self.tofRangeAuto = self.getTOFrangeInMs(_data.tof_range_auto)
        else:
            self.tofRangeAuto = self.getTOFrangeInMs(_data.tof_range_manual)
        self.displayTOFrange(self.tofRangeAuto[0], self.tofRangeAuto[1], "ms")
        # print(self.tofRangeAuto)

        #        o_gui_utility = GuiUtility(parent = self.parent)
        #        o_gui_utility.set_auto_tof_range_widgets(status = _data.tof_range_auto_flag)

        self.tofAxis = self.getTOFrangeInMs(_data.tof_axis_auto_with_margin)
        self.fullTofAxis = self.getFullTOFinMs(_data.tof_axis_auto_with_margin)

        self.xy = _data.xydata
        self.ytof = _data.ytofdata
        self.countstofdata = _data.countstofdata
        self.countsxdata = _data.countsxdata
        self.ycountsdata = _data.ycountsdata

        self.peak = self.sortIntArray(_data.peak)
        self.back = self.sortIntArray(_data.back)
        self.clocking = self.sortIntArray(_data.clocking)

        self.lowRes = self.sortIntArray(_data.low_res)
        self.backFlag = bool(_data.back_flag)
        self.lowResFlag = bool(_data.low_res_flag)

        o_update_plot_widgets = UpdatePlotWidgetStatus(parent=parent)

        if is_data:
            self.workWithData(update_reduction_table=refresh_reduction_table)
            o_update_plot_widgets.enable_data()
        else:
            self.workWithNorm(update_reduction_table=refresh_reduction_table)
            o_update_plot_widgets.enable_norm()

        if plot_yt:
            ClearPlots(self.parent, plot_yt=True, is_data=is_data, is_norm=is_norm)
            self.plot_yt()

        if plot_it:
            ClearPlots(self.parent, plot_it=True, is_data=is_data, is_norm=is_norm)
            self.plot_it()

        if plot_yi:
            ClearPlots(self.parent, plot_yi=True, is_data=is_data, is_norm=is_norm)
            self.plot_yi()

        if plot_ix:
            ClearPlots(self.parent, plot_ix=True, is_data=is_data, is_norm=is_norm)
            self.plot_ix()

        if plot_yt or plot_it or plot_yi or plot_ix:
            if is_data:
                parent.ui.dataNameOfFile.setText("%s" % (_data.filename))
            else:
                parent.ui.normNameOfFile.setText("%s" % (_data.filename))
            self.displayMetadata()
Exemplo n.º 6
0
    def __init__(self,
                 parent=None,
                 row=-1,
                 is_data=True,
                 plot_yt=True,
                 plot_yi=True,
                 plot_it=True,
                 plot_ix=True,
                 plot_stitched=False,
                 refresh_reduction_table=True):
        if row == -1:
            return

        self.parent = parent
        is_norm = not is_data
        self.is_data = is_data

        if is_data:
            col = 0
        else:
            col = 1
        self.row = row
        self.col = col

        _data = self.parent.big_table_data[row, col]

        if _data is None:
            ClearPlots(self.parent,
                       is_data=is_data,
                       is_norm=not is_data,
                       plot_yt=plot_yt,
                       plot_yi=plot_yi,
                       plot_it=plot_it,
                       plot_ix=plot_ix,
                       stitched=plot_stitched)
            return
        self._data = _data

        if (not _data.new_detector_geometry_flag):
            self.xlim = 303
            self.ylim = 255

        #if self.parent.retain_all:
        #_active_data.all_plot_axis.yi_view_interval = self.parent.global_yi_view_interval
        #_active_data.all_plot_axis.yt_view_interval = self.parent.global_yt_view_interval
        #_active_data.all_plot_axis.it_view_interval = self.parent.global_it_view_interval
        #_active_data.all_plot_axis.ix_view_interval = self.parent.global_ix_view_interval
        #_active_data.all_plot_axis.yi_data_interval = self.parent.global_yi_view_interval
        #_active_data.all_plot_axis.yt_data_interval = self.parent.global_yt_view_interval
        #_active_data.all_plot_axis.it_data_interval = self.parent.global_it_view_interval
        #_active_data.all_plot_axis.ix_data_interval = self.parent.global_ix_view_interval

        #_active_data = self._data
        #_data.active_data = _active_data
        #parent.bigTableData[row,col] = _data

        if _data.tof_range_auto_flag:
            self.tofRangeAuto = self.getTOFrangeInMs(_data.tof_range_auto)
        else:
            self.tofRangeAuto = self.getTOFrangeInMs(_data.tof_range_manual)
        self.displayTOFrange(self.tofRangeAuto[0], self.tofRangeAuto[1], 'ms')
        #print(self.tofRangeAuto)

        #        o_gui_utility = GuiUtility(parent = self.parent)
        #        o_gui_utility.set_auto_tof_range_widgets(status = _data.tof_range_auto_flag)

        self.tofAxis = self.getTOFrangeInMs(_data.tof_axis_auto_with_margin)
        self.fullTofAxis = self.getFullTOFinMs(_data.tof_axis_auto_with_margin)

        self.xy = _data.xydata
        self.ytof = _data.ytofdata
        self.countstofdata = _data.countstofdata
        self.countsxdata = _data.countsxdata
        self.ycountsdata = _data.ycountsdata

        self.peak = self.sortIntArray(_data.peak)
        self.back = self.sortIntArray(_data.back)
        self.clocking = self.sortIntArray(_data.clocking)

        self.lowRes = self.sortIntArray(_data.low_res)
        self.backFlag = bool(_data.back_flag)
        self.lowResFlag = bool(_data.low_res_flag)

        o_update_plot_widgets = UpdatePlotWidgetStatus(parent=parent)

        if is_data:
            self.workWithData(update_reduction_table=refresh_reduction_table)
            o_update_plot_widgets.enable_data()
        else:
            self.workWithNorm(update_reduction_table=refresh_reduction_table)
            o_update_plot_widgets.enable_norm()

        if plot_yt:
            ClearPlots(self.parent,
                       plot_yt=True,
                       is_data=is_data,
                       is_norm=is_norm)
            self.plot_yt()

        if plot_it:
            ClearPlots(self.parent,
                       plot_it=True,
                       is_data=is_data,
                       is_norm=is_norm)
            self.plot_it()

        if plot_yi:
            ClearPlots(self.parent,
                       plot_yi=True,
                       is_data=is_data,
                       is_norm=is_norm)
            self.plot_yi()

        if plot_ix:
            ClearPlots(self.parent,
                       plot_ix=True,
                       is_data=is_data,
                       is_norm=is_norm)
            self.plot_ix()

        if plot_yt or plot_it or plot_yi or plot_ix:
            if is_data:
                parent.ui.dataNameOfFile.setText('%s' % (_data.filename))
            else:
                parent.ui.normNameOfFile.setText('%s' % (_data.filename))
            self.displayMetadata()