当前位置: 首页>>代码示例>>Python>>正文


Python Loader.associate_file_reader方法代码示例

本文整理汇总了Python中sas.sascalc.dataloader.loader.Loader.associate_file_reader方法的典型用法代码示例。如果您正苦于以下问题:Python Loader.associate_file_reader方法的具体用法?Python Loader.associate_file_reader怎么用?Python Loader.associate_file_reader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sas.sascalc.dataloader.loader.Loader的用法示例。


在下文中一共展示了Loader.associate_file_reader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from sas.sascalc.dataloader.loader import Loader [as 别名]
# 或者: from sas.sascalc.dataloader.loader.Loader import associate_file_reader [as 别名]
    def __init__(self):
        PluginBase.__init__(self, name="Pr Inversion")
        ## Simulation window manager
        self.simview = None

        ## State data
        self.alpha = self.DEFAULT_ALPHA
        self.nfunc = self.DEFAULT_NFUNC
        self.max_length = self.DEFAULT_DMAX
        self.q_min = None
        self.q_max = None
        self.has_bck = False
        self.slit_height = 0
        self.slit_width = 0
        ## Remember last plottable processed
        self.last_data = ""
        self._current_file_data = None
        ## Time elapsed for last computation [sec]
        # Start with a good default
        self.elapsed = 0.022
        self.iq_data_shown = False

        ## Current invertor
        self.invertor = None
        self.pr = None
        self.data_id = IQ_DATA_LABEL
        # Copy of the last result in case we need to display it.
        self._last_pr = None
        self._last_out = None
        self._last_cov = None
        ## Calculation thread
        self.calc_thread = None
        ## Estimation thread
        self.estimation_thread = None
        ## Result panel
        self.control_panel = None
        ## Currently views plottable
        self.current_plottable = None
        ## Number of P(r) points to display on the output plot
        self._pr_npts = 51
        self._normalize_output = False
        self._scale_output_unity = False

        ## List of added P(r) plots
        self._added_plots = {}
        self._default_Iq = {}
        self.list_plot_id = []

        # Associate the inversion state reader with .prv files
        from inversion_state import Reader

        # Create a CanSAS/Pr reader
        self.state_reader = Reader(self.set_state)
        self._extensions = '.prv'
        l = Loader()
        l.associate_file_reader('.prv', self.state_reader)
        #l.associate_file_reader(".svs", self.state_reader)

        # Log startup
        logging.info("Pr(r) plug-in started")
开发者ID:ianhi,项目名称:sasview,代码行数:62,代码来源:pr.py

示例2: get_panels

# 需要导入模块: from sas.sascalc.dataloader.loader import Loader [as 别名]
# 或者: from sas.sascalc.dataloader.loader.Loader import associate_file_reader [as 别名]
    def get_panels(self, parent):
        """
        Create and return the list of wx.Panels for your plug-in.
        Define the plug-in perspective.

        Panels should inherit from DefaultPanel defined below,
        or should present the same interface. They must define
        "window_caption" and "window_name".

        :param parent: parent window

        :return: list of panels
        """
        # # Save a reference to the parent
        self.parent = parent
        self.frame = MDIFrame(self.parent, None, 'None', (100, 200))
        self.invariant_panel = InvariantPanel(parent=self.frame)
        self.frame.set_panel(self.invariant_panel)
        self._frame_set_helper()
        self.invariant_panel.set_manager(manager=self)
        self.perspective.append(self.invariant_panel.window_name)
        # Create reader when fitting panel are created
        self.state_reader = reader(self.set_state)
        # append that reader to list of available reader
        loader = Loader()
        loader.associate_file_reader(".inv", self.state_reader)
        # loader.associate_file_reader(".svs", self.state_reader)
        # Return the list of panels
        return [self.invariant_panel]
开发者ID:ianhi,项目名称:sasview,代码行数:31,代码来源:invariant.py

示例3: get_panels

# 需要导入模块: from sas.sascalc.dataloader.loader import Loader [as 别名]
# 或者: from sas.sascalc.dataloader.loader.Loader import associate_file_reader [as 别名]
    def get_panels(self, parent):
        """
        Define the GUI panels
        """
        self.parent = parent
        self.frame = MDIFrame(self.parent, None, 'None', (100,200))
        self.data_id = IQ_DATA_LABEL
        self.corfunc_panel = CorfuncPanel(parent=self.frame)
        self.frame.set_panel(self.corfunc_panel)
        self.corfunc_panel.set_manager(self)
        self._frame_set_helper()
        self.perspective.append(self.corfunc_panel.window_name)

        l = Loader()
        l.associate_file_reader('.crf', self.state_reader)

        return [self.corfunc_panel]
开发者ID:rprospero,项目名称:sasview,代码行数:19,代码来源:corfunc.py


注:本文中的sas.sascalc.dataloader.loader.Loader.associate_file_reader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。