Skip to content

Commit aa4f4c0

Browse files
committed
optimise MPR process
1 parent 7dd6d75 commit aa4f4c0

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

STDF_Reader_GUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from src.Threads import PdfWriterThread, CsvParseThread, XlsxParseThread, DiagParseThread, SingleRecParseThread
5050
from llm.chat import ChatBot
5151

52-
Version = 'Beta 0.8.27'
52+
Version = 'Beta 0.8.28'
5353

5454

5555
###################################################

src/FileRead.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ def __init__(self, filename, file, filezise, notify_progress_bar, ignore_tnum, i
330330

331331
#for MPR
332332
self.mpr_pin_dict = {}
333+
self.mpr_first_field = None
333334

334335
self.all_test_result_pd = pd.DataFrame()
335336
self.frame = pd.DataFrame()
@@ -376,6 +377,7 @@ def after_begin(self, dataSource):
376377

377378
#for MPR
378379
self.mpr_pin_dict = {}
380+
self.mpr_first_field = None
379381

380382
# in order to distinguish same name inst in flow
381383
self.same_name_inst_cnt_dict = {}
@@ -532,14 +534,21 @@ def after_send(self, dataSource, data):
532534

533535
key = str(fields[V4.mpr.TEST_NUM]) + "_" + tname
534536
if fields[V4.mpr.RTN_INDX] is None:
535-
tmp_pin_list = self.mpr_pin_dict[key]
537+
# Thanks to Wade Song to figure out this bug in process MPR
538+
for keyTemp in self.mpr_pin_dict.keys():
539+
if tname.split(':')[1] in keyTemp:
540+
tmp_pin_list = self.mpr_pin_dict[keyTemp]
541+
break
536542

537543
else:
538544
self.mpr_pin_dict[key] = [self.pmr_dict[str(number)] for number in fields[V4.mpr.RTN_INDX]]
545+
self.mpr_first_field = fields # This is because All data beginning with the OPT_FLAG field has a special
546+
# function in the STDF file. The first MPR for each test will have these
547+
# fields filled in. like UNITS/RTN_INDX/HI_LIMIT/LO_LIMIT
539548
tmp_pin_list = self.mpr_pin_dict[key]
540549

541550
# Process the scale unit, but meanless in IG-XL STDF, comment it
542-
unit = str(fields[V4.mpr.UNITS])
551+
unit = str(self.mpr_first_field[V4.mpr.UNITS]) #str(fields[V4.mpr.UNITS])
543552
# val_scal = fields[V4.mpr.RES_SCAL]
544553
# if val_scal == 0:
545554
# unit = unit
@@ -568,10 +577,10 @@ def after_send(self, dataSource, data):
568577
tname_pinname = tname + '@' + tmp_pin_list[i]
569578
tname_tnumber = str(fields[V4.mpr.TEST_NUM]) + '|' + tname_pinname
570579
if not (tname_tnumber in self.tname_tnumber_dict):
571-
self.tname_tnumber_dict[tname_tnumber] = str(fields[V4.mpr.TEST_NUM]) + '|' + \
580+
self.tname_tnumber_dict[tname_tnumber] = str(self.fields[V4.mpr.TEST_NUM]) + '|' + \
572581
tname_pinname + '|' + \
573-
str(fields[V4.mpr.HI_LIMIT]) + '|' + \
574-
str(fields[V4.mpr.LO_LIMIT]) + '|' + \
582+
str(self.mpr_first_field[V4.mpr.HI_LIMIT]) + '|' + \
583+
str(self.mpr_first_field[V4.mpr.LO_LIMIT]) + '|' + \
575584
unit
576585
current_tname_tnumber = str(fields[V4.mpr.TEST_NUM]) + '|' + tname_pinname
577586
full_tname_tnumber = self.tname_tnumber_dict[current_tname_tnumber]

0 commit comments

Comments
 (0)