개정판 13ce32a8
issue $000
1. Symbols 테이블 컬럼 변경에 따른 소스 수정
Change-Id: Ibf8ae34bbe0b6a5c28fe24bae65953c6b81b149d
HYTOS/HYTOS/AppDocData.py | ||
---|---|---|
542 | 542 |
|
543 | 543 |
conn = sqlite3.connect(dbPath) |
544 | 544 |
cursor = conn.cursor() |
545 |
sql = """SELECT a.UID,a.Name,b.Type,a.Threshold,a.MinMatchPoint,a.IsDetectOrigin,a.RotationCount,a.OCROption,a.IsContainChild,a.OriginalPoint,a.ConnectionPoint, |
|
546 |
a.BaseSymbol,a.AdditionalSymbol,a.IsExceptDetect,a.HasInstrumentLabel,a.flip FROM Symbol a inner join SymbolType b on a.SymbolType_UID=b.UID WHERE a.IsExceptDetect = 0 order by width * height desc""" |
|
545 |
#sql = """SELECT a.UID,a.Name,b.Type,a.Threshold,a.MinMatchPoint,a.IsDetectOrigin,a.RotationCount,a.OCROption,a.IsContainChild,a.OriginalPoint,a.ConnectionPoint, |
|
546 |
# a.BaseSymbol,a.AdditionalSymbol,a.IsExceptDetect,a.HasInstrumentLabel,a.flip FROM Symbol a inner join SymbolType b on a.SymbolType_UID=b.UID WHERE a.IsExceptDetect = 0 order by width * height desc""" |
|
547 |
|
|
548 |
sql = """select s.UID |
|
549 |
, s.Name |
|
550 |
, t.Type |
|
551 |
, s.OriginalPoint |
|
552 |
, s.ConnectionPoint |
|
553 |
from Symbols s |
|
554 |
inner join SymbolType t |
|
555 |
on s.SymbolType_UID = t.UID""" |
|
556 |
|
|
547 | 557 |
try: |
548 | 558 |
cursor.execute(sql) |
549 | 559 |
rows = cursor.fetchall() |
550 | 560 |
for row in rows: |
551 |
sym = symbol.SymbolBase(row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[0], detectFlip=row[15]) ## uid is last item
|
|
561 |
sym = symbol.SymbolBase(row[0], row[1], row[2], row[3], row[4])
|
|
552 | 562 |
targetSymbolList.append(sym) |
553 | 563 |
except Exception as ex: |
554 | 564 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
... | ... | |
1589 | 1599 |
dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE) |
1590 | 1600 |
conn = sqlite3.connect(dbPath) |
1591 | 1601 |
cursor = conn.cursor() |
1592 |
sql = """SELECT a.UID,a.Name,b.Type,a.Threshold,a.MinMatchPoint,a.IsDetectOrigin,a.RotationCount,a.OCROption,a.IsContainChild,a.OriginalPoint,a.ConnectionPoint, |
|
1593 |
a.BaseSymbol,a.AdditionalSymbol,a.IsExceptDetect,a.HasInstrumentLabel,a.flip FROM Symbol a inner join SymbolType b on a.SymbolType_UID=b.UID WHERE """ + "a." + fieldName + '=?' |
|
1602 |
|
|
1603 |
sql = """select s.UID |
|
1604 |
, s.Name |
|
1605 |
, t.Type |
|
1606 |
, s.OriginalPoint |
|
1607 |
, s.ConnectionPoint |
|
1608 |
from Symbols s |
|
1609 |
inner join SymbolType t |
|
1610 |
on s.SymbolType_UID = t.UID |
|
1611 |
where """ + "s." + fieldName + '=?' |
|
1612 |
|
|
1594 | 1613 |
try: |
1595 | 1614 |
cursor.execute(sql, (param,)) |
1596 | 1615 |
rows = cursor.fetchall() |
1597 | 1616 |
if rows is not None and len(rows) > 0: |
1598 | 1617 |
symbolTuple = rows[0] |
1599 |
ret = symbol.SymbolBase(symbolTuple[1], symbolTuple[2], symbolTuple[3] |
|
1600 |
, symbolTuple[4], symbolTuple[5], symbolTuple[6], symbolTuple[7], symbolTuple[8] |
|
1601 |
, symbolTuple[9], symbolTuple[10], symbolTuple[11], symbolTuple[12], symbolTuple[13], symbolTuple[14], symbolTuple[0], detectFlip=symbolTuple[15]) ## uid is last item |
|
1618 |
ret = symbol.SymbolBase(symbolTuple[0], symbolTuple[1], symbolTuple[2], symbolTuple[3], symbolTuple[4]) |
|
1602 | 1619 |
except Exception as ex: |
1603 | 1620 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
1604 | 1621 |
finally: |
... | ... | |
1618 | 1635 |
conn = sqlite3.connect(dbPath) |
1619 | 1636 |
cursor = conn.cursor() |
1620 | 1637 |
if fieldName is not None and param is not None: |
1621 |
sql = """SELECT a.UID,a.Name,b.Type,a.Threshold,a.MinMatchPoint,a.IsDetectOrigin,a.RotationCount,a.OCROption,a.IsContainChild,a.OriginalPoint,a.ConnectionPoint, |
|
1622 |
a.BaseSymbol,a.AdditionalSymbol,a.IsExceptDetect,a.HasInstrumentLabel,a.flip |
|
1623 |
FROM Symbol a inner join SymbolType b on a.SymbolType_UID=b.UID WHERE SymbolType_UID = (select UID from SymbolType where Type=?)""" |
|
1638 |
|
|
1639 |
sql = """select s.UID |
|
1640 |
, s.Name |
|
1641 |
, t.Type |
|
1642 |
, s.OriginalPoint |
|
1643 |
, s.ConnectionPoint |
|
1644 |
from Symbols s |
|
1645 |
inner join SymbolType t |
|
1646 |
on s.SymbolType_UID = t.UID |
|
1647 |
where s.SymbolType_UID = (select UID from SymbolType where Type=?)""" |
|
1624 | 1648 |
else: |
1625 |
sql = """SELECT a.UID,a.Name,b.Type,a.Threshold,a.MinMatchPoint,a.IsDetectOrigin,a.RotationCount,a.OCROption,a.IsContainChild,a.OriginalPoint,a.ConnectionPoint, |
|
1626 |
a.BaseSymbol,a.AdditionalSymbol,a.IsExceptDetect,a.HasInstrumentLabel,a.flip FROM Symbol a inner join SymbolType b on a.SymbolType_UID=b.UID""" |
|
1649 |
|
|
1650 |
sql = """select s.UID |
|
1651 |
, s.Name |
|
1652 |
, t.Type |
|
1653 |
, s.OriginalPoint |
|
1654 |
, s.ConnectionPoint |
|
1655 |
from Symbols s |
|
1656 |
inner join SymbolType t |
|
1657 |
on s.SymbolType_UID = t.UID""" |
|
1627 | 1658 |
try: |
1628 | 1659 |
cursor.execute(sql, (param,)) if param is not None else cursor.execute(sql) |
1629 | 1660 |
rows = cursor.fetchall() |
1630 | 1661 |
if rows is not None and len(rows) > 0: |
1631 |
for symbolTuple in rows: |
|
1632 |
sym = symbol.SymbolBase(symbolTuple[1], symbolTuple[2], symbolTuple[3], symbolTuple[4] |
|
1633 |
, symbolTuple[5], symbolTuple[6], symbolTuple[7], symbolTuple[8], symbolTuple[9] |
|
1634 |
, symbolTuple[10], symbolTuple[11], symbolTuple[12], symbolTuple[13], symbolTuple[14], symbolTuple[0], detectFlip=symbolTuple[15]) ## uid is last item |
|
1662 |
for row in rows: |
|
1663 |
sym = symbol.SymbolBase(row[0], row[1], row[2], row[3], row[4]) |
|
1664 |
|
|
1635 | 1665 |
ret.append(sym) |
1636 | 1666 |
except Exception as ex: |
1637 | 1667 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
... | ... | |
3078 | 3108 |
return symbolTypeList |
3079 | 3109 |
|
3080 | 3110 |
|
3111 |
|
|
3112 |
def getColumnDisplayNames(self): |
|
3113 |
columnDisplayNameList = [] |
|
3114 |
|
|
3115 |
try: |
|
3116 |
dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE) |
|
3117 |
|
|
3118 |
conn = sqlite3.connect(dbPath) |
|
3119 |
cursor = conn.cursor() |
|
3120 |
sql = 'SELECT * FROM Column_DisplayNames' |
|
3121 |
try: |
|
3122 |
cursor.execute(sql) |
|
3123 |
rows = cursor.fetchall() |
|
3124 |
for row in rows: |
|
3125 |
columnDisplayNameList.append((row[0], row[1], row[2])) # UID, Name, Display_Name |
|
3126 |
except Exception as ex: |
|
3127 |
from App import App |
|
3128 |
|
|
3129 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
3130 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
3131 |
finally: |
|
3132 |
conn.close() |
|
3133 |
|
|
3134 |
return columnDisplayNameList |
|
3135 |
|
|
3136 |
|
|
3137 |
|
|
3081 | 3138 |
''' |
3082 | 3139 |
@brief Return Symbol Type Items |
3083 | 3140 |
@author Jeongwoo |
HYTOS/HYTOS/Commands/CreateSymbolCommand.py | ||
---|---|---|
22 | 22 |
''' |
23 | 23 |
@history 2018.05.04 Jeongwoo Add Parameter |
24 | 24 |
''' |
25 |
def __init__(self, imageViewer, resultTreeWidget, dirTreeWidget):
|
|
25 |
def __init__(self, imageViewer, resultTreeWidget, symbolTreeWidget):
|
|
26 | 26 |
super(CreateSymbolCommand, self).__init__(imageViewer) |
27 | 27 |
self.name = 'CreateSymbol' |
28 | 28 |
self.imageViewer.setCursor(QCursor(Qt.CrossCursor)) |
29 | 29 |
self.resultTreeWidget = resultTreeWidget |
30 |
self.dirTreeWidget = dirTreeWidget
|
|
30 |
self.symbolTreeWidget = symbolTreeWidget
|
|
31 | 31 |
|
32 | 32 |
''' |
33 | 33 |
@brief crop image by rectangle selected by user |
34 | 34 |
@history 2018.05.02 Jeongwoo Init self.offsetX and self.offsetY |
35 | 35 |
Add QtImageViewer.startPointChanged.emit |
36 | 36 |
2018.05.03 Jeongwoo Make Svg/Image File Path by SymbolBase.getSvgFileFullePath() and SymbolBase.getImageFileFullPath() |
37 |
2018.05.04 Jeongwoo Add self.dirTreeWidget.initTreeWidget()
|
|
37 |
2018.05.04 Jeongwoo Add self.symbolTreeWidget.initTreeWidget()
|
|
38 | 38 |
2018.06.08 Jeongwoo Add Parameter on SymbolSvgItem.buildItem() |
39 | 39 |
''' |
40 | 40 |
def execute(self, param): |
... | ... | |
53 | 53 |
croppedImage = self.imageViewer.image().copy(selectionBBox.toAlignedRect()) |
54 | 54 |
symbolEditorDialog = SymbolEditorDialog.QSymbolEditorDialog(self.imageViewer, croppedImage, AppDocData.instance().getCurrentProject()) |
55 | 55 |
(isAccepted, isImmediateInsert, offsetX, offsetY, newSym) = symbolEditorDialog.showDialog() |
56 |
self.dirTreeWidget.initDirTreeWidget()
|
|
56 |
self.symbolTreeWidget.initSymbolTreeWidget()
|
|
57 | 57 |
if isAccepted: |
58 | 58 |
if isImmediateInsert: |
59 | 59 |
svgPath = newSym.getSvgFileFullPath() |
HYTOS/HYTOS/DetectSymbolDialog.py | ||
---|---|---|
84 | 84 |
(isAccepted, isImmediateInsert, offsetX, offsetY, newSym) = symbolEditorDialog.showDialog() |
85 | 85 |
if isAccepted: |
86 | 86 |
self.table.removeCellWidget(row, column) |
87 |
self.parent.dirTreeWidget.initDirTreeWidget()
|
|
87 |
self.parent.symbolTreeWidget.initSymbolTreeWidget()
|
|
88 | 88 |
self.setAllSymbolsTable() |
89 | 89 |
|
90 | 90 |
''' |
HYTOS/HYTOS/Drawing.py | ||
---|---|---|
21 | 21 |
self.UID = drawing[0][0] if drawing else uuid.uuid4() |
22 | 22 |
''' up to here ''' |
23 | 23 |
|
24 |
self._hmbTable = None |
|
25 |
|
|
24 | 26 |
''' |
25 | 27 |
@brief getter of attrs |
26 | 28 |
@author humkyung |
... | ... | |
51 | 53 |
else: |
52 | 54 |
self._attrs.append([name, value]) |
53 | 55 |
|
54 |
print('attribute({},{})'.format(name, value)) |
|
56 |
print('attribute({},{})'.format(name, value)) |
|
57 |
|
|
58 |
''' |
|
59 |
@brief getter of hmb table |
|
60 |
@author humkyung |
|
61 |
@date 2018.07.16 |
|
62 |
''' |
|
63 |
@property |
|
64 |
def hmbTable(self): |
|
65 |
from HMBTable import HMBTable |
|
66 |
|
|
67 |
if self._hmbTable is None: |
|
68 |
self._hmbTable = HMBTable() |
|
69 |
self._hmbTable.loadData() |
|
70 |
|
|
71 |
return self._hmbTable |
|
72 |
|
|
73 |
''' |
|
74 |
@brief setter of hmb table |
|
75 |
@author humkyung |
|
76 |
@date 2018.07.16 |
|
77 |
''' |
|
78 |
@hmbTable.setter |
|
79 |
def hmbTable(self, value): |
|
80 |
self._hmbTable = value |
HYTOS/HYTOS/HMBTable.py | ||
---|---|---|
10 | 10 |
''' |
11 | 11 |
class HMBData: |
12 | 12 |
def __init__(self, uid=None): |
13 |
self._uid = uid |
|
13 |
self._uid = None |
|
14 |
self._drawing_uid = None |
|
14 | 15 |
self._stream_no = None |
15 |
self._name = None |
|
16 |
self._unit = None |
|
17 |
self._value = None |
|
16 |
self._display_no = None |
|
17 |
|
|
18 | 18 |
self.isDeleted = False |
19 | 19 |
|
20 | 20 |
''' |
... | ... | |
25 | 25 |
def uid(self): |
26 | 26 |
return self._uid |
27 | 27 |
|
28 |
|
|
29 | 28 |
''' |
30 | 29 |
@author humkyung |
31 | 30 |
@date 2018.07.12 |
... | ... | |
33 | 32 |
@uid.setter |
34 | 33 |
def uid(self, value): |
35 | 34 |
self._uid = value |
36 |
|
|
37 |
''' |
|
38 |
@author humkyung |
|
39 |
@date 2018.07.12 |
|
40 |
''' |
|
41 |
@property |
|
42 |
def streamNo(self): |
|
43 |
return self._stream_no |
|
44 | 35 |
|
45 |
''' |
|
46 |
@author humkyung |
|
47 |
@date 2018.07.12 |
|
48 |
''' |
|
49 |
@streamNo.setter |
|
50 |
def streamNo(self, value): |
|
51 |
self._stream_no = value |
|
52 | 36 |
|
53 | 37 |
''' |
54 | 38 |
@author humkyung |
55 | 39 |
@date 2018.07.12 |
56 | 40 |
''' |
57 | 41 |
@property |
58 |
def name(self):
|
|
59 |
return self._name
|
|
42 |
def drawing_uid(self):
|
|
43 |
return self._drawing_uid
|
|
60 | 44 |
|
61 | 45 |
''' |
62 | 46 |
@author humkyung |
63 | 47 |
@date 2018.07.12 |
64 | 48 |
''' |
65 |
@name.setter |
|
66 |
def name(self, value): |
|
67 |
self._name = value |
|
49 |
@drawing_uid.setter |
|
50 |
def drawing_uid(self, value): |
|
51 |
self._drawing_uid = value |
|
52 |
|
|
68 | 53 |
|
69 | 54 |
''' |
70 | 55 |
@author humkyung |
71 | 56 |
@date 2018.07.12 |
72 | 57 |
''' |
73 | 58 |
@property |
74 |
def unit(self):
|
|
75 |
return self._unit
|
|
59 |
def display_no(self):
|
|
60 |
return self._display_no
|
|
76 | 61 |
|
77 | 62 |
''' |
78 | 63 |
@author humkyung |
79 | 64 |
@date 2018.07.12 |
80 | 65 |
''' |
81 |
@unit.setter
|
|
82 |
def unit(self, value):
|
|
83 |
self._unit = value
|
|
66 |
@display_no.setter
|
|
67 |
def display_no(self, value):
|
|
68 |
self._display_no = value
|
|
84 | 69 |
|
85 | 70 |
''' |
86 | 71 |
@author humkyung |
87 | 72 |
@date 2018.07.12 |
88 | 73 |
''' |
89 | 74 |
@property |
90 |
def value(self):
|
|
91 |
return self._value
|
|
75 |
def stream_no(self):
|
|
76 |
return self._stream_no
|
|
92 | 77 |
|
93 | 78 |
''' |
94 | 79 |
@author humkyung |
95 | 80 |
@date 2018.07.12 |
96 | 81 |
''' |
97 |
@value.setter
|
|
98 |
def value(self, value):
|
|
99 |
self._value = value
|
|
82 |
@stream_no.setter
|
|
83 |
def stream_no(self, value):
|
|
84 |
self._stream_no = value
|
|
100 | 85 |
|
101 |
''' |
|
102 |
@brief create hmb data from database record |
|
103 |
@author humkyung |
|
104 |
@date 2018.07.12 |
|
105 |
''' |
|
106 |
@staticmethod |
|
107 |
def fromRow(row): |
|
108 |
hmb = HMBData() |
|
109 |
hmb._uid = row[0] |
|
110 |
hmb._stream_no = row[1] |
|
111 |
hmb._name = row[2] |
|
112 |
hmb._unit = row[3] |
|
113 |
hmb._value = row[4] |
|
114 | 86 |
|
115 |
return hmb |
|
116 | 87 |
|
117 | 88 |
class HMBTable: |
118 | 89 |
''' |
... | ... | |
123 | 94 |
def __init__(self): |
124 | 95 |
self._hmbs = None |
125 | 96 |
|
97 |
@staticmethod |
|
98 |
def new_data(): |
|
99 |
import uuid |
|
100 |
|
|
101 |
# 새로운 HMB 데이타를 생성한다. |
|
102 |
hmb = HMBData() |
|
103 |
hmb.uid = uuid.uuid4() |
|
104 |
hmb.isDeleted = False |
|
105 |
return hmb |
|
106 |
|
|
126 | 107 |
''' |
127 | 108 |
@brief load hmb data from database |
128 | 109 |
@author humkyung |
... | ... | |
142 | 123 |
|
143 | 124 |
conn = sqlite3.connect(dbPath) |
144 | 125 |
cursor = conn.cursor() |
145 |
sql = 'SELECT UID,STREAM_NO,NAME,UNIT,VALUE FROM HMB ORDER BY STREAM_NO' |
|
126 |
sql = """select UID |
|
127 |
, Components_UID |
|
128 |
, Stream_No |
|
129 |
from HMB |
|
130 |
order by Stream_No""" |
|
146 | 131 |
cursor.execute(sql) |
147 | 132 |
rows = cursor.fetchall() |
148 | 133 |
for row in rows: |
... | ... | |
208 | 193 |
@date 2018.07.12 |
209 | 194 |
''' |
210 | 195 |
def streamNos(self): |
211 |
return set([hmb.streamNo for hmb in self._hmbs if hmb.isDeleted == False]) if self._hmbs is not None else {}
|
|
196 |
return set([hmb.stream_no for hmb in self._hmbs if hmb.isDeleted == False]) if self._hmbs is not None else {}
|
|
212 | 197 |
|
213 | 198 |
''' |
214 | 199 |
@brief return given index's data |
HYTOS/HYTOS/ItemTreeWidget.py | ||
---|---|---|
296 | 296 |
child = self.root.addChild(QTreeWidgetItem(['LINE NO'])) |
297 | 297 |
self.LineNoTreeItem = self.root.child(self.root.childCount() - 1) |
298 | 298 |
self.LineNoTreeItem.setFlags(self.root.flags() | Qt.ItemIsTristate | Qt.ItemIsUserCheckable) |
299 |
self.LineNoTreeItem.setCheckState(0, Qt.Checked) |
|
299 |
#self.LineNoTreeItem.setCheckState(0, Qt.Checked)
|
|
300 | 300 |
self.root.addChild(QTreeWidgetItem(['EQUIPMENTS'])) |
301 | 301 |
self.EqpTreeItem = self.root.child(self.root.childCount() - 1) |
302 | 302 |
self.root.addChild(QTreeWidgetItem(['SYMBOLS'])) |
HYTOS/HYTOS/MainWindow.py | ||
---|---|---|
74 | 74 |
Add QActionGroup for managing checkable action |
75 | 75 |
Jeongwoo 2018.06.27 Add Action [Zoom, Fit Window] and Add new actions into ActionGroup |
76 | 76 |
humkyung 2018.08.23 add labelStatus to statusbar |
77 |
Euisung 2018.09.27 add OCR Training , Signal/Slot Connection 'oCRTrainingClicked' |
|
78 |
Euisung 2018.10.05 add OCR Editor , Signal/Slot Connection 'oCRTrainingEdidorClicked' |
|
79 |
Euisung 2018.10.22 delete Signal/Slot Connection 'oCRTrainingEdidorClicked' |
|
77 |
|
|
80 | 78 |
''' |
81 | 79 |
def __init__(self): |
82 | 80 |
from LineTypeConditions import LineTypeConditions |
... | ... | |
98 | 96 |
self.statusbar.addPermanentWidget(self.labelLineStatus) |
99 | 97 |
self.statusbar.addPermanentWidget(self.labelTextStatus) |
100 | 98 |
self.statusbar.addPermanentWidget(self.labelStatus) |
99 |
self.showMaximized() |
|
101 | 100 |
|
102 | 101 |
docData = AppDocData.instance() |
103 | 102 |
project = docData.getCurrentProject() |
104 | 103 |
_translate = QCoreApplication.translate |
105 | 104 |
self.setWindowTitle(_translate(App.NAME + " - {}".format(project.name), App.NAME + " - {}".format(project.name))) |
105 |
self.resizeDocks({self.dockWidgetSymbolExplorer}, {self.dockWidgetDrawingExplorer.sizeHint().width()}, Qt.Horizontal) |
|
106 | 106 |
|
107 | 107 |
self.toolBar.insertSeparator(self.actionValidate) |
108 | 108 |
|
... | ... | |
115 | 115 |
self.verticalLayout.addWidget(self.graphicsView) |
116 | 116 |
|
117 | 117 |
# Add Custom TreeWidget |
118 |
self.dirTreeWidget = SymbolTreeWidget.QSymbolTreeWidget() |
|
119 |
self.dirTreeWidget.header().hide() |
|
120 |
self.symbolTabVerticalLayout.addWidget(self.dirTreeWidget) |
|
121 |
|
|
122 |
# Add Custom Property TableWidget |
|
123 |
#self.propertyTableWidget = SymbolPropertyTableWidget.QSymbolPropertyTableWidget() |
|
124 |
#self.symbolTabVerticalLayout.addWidget(self.propertyTableWidget) |
|
125 |
#self.dirTreeWidget.singleClicked.connect(self.propertyTableWidget.getClickedSymbol) |
|
126 |
# add splitter widget |
|
127 |
#splitter = QSplitter(Qt.Vertical) |
|
128 |
#splitter.addWidget(self.dirTreeWidget) |
|
129 |
#splitter.addWidget(self.propertyTableWidget) |
|
130 |
#self.symbolTabVerticalLayout.addWidget(splitter) |
|
131 |
# up to here |
|
118 |
self.symbolTreeWidget = SymbolTreeWidget.QSymbolTreeWidget() |
|
119 |
self.symbolTreeWidget.header().hide() |
|
120 |
self.verticalLayoutSymbolList.addWidget(self.symbolTreeWidget) |
|
132 | 121 |
|
133 | 122 |
# Add Custom Result Tree Widget (Symbol Explorer) |
134 | 123 |
self.itemTreeWidget = ItemTreeWidget.QItemTreeWidget(self.graphicsView) |
135 | 124 |
self.itemTreeWidget.header().hide() |
136 |
self.symbolExplorerVerticalLayout.addWidget(self.itemTreeWidget) |
|
137 |
|
|
138 |
# Add Empty Widget |
|
139 |
self.resultPropertyTableWidget = ItemPropertyTableWidget.QItemPropertyTableWidget(self) |
|
140 |
self.symbolExplorerVerticalLayout.addWidget(self.resultPropertyTableWidget) |
|
141 |
self.itemTreeWidget.singleClicked.connect(self.resultPropertyTableWidget.onSymbolClicked) |
|
142 |
self.itemTreeWidget.noteNoSingleClicked.connect(self.resultPropertyTableWidget.onNoteClicked) |
|
143 |
self.itemTreeWidget.lineNoSingleClicked.connect(self.resultPropertyTableWidget.onLineNoClicked) |
|
144 |
self.itemTreeWidget.drawingClicked.connect(self.resultPropertyTableWidget.onDrawingClicked) |
|
125 |
|
|
126 |
self.treeWidgetDrawingList.setHeaderHidden(False) |
|
127 |
self.treeWidgetDrawingList.header().setStretchLastSection(True) |
|
128 |
self.treeWidgetDrawingList.setHeaderLabels([self.tr('Name'), self.tr('DateTime'), self.tr('Uid')]) |
|
129 |
self.treeWidgetDrawingList.header().setSectionResizeMode(0, QHeaderView.ResizeToContents) |
|
130 |
self.treeWidgetDrawingList.header().setSectionResizeMode(1, QHeaderView.ResizeToContents) |
|
131 |
self.treeWidgetDrawingList.header().setSectionResizeMode(2, QHeaderView.ResizeToContents) |
|
132 |
self.treeWidgetDrawingList.hideColumn(2) |
|
133 |
self.treeWidgetDrawingList.itemDoubleClicked.connect(self.open_selected_drawing) |
|
134 |
|
|
145 | 135 |
# add splitter widget |
146 | 136 |
splitter = QSplitter(Qt.Vertical) |
137 |
splitter.addWidget(self.treeWidgetDrawingList) |
|
147 | 138 |
splitter.addWidget(self.itemTreeWidget) |
148 |
splitter.addWidget(self.resultPropertyTableWidget) |
|
149 |
self.symbolExplorerVerticalLayout.addWidget(splitter) |
|
139 |
self.verticalLayoutDrawingList.addWidget(splitter) |
|
150 | 140 |
# up to here |
151 | 141 |
|
152 | 142 |
# Initialize Action group |
153 | 143 |
self.actionGroup = QActionGroup(self) |
154 |
self.actionGroup.addAction(self.actionRecognition) |
|
155 |
self.actionGroup.addAction(self.actionLineRecognition) |
|
156 | 144 |
self.actionGroup.addAction(self.actionLine) |
157 |
self.actionGroup.addAction(self.actionGenerateOutput) |
|
158 | 145 |
|
159 | 146 |
self.actionGroup.addAction(self.actionZoom) |
160 | 147 |
self.actionGroup.addAction(self.actionFitWindow) |
... | ... | |
168 | 155 |
self.actionNew.triggered.connect(self.new_drawing) |
169 | 156 |
self.actionSave.triggered.connect(self.actionSaveCliked) |
170 | 157 |
self.actionLine.triggered.connect(self.onPlaceLine) |
171 |
self.actionRecognition.triggered.connect(self.recognize) |
|
172 |
self.actionLineRecognition.triggered.connect(self.connect_attributes) |
|
173 | 158 |
self.actionConfiguration.triggered.connect(self.configuration) |
174 | 159 |
|
175 |
self.actionGenerateOutput.triggered.connect(self.generateOutput) |
|
176 |
self.pushButtonClearLog.clicked.connect(self.onClearLog) |
|
177 |
self.actionHMB_DATA.triggered.connect(self.onHMBData) |
|
178 |
self.actionItem_Data_List.triggered.connect(self.showItemDataList) |
|
179 |
self.actionText_Data_List.triggered.connect(self.showTextDataList) |
|
180 |
self.actionCodeTable.triggered.connect(self.onShowCodeTable) |
|
181 | 160 |
self.actionImage_Drawing.triggered.connect(self.onViewImageDrawing) |
182 | 161 |
self.actionDrawing_Only.triggered.connect(self.onViewDrawingOnly) |
183 |
self.actionValidate.triggered.connect(self.onValidation) |
|
184 | 162 |
self.actionViewText.triggered.connect(self.onViewText) |
185 | 163 |
self.actionViewSymbol.triggered.connect(self.onViewSymbol) |
186 | 164 |
self.actionViewLine.triggered.connect(self.onViewLine) |
... | ... | |
191 | 169 |
self.actionZoom.triggered.connect(self.onAreaZoom) |
192 | 170 |
|
193 | 171 |
self.actionFitWindow.triggered.connect(self.fitWindow) |
194 |
self.actionpdf_to_image.triggered.connect(self.onConvertPDFToImage) |
|
195 | 172 |
self.actionCreate_Symbol.triggered.connect(self.create_symbol) |
196 |
#self.graphicsView.scene.changed.connect(self.onSceneChanged) |
|
197 | 173 |
self.graphicsView.scene.contents_changed.connect(self.onSceneChanged) |
198 | 174 |
self.graphicsView.scene.selectionChanged.connect(self.onSelectionChanged) |
199 | 175 |
self.actionInitialize.triggered.connect(self.onInitializeScene) |
200 |
|
|
201 | 176 |
self.addMessage.connect(self.onAddMessage) |
202 |
self.actionFindReplaceText.triggered.connect(self.findReplaceTextClicked) |
|
203 |
|
|
204 |
|
|
205 |
# removedItems |
|
206 |
''' |
|
207 |
self.removedItems = {} |
|
208 |
self.removedItems['LINE'] = [] |
|
209 |
self.removedItems['EQUIP'] = [] |
|
210 |
self.removedItems['INST'] = [] |
|
211 |
self.removedItems['NOTE'] = [] |
|
212 |
''' |
|
213 |
|
|
214 |
self.delimiter = '"' |
|
215 |
|
|
216 |
self.resizeDocks({self.dockWidget}, {self.dockWidgetObjectExplorer.sizeHint().width()}, Qt.Horizontal) |
|
217 | 177 |
|
218 |
self.treeWidgetDrawingList.setHeaderHidden(False) |
|
219 |
self.treeWidgetDrawingList.header().setStretchLastSection(True) |
|
220 |
self.treeWidgetDrawingList.setHeaderLabels([self.tr('Name'), self.tr('DateTime')]) |
|
221 |
self.treeWidgetDrawingList.header().setSectionResizeMode(0, QHeaderView.ResizeToContents) |
|
222 |
self.treeWidgetDrawingList.header().setSectionResizeMode(1, QHeaderView.ResizeToContents) |
|
223 |
self.treeWidgetDrawingList.itemDoubleClicked.connect(self.open_selected_drawing) |
|
224 | 178 |
self.load_drawing_list() |
179 |
self.initTableWidgetHMB() |
|
225 | 180 |
|
226 | 181 |
# load stylesheet file list |
227 | 182 |
stylesheet_name = QtWidgets.qApp.stylesheet_name |
... | ... | |
244 | 199 |
action.triggered.connect(partial(self.load_language, file)) |
245 | 200 |
# up to here |
246 | 201 |
|
247 |
# inconsistency table |
|
248 |
self.tableWidgetInconsistency.setColumnCount(2) |
|
249 |
self.tableWidgetInconsistency.setHorizontalHeaderLabels(['Owner', 'Message']) |
|
250 |
self.tableWidgetInconsistency.setEditTriggers(QAbstractItemView.NoEditTriggers) |
|
251 |
self.tableWidgetInconsistency.itemClicked.connect(self.inconsistencyItemClickEvent) |
|
252 |
self.tableWidgetInconsistency.keyPressEvent = self.inconsistencyTableKeyPressEvent |
|
253 | 202 |
|
254 | 203 |
def eventFilter(self, source, event): |
255 | 204 |
""" |
... | ... | |
263 | 212 |
|
264 | 213 |
def inconsistencyTableKeyPressEvent(self, event): |
265 | 214 |
try: |
266 |
row = self.tableWidgetInconsistency.selectedIndexes()[0].row()
|
|
267 |
col = self.tableWidgetInconsistency.selectedIndexes()[0].column()
|
|
215 |
row = self.tableWidgetHMB.selectedIndexes()[0].row()
|
|
216 |
col = self.tableWidgetHMB.selectedIndexes()[0].column()
|
|
268 | 217 |
from HighlightCommand import HighlightCommand |
269 | 218 |
if event.key() == Qt.Key_Up: |
270 | 219 |
if row is not 0: |
271 |
errorItem = self.tableWidgetInconsistency.item(row - 1, 1).tag
|
|
220 |
errorItem = self.tableWidgetHMB.item(row - 1, 1).tag
|
|
272 | 221 |
HighlightCommand(self.graphicsView).execute(errorItem) |
273 | 222 |
elif event.key() == Qt.Key_Down: |
274 |
if row is not self.tableWidgetInconsistency.rowCount() - 1:
|
|
275 |
errorItem = self.tableWidgetInconsistency.item(row + 1, 1).tag
|
|
223 |
if row is not self.tableWidgetHMB.rowCount() - 1:
|
|
224 |
errorItem = self.tableWidgetHMB.item(row + 1, 1).tag
|
|
276 | 225 |
HighlightCommand(self.graphicsView).execute(errorItem) |
277 | 226 |
except Exception as ex: |
278 | 227 |
pass |
279 | 228 |
#finally: |
280 |
# return QTableView.keyPressEvent(self.tableWidgetInconsistency, event) |
|
281 |
|
|
282 |
def onValidation(self): |
|
283 |
""" |
|
284 |
@brief validation check |
|
285 |
@author euisung |
|
286 |
@date 2019.04.01 |
|
287 |
""" |
|
288 |
if not self.graphicsView.hasImage(): |
|
289 |
self.showImageSelectionMessageBox() |
|
290 |
return |
|
291 |
|
|
292 |
errors = [] |
|
293 |
|
|
294 |
try: |
|
295 |
for item in self.graphicsView.scene.items(): |
|
296 |
if type(item) is QEngineeringErrorItem: |
|
297 |
item.transfer.onRemoved.emit(item) |
|
298 |
elif type(item) is QEngineeringLineItem or issubclass(type(item), SymbolSvgItem): |
|
299 |
for error in item.validate(): |
|
300 |
errors.append(error) |
|
301 |
|
|
302 |
for error in errors: |
|
303 |
error.transfer.onRemoved.connect(self.itemRemoved) |
|
304 |
self.graphicsView.scene.addItem(error) |
|
305 |
|
|
306 |
self.tableWidgetInconsistency.clearContents() |
|
307 |
self.tableWidgetInconsistency.setRowCount(len(errors)) |
|
308 |
for index in range(len(errors)): |
|
309 |
items = self.makeInconsistencyTableRow(errors[index]) |
|
310 |
self.tableWidgetInconsistency.setItem(index, 0, items[0]) |
|
311 |
self.tableWidgetInconsistency.setItem(index, 1, items[1]) |
|
312 |
except Exception as ex: |
|
313 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
314 |
self.addMessage.emit(MessageType.Error, message) |
|
315 |
|
|
229 |
# return QTableView.keyPressEvent(self.tableWidgetHMB, event) |
|
230 |
|
|
316 | 231 |
def makeInconsistencyTableRow(self, errorItem): |
317 | 232 |
''' |
318 | 233 |
@brief make row data for inconsistency widget |
... | ... | |
382 | 297 |
finally: |
383 | 298 |
self.retranslateUi(self) |
384 | 299 |
|
300 |
|
|
301 |
def initTableWidgetHMB(self): |
|
302 |
if hasattr(self, '_headers'): del self._headers |
|
303 |
if not hasattr(self, '_headers'): self._headers = [] |
|
304 |
|
|
305 |
''' |
|
306 |
docData = AppDocData.instance() |
|
307 |
columnDisplayNameList = docData.getColumnDisplayNames() |
|
308 |
|
|
309 |
for columnDisplayName in columnDisplayNameList: |
|
310 |
self._headers.append(columnDisplayName[2]) |
|
311 |
''' |
|
312 |
|
|
313 |
self._headers.append('Uid') |
|
314 |
self._headers.append('Drawing_Uid') |
|
315 |
self._headers.append('Stream No.') |
|
316 |
self._headers.append('Phase') |
|
317 |
self._headers.append('Flowrate (Mass)') |
|
318 |
self._headers.append('Flowrate (Volume)') |
|
319 |
self._headers.append('Density') |
|
320 |
self._headers.append('Viscosity') |
|
321 |
self._headers.append('Temperature') |
|
322 |
self._headers.append('Molecular Weight') |
|
323 |
self._headers.append('Specific Heat Ratio (Cp/Cv)') |
|
324 |
self._headers.append('Compress. Factor (Z)') |
|
325 |
self._headers.append('Pipe Nominal Diameter') |
|
326 |
self._headers.append('Pipe Inside Diameter') |
|
327 |
self._headers.append('Sch. No.') |
|
328 |
self._headers.append('Straight Length') |
|
329 |
self._headers.append('Equivalent Length') |
|
330 |
self._headers.append('Roughness') |
|
331 |
self._headers.append('Limitation of Velocity') |
|
332 |
self._headers.append('Limitation of Press. Drop') |
|
333 |
|
|
334 |
|
|
335 |
self.tableWidgetHMB.setColumnCount(len(self._headers)) |
|
336 |
self.tableWidgetHMB.setHorizontalHeaderLabels(self._headers) |
|
337 |
self.tableWidgetHMB.setEditTriggers(QAbstractItemView.NoEditTriggers) |
|
338 |
|
|
339 |
#self.tableWidgetHMB.setColumnHidden(0, True) |
|
340 |
#self.tableWidgetHMB.setColumnHidden(1, True) |
|
341 |
|
|
342 |
self.tableWidgetHMB.resizeColumnsToContents() |
|
343 |
|
|
385 | 344 |
''' |
386 | 345 |
@brief Clear TreeWidget and Set Current PID |
387 | 346 |
@author Jeongwoo |
... | ... | |
407 | 366 |
self.treeWidgetDrawingList.root.setCheckState(0, Qt.Unchecked) |
408 | 367 |
|
409 | 368 |
for drawing in drawings: |
410 |
item = QTreeWidgetItem(self.treeWidgetDrawingList.root, [drawing[1], drawing[2] if drawing and drawing[0] else '']) |
|
369 |
item = QTreeWidgetItem(self.treeWidgetDrawingList.root, [drawing[1], drawing[2], drawing[0] if drawing and drawing[0] else ''])
|
|
411 | 370 |
item.setFlags(item.flags() | Qt.ItemIsUserCheckable) |
412 | 371 |
item.setCheckState(0, Qt.Unchecked) |
413 | 372 |
|
... | ... | |
429 | 388 |
if item.parent() is not None: |
430 | 389 |
self.open_border_file() |
431 | 390 |
self.load_data(item.text(0)) |
432 |
|
|
433 |
''' |
|
434 |
@brief OCR Editor |
|
435 |
@author euisung |
|
436 |
@date 2018.10.05 |
|
437 |
@history 2018.10.16 euisung no more used, Integrated with oCRTrainingClicked |
|
438 |
''' |
|
439 |
def oCRTrainingEdidorClicked(self): |
|
440 |
from TrainingEditorDialog import QTrainingEditorDialog |
|
441 |
|
|
442 |
try: |
|
443 |
dialog = QTrainingEditorDialog(self) |
|
444 |
dialog.exec_() |
|
445 |
except Exception as ex: |
|
446 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
447 |
self.addMessage.emit(MessageType.Error, message) |
|
448 |
|
|
449 |
return |
|
450 |
|
|
451 |
''' |
|
452 |
@brief OCR Training |
|
453 |
@author euisung |
|
454 |
@date 2018.09.27 |
|
455 |
@history euisung 2018.10.16 TrainingListDialog -> TrainingImageListDialog |
|
456 |
''' |
|
457 |
def oCRTrainingClicked(self): |
|
458 |
try: |
|
459 |
dialog = QTrainingImageListDialog(self) |
|
460 |
dialog.exec_() |
|
461 |
except Exception as ex: |
|
462 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
463 |
self.addMessage.emit(MessageType.Error, message) |
|
464 |
|
|
465 |
''' |
|
466 |
@brief show unknownitem's count |
|
467 |
@author kyouho |
|
468 |
@date 2018.08.27 |
|
469 |
''' |
|
470 |
def findReplaceTextClicked(self): |
|
471 |
if not self.graphicsView.hasImage(): |
|
472 |
self.showImageSelectionMessageBox() |
|
473 |
return |
|
474 |
|
|
475 |
from TextItemEditDialog import QTextItemEditDialog |
|
476 |
|
|
477 |
self.dlgTextItemEdit = QTextItemEditDialog(self) |
|
478 |
self.dlgTextItemEdit.show() |
|
479 |
self.dlgTextItemEdit.exec_() |
|
480 | 391 |
|
481 | 392 |
''' |
482 | 393 |
@brief show unknownitem's count |
... | ... | |
493 | 404 |
|
494 | 405 |
items = [item for item in self.graphicsView.scene.items() if issubclass(type(item), SymbolSvgItem) and type(item) is not QEngineeringErrorItem] |
495 | 406 |
self.labelSymbolStatus.setText("<font color='blue'>" + self.tr('Symbol') + " : {}</font>".format(len(items))) |
496 |
|
|
407 |
|
|
497 | 408 |
items = [item for item in self.graphicsView.scene.items() if type(item) is QEngineeringLineItem] |
498 | 409 |
self.labelLineStatus.setText("<font color='blue'>" + self.tr('Line') + " : {}</font>".format(len(items))) |
499 | 410 |
|
... | ... | |
602 | 513 |
self.load_drawing_list() |
603 | 514 |
|
604 | 515 |
''' |
605 |
@brief refresh resultPropertyTableWidget |
|
606 |
@author kyouho |
|
607 |
@date 2018.07.19 |
|
608 |
''' |
|
609 |
def refreshResultPropertyTableWidget(self): |
|
610 |
items = self.graphicsView.scene.selectedItems() |
|
611 |
if len(items) == 1: |
|
612 |
self.resultPropertyTableWidget.show_item_property(items[0]) |
|
613 |
|
|
614 |
''' |
|
615 | 516 |
@brief add message listwidget |
616 | 517 |
@author humkyung |
617 | 518 |
@date 2018.07.31 |
... | ... | |
630 | 531 |
except Exception as ex: |
631 | 532 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
632 | 533 |
|
633 |
''' |
|
634 |
@brief clear log |
|
635 |
@author humkyung |
|
636 |
@date 2018.08.01 |
|
637 |
''' |
|
638 |
def onClearLog(self): |
|
639 |
self.listWidgetLog.clear() |
|
534 |
|
|
640 | 535 |
|
641 | 536 |
''' |
642 | 537 |
@brief rotate selected symbol |
... | ... | |
671 | 566 |
self.graphicsView.useDefaultCommand() |
672 | 567 |
self.graphicsView.zoomImageInit() |
673 | 568 |
|
674 |
def onConvertPDFToImage(self): |
|
675 |
""" |
|
676 |
@brief convert to selected pdf to image |
|
677 |
@author humkyung |
|
678 |
@date 2018.07.09 |
|
679 |
@history Euisung 2018.10.11 hide shell |
|
680 |
""" |
|
681 |
try: |
|
682 |
filePath = os.path.join(os.path.dirname(os.path.realpath(__file__)) , 'bin64', 'PDF_TO_IMAGE.exe') |
|
683 |
subprocess.call(filePath, shell = False) |
|
684 |
except Exception as ex: |
|
685 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
686 |
|
|
687 | 569 |
''' |
688 | 570 |
@brief selection changed |
689 | 571 |
@author humkyung |
... | ... | |
696 | 578 |
if items: |
697 | 579 |
item = items[-1] |
698 | 580 |
self.itemTreeWidget.findItem(item) |
699 |
self.resultPropertyTableWidget.show_item_property(item) |
|
581 |
#self.resultPropertyTableWidget.show_item_property(item)
|
|
700 | 582 |
if type(item) is QEngineeringErrorItem: |
701 |
for index in range(self.tableWidgetInconsistency.rowCount()):
|
|
702 |
if self.tableWidgetInconsistency.item(index, 1).tag is item:
|
|
703 |
self.tableWidgetInconsistency.selectRow(index)
|
|
583 |
for index in range(self.tableWidgetHMB.rowCount()):
|
|
584 |
if self.tableWidgetHMB.item(index, 1).tag is item:
|
|
585 |
self.tableWidgetHMB.selectRow(index)
|
|
704 | 586 |
break |
705 |
else: |
|
706 |
self.resultPropertyTableWidget.show_item_property(None) |
|
587 |
|
|
707 | 588 |
|
708 | 589 |
''' |
709 | 590 |
@brief Initialize scene and itemTreeWidget |
... | ... | |
727 | 608 |
if QMessageBox.Ok == msg.exec_(): |
728 | 609 |
|
729 | 610 |
appDocData = AppDocData.instance() |
611 |
appDocData.activeDrawing.hmbTable.reset() |
|
730 | 612 |
appDocData.clearItemList(True) |
731 |
|
|
613 |
|
|
614 |
|
|
732 | 615 |
items = self.graphicsView.scene.items() |
733 | 616 |
for item in items: |
734 | 617 |
if type(item) is not QGraphicsPixmapItem and item.scene() is not None: |
... | ... | |
753 | 636 |
baseName = os.path.basename(self.path) |
754 | 637 |
self.itemTreeWidget.setCurrentDrawing(baseName) |
755 | 638 |
|
639 |
self.load_HMB() |
|
640 |
|
|
756 | 641 |
except Exception as ex: |
757 | 642 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
758 | 643 |
self.addMessage.emit(MessageType.Error, message) |
... | ... | |
787 | 672 |
self.showImageSelectionMessageBox() |
788 | 673 |
return |
789 | 674 |
if self.actionEquipment.isChecked(): |
790 |
self.graphicsView.command = CreateSymbolCommand.CreateSymbolCommand(self.graphicsView, self.itemTreeWidget, self.dirTreeWidget)
|
|
675 |
self.graphicsView.command = CreateSymbolCommand.CreateSymbolCommand(self.graphicsView, self.itemTreeWidget, self.symbolTreeWidget)
|
|
791 | 676 |
else: |
792 | 677 |
self.graphicsView.useDefaultCommand() |
793 | 678 |
|
... | ... | |
804 | 689 |
self.showImageSelectionMessageBox() |
805 | 690 |
return |
806 | 691 |
if self.actionNozzle.isChecked(): |
807 |
self.graphicsView.command = CreateSymbolCommand.CreateSymbolCommand(self.graphicsView, self.itemTreeWidget, self.dirTreeWidget)
|
|
692 |
self.graphicsView.command = CreateSymbolCommand.CreateSymbolCommand(self.graphicsView, self.itemTreeWidget, self.symbolTreeWidget)
|
|
808 | 693 |
else: |
809 | 694 |
self.graphicsView.useDefaultCommand() |
810 | 695 |
|
... | ... | |
860 | 745 |
QEngineeringInstrumentItem.INST_COLOR = None |
861 | 746 |
|
862 | 747 |
''' |
863 |
@brief show nominal diameter dialog |
|
864 |
@author humkyung |
|
865 |
@date 2018.06.28 |
|
866 |
''' |
|
867 |
def onShowCodeTable(self): |
|
868 |
from CodeTableDialog import QCodeTableDialog |
|
869 |
|
|
870 |
dlg = QCodeTableDialog(self) |
|
871 |
dlg.exec_() |
|
872 |
|
|
873 |
''' |
|
874 |
@brief show HMB data |
|
875 |
@author humkyung |
|
876 |
@date 2018.07.11 |
|
877 |
''' |
|
878 |
def onHMBData(self): |
|
879 |
from HMBDialog import QHMBDialog |
|
880 |
|
|
881 |
dlg = QHMBDialog(self) |
|
882 |
dlg.show() |
|
883 |
dlg.exec_() |
|
884 |
|
|
885 |
''' |
|
886 |
@brief show line data list |
|
887 |
@author humkyung |
|
888 |
@date 2018.05.03 |
|
889 |
''' |
|
890 |
def showItemDataList(self): |
|
891 |
from ItemDataExportDialog import QItemDataExportDialog |
|
892 |
|
|
893 |
self.dlgLineDataList = QItemDataExportDialog(self) |
|
894 |
self.dlgLineDataList.exec_() |
|
895 |
|
|
896 |
def showTextDataList(self): |
|
897 |
''' |
|
898 |
@brief show all text item in scene |
|
899 |
@author euisung |
|
900 |
@date 2019.04.18 |
|
901 |
''' |
|
902 |
try: |
|
903 |
if not self.graphicsView.hasImage(): |
|
904 |
self.showImageSelectionMessageBox() |
|
905 |
return |
|
906 |
|
|
907 |
self.onCommandRejected() |
|
908 |
dialog = QTextDataListDialog(self) |
|
909 |
dialog.show() |
|
910 |
dialog.exec_() |
|
911 |
except Exception as ex: |
|
912 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
913 |
self.addMessage.emit(MessageType.Error, message) |
|
914 |
|
|
915 |
''' |
|
916 | 748 |
@brief Show Image Selection Guide MessageBox |
917 | 749 |
@author Jeongwoo |
918 | 750 |
@date 2018.05.02 |
... | ... | |
1017 | 849 |
self.progress.setValue(self.progress.maximum()) |
1018 | 850 |
self.progress.hide() |
1019 | 851 |
self.changeViewCheckedState(True) |
1020 |
|
|
852 |
self.load_HMB() |
|
1021 | 853 |
except Exception as ex: |
1022 | 854 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
1023 | 855 |
self.addMessage.emit(MessageType.Error, message) |
... | ... | |
1121 | 953 |
self.actionViewVendor_Area.setChecked(not checked) |
1122 | 954 |
self.actionDrawing_Only.setChecked(not checked) |
1123 | 955 |
if clear: |
1124 |
self.tableWidgetInconsistency.clearContents() |
|
1125 |
self.tableWidgetInconsistency.setRowCount(0) |
|
956 |
self.tableWidgetHMB.clearContents() |
|
957 |
self.initTableWidgetHMB() |
|
958 |
#self.tableWidgetHMB.setRowCount(0) |
|
1126 | 959 |
|
1127 | 960 |
def onViewDrawingOnly(self, isChecked): |
1128 | 961 |
''' |
... | ... | |
1234 | 1067 |
if image is not None: |
1235 | 1068 |
symbolEditorDialog = SymbolEditorDialog.QSymbolEditorDialog(self, image.copy(x, y, width, height), AppDocData.instance().getCurrentProject()) |
1236 | 1069 |
(isAccepted, isImmediateInsert, offsetX, offsetY, newSym) = symbolEditorDialog.showDialog() |
1237 |
self.dirTreeWidget.initDirTreeWidget()
|
|
1070 |
self.symbolTreeWidget.initSymbolTreeWidget()
|
|
1238 | 1071 |
if isAccepted: |
1239 | 1072 |
if isImmediateInsert: |
1240 | 1073 |
svgPath = newSym.getSvgFileFullPath() |
... | ... | |
1283 | 1116 |
@author humkyung |
1284 | 1117 |
@date 2018.07.23 |
1285 | 1118 |
''' |
1286 |
def onLineCreated(self): |
|
1287 |
from EngineeringConnectorItem import QEngineeringConnectorItem
|
|
1119 |
def onLineCreated(self):
|
|
1120 |
from HMBTable import HMBTable
|
|
1288 | 1121 |
|
1289 | 1122 |
try: |
1290 | 1123 |
count = len(self.actionLine.tag.streamline._vertices) |
1291 |
if count > 1: |
|
1292 |
""" |
|
1293 |
#ZVALUE = 100 |
|
1294 |
|
|
1295 |
#self.setZValue(ZVALUE) |
|
1296 |
|
|
1297 |
index = 0 |
|
1298 |
for vertex in [self.actionLine.tag.streamline._vertices[0],self.actionLine.tag.streamline._vertices[-1]]: |
|
1299 |
connector = QEngineeringConnectorItem(parent=self.actionLine.tag.streamline, index=index+1) |
|
1300 |
connector.setPos(vertex) |
|
1301 |
connector.setParentItem(self.actionLine.tag.streamline) |
|
1302 |
# connector의 connectPoint, sceneConnectPoint를 vertex로 함 추후 좀 알아봐서 수정 필요 |
|
1303 |
connector.connectPoint = vertex |
|
1304 |
connector.sceneConnectPoint = vertex |
|
1305 |
|
|
1306 |
# add connector move ables |
|
1307 |
connector.setFlags(QGraphicsItem.ItemIsSelectable|QGraphicsItem.ItemIsFocusable) |
|
1308 |
connector.setAcceptTouchEvents(True) |
|
1309 |
#connector.transfer.onPosChanged.connect(self.onConnectorPosChaned) |
|
1310 |
|
|
1311 |
connector.setZValue(self.actionLine.tag.streamline.zValue() + 1) |
|
1312 |
self.actionLine.tag.streamline.connectors.append(connector) |
|
1313 |
#index = index + 1 |
|
1124 |
if count > 1: |
|
1125 |
drawing = AppDocData.instance().activeDrawing |
|
1314 | 1126 |
|
1127 |
streamNos = sorted(list(drawing.hmbTable.streamNos())) |
|
1315 | 1128 |
|
1129 |
hmb = HMBTable.new_data() |
|
1130 |
hmb.drawing_uid = drawing.UID |
|
1131 |
hmb.stream_no = len(streamNos) + 1 |
|
1132 |
hmb.display_no = hmb.stream_no |
|
1316 | 1133 |
|
1317 |
items = [] |
|
1318 |
|
|
1319 |
poly = QEngineeringPolylineItem() |
|
1134 |
#self.actionLine.tag.streamline. |
|
1320 | 1135 |
|
1321 |
lineType = 'Stream Line' |
|
1322 |
for index in range(count - 1): |
|
1136 |
drawing.hmbTable.append(hmb) |
|
1323 | 1137 |
|
1324 |
start = self.actionLine.tag.streamline._vertices[index] |
|
1325 |
end = self.actionLine.tag.streamline._vertices[index + 1] |
|
1326 |
|
|
1327 |
poly._pol.append(QPointF(start[0], start[1])) |
|
1328 |
poly._pol.append(QPointF(end[0], end[1])) |
|
1329 |
#poly.setPen(QPen(Qt.red, 2, Qt.SolidLine)) |
|
1330 |
poly.buildItem() |
|
1331 |
|
|
1332 |
items.append(poly) |
|
1333 |
selected = [item for item in self.graphicsView.scene.items(poly._pol.first()) if type(item) is QEngineeringConnectorItem or type(item) is QEngineeringPolylineItem] |
|
1334 |
if selected: |
|
1335 |
poly.connect_if_possible(selected[0].parent if type(selected[0]) is QEngineeringConnectorItem else selected[0], 5) |
|
1336 |
|
|
1138 |
self.load_HMB() |
|
1337 | 1139 |
|
1338 |
self.graphicsView.scene.addItem(poly)
|
|
1339 |
|
|
1140 |
finally:
|
|
1141 |
self.actionLine.tag.reset() |
|
1340 | 1142 |
|
1341 |
#pt = poly._pol[-1].endPoint() |
|
1342 |
#selected = [item for item in self.graphicsView.scene.items(QPointF(pt[0], pt[1])) if type(item) is QEngineeringConnectorItem and item.parent is not items[-1]] |
|
1343 |
#if selected: |
|
1344 |
# items[-1].connect_if_possible(selected[0].parent, 5) |
|
1345 | 1143 |
|
1346 |
|
|
1144 |
def load_HMB(self): |
|
1145 |
self.tableWidgetHMB.clearContents() |
|
1146 |
self.tableWidgetHMB.setRowCount(0) |
|
1347 | 1147 |
|
1348 |
lineType = 'Stream Line' |
|
1349 |
for index in range(count - 1): |
|
1350 |
start = self.actionLine.tag.streamline._vertices[index] |
|
1351 |
end = self.actionLine.tag.streamline._vertices[index + 1] |
|
1352 |
|
|
1353 |
lineItem = QEngineeringLineItem(vertices=[start, end]) |
|
1354 |
lineItem.transfer.onRemoved.connect(self.itemRemoved) |
|
1355 |
lineItem.lineType = lineType |
|
1356 |
if items: |
|
1357 |
lineItem.connect_if_possible(items[-1], 5) |
|
1358 |
else: |
|
1359 |
pt = lineItem.startPoint() |
|
1360 |
selected = [item for item in self.graphicsView.scene.items(QPointF(pt[0], pt[1])) if type(item) is QEngineeringConnectorItem or type(item) is QEngineeringLineItem] |
|
1361 |
if selected: |
|
1362 |
lineItem.connect_if_possible(selected[0].parent if type(selected[0]) is QEngineeringConnectorItem else selected[0], 5) |
|
1363 |
|
|
1364 |
items.append(lineItem) |
|
1365 |
self.graphicsView.scene.addItem(lineItem) |
|
1148 |
drawing = AppDocData.instance().activeDrawing |
|
1366 | 1149 |
|
1367 |
pt = items[-1].endPoint() |
|
1368 |
selected = [item for item in self.graphicsView.scene.items(QPointF(pt[0], pt[1])) if type(item) is QEngineeringConnectorItem and item.parent is not items[-1]] |
|
1369 |
if selected: |
|
1370 |
items[-1].connect_if_possible(selected[0].parent, 5) |
|
1371 |
|
|
1372 |
""" |
|
1373 |
finally: |
|
1374 |
#self.graphicsView.scene.removeItem(self.actionLine.tag._streamline) |
|
1375 |
self.actionLine.tag.reset() |
|
1150 |
hmbs = drawing.hmbTable._hmbs |
|
1151 |
if hmbs is not None: |
|
1152 |
rowCount = len(hmbs) |
|
1153 |
self.tableWidgetHMB.setRowCount(rowCount) |
|
1154 |
|
|
1155 |
rowIndex = 0 |
|
1156 |
for hmb in hmbs: |
|
1157 |
self.tableWidgetHMB.setItem(rowIndex, 0, QTableWidgetItem(str(hmb.uid))) |
|
1158 |
self.tableWidgetHMB.setItem(rowIndex, 1, QTableWidgetItem(str(hmb.drawing_uid))) |
|
1159 |
self.tableWidgetHMB.setItem(rowIndex, 2, QTableWidgetItem(str(hmb.stream_no))) |
|
1160 |
rowIndex += 1 |
|
1161 |
|
|
1162 |
|
|
1163 |
|
|
1376 | 1164 |
|
1377 | 1165 |
''' |
1378 | 1166 |
@brief refresh scene |
... | ... | |
1477 | 1265 |
except Exception as ex: |
1478 | 1266 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
1479 | 1267 |
self.addMessage.emit(MessageType.Error, message) |
1480 |
|
|
1481 |
''' |
|
1482 |
@brief recognize symbol and text |
|
1483 |
@author humkyung |
|
1484 |
@date 2018.04.?? |
|
1485 |
@history 2018.04.16 humkyung execute line no tracing |
|
1486 |
2018.05.02 Jeongwoo Show MessageBox when imageviewer doesn't have image |
|
1487 |
2018.05.25 Jeongwoo Add parameter on QRecognitionDialog.__init__() and Move thread to QRecognitionDialog |
|
1488 |
Remove codes below if self.dlg.isAccepted == True |
|
1489 |
2018.05.29 Jeongwoo Remove connects and comments |
|
1490 |
humkyung 2018.11.05 save working date-time |
|
1491 |
''' |
|
1492 |
def recognize(self, MainWindow): |
|
1493 |
from datetime import datetime |
|
1494 |
from RecognitionDialog import QRecognitionDialog |
|
1495 |
|
|
1496 |
if not self.graphicsView.hasImage(): |
|
1497 |
self.showImageSelectionMessageBox() |
|
1498 |
return |
|
1499 |
|
|
1500 |
try: |
|
1501 |
''' |
|
1502 |
self.removedItems['LINE'] = [] |
|
1503 |
self.removedItems['EQUIP'] = [] |
|
1504 |
self.removedItems['INST'] = [] |
|
1505 |
self.removedItems['NOTE'] = [] |
|
1506 |
''' |
|
1507 |
|
|
1508 |
appDocData = AppDocData.instance() |
|
1509 |
|
|
1510 |
self.onClearLog() |
|
1511 |
appDocData.needReOpening = False |
|
1512 |
drawingList = [] |
|
1513 |
drawingList.append(self.path) |
|
1514 |
self.dlg = QRecognitionDialog(self, drawingList, False) |
|
1515 |
self.dlg.exec_() |
|
1516 |
|
|
1517 |
if appDocData.needReOpening == True: |
|
1518 |
self.itemTreeWidget.setCurrentDrawing(appDocData.activeDrawing.name) |
|
1519 |
self.drawDetectedItemsToScene() |
|
1520 |
|
|
1521 |
# save working date-time |
|
1522 |
drawings = appDocData.getDrawings() |
|
1523 |
drawing = [drawing for drawing in drawings if appDocData.imgName == os.path.splitext(drawing[1])[0]] |
|
1524 |
if drawing[0]: |
|
1525 |
drawing[0][2] = datetime.now().strftime('%Y-%m-%d %H:%M:%S') |
|
1526 |
appDocData.saveDrawings(drawing) |
|
1527 |
|
|
1528 |
currentPid = appDocData.activeDrawing.name |
|
1529 |
|
|
1530 |
drawingTop = self.treeWidgetDrawingList.topLevelItem(0) |
|
1531 |
drawingCount = drawingTop.childCount() |
|
1532 |
|
|
1533 |
for drawing in range(drawingCount): |
|
1534 |
drawingChild = drawingTop.child(drawing) |
|
1535 |
if drawingChild.data(0, 0).find(currentPid) is 0: |
|
1536 |
drawingChild.setText(1, datetime.now().strftime('%Y-%m-%d %H:%M:%S')) |
|
1537 |
self.changeViewCheckedState(True) |
|
1538 |
# up to here |
|
1539 |
except Exception as ex: |
|
1540 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
1541 |
self.addMessage.emit(MessageType.Error, message) |
|
1542 |
|
|
1268 |
|
|
1543 | 1269 |
''' |
1544 | 1270 |
@brief remove item from tree widget and then remove from scene |
1545 | 1271 |
@date 2018.05.25 |
... | ... | |
1595 | 1321 |
self.addMessage.emit(MessageType.Error, message) |
1596 | 1322 |
|
1597 | 1323 |
''' |
1598 |
@brief recognize line |
|
1599 |
@author humkyung |
|
1600 |
@date 2018.04.19 |
|
1601 |
@history Jeongwoo 2018.04.26 Variable name changed (texts → lineNos) |
|
1602 |
TextItem type changed (QEngineeringTextItem → QEngineeringLineNoTextItem) |
|
1603 |
humkyung 2018.04.26 remove small objects before recognizing line |
|
1604 |
Jeongwoo 2018.05.02 Show MessageBox when imageviewer doesn't have image |
|
1605 |
Jeongwoo 2018.05.25 Move codes about LineDetector |
|
1606 |
humkyung 2018.06.17 show progress dialog |
|
1607 |
''' |
|
1608 |
def connect_attributes(self, MainWindow): |
|
1609 |
from LineNoTracer import LineNoTracer |
|
1610 |
from ConnectAttrDialog import QConnectAttrDialog |
|
1611 |
|
|
1612 |
if not self.graphicsView.hasImage(): |
|
1613 |
self.showImageSelectionMessageBox() |
|
1614 |
return |
|
1615 |
|
|
1616 |
try: |
|
1617 |
self.dlgConnectAttr = QConnectAttrDialog(self, self.graphicsView) |
|
1618 |
if QDialog.Accepted == self.dlgConnectAttr.exec_(): |
|
1619 |
self.itemTreeWidget.InitLineNoItems() |
|
1620 |
|
|
1621 |
# construct line no item |
|
1622 |
line_nos = AppDocData.instance().tracerLineNos |
|
1623 |
for line_no in line_nos: |
|
1624 |
item = self.itemTreeWidget.addTreeItem(self.itemTreeWidget.root, line_no) |
|
1625 |
connectedItems = line_no.getConnectedItems() |
|
1626 |
for connectedItem in connectedItems: |
|
1627 |
if issubclass(type(connectedItem), SymbolSvgItem): |
|
1628 |
self.itemTreeWidget.addTreeItem(item, connectedItem) |
|
1629 |
# up to here |
|
1630 |
|
|
1631 |
self.graphicsView.invalidateScene() |
|
1632 |
except Exception as ex: |
|
1633 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
1634 |
self.addMessage.emit(MessageType.Error, message) |
|
1635 |
|
|
1636 |
''' |
|
1637 | 1324 |
@history 2018.05.25 Jeongwoo Moved from MainWindow |
1638 | 1325 |
SvgItem and TextItem Connect with method in this class |
1639 | 1326 |
Change method to add GraphicsItem |
... | ... | |
2489 | 2176 |
self.graphicsView.scene.addItem(lineItem) |
2490 | 2177 |
|
2491 | 2178 |
''' |
2492 |
@brief generate output xml file |
|
2493 |
@author humkyung |
|
2494 |
@date 2018.04.23 |
|
2495 |
@history 2018.05.02 Jeongwoo Show MessageBox when imageviewer doesn't have image |
|
2496 |
''' |
|
2497 |
def generateOutput(self): |
|
2498 |
import XmlGenerator as xg |
|
2499 |
|
|
2500 |
if not self.graphicsView.hasImage(): |
|
2501 |
self.showImageSelectionMessageBox() |
|
2502 |
return |
|
2503 |
|
|
2504 |
try: |
|
2505 |
appDocData = AppDocData.instance() |
|
2506 |
|
|
2507 |
## collect items |
|
2508 |
appDocData.lines.clear() |
|
2509 |
appDocData.lines = [item for item in self.graphicsView.scene.items() if type(item) is QEngineeringLineItem and item.owner is None] |
|
2510 |
|
|
2511 |
appDocData.symbols.clear() |
|
2512 |
appDocData.symbols = [item for item in self.graphicsView.scene.items() if issubclass(type(item), SymbolSvgItem) and item.owner is None] |
|
2513 |
|
|
2514 |
appDocData.equipments.clear() |
|
2515 |
for item in self.graphicsView.scene.items(): |
|
2516 |
if type(item) is QEngineeringEquipmentItem: |
|
2517 |
appDocData.equipments.append(item) |
|
2518 |
|
|
2519 |
appDocData.texts.clear() |
|
2520 |
appDocData.texts = [item for item in self.graphicsView.scene.items() if issubclass(type(item), QEngineeringTextItem) and type(item) is not QEngineeringLineNoTextItem] |
|
2521 |
## up to here |
|
2522 |
|
|
2523 |
appDocData.imgOutput = np.ones((appDocData.imgHeight, appDocData.imgWidth), np.uint8)*255 |
|
2524 |
xg.writeOutputXml(appDocData.imgName, appDocData.imgWidth, appDocData.imgHeight) # TODO: check |
|
2525 |
project = appDocData.getCurrentProject() |
|
2526 |
cv2.imwrite(os.path.join(project.getTempPath() , 'OUTPUT.png') , appDocData.imgOutput) |
|
2527 |
except Exception as ex: |
|
2528 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
2529 |
self.addMessage.emit(MessageType.Error, message) |
|
2530 |
|
|
2531 |
''' |
|
2532 | 2179 |
@brief resetting attribute at secne |
2533 | 2180 |
@author kyoyho |
2534 | 2181 |
@date 2018.08.21 |
... | ... | |
2634 | 2281 |
def create_symbol(self): |
2635 | 2282 |
symbolEditorDialog = SymbolEditorDialog.QSymbolEditorDialog(self, None, AppDocData.instance().getCurrentProject()) |
2636 | 2283 |
(isAccepted, isImmediateInsert, offsetX, offsetY, newSym) = symbolEditorDialog.showDialog() |
2637 |
self.dirTreeWidget.initDirTreeWidget()
|
|
2284 |
self.symbolTreeWidget.initSymbolTreeWidget()
|
|
2638 | 2285 |
|
2639 | 2286 |
|
2640 | 2287 |
if __name__ == '__main__': |
HYTOS/HYTOS/MainWindow_UI.py | ||
---|---|---|
11 | 11 |
class Ui_MainWindow(object): |
12 | 12 |
def setupUi(self, MainWindow): |
13 | 13 |
MainWindow.setObjectName("MainWindow") |
14 |
MainWindow.resize(1280, 733)
|
|
14 |
MainWindow.resize(1169, 744)
|
|
15 | 15 |
font = QtGui.QFont() |
16 | 16 |
font.setFamily("맑은 고딕") |
17 | 17 |
font.setBold(True) |
... | ... | |
32 | 32 |
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) |
33 | 33 |
MainWindow.setCentralWidget(self.centralwidget) |
34 | 34 |
self.menubar = QtWidgets.QMenuBar(MainWindow) |
35 |
self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 21))
|
|
35 |
self.menubar.setGeometry(QtCore.QRect(0, 0, 1169, 21))
|
|
36 | 36 |
self.menubar.setObjectName("menubar") |
37 | 37 |
self.menu = QtWidgets.QMenu(self.menubar) |
38 | 38 |
self.menu.setObjectName("menu") |
... | ... | |
52 | 52 |
self.statusbar = QtWidgets.QStatusBar(MainWindow) |
53 | 53 |
self.statusbar.setObjectName("statusbar") |
54 | 54 |
MainWindow.setStatusBar(self.statusbar) |
55 |
self.toolBar = QtWidgets.QToolBar(MainWindow) |
|
56 |
font = QtGui.QFont() |
|
57 |
font.setFamily("맑은 고딕") |
|
58 |
font.setBold(True) |
|
59 |
font.setWeight(75) |
|
60 |
self.toolBar.setFont(font) |
|
61 |
self.toolBar.setIconSize(QtCore.QSize(32, 32)) |
|
62 |
self.toolBar.setObjectName("toolBar") |
|
63 |
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) |
|
64 |
self.dockWidget = QtWidgets.QDockWidget(MainWindow) |
|
65 |
self.dockWidget.setMinimumSize(QtCore.QSize(200, 115)) |
|
66 |
self.dockWidget.setObjectName("dockWidget") |
|
55 |
self.dockWidgetSymbolExplorer = QtWidgets.QDockWidget(MainWindow) |
|
56 |
self.dockWidgetSymbolExplorer.setMinimumSize(QtCore.QSize(200, 115)) |
|
57 |
self.dockWidgetSymbolExplorer.setObjectName("dockWidgetSymbolExplorer") |
|
67 | 58 |
self.dockWidgetContents = QtWidgets.QWidget() |
68 | 59 |
self.dockWidgetContents.setObjectName("dockWidgetContents") |
69 | 60 |
self.gridLayout_2 = QtWidgets.QGridLayout(self.dockWidgetContents) |
70 | 61 |
self.gridLayout_2.setObjectName("gridLayout_2") |
71 |
self.tabWidget = QtWidgets.QTabWidget(self.dockWidgetContents) |
|
72 |
self.tabWidget.setObjectName("tabWidget") |
|
73 |
self.Symbol = QtWidgets.QWidget() |
|
74 |
self.Symbol.setObjectName("Symbol") |
|
75 |
self.gridLayout_3 = QtWidgets.QGridLayout(self.Symbol) |
|
76 |
self.gridLayout_3.setObjectName("gridLayout_3") |
|
77 |
self.symbolTabVerticalLayout = QtWidgets.QVBoxLayout() |
|
78 |
self.symbolTabVerticalLayout.setObjectName("symbolTabVerticalLayout") |
|
79 |
self.horizontalLayout_3 = QtWidgets.QHBoxLayout() |
|
80 |
self.horizontalLayout_3.setObjectName("horizontalLayout_3") |
|
81 |
self.symbolTabVerticalLayout.addLayout(self.horizontalLayout_3) |
|
82 |
self.gridLayout_3.addLayout(self.symbolTabVerticalLayout, 0, 0, 1, 1) |
|
83 |
self.tabWidget.addTab(self.Symbol, "") |
|
84 |
self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1) |
|
85 |
self.dockWidget.setWidget(self.dockWidgetContents) |
|
86 |
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidget) |
|
87 |
self.dockWidgetObjectExplorer = QtWidgets.QDockWidget(MainWindow) |
|
88 |
self.dockWidgetObjectExplorer.setMinimumSize(QtCore.QSize(300, 219)) |
|
89 |
self.dockWidgetObjectExplorer.setObjectName("dockWidgetObjectExplorer") |
|
62 |
self.verticalLayoutSymbolList = QtWidgets.QVBoxLayout() |
|
63 |
self.verticalLayoutSymbolList.setObjectName("verticalLayoutSymbolList") |
|
64 |
self.gridLayout_2.addLayout(self.verticalLayoutSymbolList, 0, 0, 1, 1) |
|
65 |
self.dockWidgetSymbolExplorer.setWidget(self.dockWidgetContents) |
|
66 |
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidgetSymbolExplorer) |
|
67 |
self.dockWidgetDrawingExplorer = QtWidgets.QDockWidget(MainWindow) |
|
68 |
self.dockWidgetDrawingExplorer.setMinimumSize(QtCore.QSize(300, 328)) |
|
69 |
self.dockWidgetDrawingExplorer.setObjectName("dockWidgetDrawingExplorer") |
|
90 | 70 |
self.dockWidgetContents_2 = QtWidgets.QWidget() |
91 | 71 |
self.dockWidgetContents_2.setObjectName("dockWidgetContents_2") |
92 | 72 |
self.gridLayout_4 = QtWidgets.QGridLayout(self.dockWidgetContents_2) |
93 | 73 |
self.gridLayout_4.setObjectName("gridLayout_4") |
94 |
self.tabWidgetItemExplorer = QtWidgets.QTabWidget(self.dockWidgetContents_2) |
|
95 |
self.tabWidgetItemExplorer.setObjectName("tabWidgetItemExplorer") |
|
96 |
self.tabItemProperty = QtWidgets.QWidget() |
|
97 |
self.tabItemProperty.setObjectName("tabItemProperty") |
|
98 |
self.gridLayout_6 = QtWidgets.QGridLayout(self.tabItemProperty) |
|
99 |
self.gridLayout_6.setObjectName("gridLayout_6") |
|
100 |
self.symbolExplorerVerticalLayout = QtWidgets.QVBoxLayout() |
|
101 |
self.symbolExplorerVerticalLayout.setObjectName("symbolExplorerVerticalLayout") |
|
102 |
self.gridLayout_6.addLayout(self.symbolExplorerVerticalLayout, 0, 0, 1, 1) |
|
103 |
self.tabWidgetItemExplorer.addTab(self.tabItemProperty, "") |
|
104 |
self.tabDrawingList = QtWidgets.QWidget() |
|
105 |
self.tabDrawingList.setObjectName("tabDrawingList") |
|
106 |
self.gridLayout_7 = QtWidgets.QGridLayout(self.tabDrawingList) |
|
107 |
self.gridLayout_7.setObjectName("gridLayout_7") |
|
108 | 74 |
self.verticalLayoutDrawingList = QtWidgets.QVBoxLayout() |
109 | 75 |
self.verticalLayoutDrawingList.setObjectName("verticalLayoutDrawingList") |
110 |
self.treeWidgetDrawingList = QtWidgets.QTreeWidget(self.tabDrawingList)
|
|
76 |
self.treeWidgetDrawingList = QtWidgets.QTreeWidget(self.dockWidgetContents_2)
|
|
111 | 77 |
self.treeWidgetDrawingList.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) |
112 | 78 |
self.treeWidgetDrawingList.setColumnCount(2) |
113 | 79 |
self.treeWidgetDrawingList.setObjectName("treeWidgetDrawingList") |
... | ... | |
115 | 81 |
self.treeWidgetDrawingList.headerItem().setText(1, "2") |
116 | 82 |
self.treeWidgetDrawingList.header().setVisible(False) |
117 | 83 |
self.verticalLayoutDrawingList.addWidget(self.treeWidgetDrawingList) |
118 |
self.gridLayout_7.addLayout(self.verticalLayoutDrawingList, 0, 0, 1, 1) |
|
119 |
self.tabWidgetItemExplorer.addTab(self.tabDrawingList, "") |
|
120 |
self.gridLayout_4.addWidget(self.tabWidgetItemExplorer, 0, 0, 1, 1) |
|
121 |
self.dockWidgetObjectExplorer.setWidget(self.dockWidgetContents_2) |
|
122 |
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidgetObjectExplorer) |
|
84 |
self.gridLayout_4.addLayout(self.verticalLayoutDrawingList, 0, 0, 1, 1) |
|
85 |
self.dockWidgetDrawingExplorer.setWidget(self.dockWidgetContents_2) |
|
86 |
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidgetDrawingExplorer) |
|
123 | 87 |
self.EditToolbar = QtWidgets.QToolBar(MainWindow) |
124 | 88 |
self.EditToolbar.setEnabled(True) |
125 | 89 |
self.EditToolbar.setIconSize(QtCore.QSize(32, 32)) |
126 | 90 |
self.EditToolbar.setObjectName("EditToolbar") |
127 | 91 |
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.EditToolbar) |
128 | 92 |
self.dockWidgetOutputWnd = QtWidgets.QDockWidget(MainWindow) |
129 |
self.dockWidgetOutputWnd.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable|QtWidgets.QDockWidget.DockWidgetMovable)
|
|
93 |
self.dockWidgetOutputWnd.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures)
|
|
130 | 94 |
self.dockWidgetOutputWnd.setAllowedAreas(QtCore.Qt.AllDockWidgetAreas) |
131 | 95 |
self.dockWidgetOutputWnd.setObjectName("dockWidgetOutputWnd") |
132 | 96 |
self.dockWidgetContents_3 = QtWidgets.QWidget() |
133 | 97 |
self.dockWidgetContents_3.setObjectName("dockWidgetContents_3") |
134 | 98 |
self.gridLayout_5 = QtWidgets.QGridLayout(self.dockWidgetContents_3) |
135 | 99 |
self.gridLayout_5.setObjectName("gridLayout_5") |
136 |
self.tabWidget_2 = QtWidgets.QTabWidget(self.dockWidgetContents_3) |
|
137 |
self.tabWidget_2.setObjectName("tabWidget_2") |
|
138 |
self.tabTerminal = QtWidgets.QWidget() |
|
139 |
self.tabTerminal.setObjectName("tabTerminal") |
|
140 |
self.gridLayout_12 = QtWidgets.QGridLayout(self.tabTerminal) |
|
141 |
self.gridLayout_12.setObjectName("gridLayout_12") |
|
142 |
self.verticalLayout_3 = QtWidgets.QVBoxLayout() |
|
143 |
self.verticalLayout_3.setObjectName("verticalLayout_3") |
|
144 |
self.horizontalLayout_5 = QtWidgets.QHBoxLayout() |
|
145 |
self.horizontalLayout_5.setObjectName("horizontalLayout_5") |
|
146 |
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) |
|
147 |
self.horizontalLayout_5.addItem(spacerItem) |
|
148 |
self.pushButtonClearLog = QtWidgets.QPushButton(self.tabTerminal) |
|
149 |
self.pushButtonClearLog.setEnabled(True) |
|
150 |
self.pushButtonClearLog.setMaximumSize(QtCore.QSize(32, 16777215)) |
|
151 |
self.pushButtonClearLog.setObjectName("pushButtonClearLog") |
|
152 |
self.horizontalLayout_5.addWidget(self.pushButtonClearLog, 0, QtCore.Qt.AlignRight) |
|
153 |
self.verticalLayout_3.addLayout(self.horizontalLayout_5) |
|
154 |
self.listWidgetLog = QtWidgets.QListWidget(self.tabTerminal) |
|
155 |
self.listWidgetLog.setObjectName("listWidgetLog") |
|
156 |
self.verticalLayout_3.addWidget(self.listWidgetLog) |
|
157 |
self.horizontalLayout_6 = QtWidgets.QHBoxLayout() |
|
158 |
self.horizontalLayout_6.setObjectName("horizontalLayout_6") |
|
159 |
self.verticalLayout_3.addLayout(self.horizontalLayout_6) |
|
160 |
self.gridLayout_12.addLayout(self.verticalLayout_3, 0, 0, 1, 1) |
|
161 |
self.tabWidget_2.addTab(self.tabTerminal, "") |
|
162 |
self.tabInconsistency = QtWidgets.QWidget() |
|
163 |
self.tabInconsistency.setObjectName("tabInconsistency") |
|
164 |
self.gridLayout_8 = QtWidgets.QGridLayout(self.tabInconsistency) |
|
165 |
self.gridLayout_8.setObjectName("gridLayout_8") |
|
166 |
self.verticalLayout_2 = QtWidgets.QVBoxLayout() |
|
167 |
self.verticalLayout_2.setObjectName("verticalLayout_2") |
|
168 |
self.tableWidgetInconsistency = QtWidgets.QTableWidget(self.tabInconsistency) |
|
169 |
self.tableWidgetInconsistency.setObjectName("tableWidgetInconsistency") |
|
170 |
self.tableWidgetInconsistency.setColumnCount(0) |
|
171 |
self.tableWidgetInconsistency.setRowCount(0) |
|
172 |
self.verticalLayout_2.addWidget(self.tableWidgetInconsistency) |
|
173 |
self.gridLayout_8.addLayout(self.verticalLayout_2, 0, 0, 1, 1) |
|
174 |
self.tabWidget_2.addTab(self.tabInconsistency, "") |
|
175 |
self.gridLayout_5.addWidget(self.tabWidget_2, 0, 0, 1, 1) |
|
100 |
self.horizontalLayout = QtWidgets.QHBoxLayout() |
|
101 |
self.horizontalLayout.setObjectName("horizontalLayout") |
|
102 |
self.tableWidgetHMB = QtWidgets.QTableWidget(self.dockWidgetContents_3) |
|
103 |
self.tableWidgetHMB.setObjectName("tableWidgetHMB") |
|
104 |
self.tableWidgetHMB.setColumnCount(0) |
|
105 |
self.tableWidgetHMB.setRowCount(0) |
|
106 |
self.horizontalLayout.addWidget(self.tableWidgetHMB) |
|
107 |
self.gridLayout_5.addLayout(self.horizontalLayout, 0, 0, 1, 1) |
|
176 | 108 |
self.dockWidgetOutputWnd.setWidget(self.dockWidgetContents_3) |
177 | 109 |
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(8), self.dockWidgetOutputWnd) |
110 |
self.toolBar = QtWidgets.QToolBar(MainWindow) |
|
111 |
font = QtGui.QFont() |
|
112 |
font.setFamily("맑은 고딕") |
|
113 |
font.setBold(True) |
|
114 |
font.setWeight(75) |
|
115 |
self.toolBar.setFont(font) |
|
116 |
self.toolBar.setIconSize(QtCore.QSize(32, 32)) |
|
117 |
self.toolBar.setObjectName("toolBar") |
|
118 |
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) |
|
178 | 119 |
self.actionOpen = QtWidgets.QAction(MainWindow) |
179 | 120 |
icon = QtGui.QIcon() |
180 | 121 |
icon.addPixmap(QtGui.QPixmap(":/newPrefix/file.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
... | ... | |
437 | 378 |
self.menu.addAction(self.menuLanguage.menuAction()) |
438 | 379 |
self.menu.addSeparator() |
439 | 380 |
self.menu.addAction(self.actionClose) |
440 |
self.menu_2.addAction(self.actionHMB_DATA) |
|
441 |
self.menu_2.addAction(self.actionItem_Data_List) |
|
442 |
self.menu_2.addSeparator() |
|
443 |
self.menu_2.addAction(self.actionCodeTable) |
|
444 |
self.menu_2.addAction(self.actionOCR_Training) |
|
445 | 381 |
self.menu_3.addAction(self.actionImage_Drawing) |
446 | 382 |
self.menu_3.addAction(self.actionViewText) |
447 | 383 |
self.menu_3.addAction(self.actionViewSymbol) |
... | ... | |
453 | 389 |
self.menu_3.addSeparator() |
454 | 390 |
self.menu_3.addAction(self.actionDrawing_Only) |
455 | 391 |
self.menu_4.addAction(self.actionCreate_Symbol) |
456 |
self.menu_5.addAction(self.actionFindReplaceText) |
|
457 |
self.menu_5.addAction(self.actionText_Data_List) |
|
458 | 392 |
self.menubar.addAction(self.menu.menuAction()) |
459 | 393 |
self.menubar.addAction(self.menu_5.menuAction()) |
460 | 394 |
self.menubar.addAction(self.menu_2.menuAction()) |
461 | 395 |
self.menubar.addAction(self.menu_3.menuAction()) |
462 | 396 |
self.menubar.addAction(self.menu_4.menuAction()) |
463 |
self.toolBar.addAction(self.actionNew) |
|
464 |
self.toolBar.addAction(self.actionSave) |
|
465 |
self.toolBar.addAction(self.actionRecognition) |
|
466 |
self.toolBar.addAction(self.actionLineRecognition) |
|
467 |
self.toolBar.addAction(self.actionInitialize) |
|
468 |
self.toolBar.addSeparator() |
|
469 |
self.toolBar.addAction(self.actionLine) |
|
470 |
self.toolBar.addAction(self.actionValidate) |
|
471 |
self.toolBar.addSeparator() |
|
472 |
self.toolBar.addAction(self.actionGenerateOutput) |
|
473 | 397 |
self.EditToolbar.addAction(self.actionRotate) |
474 | 398 |
self.EditToolbar.addAction(self.actionZoom) |
475 | 399 |
self.EditToolbar.addAction(self.actionFitWindow) |
476 | 400 |
self.EditToolbar.addSeparator() |
401 |
self.toolBar.addAction(self.actionNew) |
|
402 |
self.toolBar.addAction(self.actionSave) |
내보내기 Unified diff