本文整理汇总了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)
示例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()