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
diff --git a/src/osmo_gsm_tester/obj/srslte_common.py b/src/osmo_gsm_tester/obj/srslte_common.py
index 9619fb6..c4d8e62 100644
--- a/src/osmo_gsm_tester/obj/srslte_common.py
+++ b/src/osmo_gsm_tester/obj/srslte_common.py
@@ -87,3 +87,14 @@
           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
\ No newline at end of file