srslte_common: add get_num_phy_errors() method

the get_num_phy_errors() uses the external KPI analyzer module
to calculate the number of PHY layers errors in a vector of log metrics

Change-Id: I0c8de87e7f83f986e288585640ce56847959c497
This commit is contained in:
Andre Puschmann 2020-10-05 15:24:17 +02:00
parent a9bbbd64e4
commit f4fb48af9a
1 changed files with 11 additions and 0 deletions

View File

@ -87,3 +87,14 @@ class srslte_common(): # don't inherit from log.Origin here but instead use .nam
self.kpis = {}
return self.kpis
def get_num_phy_errors(self, kpi):
""" Use KPI analyzer to calculate the number PHY errors for either UE or eNB components from parsed KPI vector """
try:
# Same as above, make sure the srsLTE scripts folder is included in your PYTHONPATH env variable
from kpi_analyzer import kpi_analyzer
analyzer = kpi_analyzer(self.name())
return analyzer.get_num_phy_errors(kpi)
except ImportError:
self.log("Can't load KPI analyzer module.")
return 0