From d18dcae4e327ffa4c161d45ae50e08cc76789eab Mon Sep 17 00:00:00 2001 From: andreas128 Date: Fri, 1 Sep 2017 16:39:27 +0200 Subject: Add store tx received for debug logging level --- dpd/src/Measure.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'dpd') diff --git a/dpd/src/Measure.py b/dpd/src/Measure.py index f6644bb..2450b8a 100644 --- a/dpd/src/Measure.py +++ b/dpd/src/Measure.py @@ -12,6 +12,11 @@ import struct import numpy as np import logging import src.Dab_Util as DU +import os +import datetime + +import logging +logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename) class Measure: """Collect Measurement from DabMod""" @@ -98,7 +103,10 @@ class Measure: """ txframe, tx_ts, rxframe, rx_ts = self.receive_tcp() - txframe_end = txframe[-100:] + + if logging.getLogger().getEffectiveLevel() == logging.DEBUG: + dt = datetime.datetime.now().isoformat() + txframe.tofile(logging_path + "/txframe_" + dt + ".iq") # Normalize received signal with sent signal rx_median = np.median(np.abs(rxframe)) -- cgit v1.2.3