當前位置: 首頁>>代碼示例>>Python>>正文


Python Panel._instrument_changed方法代碼示例

本文整理匯總了Python中panel.Panel._instrument_changed方法的典型用法代碼示例。如果您正苦於以下問題:Python Panel._instrument_changed方法的具體用法?Python Panel._instrument_changed怎麽用?Python Panel._instrument_changed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在panel.Panel的用法示例。


在下文中一共展示了Panel._instrument_changed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _instrument_changed

# 需要導入模塊: from panel import Panel [as 別名]
# 或者: from panel.Panel import _instrument_changed [as 別名]
    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]
開發者ID:machielblok,項目名稱:qtlab-user-diamond-master,代碼行數:11,代碼來源:scan2d.py

示例2: _instrument_changed

# 需要導入模塊: from panel import Panel [as 別名]
# 或者: from panel.Panel import _instrument_changed [as 別名]
    def _instrument_changed(self, changes): 

        if 'dimension' in changes:
            self._ins_dimension = changes['dimension']

        if self._ins_dimension == self._dimension:
            Panel._instrument_changed(self, changes)
            
            if changes.has_key('scan_length'):
                self.ui.scan_length.setValue(float(changes['scan_length']))

            if changes.has_key('pixel_time'):
                self.ui.pixel_time.setValue(int(changes['pixel_time']))

            if changes.has_key('nr_of_points'):
                self.ui.nr_of_points.setValue(int(changes['nr_of_points']))

            if changes.has_key('gaussian_fit'):
                self.ui.gaussian_fit.setChecked(bool(changes['gaussian_fit']))

            if changes.has_key('counter'):
                self.ui.counter.setValue(int(changes['counter']))

            if 'data_update' in changes:
               
                d = changes['data_update']

                if 'points' in d:

                    self.ui.plot.set_x(self._data['points'])
                    try:
                        self.ui.plot.plot.delplot('countrates')
                        self.ui.plot.plot.delplot('fit')
                    except:
                        pass
                if 'countrates' in d:

                    self.ui.plot.add_y(self._data['countrates'], 'countrates',
                            type='scatter', marker='circle', color='green')
                if 'fit' in d:
	
                    self.ui.plot.add_y(self._data['fit'], 'fit', 
                            type='line', line_width=2, color='red')


            if changes.has_key('fit_result'):
                self._got_fit_result(changes['fit_result'])
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:49,代碼來源:optimize1d_counts_panel.py


注:本文中的panel.Panel._instrument_changed方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。