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


Python System.stop方法代碼示例

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


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

示例1: qa_linker

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import stop [as 別名]
def qa_linker():
    import time
    from gnuradio import window
    from system import System
    from signal_psk31 import PSK31Signal

    def mag(c):
        """Magnitude of complex number."""
        return (c*c.conjugate()).real

    src = gr.wavfile_source("../example.WAV", False)
    samp_rate = 44100
    tb = gr.top_block()
    system = System(tb, src, samp_rate, throttle=False, src_is_float=True,
                    center_freq=0)
    linker = Linker(1000, 80, samp_rate)
    snk = gr.null_sink(gr.sizeof_gr_complex)
    system.connect(system.out, linker, snk)
    system.refresh()
    system.start()
    time.sleep(5)
    system.stop()
    data = linker.probe.level()
    print(data[:10])
    print(linker.samp_rate)
    plot_fft([mag(x) for x in data], linker.samp_rate)
開發者ID:benreynwar,項目名稱:gr-ham,代碼行數:28,代碼來源:channelizer.py

示例2: BRTest

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import stop [as 別名]
class BRTest(unittest.TestCase):
    def showMsg(self, msg):
        print "[%s/%s/%s] %s" % (self.testname, self.testinstance,
                                 datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
                                 msg)
    def setUp(self):
        if os.getenv("REUSE_BUILD"):
            self.builddir = os.getenv("REUSE_BUILD").rstrip("/")
            skip_build = True
        else:
            skip_build = False
            b = subprocess.check_output(["mktemp", "-d", "buildroot.XXXXX"],
                                        cwd=configtest.builddir)
            b = b.strip()
            self.builddir = os.path.join(configtest.builddir, b)
        self.testname = self.__class__.__name__
        self.testinstance = os.path.basename(self.builddir)
        self.buildlog = self.builddir + "-build.log"
        self.runlog = self.builddir + "-run.log"
        self.s = None
        self.showMsg("Starting")
        self.b = Builder(self.__class__.config, self.builddir, self.buildlog)
        if not skip_build:
            self.showMsg("Building")
            self.b.build()
            self.showMsg("Building done")
        self.s = System(self.runlog)

    def tearDown(self):
        self.showMsg("Cleaning up")
        if self.s:
            self.s.stop()
        if self.b and os.getenv("KEEP_BUILD"):
            self.b.delete()
開發者ID:linux4hach,項目名稱:buildroot-runtime-test,代碼行數:36,代碼來源:basetest.py


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