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


Python Collector.setNextIndex方法代码示例

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


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

示例1: MainWindow

# 需要导入模块: from collector import Collector [as 别名]
# 或者: from collector.Collector import setNextIndex [as 别名]

#.........这里部分代码省略.........
            self.maximizer.set_bottom)
        self.otherWidget.work.toggled.connect(self.on_work)

    def on_work(self, val):
        if not val:
            self.status = "idle"
        else:
            self.status = "waiting"


    def on_wait(self, data):
        t, T1, T2 = self.collector.get_actual_temperature(2 * EXT_STAB_TIME)
        targets = [self.state.settings["USB"]["T1set"],
                   self.state.settings["USB"]["T2set"]]
        if logic.check_stability(t, [T1, T2], targets, EXT_STAB_TIME):
            self.status = "searching"
            self.state.update("PCIE", ("framecount", 200))
            print "Searching"
            middle = (self.state.settings["TimeScanner"]["top"] +
                      self.state.settings["TimeScanner"]["bottom"]) / 2
            self.state.update("USB", ("PFGI_TscanAmp", middle))
            setter = lambda x: self.state.update("USB", ("DIL_T", x))
            dt = INT_STAB_RATE * SEARCH_STEP / 3
            logic.init_search(SEARCH_BOT, SEARCH_TOP, SEARCH_STEP,
                              dt, setter)

    def on_scan(self, pcie_dev_response):
        self.collector.appendDragonResponse(pcie_dev_response)
        submatrix_to_process = None
        if self.laserscanner == "DILT":
            self.collector.appendOnChipTemperature(
                self.DIL_Tscanner.scan_position)
            self.DIL_Tscanner.scan()
            self.collector.setNextIndex(self.DIL_Tscanner.pos)
            if self.DIL_Tscanner.top_reached:
                self.startDownScan.emit()
            elif self.DIL_Tscanner.bottom_reached:
                self.startUpScan.emit()
            if (self.DIL_Tscanner.top_reached or
                self.DIL_Tscanner.bottom_reached):
                submatrix_to_process = self.DIL_Tscanner.lastsubmatrix
        if self.laserscanner == "PFGIT":
            self.collector.appendOnChipTemperature(
                self.PFGITscanner.scan_position)
            self.PFGITscanner.scan()
            self.collector.setNextIndex(self.PFGITscanner.pos)
            self.state.update("USB", ("PFGI_TscanAmp", self.PFGITscanner.targetT))
            if (self.PFGITscanner.top_reached or
                self.PFGITscanner.bottom_reached):
                submatrix_to_process = self.PFGITscanner.lastsubmatrix
        if submatrix_to_process is not None:
            self.start_processing(submatrix_to_process)

    def start_processing(self, submatrix):
        data_reg = [self.state.settings["Secondary"]["start"],
                    self.state.settings["Secondary"]["length"]]
        insane_inds = logic.check_spectra_insanity(submatrix, data_reg)
        if insane_inds:
            print "Insane channels:", insane_inds
            if len(insane_inds) == self.state.settings["Secondary"]["length"]:
                print "All specrta are broken, searching"
                self.status = "searching"
            return
        primary = self.correlator.process_submatrix(submatrix)
        self.maximizer.process_submatrix(submatrix)
        averages = self.corraverager.appendDistances(primary)
开发者ID:budylin,项目名称:pybotdr,代码行数:70,代码来源:mainwindow.py


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