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


Python Collector.clear方法代碼示例

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


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

示例1: MainWindow

# 需要導入模塊: from collector import Collector [as 別名]
# 或者: from collector.Collector import clear [as 別名]

#.........這裏部分代碼省略.........
            print "stopping DILT scan"
            if not self.status == "scanning":
                self.conttimer.timeout.disconnect(self._cont_DILT)
            else:
                self.status = "idle"

    def mouseDoubleClickEvent(self, event):
        widgets = [self.usbWidget]
        if self.plotsOnly:
            for w in widgets:
                w.show()
            self.plotsOnly = False
        else:
            for w in widgets:
                w.hide()
            self.plotsOnly = True

    def keyPressEvent(self, event):
        if event.key() == QtCore.Qt.Key_F1:
            self.freezeGraphs()
        super(Base, self).keyPressEvent(event)

    def freezeGraphs(self):
        if self.plotsFreezed:
            self.collector.reflectogrammChanged.connect(self.dragonplot.myplot)
            self.collector.spectraOnChipChanged.connect(self.spectraplot.setData)
            self.collector.temperatureCurveChanged.connect(self.temperatureplot.t0)
            self.collector.temperatureCurve2Changed.connect(self.temperatureplot.t1)
            self.correlator.measured.connect(self.distanceplot.myplot)
            self.corraverager.measured.connect(self.distanceplot.d2)
        else:
            self.collector.reflectogrammChanged.disconnect(self.dragonplot.myplot)
            self.collector.spectraOnChipChanged.disconnect(self.spectraplot.setData)
            self.collector.temperatureCurveChanged.disconnect(self.temperatureplot.t0)
            self.collector.temperatureCurve2Changed.disconnect(self.temperatureplot.t1)
            self.correlator.measured.disconnect(self.distanceplot.myplot)
            self.corraverager.measured.disconnect(self.distanceplot.d2)

        self.plotsFreezed = not self.plotsFreezed

    def _cont(self):
        print "started scanning with PFGIT"
        self.status = "scanning"
        self.laserscanner = "PFGIT"
        self.collector.clear()
        self.PFGITscanner.reset()
        self.collector.setNextIndex(self.PFGITscanner.pos)

    def _cont_DILT(self):
        print "started scanning with DILT"
        self.status = "scanning"
        self.laserscanner = "DIL"
        self.collector.clear()
        self.DIL_Tscanner.reset()
        self.collector.setNextIndex(self.DIL_Tscanner.pos)
        self.startUpScan()

    def process_secondary(self):
        for i in range(4):
            diff = self.secondary.diffs[i] - (i - 1.5) * 20
            self.diffsPlot.myplot(diff, n=i)

        print self.secondary.results.shape
        print self.secondary.results[:,990:1010]
        print self.secondary.results[:,10990:11010]
        print np.sum(self.secondary.results, axis=1)

    def connectCorrectorWidget(self):
        self.correctorWidget.A.valueChanged.connect(self.corrector.setA)
        self.correctorWidget.channel.valueChanged.connect(self.corrector.setChannel)
        self.correctorWidget.enabled.toggled.connect(self.corrector.setEnabled)
        self.correctorWidget.distance.valueChanged.connect(self.corrector.setTargetDistance)

    def connectScanerWidget(self):
        self.scannerWidget.top.valueChanged.connect(self.PFGITscanner.setTop)
        self.scannerWidget.bottom.valueChanged.connect(self.PFGITscanner.setBottom)
        self.scannerWidget.nsteps.valueChanged.connect(self.PFGITscanner.setNdot)
        self.scannerWidget.accurateScan.clicked.connect(self.start_PFGIT_scan)

        self.DILTScannerWidget.top.valueChanged.connect(self.DIL_Tscanner.setTop)
        self.DILTScannerWidget.bottom.valueChanged.connect(self.DIL_Tscanner.setBottom)
        self.DILTScannerWidget.nsteps.valueChanged.connect(self.DIL_Tscanner.setNdot)
        self.DILTScannerWidget.accurateScan.clicked.connect(self.start_DILT_scan)




    def connectOtherWidget(self):
        self.otherWidget.plotChannel.valueChanged.connect(self.spectraplot.setChannel)
        self.otherWidget.saveData.clicked.connect(self.collector.savelastscan)
        self.otherWidget.saveView.clicked.connect(self.saveView)
        self.otherWidget.inverse.toggled.connect(
            self.collector.setInversion)

    def start_FOL2_oscilation(self):
        self.killTimer(self.FOL2timer)
        self.FOL2timer = self.startTimer(self.usbWidget.FOL2_period.value())

    def closeEvent(self, event):
        pass
開發者ID:budylin,項目名稱:pybotdr,代碼行數:104,代碼來源:mainwindow.py

示例2: MainWindow

# 需要導入模塊: from collector import Collector [as 別名]
# 或者: from collector.Collector import clear [as 別名]

#.........這裏部分代碼省略.........
            for w in widgets:
                w.hide()
            self.plotsOnly = True
    
    def keyPressEvent(self, event):
        print event.key()
        print "123"
        if event.key() == QtCore.Qt.Key_F1:
            print "F1 pressed"
            self.freezeGraphs()
        super(Base, self).keyPressEvent(event)
    
    def freezeGraphs(self):
        if self.plotsFreezed:
            self.collector.reflectogrammChanged.connect(self.dragonplot.myplot)
            self.collector.spectraOnChipChanged.connect(self.spectraplot.setData)
            self.collector.temperatureCurveChanged.connect(self.temperatureplot.t0)
            self.collector.temperatureCurve2Changed.connect(self.temperatureplot.t1)
            self.correlator.measured.connect(self.distanceplot.myplot)
            self.corraverager.measured.connect(self.distanceplot.d2)
        else:
            self.collector.reflectogrammChanged.disconnect(self.dragonplot.myplot)
            self.collector.spectraOnChipChanged.disconnect(self.spectraplot.setData)
            self.collector.temperatureCurveChanged.disconnect(self.temperatureplot.t0)
            self.collector.temperatureCurve2Changed.disconnect(self.temperatureplot.t1)
            self.correlator.measured.disconnect(self.distanceplot.myplot)
            self.corraverager.measured.disconnect(self.distanceplot.d2)
        
        self.plotsFreezed = not self.plotsFreezed
    
    def _cont(self):
        print "started"
        self.isScanning = True
        self.collector.clear()
        print "cleared"
        self.scanner.reset()
        print "reset"
        
        self.pcieClient.measured.connect(self.collector.appendDragonResponse)
        #self.precollector.averaged.connect(self.collector.appendDragonResponse)
        
        self.scanner.scan()
        self.collector.reflectogrammChanged.connect(self.scanner.scan)
        self.scanner.boundaryReached.connect(
            self.approximator.process_submatrix)
        self.scanner.boundaryReached.connect(
            self.correlator.process_submatrix)
        self.scanner.boundaryReached.connect(
            self.maximizer.process_submatrix)
    
    def _cont_DILT(self):
        print "started"
        self.isScanning = True
        self.collector.clear()
        self.DIL_Tscanner.reset()
        
        self.pcieClient.measured.connect(self.collector.appendDragonResponse)
        #self.precollector.averaged.connect(self.collector.appendDragonResponse)
        
        self.DIL_Tscanner.scan()
        self.usbWorker.start_up_scan()
        self.collector.reflectogrammChanged.connect(self.DIL_Tscanner.scan)
        self.DIL_Tscanner.topReached.connect(self.usbWorker.start_down_scan)
        self.DIL_Tscanner.bottomReached.connect(self.usbWorker.start_up_scan)
        self.DIL_Tscanner.boundaryReached.connect(
            self.approximator.process_submatrix)
開發者ID:omega-photonics,項目名稱:dragon-pyBOTDR,代碼行數:70,代碼來源:mainwindow.py


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