本文整理汇总了Python中pyface.timer.do_later.do_later函数的典型用法代码示例。如果您正苦于以下问题:Python do_later函数的具体用法?Python do_later怎么用?Python do_later使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了do_later函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: app_factory
def app_factory():
'''
assemble the plugins
return a Pychron WorkbenchApplication
'''
plugins = [
CorePlugin(),
WorkbenchPlugin(),
PychronWorkbenchPlugin(),
PychronWorkbenchUIPlugin(),
]
plugins += get_hardware_plugins()
plugins += get_user_plugins()
app = Pychron(plugins=plugins)
gLoggerDisplay.application = app
gMessageDisplay.application = app
gWarningDisplay.application = app
gTraceDisplay.application = app
if globalv.open_logger_on_launch:
do_later(gLoggerDisplay.open_view, gLoggerDisplay)
return app
开发者ID:softtrainee,项目名称:arlab,代码行数:26,代码来源:pychron_run.py
示例2: _open_individual
def _open_individual(self, si):
si = self._record_factory(si)
if isinstance(si, str):
si = self._record_factory(si)
else:
si.selector = self
if not si.initialize():
return
sid = si.record_id
try:
si.load_graph()
si.window_x = self.wx
si.window_y = self.wy
def do(si, sid):
self.debug('{}'.format(si))
info = si.edit_traits()
self._open_window(sid, info)
self.debug('do later open')
do_later(do, si, sid)
except Exception, e:
import traceback
traceback.print_exc()
self.warning(e)
开发者ID:softtrainee,项目名称:arlab,代码行数:28,代码来源:database_selector.py
示例3: _update_editor
def _update_editor(self, editor, editor_factory,
identifier, aliquot, layout=True,
use_date_range=False, calculate_age=False):
if editor is None:
editor = editor_factory()
# if layout:
# self.task.split_editors(-2, -1)
# else:
# if not self._polling:
# self.task.activate_editor(editor)
#gather analyses
tool=None
if hasattr(editor, 'search_tool'):
tool = editor.search_tool
ans = self._get_analyses(tool, identifier,
aliquot, use_date_range)
ans = self._sort_analyses(ans)
if calculate_age:
for ai in ans:
ai.calculate_age()
editor.set_items(ans, update_graph=False)
group_analyses_by_key(editor.analyses, 'labnumber')
editor.clear_aux_plot_limits()
do_later(editor.rebuild)
# editor.rebuild()
return editor
开发者ID:UManPychron,项目名称:pychron,代码行数:31,代码来源:system_monitor_editor.py
示例4: check
def check(self):
'''
'''
local_info = None
major = None
minor = None
# get the local version info
if os.path.isfile(self.local_path):
with open(self.local_path, 'rb') as f:
local_info = pickle.load(f)
if os.path.isfile(self.src_path):
# get the version_info associated with the src code
with open(self.src_path, 'rb') as f:
f.readline()
line = f.readline()
major = line.split('=')[1].strip()
line = f.readline()
minor = line.split('=')[1].strip()
self.version_info = VersionInfo(major=major,
minor=minor)
f.readline()
p = []
ps = []
new_para = False
for line in f:
line = line.strip()
if new_para:
ps.append(p)
p = []
new_para = False
if len(line) > 0:
if len(p) == 0 and line[0] == '#':
line = '<h5><u>{}</u></h5>'.format(line[1:])
p.append(line)
else:
new_para = True
self.version_info.text = \
''.join(['<p>{}</p>'.format(pj) for pj in
[' '.join(pi) for pi in ps if len(pi) > 0]])
if minor is not None and major is not None:
mismatch = True
if local_info is not None:
mismatch = local_info.version != '.'.join((major,
minor))
if mismatch:
if local_info is not None:
self.local_version = local_info.version
elif local_info is None:
do_later(self.edit_traits, kind='modal')
开发者ID:softtrainee,项目名称:arlab,代码行数:60,代码来源:version_info.py
示例5: open_power_graph
def open_power_graph(self, rid, path=None):
if self.power_graph is not None:
self.power_graph.close()
del(self.power_graph)
g = StreamGraph(
window_x=0.01,
window_y=0.4,
container_dict=dict(padding=5),
# view_identifier='pychron.fusions.power_graph'
)
self.power_graph = g
g.window_title = 'Power Readback - {}'.format(rid)
g.new_plot(data_limit=60,
scan_delay=1,
xtitle='time (s)',
ytitle='power (%)',
)
g.new_series()
if self.record_brightness:
g.new_series()
do_later(self._open_power_graph, g)
开发者ID:softtrainee,项目名称:arlab,代码行数:26,代码来源:fusions_laser_manager.py
示例6: _current_task_name_changed
def _current_task_name_changed(self, new):
print 'task change {} {}, no_update {}'.format(id(self), new, self._no_update)
if self._no_update:
return
func = getattr(self, 'activate_{}_task'.format(new.lower()))
do_later(func)
开发者ID:OSUPychron,项目名称:pychron,代码行数:7,代码来源:analysis_edit_task.py
示例7: _print_results
def _print_results(self):
def wrapper(display, *args):
display.freeze()
display.clear(gui=False)
for ai in args:
ai(display)
display.thaw()
def func():
wrapper(self.signal_display,
self._print_signals,
self._print_baselines
)
wrapper(self.ratio_display,
self._print_ratios,
self._print_blanks
)
wrapper(self.summary_display,
self._print_summary
)
wrapper(self.fit_display,
self._print_fits
)
do_later(func)
开发者ID:softtrainee,项目名称:arlab,代码行数:25,代码来源:plot_panel.py
示例8: close_valve
def close_valve(self, name, **kw):
if not self._close_logic(name):
self.debug('logic failed')
do_later(self.warning_dialog, 'Close Valve Failed. Prevented by safety logic')
return False, False
if self.switch_manager:
return self.switch_manager.close_switch(name, **kw)
开发者ID:NMGRL,项目名称:pychron,代码行数:8,代码来源:furnace_manager.py
示例9: _listen
def _listen(self):
self._otime = self.otime
while self._alive:
time.sleep(1 / self._freq)
if self._check():
do_later(self._callback)
# self._callback()
self._otime = self.otime
开发者ID:softtrainee,项目名称:arlab,代码行数:8,代码来源:file_listener.py
示例10: _set_message
def _set_message(self, v):
if v:
self.console = '{}\n{}'.format(self.console, self.format_message(v))
do_later(self.trait_set, message='')
cmd = self.process_command(v)
if isinstance(cmd, str):
self._update_console(cmd)
开发者ID:UManPychron,项目名称:pychron,代码行数:8,代码来源:foobot.py
示例11: show
def show(self, **kw):
args = tuple()
if not self.initialized:
func = self.edit_traits
else:
func = self.trait_set
kw['raised'] = True
do_later(func, *args, **kw)
开发者ID:softtrainee,项目名称:arlab,代码行数:9,代码来源:viewable.py
示例12: do_grapher
def do_grapher(args):
op = args.o[0]
g = Grapher()
g.load(args.datafile[0], args.kind[0])
if op:
do_later(g.graph.save_pdf, op)
g.configure_traits()
开发者ID:softtrainee,项目名称:arlab,代码行数:9,代码来源:grapher.py
示例13: _add_marker_button_fired
def _add_marker_button_fired(self):
# self.add_recording_marker()
# xs = self.graph.get_data('x0')
def do():
xs = self.graph.plots[0].data.get_data('x0')
self.record_data_manager.write_to_frame(tuple(' '))
self.graph.add_vertical_rule(xs[-1])
do_later(do)
开发者ID:softtrainee,项目名称:arlab,代码行数:9,代码来源:scan_manager.py
示例14: _open_graph
def _open_graph(self, graph=None):
def _open(graph):
if graph is None:
graph = self.graph
ui = graph.edit_traits()
if self.parent:
self.parent.add_window(ui)
do_later(_open, graph=graph)
开发者ID:softtrainee,项目名称:arlab,代码行数:9,代码来源:power_calibration_manager.py
示例15: _reset_connection_label
def _reset_connection_label(self, d):
def func():
self._connected_label = 'Not Tested'
self._connected_color = 'orange'
if d:
do_later(func)
else:
func()
开发者ID:NMGRL,项目名称:pychron,代码行数:9,代码来源:connection_preferences.py
示例16: activated
def activated(self):
# self.manager.tray = 'A'
# self.manager.irradiation = 'NM-251'
# self.manager.level = 'H'
# self.manager.labnumber = '61311'
if self.manager.setup():
bind_preference(self, 'save_directory', 'pychron.loading.save_directory')
else:
do_later(self.window.close)
开发者ID:jirhiker,项目名称:pychron,代码行数:10,代码来源:load_task.py
示例17: _test
def _test(self):
det = self.detector
do_later(det.edit_traits)
import time
time.sleep(1)
det.collect_baseline()
while 1:
do_later(det.get_value, verbose=False)
time.sleep(0.25)
开发者ID:softtrainee,项目名称:arlab,代码行数:11,代码来源:brigthness_manager.py
示例18: _test_interpolate_one
def _test_interpolate_one(self):
sm = self.stage_map
ca = self.canvas
h = sm.get_hole('7')
args = sm.get_interpolated_position('7')
# print args
color = (1, 1, 0)
if args:
nx = args[0]
ny = args[1]
self.record_interpolation(h, nx, ny, color, dump=False)
do_later(ca.invalidate_and_redraw)
开发者ID:softtrainee,项目名称:arlab,代码行数:12,代码来源:stage_visualizer.py
示例19: _equilibrate_temp
def _equilibrate_temp(self, temp, func, st, tol, std):
''' wait until pyrometer temp equilibrated
'''
temps = []
# ttemps = []
py = self.laser_manager.pyrometer
tc = self.laser_manager.get_device('temperature_monitor')
n = 15
self.laser_manager.set_laser_temperature(temp)
ctemp = self.laser_manager.map_temperature(temp)
# ctemp = self.laser_manager.temperature_controller.map_temperature(temp)
while 1:
if self._cancel:
break
sti = time.time()
py_t = py.read_temperature(verbose=False)
tc_t = tc.read_temperature(verbose=False)
# t = time.time() - st
do_later(func, py_t, tc_t)
temps.append(py_t)
# ttemps.append(tc_t)
ns = array(temps[-n:])
# ts = array(ttemps[-n:])
if abs(ns.mean() - ctemp) < tol and ns.std() < std:
break
elapsed = time.time() - sti
time.sleep(max(0.0001, min(1, 1 - elapsed)))
nn = 30
ptemps = []
ctemps = []
for _ in range(nn):
if self._cancel:
break
sti = time.time()
# t = sti - st
py_t = py.read_temperature(verbose=False)
tc_t = tc.read_temperature(verbose=False)
do_later(func, py_t, tc_t)
ptemps.append(py_t)
ctemps.append(tc_t)
elapsed = time.time() - sti
time.sleep(max(0.0001, min(1, 1 - elapsed)))
return array(ptemps).mean(), array(ctemps).mean()
开发者ID:softtrainee,项目名称:arlab,代码行数:52,代码来源:laser_script_executor.py
示例20: _test_interpolate_all
def _test_interpolate_all(self):
sm = self.stage_map
ca = self.canvas
colors = [(1, 1, 0), (0, 1, 1), (0, 0.75, 1), (0, 0.5, 1),
(0, 0.75, 0.75), (0, 0.5, 0.75)
]
for j, color in enumerate(colors[:1]):
self.info('iteration {}'.format(j + 1))
s = 0
for i in range(60, -1, -1):
h = sm.get_hole(str(i + 1))
self.set_current_hole(h)
r = random.randint(0, 10)
r = 0
if r > 5:
nx, ny = self._apply_calibration(h)
nx = self._add_error(nx)
ny = self._add_error(ny)
self.record_correction(h, nx, ny, dump=False)
sm.set_hole_correction(h.id, nx, ny)
else:
kw = dict(cpos=self.center,
rotation=self.rotation)
if not self.use_calibration:
kw['cpos'] = (0, 0)
kw['rotation'] = 0
args = sm.get_interpolated_position(h.id,
**kw
)
if args:
s += 1
nx = args[0]
ny = args[1]
self.record_interpolation(h, nx, ny , color, dump=False)
else:
if not h.has_correction():
self.record_uncorrected(h)
# time.sleep(0.5)
# do_later(ca.invalidate_and_redraw)
n = 61 - sum([1 for si in sm.sample_holes if si.has_correction()])
self.info('interpolated holes {} - noncorrected {}'.format(s, n))
if not n or not s:
break
do_later(ca.invalidate_and_redraw)
self.dump()
self.info('noncorrected holes = {}'.format(n))
开发者ID:softtrainee,项目名称:arlab,代码行数:50,代码来源:stage_visualizer.py
注:本文中的pyface.timer.do_later.do_later函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论