本文整理汇总了Python中panel.Panel类的典型用法代码示例。如果您正苦于以下问题:Python Panel类的具体用法?Python Panel怎么用?Python Panel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Panel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# designer ui
self.ui = Ui_Panel()
self.ui.setupUi(self)
# set values from instruments
# Front
self.ui.z.setValue(self._ins.get_mos_z())
self.ui.z_slider.setValue(int(self._ins.get_mos_z()*10))
# Back
#self.ui.back_z.setValue(self._ins.get_mos_back_z())
#self.ui.back_z_slider.setValue(int(self._ins.get_mos_back_z()*10))
# Stage
self.ui.x.setValue(self._ins.get_mos_x())
self.ui.y.setValue(self._ins.get_mos_y())
# Back
#self.ui.back_x.setValue(self._ins.get_mos_rearsm_x())
#self.ui.back_y.setValue(self._ins.get_mos_rearsm_y())
# Detsm
#self.ui.detsm_x.setValue(self._ins.get_mos_detsm_x())
#self.ui.detsm_y.setValue(self._ins.get_mos_detsm_y())
# Other
self.ui.keyword.setText(self._ins.get_keyword())
示例2: __init__
def __init__(self, parent, **kwargs):
Panel.__init__(self, parent, top=parent.height-30, left=0, width=parent.width, height=30)
self.border_style = BORDER_LOWERED
self._grip = TkSizeGrip(self._ctrl)
self._grip.pack(side=RIGHT, fill=Y)
# TODO: fix bug when toggling packed objects visibility (need to know original setup to reposition)
self.align = ALIGN_BOTTOM
示例3: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# designer ui
self.ui = Ui_Panel()
self.ui.setupUi(self)
self.ui.test_value.setValue(self._ins.get_test_value())
self.ui.float_test_value.setValue(self._ins.get_float_test_value())
self.ui.string_test_value.setText(self._ins.get_string_test_value())
self.ui.slider_value.setValue(self._ins.get_slider_value())
self.ui.check_value.setChecked(self._ins.get_check_value())
self.ui.radio1.setChecked(self._ins.get_radio1())
self.ui.radio2.setChecked(self._ins.get_radio2())
self.ui.radio3.setChecked(self._ins.get_radio3())
self.ui.test_value.valueChanged.connect(self._set_test_value)
self.ui.float_test_value.valueChanged.connect(self._set_float_test_value)
self.ui.string_test_value.textEdited.connect(self._set_string_test_value)
self.ui.slider_value.sliderMoved.connect(self._set_slider_value)
self.ui.check_value.toggled.connect(self._set_check_value)
self.ui.radio1.toggled.connect(self._set_radio1)
self.ui.radio2.toggled.connect(self._set_radio2)
self.ui.radio3.toggled.connect(self._set_radio3)
self.ui.do_something.pressed.connect(self._do_something)
self.ui.do_something_else.pressed.connect(self._do_something_else)
示例4: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# designer ui
self.ui = Ui_Panel()
self.ui.setupUi(self)
self.ui.keyword.setText(self._ins.get_keyword())
self.ui.x.setValue(self._ins.get_x())
self.ui.y.setValue(self._ins.get_y())
self.ui.z.setValue(self._ins.get_z())
self.ui.z_slider.setValue(self._ins.get_z_slider())
self.ui.step.setValue(self._ins.get_step())
self.ui.keyword.textEdited.connect(self._set_keyword)
self.ui.x.valueChanged.connect(self._set_x)
self.ui.y.valueChanged.connect(self._set_y)
self.ui.z.valueChanged.connect(self._set_z)
self.ui.z_slider.sliderMoved.connect(self._set_z_slider)
self.ui.step.valueChanged.connect(self._set_step)
self.ui.step_up.pressed.connect(self._step_up)
self.ui.step_left.pressed.connect(self._step_left)
self.ui.step_right.pressed.connect(self._step_right)
self.ui.step_down.pressed.connect(self._step_down)
示例5: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# designer ui
self.ui = Ui_Panel()
self.ui.setupUi(self)
self.ui.doubleSpinBox_start_F.setValue(self._ins.get_doubleSpinBox_start_F())
self.ui.doubleSpinBox_stop_f.setValue(self._ins.get_doubleSpinBox_stop_f())
self.ui.doubleSpinBox_step_f.setValue(self._ins.get_doubleSpinBox_step_f())
self.ui.doubleSpinBox_coarse_wav.setValue(self._ins.get_doubleSpinBox_coarse_wav())
self.ui.doubleSpinBox_int_time.setValue(self._ins.get_doubleSpinBox_int_time())
self.ui.doubleSpinBox_start_F.valueChanged.connect(self._set_doubleSpinBox_start_F)
self.ui.doubleSpinBox_stop_f.valueChanged.connect(self._set_doubleSpinBox_stop_f)
self.ui.doubleSpinBox_step_f.valueChanged.connect(self._set_doubleSpinBox_step_f)
self.ui.doubleSpinBox_coarse_wav.valueChanged.connect(self._set_doubleSpinBox_coarse_wav)
self.ui.doubleSpinBox_int_time.valueChanged.connect(self._set_doubleSpinBox_int_time)
self.ui.start_scan_button.pressed.connect(self._start_scan_button)
self.ui.stop_scan_button.pressed.connect(self._stop_scan_button)
self.ui.save_scan_button.pressed.connect(self._save_scan_button)
self.ui.plot.bottom_axis.title = 'frequency [GHz]'
self.ui.plot.left_axis.title = 'intensity'
self.ui.plot.plot.padding = 5
#self.ui.plot.plot.padding_bottom = 30
self.ui.plot.plot.padding_left = 70
示例6: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# UI
self.ui = Ui_Panel()
self.ui.setupUi(self, evalfunc=self._ins.evaluate,
execfunc=self._ins.execute)
示例7: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# designer ui:
self.ui = Ui_Panel()
self.ui.setupUi(self)
for p in [self.ui.plot1, self.ui.plot2]:
p.left_axis.title = 'counts [Hz]'
p.plot.padding = 5
p.plot.padding_bottom = 30
p.plot.padding_left = 100
plot = p.plot.plots['trace'][0]
plot.padding = 0
plot.color = 'green'
plot.marker = 'circle'
plot.marker_size = 3
for c in [self.ui.counts1, self.ui.counts2]:
c.setText('0.0')
# set other defaults
self.ui.plot1.display_time = 20
self.ui.plot2.display_time = 20
self.ui.t_range.setValue(20)
示例8: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# designer ui
self.ui = Ui_Panel()
self.ui.setupUi(self)
self.ui.scan_length.setValue(self._ins.get_scan_length())
self.ui.pixel_time.setValue(self._ins.get_pixel_time())
self.ui.nr_of_points.setValue(self._ins.get_nr_of_points())
self.ui.gaussian_fit.setChecked(self._ins.get_gaussian_fit())
self.ui.counter.setValue(self._ins.get_counter())
self.ui.scan_length.valueChanged.connect(self._set_scan_length)
self.ui.pixel_time.valueChanged.connect(self._set_pixel_time)
self.ui.nr_of_points.valueChanged.connect(self._set_nr_of_points)
self.ui.gaussian_fit.toggled.connect(self._set_gaussian_fit)
self.ui.counter.valueChanged.connect(self._set_counter)
self.ui.start.pressed.connect(self._start)
# set up plot
for p in self.ui.xplot, self.ui.yplot:
p.bottom_axis.title = 'x [um]'
p.left_axis.title = 'counts [Hz]'
p.plot.padding = 5
p.plot.padding_bottom = 30
p.plot.padding_left = 70
self.ui.yplot.bottom_axis.title = 'y [um]'
示例9: __init__
def __init__(self):
self.console = None
self.outText = None
self.inText = None
self.outTextScroller = None
self.nestedInputPanel = None
self.directoryText = None
Panel.__init__(self, "insets 0 0 0 0")
示例10: _instrument_changed
def _instrument_changed(self, changes):
Panel._instrument_changed(self, changes)
if 'data_reset' in changes or 'data_update' in changes:
self._replot()
for k in ['x_position', 'y_position']:
if k in changes:
self.position[k] = changes[k]
示例11: __init__
def __init__(self, x, y, expedition):
Panel.__init__(self, x, y, 200, 80)
self.expedition = expedition
self.specialists_label = Label(0, 0, "Workers/Warriors: %d/%d" % (expedition.workers, expedition.warriors))
self.people_label = Label(0, 20, "Population: %d" % expedition.people)
self.destination_label = Label(0, 40, "Destination: (%d, %d)" % (expedition.path[0].x, expedition.path[0].y))
self.regularity_label = Label(0, 60, "Regular: %s" % ("Yes" if expedition.regular else "No"))
self.add(self.specialists_label)
self.add(self.people_label)
self.add(self.destination_label)
self.add(self.regularity_label)
示例12: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# designer ui
self.ui = Ui_Panel()
self.ui.setupUi(self)
self.ui.t_range.setValue(self._ins.get_t_range())
self.ui.integration_time.setValue(self._ins.get_integration_time())
self.ui.t_range.valueChanged.connect(self._set_t_range)
self.ui.integration_time.valueChanged.connect(self._set_integration_time)
示例13: appendPanelElement
def appendPanelElement(self, panelElement):
'''
Append an element to the first panel that has room
if there is no free spot create a panel and put the element inside
'''
for panel in self.panels:
if panel.appendPanelElement(panelElement):
break
else:
panel = Panel(1)
self.panels.append(panel)
return panel.appendPanelElement(panelElement)
return True
示例14: __init__
def __init__(self, parent, *arg, **kw):
Panel.__init__(self, parent, *arg, **kw)
# designer ui
self.ui = Ui_Panel()
self.ui.setupUi(self)
self.ui.x.setValue(self._ins.get_mos_x())
self.ui.y.setValue(self._ins.get_mos_y())
self.ui.z.setValue(self._ins.get_mos_z())
self.ui.z_slider.setValue(int(self._ins.get_mos_z()*10))
self.ui.keyword.setText(self._ins.get_keyword())
示例15: main
def main():
lMonitors = parseMonitors()
config = Configuration("test.conf")
panel_threads = []
# only handling 'all' case for now.
if config.location['monitor'] == 'all':
for m in lMonitors:
p = Panel(config)
p.launch(m)
t = threading.Thread(target=p.run, kwargs={'monitor': m})
t.start()
pass