Skip to content

Commit 33f75e3

Browse files
committed
load_excel
1 parent 0122614 commit 33f75e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Class/KnowledgeBase.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class KnowledgeBase():
1111
def __init__(self, matchList: [Match] = [Match], outPortList: [Port] = [Port], inPortList: [Port] = [Port]):
1212
self.matchList = matchList
1313
self.portListDict = {str: [Port]}
14+
self.portDict = {str: Port}
1415
self.matrixDict = {str: Matrix} # in,out,match
1516

1617
def learn_folder(self, path2folder='..\excel\learn/220-母线&线路-第一套合并单元&第一套合并单元'):
@@ -43,6 +44,11 @@ def load_excel(self, path2excel='..\excel\learn/220-母线&线路-第一套合
4344
for row in sheet.iterrows():
4445
port = Port(row[1][title + '端子描述'], row[1][title + '端子引用'])
4546
portList.append(port)
47+
key2 = row[1][title + '端子描述'] + title + row[1][title + '端子引用']
48+
self.portDict[key2] = port
49+
matrix = self.matrixDict.get(title, Matrix)
50+
if sheetName == '已配置':
51+
port = matrix.get(key2,{object: float})
4652
self.portListDict[key] = portList
4753
except RuntimeError:
4854
print(row[1])

0 commit comments

Comments
 (0)