本文整理匯總了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()