From f476055cf23ea81cb7c9cedb661cf14d47e23374 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 23 Apr 2015 09:43:58 +0300 Subject: [PATCH] detect: move TIMEOUT to config module --- amodem/config.py | 1 + amodem/detect.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/amodem/config.py b/amodem/config.py index 6311077..2d4246f 100644 --- a/amodem/config.py +++ b/amodem/config.py @@ -17,6 +17,7 @@ class Configuration(object): # receiver config skip_start = 0.1 + timeout = 60.0 def __init__(self, **kwargs): self.__dict__.update(**kwargs) diff --git a/amodem/detect.py b/amodem/detect.py index e8dba4d..4f14050 100644 --- a/amodem/detect.py +++ b/amodem/detect.py @@ -19,15 +19,13 @@ class Detector(object): SEARCH_WINDOW = int(0.1 * CARRIER_DURATION) START_PATTERN_LENGTH = SEARCH_WINDOW // 4 - TIMEOUT = 10.0 # [seconds] - def __init__(self, config, pylab): self.freq = config.Fc self.omega = 2 * np.pi * self.freq / config.Fs self.Nsym = config.Nsym self.Tsym = config.Tsym self.maxlen = config.baud # 1 second of symbols - self.max_offset = self.TIMEOUT * config.Fs + self.max_offset = config.timeout * config.Fs self.plt = pylab def _wait(self, samples):