개정판 168c1988
issue #000: change flange min length global validation on going
Change-Id: Ia5d0e2a79aea2cecaf12874c91e51c5f4ec19197
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
1708 | 1708 |
self._symbolBase = {} |
1709 | 1709 |
return (ret, fileName) |
1710 | 1710 | |
1711 |
def getDuplicatedAttrs(self, param): |
|
1712 |
""" get duplicated attributes """ |
|
1713 | ||
1714 |
res = [] |
|
1715 |
|
|
1716 |
with self.project.database.connect() as conn: |
|
1717 |
cursor = conn.cursor() |
|
1718 |
sql = self.project.database.to_sql(f"SELECT t.Value, c.UID, d.Name FROM " |
|
1719 |
f"(SELECT a.[Value] FROM Attributes a GROUP BY a.[value] HAVING COUNT(a.[value]) > 1) t " |
|
1720 |
f"INNER JOIN Attributes a ON a.Value=t.value " |
|
1721 |
f"INNER JOIN SymbolAttribute b ON a.SymbolAttribute_UID=b.UID " |
|
1722 |
f"INNER JOIN Components c ON a.Components_UID=c.UID " |
|
1723 |
f"INNER JOIN Drawings d ON c.Drawings_UID=d.UID " |
|
1724 |
f"WHERE b.Attribute=? AND t.value != '' AND t.value != 'None' AND t.value IS NOT null") |
|
1725 |
try: |
|
1726 |
cursor.execute(sql, (param,)) |
|
1727 |
rows = cursor.fetchall() |
|
1728 |
for row in rows: |
|
1729 |
res.append([row['Name'], row['UID'], row['Value']]) |
|
1730 | ||
1731 |
res = sorted(res, key=lambda pram: param[2]) |
|
1732 |
return res |
|
1733 | ||
1734 |
except Exception as ex: |
|
1735 |
from App import App |
|
1736 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
1737 |
sys.exc_info()[-1].tb_lineno) |
|
1738 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
1739 | ||
1711 | 1740 |
''' |
1712 | 1741 |
@brief get symbol name |
1713 | 1742 |
@history 18.04.24 Jeongwoo Add isExceptDetect Field |
1714 | 1743 |
''' |
1715 | ||
1716 | 1744 |
def getSymbolByQuery(self, fieldName, param): |
1717 | 1745 |
ret = None |
1718 | 1746 |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
273 | 273 |
self.actionSave.triggered.connect(self.actionSaveCliked) |
274 | 274 |
self.addMessage.connect(self.onAddMessage) |
275 | 275 |
self.actionFindReplaceText.triggered.connect(self.findReplaceTextClicked) |
276 |
self.actionSymbol_Replace_Insert.triggered.connect(self.ReplaceInsertSymbolClicked) |
|
276 |
self.actionSymbol_Replace_Insert.triggered.connect(self.replaceInsertSymbolClicked) |
|
277 |
self.actionGlobal_Validation.triggered.connect(self.validationGlobalClicked) |
|
277 | 278 |
self.actionEditRecognizeLine.triggered.connect(self.on_recognize_line) |
278 | 279 |
self.pushButtonDetectSymbol.clicked.connect(self.show_detect_symbol_dialog) |
279 | 280 |
self.actionUndo.triggered.connect(self._scene.undo_stack.undo) |
... | ... | |
684 | 685 |
self.dlgTextItemEdit.show() |
685 | 686 |
self.dlgTextItemEdit.exec_() |
686 | 687 | |
687 |
def ReplaceInsertSymbolClicked(self): |
|
688 |
def validationGlobalClicked(self): |
|
689 |
""" global validation dialog """ |
|
690 |
from ValidationGlobalDialog import QValidationGlobalDialog |
|
691 | ||
692 |
self.dlgGValidation = QValidationGlobalDialog(self) |
|
693 |
self.dlgGValidation.show() |
|
694 |
self.dlgGValidation.exec_() |
|
695 | ||
696 |
def replaceInsertSymbolClicked(self): |
|
688 | 697 |
"""pop up replace and insert dialog""" |
689 | 698 |
if not self.graphicsView.hasImage(): |
690 | 699 |
self.showImageSelectionMessageBox() |
... | ... | |
1575 | 1584 |
def save_alarm_enable(self, enable, init=False): |
1576 | 1585 |
from datetime import datetime |
1577 | 1586 | |
1578 |
app_doc_data = AppDocData.instance() |
|
1579 |
configs = app_doc_data.getConfigs('Data Save', 'Time') |
|
1580 |
time_min = int(configs[0].value) if 1 == len(configs) else 0 |
|
1581 | ||
1582 |
if enable and time_min > 0: |
|
1583 |
if not self.save_timer: |
|
1584 |
self.save_timer = QTimer() |
|
1585 |
self.save_timer.timeout.connect(self.save_alarm) |
|
1586 |
self.save_timer.setInterval(60000) |
|
1587 | ||
1588 |
if init: |
|
1589 |
self.save_timer._init_time = datetime.now() |
|
1590 |
self.save_timer._stop_time = None |
|
1591 |
self.save_timer._interval_time = datetime.now() - datetime.now() |
|
1592 | ||
1593 |
if self.save_timer._stop_time: |
|
1594 |
self.save_timer._interval_time = datetime.now() - self.save_timer._stop_time |
|
1595 |
|
|
1596 |
#if 60000 * time_min != self.save_timer.interval(): |
|
1597 |
# self.save_timer.setInterval(60000) |
|
1587 |
try: |
|
1588 |
app_doc_data = AppDocData.instance() |
|
1589 |
configs = app_doc_data.getConfigs('Data Save', 'Time') |
|
1590 |
time_min = int(configs[0].value) if 1 == len(configs) else 0 |
|
1591 | ||
1592 |
if enable and time_min > 0: |
|
1593 |
if not self.save_timer: |
|
1594 |
self.save_timer = QTimer() |
|
1595 |
self.save_timer.timeout.connect(self.save_alarm) |
|
1596 |
self.save_timer.setInterval(60000) |
|
1597 | ||
1598 |
if init: |
|
1599 |
self.save_timer._init_time = datetime.now() |
|
1600 |
self.save_timer._stop_time = None |
|
1601 |
self.save_timer._interval_time = datetime.now() - datetime.now() |
|
1602 | ||
1603 |
if self.save_timer._stop_time: |
|
1604 |
self.save_timer._interval_time = datetime.now() - self.save_timer._stop_time |
|
1605 |
|
|
1606 |
#if 60000 * time_min != self.save_timer.interval(): |
|
1607 |
# self.save_timer.setInterval(60000) |
|
1598 | 1608 | |
1599 |
self.save_timer.start() |
|
1600 |
else: |
|
1601 |
if self.save_timer: |
|
1602 |
self.save_timer.stop() |
|
1603 |
self.save_timer._stop_time = datetime.now() |
|
1609 |
self.save_timer.start() |
|
1610 |
else: |
|
1611 |
if self.save_timer: |
|
1612 |
self.save_timer.stop() |
|
1613 |
self.save_timer._stop_time = datetime.now() |
|
1614 |
|
|
1615 |
except Exception as ex: |
|
1616 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
1617 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
1618 |
self.addMessage.emit(MessageType.Error, message) |
|
1604 | 1619 | |
1605 | 1620 |
def save_alarm(self): |
1606 | 1621 |
from datetime import datetime |
... | ... | |
1832 | 1847 |
offsetX, offsetY = [int(point) for point in newSym.getOriginalPoint().split(',')] |
1833 | 1848 |
QtImageViewer.matchSymbolToLine(self.graphicsView.scene(), svg, QPoint(position.x() + offsetX, position.y() + offsetY)) |
1834 | 1849 | |
1835 |
package_item.transfer.onRemoved.emit(selected[0])
|
|
1850 |
package_item.transfer.onRemoved.emit(package_item)
|
|
1836 | 1851 |
finally: |
1837 | 1852 |
self.onCommandRejected() |
1838 | 1853 |
QApplication.restoreOverrideCursor() |
DTI_PID/DTI_PID/MainWindow_UI.py | ||
---|---|---|
601 | 601 |
self.actionReplace_Code_Table = QtWidgets.QAction(MainWindow) |
602 | 602 |
self.actionReplace_Code_Table.setIcon(icon15) |
603 | 603 |
self.actionReplace_Code_Table.setObjectName("actionReplace_Code_Table") |
604 |
self.actionGlobal_Validation = QtWidgets.QAction(MainWindow) |
|
605 |
self.actionGlobal_Validation.setObjectName("actionGlobal_Validation") |
|
604 | 606 |
self.menuExport.addAction(self.actionExportAsSVG) |
605 | 607 |
self.menuExport.addAction(self.actionExportAsXML) |
606 | 608 |
self.menuExport.addAction(self.actionExportAsImage) |
... | ... | |
624 | 626 |
self.menu_2.addAction(self.actionCustom_Code_Table) |
625 | 627 |
self.menu_2.addAction(self.actionReplace_Code_Table) |
626 | 628 |
self.menu_2.addSeparator() |
629 |
self.menu_2.addAction(self.actionGlobal_Validation) |
|
630 |
self.menu_2.addSeparator() |
|
627 | 631 |
self.menu_2.addAction(self.actionOCR_Training) |
628 | 632 |
self.menu_2.addAction(self.actionSymbol_Training) |
629 | 633 |
self.menu_2.addAction(self.actionMake_Label_Data) |
... | ... | |
809 | 813 |
self.actionRotateCCW.setText(_translate("MainWindow", "RotateCCW")) |
810 | 814 |
self.actionRotateCCW.setToolTip(_translate("MainWindow", "Roate counter clockwise")) |
811 | 815 |
self.actionReplace_Code_Table.setText(_translate("MainWindow", "Replace Code Table")) |
816 |
self.actionGlobal_Validation.setText(_translate("MainWindow", "Global Validation")) |
|
812 | 817 | |
813 | 818 |
import MainWindow_rc |
814 | 819 |
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
2536 | 2536 |
# Line 최대 Width |
2537 | 2537 |
line_width = 18 |
2538 | 2538 |
# flange min length |
2539 |
flange_min = 30
|
|
2539 |
flange_min = 25
|
|
2540 | 2540 |
# flange max length |
2541 | 2541 |
flange_max = 50 |
2542 | 2542 |
# flange max width |
... | ... | |
2700 | 2700 |
# Line 최대 Width |
2701 | 2701 |
line_width = 18 |
2702 | 2702 |
# flange min length |
2703 |
flange_min = 30
|
|
2703 |
flange_min = 25
|
|
2704 | 2704 |
# flange max length |
2705 | 2705 |
flange_max = 50 |
2706 | 2706 |
# flange max width |
DTI_PID/DTI_PID/UI/MainWindow.ui | ||
---|---|---|
107 | 107 |
<addaction name="actionCustom_Code_Table"/> |
108 | 108 |
<addaction name="actionReplace_Code_Table"/> |
109 | 109 |
<addaction name="separator"/> |
110 |
<addaction name="actionGlobal_Validation"/> |
|
111 |
<addaction name="separator"/> |
|
110 | 112 |
<addaction name="actionOCR_Training"/> |
111 | 113 |
<addaction name="actionSymbol_Training"/> |
112 | 114 |
<addaction name="actionMake_Label_Data"/> |
... | ... | |
1367 | 1369 |
<string>Replace Code Table</string> |
1368 | 1370 |
</property> |
1369 | 1371 |
</action> |
1372 |
<action name="actionGlobal_Validation"> |
|
1373 |
<property name="text"> |
|
1374 |
<string>Global Validation</string> |
|
1375 |
</property> |
|
1376 |
</action> |
|
1370 | 1377 |
</widget> |
1371 | 1378 |
<resources> |
1372 | 1379 |
<include location="../res/MainWindow.qrc"/> |
DTI_PID/DTI_PID/ValidationDialog.py | ||
---|---|---|
1 | 1 |
# coding: utf-8 |
2 |
""" This is OPC Relation dialog module """
|
|
2 |
""" This is validation dialog module """
|
|
3 | 3 | |
4 | 4 |
import os |
5 | 5 |
import sys |
내보내기 Unified diff