Add strength list to check the bsp

This commit is contained in:
Porter
2025-05-25 12:15:16 +08:00
parent cdc40f795c
commit fb2104edf3
6 changed files with 62 additions and 132 deletions
+25
View File
@@ -137,6 +137,31 @@ class ChanLun():
for index in range(0, len(dataframe)):
state_list.append("00")
return state_list
def get_klc_strength_list(self, dataframe):
klc_list = self.get_klc_list(dataframe)
bi_list = self.cal_bi_list(klc_list)
klc_strength_list = []
klc_index = 0
fx_list = []
for index in range(0, len(dataframe)):
if klc_index == len(klc_list):
klc_index = len(klc_list) - 1
klc = klc_list[klc_index]
if klc.end_klu and klc.end_klu.idx == index:
klc_index += 1
if klc.klc_fx_type == Chan_KLC_FX.TOP1 or klc.klc_fx_type == Chan_KLC_FX.TOP2:
fx_list.append(1)
elif klc.klc_fx_type == Chan_KLC_FX.BOTTOM1 or klc.klc_fx_type == Chan_KLC_FX.BOTTOM2:
fx_list.append(-1)
else:
fx_list.append(0)
klc_strength_list.append(klc.cal_fx_strength())
#if klc.klc_fx_type != Chan_KLC_FX.UNKNOWN and klc.cal_fx_strength() > 1:
#print(klc.start_time, klc.end_time, klc.cal_fx_strength(), klc.klc_fx_type, fx_list[-1], klc_strength_list[-1])
else:
klc_strength_list.append(0)
fx_list.append(0)
return klc_strength_list, fx_list
def get_all_state(self, df_list):
state_list = []
for df in df_list: