本文整理汇总了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")
示例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]
示例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]