개정판 fe6060ea
issue #1366: add server addeess option and spec break ongoing
Change-Id: Ice85881a505eaeccb6e67a939e7ded320306ac19
DTI_PID/DTI_PID/AppWebService.py | ||
---|---|---|
9 | 9 |
import sys |
10 | 10 |
import base64 |
11 | 11 |
import numpy as np |
12 |
|
|
12 |
from AppDocData import AppDocData |
|
13 | 13 |
|
14 | 14 |
class AppWebService: |
15 | 15 |
""" This is AppDatabase class """ |
16 | 16 |
|
17 | 17 |
def __init__(self): |
18 |
#self._url = 'http://127.0.0.1:8080/' |
|
19 |
self._url = 'http://192.168.0.21:80' |
|
18 |
configs = AppDocData.instance().getConfigs('Engine', 'Address') |
|
19 |
self._url = configs[0].value if configs else None |
|
20 |
#self._url = 'http://192.168.0.21:80' |
|
20 | 21 |
|
21 | 22 |
def text_connection(self): |
22 | 23 |
try: |
24 |
if not self._url: |
|
25 |
return False |
|
23 | 26 |
response = requests.get(self._url) |
24 | 27 |
if response.status_code == 200: |
25 | 28 |
return True |
... | ... | |
49 | 52 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
50 | 53 |
sys.exc_info()[-1].tb_lineno) |
51 | 54 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
55 |
return [] |
|
52 | 56 |
|
53 | 57 |
def request_text_box_tile(self, img_infos, img_path, score_path): |
54 | 58 |
try: |
... | ... | |
83 | 87 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
84 | 88 |
sys.exc_info()[-1].tb_lineno) |
85 | 89 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
90 |
return [] |
|
86 | 91 |
|
87 | 92 |
''' |
88 | 93 |
def request(self, url): |
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
418 | 418 |
else: |
419 | 419 |
self.ui.radioButtonSaveUnknownYes.setChecked(True) |
420 | 420 |
self.ui.radioButtonSaveUnknownNo.setChecked(False) |
421 |
configs = docData.getConfigs('Engine', 'Address') |
|
422 |
self.ui.lineEditServerAddress.setText(configs[0].value if configs else '') |
|
421 | 423 |
configs = docData.getConfigs('Engine', 'Text Area') |
422 | 424 |
if configs: |
423 | 425 |
size = int(configs[0].value) |
... | ... | |
1054 | 1056 |
('-1' if self.ui.radioButtonLoadXmlNo.isChecked() else '2'))) |
1055 | 1057 |
configs.append( |
1056 | 1058 |
Config('Data Save', 'Unknown Xml Only', '1' if self.ui.radioButtonSaveUnknownYes.isChecked() else '-1')) |
1059 |
configs.append(Config('Engine', 'Address', self.ui.lineEditServerAddress.text())) |
|
1057 | 1060 |
configs.append(Config('Engine', 'Text Area', '1' if self.ui.radioButtonTextAreaLocal.isChecked() else '-1')) |
1058 | 1061 |
configs.append(Config('Engine', 'OCR', '1' if self.ui.radioButtonOCRLocal.isChecked() else '-1')) |
1059 | 1062 |
|
DTI_PID/DTI_PID/Configuration_UI.py | ||
---|---|---|
604 | 604 |
self.tabETC.setObjectName("tabETC") |
605 | 605 |
self.gridLayout_22 = QtWidgets.QGridLayout(self.tabETC) |
606 | 606 |
self.gridLayout_22.setObjectName("gridLayout_22") |
607 |
spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) |
|
608 |
self.gridLayout_22.addItem(spacerItem5, 3, 0, 1, 1) |
|
609 | 607 |
self.gridLayout_21 = QtWidgets.QGridLayout() |
610 | 608 |
self.gridLayout_21.setObjectName("gridLayout_21") |
611 | 609 |
self.groupBox_12 = QtWidgets.QGroupBox(self.tabETC) |
... | ... | |
614 | 612 |
self.gridLayout_24.setObjectName("gridLayout_24") |
615 | 613 |
self.gridLayout_32 = QtWidgets.QGridLayout() |
616 | 614 |
self.gridLayout_32.setObjectName("gridLayout_32") |
617 |
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
618 |
self.gridLayout_32.addItem(spacerItem6, 0, 2, 1, 1)
|
|
615 |
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
616 |
self.gridLayout_32.addItem(spacerItem5, 0, 2, 1, 1)
|
|
619 | 617 |
self.label_36 = QtWidgets.QLabel(self.groupBox_12) |
620 | 618 |
self.label_36.setMinimumSize(QtCore.QSize(200, 0)) |
621 | 619 |
self.label_36.setObjectName("label_36") |
... | ... | |
670 | 668 |
self.buttonGroup.addButton(self.radioButtonLoadXmlNo) |
671 | 669 |
self.horizontalLayout_3.addWidget(self.radioButtonLoadXmlNo) |
672 | 670 |
self.gridLayout_31.addLayout(self.horizontalLayout_3, 0, 1, 1, 1) |
673 |
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
674 |
self.gridLayout_31.addItem(spacerItem7, 0, 2, 1, 1)
|
|
671 |
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
672 |
self.gridLayout_31.addItem(spacerItem6, 0, 2, 1, 1)
|
|
675 | 673 |
self.horizontalLayout_4 = QtWidgets.QHBoxLayout() |
676 | 674 |
self.horizontalLayout_4.setObjectName("horizontalLayout_4") |
677 | 675 |
self.radioButtonSaveUnknownYes = QtWidgets.QRadioButton(self.groupBox_11) |
... | ... | |
710 | 708 |
self.radioButtonTextAreaServer.setObjectName("radioButtonTextAreaServer") |
711 | 709 |
self.buttonGroup_6.addButton(self.radioButtonTextAreaServer) |
712 | 710 |
self.horizontalLayout_7.addWidget(self.radioButtonTextAreaServer) |
713 |
self.gridLayout_37.addLayout(self.horizontalLayout_7, 0, 1, 1, 1) |
|
714 |
self.label_46 = QtWidgets.QLabel(self.groupBox_13) |
|
715 |
self.label_46.setMinimumSize(QtCore.QSize(200, 0)) |
|
716 |
self.label_46.setObjectName("label_46") |
|
717 |
self.gridLayout_37.addWidget(self.label_46, 0, 0, 1, 1) |
|
718 |
spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) |
|
719 |
self.gridLayout_37.addItem(spacerItem8, 0, 2, 1, 1) |
|
720 |
self.label_47 = QtWidgets.QLabel(self.groupBox_13) |
|
721 |
self.label_47.setObjectName("label_47") |
|
722 |
self.gridLayout_37.addWidget(self.label_47, 1, 0, 1, 1) |
|
711 |
self.gridLayout_37.addLayout(self.horizontalLayout_7, 1, 1, 1, 1) |
|
723 | 712 |
self.horizontalLayout_8 = QtWidgets.QHBoxLayout() |
724 | 713 |
self.horizontalLayout_8.setObjectName("horizontalLayout_8") |
725 | 714 |
self.radioButtonOCRLocal = QtWidgets.QRadioButton(self.groupBox_13) |
... | ... | |
728 | 717 |
self.radioButtonOCRServer = QtWidgets.QRadioButton(self.groupBox_13) |
729 | 718 |
self.radioButtonOCRServer.setObjectName("radioButtonOCRServer") |
730 | 719 |
self.horizontalLayout_8.addWidget(self.radioButtonOCRServer) |
731 |
self.gridLayout_37.addLayout(self.horizontalLayout_8, 1, 1, 1, 1) |
|
720 |
self.gridLayout_37.addLayout(self.horizontalLayout_8, 2, 1, 1, 1) |
|
721 |
self.label_46 = QtWidgets.QLabel(self.groupBox_13) |
|
722 |
self.label_46.setMinimumSize(QtCore.QSize(200, 0)) |
|
723 |
self.label_46.setObjectName("label_46") |
|
724 |
self.gridLayout_37.addWidget(self.label_46, 1, 0, 1, 1) |
|
725 |
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) |
|
726 |
self.gridLayout_37.addItem(spacerItem7, 1, 2, 1, 1) |
|
727 |
self.label_47 = QtWidgets.QLabel(self.groupBox_13) |
|
728 |
self.label_47.setObjectName("label_47") |
|
729 |
self.gridLayout_37.addWidget(self.label_47, 2, 0, 1, 1) |
|
730 |
self.label_48 = QtWidgets.QLabel(self.groupBox_13) |
|
731 |
self.label_48.setObjectName("label_48") |
|
732 |
self.gridLayout_37.addWidget(self.label_48, 0, 0, 1, 1) |
|
733 |
self.lineEditServerAddress = QtWidgets.QLineEdit(self.groupBox_13) |
|
734 |
self.lineEditServerAddress.setObjectName("lineEditServerAddress") |
|
735 |
self.gridLayout_37.addWidget(self.lineEditServerAddress, 0, 1, 1, 1) |
|
732 | 736 |
self.gridLayout_38.addLayout(self.gridLayout_37, 0, 0, 1, 1) |
733 | 737 |
self.gridLayout_21.addWidget(self.groupBox_13, 2, 0, 1, 1) |
734 | 738 |
self.gridLayout_22.addLayout(self.gridLayout_21, 0, 0, 1, 1) |
739 |
spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) |
|
740 |
self.gridLayout_22.addItem(spacerItem8, 3, 0, 1, 1) |
|
735 | 741 |
self.tabWidget.addTab(self.tabETC, "") |
736 | 742 |
self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) |
737 | 743 |
self.buttonBox = QtWidgets.QDialogButtonBox(ConfigurationDialog) |
... | ... | |
921 | 927 |
self.groupBox_13.setTitle(_translate("ConfigurationDialog", "Recognition Engine")) |
922 | 928 |
self.radioButtonTextAreaLocal.setText(_translate("ConfigurationDialog", "Local")) |
923 | 929 |
self.radioButtonTextAreaServer.setText(_translate("ConfigurationDialog", "Server")) |
924 |
self.label_46.setText(_translate("ConfigurationDialog", "Text Area")) |
|
925 |
self.label_47.setText(_translate("ConfigurationDialog", "OCR")) |
|
926 | 930 |
self.radioButtonOCRLocal.setText(_translate("ConfigurationDialog", "Local")) |
927 | 931 |
self.radioButtonOCRServer.setText(_translate("ConfigurationDialog", "Server")) |
932 |
self.label_46.setText(_translate("ConfigurationDialog", "Text Area")) |
|
933 |
self.label_47.setText(_translate("ConfigurationDialog", "OCR")) |
|
934 |
self.label_48.setText(_translate("ConfigurationDialog", "Server Address")) |
|
928 | 935 |
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabETC), _translate("ConfigurationDialog", "ETC")) |
929 | 936 |
|
930 | 937 |
import MainWindow_rc |
DTI_PID/DTI_PID/ItemPropertyTableWidget.py | ||
---|---|---|
16 | 16 |
import sys |
17 | 17 |
import math |
18 | 18 |
import re |
19 |
import SelectAttributeCommand |
|
19 |
import SelectAttributeCommand, SelectAttributeBatchCommand
|
|
20 | 20 |
|
21 | 21 |
from EngineeringAbstractItem import QEngineeringAbstractItem |
22 | 22 |
from SymbolSvgItem import SymbolSvgItem |
... | ... | |
338 | 338 |
self.setItem(2, 1, QTableWidgetItem(self.tr("Type"))) |
339 | 339 |
self.setItem(3, 1, QTableWidgetItem(self.tr("Angle"))) |
340 | 340 |
self.setItem(4, 1, QTableWidgetItem(self.tr("Origin"))) |
341 |
self.setItem(5, 1, QTableWidgetItem(self.tr("OWNER")))
|
|
341 |
self.setItem(5, 1, QTableWidgetItem(self.tr("Set Batch")))
|
|
342 | 342 |
self.setItem(6, 1, QTableWidgetItem(self.tr("Set Specs"))) |
343 | 343 |
elif type(item) is QEngineeringErrorItem: |
344 | 344 |
self.setRowCount(7) |
... | ... | |
1034 | 1034 |
cmd = SelectAttributeCommand.SelectAttributeCommand(items[0], attr, self.mainWindow.graphicsView) |
1035 | 1035 |
cmd.onSuccess.connect(self.onSuccessSelectAttribute) |
1036 | 1036 |
self.mainWindow.graphicsView.command = cmd |
1037 |
|
|
1038 | 1037 |
elif keyCell.text() == 'Set Specs': |
1039 | 1038 |
from SpecBreakDialog import QSpecBreakDialog |
1040 | 1039 |
|
... | ... | |
1045 | 1044 |
except Exception as ex: |
1046 | 1045 |
print('error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
1047 | 1046 |
sys.exc_info()[-1].tb_lineno)) |
1047 |
elif keyCell.text() == 'Set Batch': |
|
1048 |
cmd = SelectAttributeBatchCommand.SelectAttributeBatchCommand(items[0], self.mainWindow.graphicsView) |
|
1049 |
cmd.onSuccess.connect(self.onSuccessSelectAttribute) |
|
1050 |
self.mainWindow.graphicsView.command = cmd |
|
1051 |
|
|
1048 | 1052 |
elif issubclass(type(attr), SymbolProp): |
1049 | 1053 |
attr = keyCell.data(Qt.UserRole) |
1050 | 1054 |
cmd = SelectAttributeCommand.SelectAttributeCommand(items[0], attr, self.mainWindow.graphicsView) |
... | ... | |
1056 | 1060 |
@author kyouho |
1057 | 1061 |
@date 2018.10.23 |
1058 | 1062 |
''' |
1059 |
|
|
1060 | 1063 |
def onSuccessSelectAttribute(self, connItem=None): |
1061 | 1064 |
""" update item's properties after selecting """ |
1062 | 1065 |
self.show_item_property(self._item) |
DTI_PID/DTI_PID/UI/Configuration.ui | ||
---|---|---|
1282 | 1282 |
<string>ETC</string> |
1283 | 1283 |
</attribute> |
1284 | 1284 |
<layout class="QGridLayout" name="gridLayout_22"> |
1285 |
<item row="3" column="0"> |
|
1286 |
<spacer name="verticalSpacer_2"> |
|
1287 |
<property name="orientation"> |
|
1288 |
<enum>Qt::Vertical</enum> |
|
1289 |
</property> |
|
1290 |
<property name="sizeHint" stdset="0"> |
|
1291 |
<size> |
|
1292 |
<width>20</width> |
|
1293 |
<height>40</height> |
|
1294 |
</size> |
|
1295 |
</property> |
|
1296 |
</spacer> |
|
1297 |
</item> |
|
1298 | 1285 |
<item row="0" column="0"> |
1299 | 1286 |
<layout class="QGridLayout" name="gridLayout_21"> |
1300 | 1287 |
<item row="1" column="0"> |
... | ... | |
1498 | 1485 |
<layout class="QGridLayout" name="gridLayout_38"> |
1499 | 1486 |
<item row="0" column="0"> |
1500 | 1487 |
<layout class="QGridLayout" name="gridLayout_37"> |
1501 |
<item row="0" column="1">
|
|
1488 |
<item row="1" column="1">
|
|
1502 | 1489 |
<layout class="QHBoxLayout" name="horizontalLayout_7"> |
1503 | 1490 |
<item> |
1504 | 1491 |
<widget class="QRadioButton" name="radioButtonTextAreaLocal"> |
... | ... | |
1522 | 1509 |
</item> |
1523 | 1510 |
</layout> |
1524 | 1511 |
</item> |
1525 |
<item row="0" column="0"> |
|
1512 |
<item row="2" column="1"> |
|
1513 |
<layout class="QHBoxLayout" name="horizontalLayout_8"> |
|
1514 |
<item> |
|
1515 |
<widget class="QRadioButton" name="radioButtonOCRLocal"> |
|
1516 |
<property name="text"> |
|
1517 |
<string>Local</string> |
|
1518 |
</property> |
|
1519 |
</widget> |
|
1520 |
</item> |
|
1521 |
<item> |
|
1522 |
<widget class="QRadioButton" name="radioButtonOCRServer"> |
|
1523 |
<property name="text"> |
|
1524 |
<string>Server</string> |
|
1525 |
</property> |
|
1526 |
</widget> |
|
1527 |
</item> |
|
1528 |
</layout> |
|
1529 |
</item> |
|
1530 |
<item row="1" column="0"> |
|
1526 | 1531 |
<widget class="QLabel" name="label_46"> |
1527 | 1532 |
<property name="minimumSize"> |
1528 | 1533 |
<size> |
... | ... | |
1535 | 1540 |
</property> |
1536 | 1541 |
</widget> |
1537 | 1542 |
</item> |
1538 |
<item row="0" column="2">
|
|
1543 |
<item row="1" column="2">
|
|
1539 | 1544 |
<spacer name="horizontalSpacer_6"> |
1540 | 1545 |
<property name="orientation"> |
1541 | 1546 |
<enum>Qt::Horizontal</enum> |
... | ... | |
1548 | 1553 |
</property> |
1549 | 1554 |
</spacer> |
1550 | 1555 |
</item> |
1551 |
<item row="1" column="0">
|
|
1556 |
<item row="2" column="0">
|
|
1552 | 1557 |
<widget class="QLabel" name="label_47"> |
1553 | 1558 |
<property name="text"> |
1554 | 1559 |
<string>OCR</string> |
1555 | 1560 |
</property> |
1556 | 1561 |
</widget> |
1557 | 1562 |
</item> |
1558 |
<item row="1" column="1"> |
|
1559 |
<layout class="QHBoxLayout" name="horizontalLayout_8"> |
|
1560 |
<item> |
|
1561 |
<widget class="QRadioButton" name="radioButtonOCRLocal"> |
|
1562 |
<property name="text"> |
|
1563 |
<string>Local</string> |
|
1564 |
</property> |
|
1565 |
</widget> |
|
1566 |
</item> |
|
1567 |
<item> |
|
1568 |
<widget class="QRadioButton" name="radioButtonOCRServer"> |
|
1569 |
<property name="text"> |
|
1570 |
<string>Server</string> |
|
1571 |
</property> |
|
1572 |
</widget> |
|
1573 |
</item> |
|
1574 |
</layout> |
|
1563 |
<item row="0" column="0"> |
|
1564 |
<widget class="QLabel" name="label_48"> |
|
1565 |
<property name="text"> |
|
1566 |
<string>Server Address</string> |
|
1567 |
</property> |
|
1568 |
</widget> |
|
1569 |
</item> |
|
1570 |
<item row="0" column="1"> |
|
1571 |
<widget class="QLineEdit" name="lineEditServerAddress"/> |
|
1575 | 1572 |
</item> |
1576 | 1573 |
</layout> |
1577 | 1574 |
</item> |
... | ... | |
1580 | 1577 |
</item> |
1581 | 1578 |
</layout> |
1582 | 1579 |
</item> |
1580 |
<item row="3" column="0"> |
|
1581 |
<spacer name="verticalSpacer_2"> |
|
1582 |
<property name="orientation"> |
|
1583 |
<enum>Qt::Vertical</enum> |
|
1584 |
</property> |
|
1585 |
<property name="sizeHint" stdset="0"> |
|
1586 |
<size> |
|
1587 |
<width>20</width> |
|
1588 |
<height>40</height> |
|
1589 |
</size> |
|
1590 |
</property> |
|
1591 |
</spacer> |
|
1592 |
</item> |
|
1583 | 1593 |
</layout> |
1584 | 1594 |
</widget> |
1585 | 1595 |
</widget> |
... | ... | |
1705 | 1715 |
</connection> |
1706 | 1716 |
</connections> |
1707 | 1717 |
<buttongroups> |
1708 |
<buttongroup name="buttonGroup_4"/> |
|
1709 |
<buttongroup name="buttonGroup_3"/> |
|
1710 |
<buttongroup name="buttonGroup_5"/> |
|
1711 | 1718 |
<buttongroup name="buttonGroup"/> |
1712 | 1719 |
<buttongroup name="buttonGroup_2"/> |
1720 |
<buttongroup name="buttonGroup_3"/> |
|
1721 |
<buttongroup name="buttonGroup_5"/> |
|
1722 |
<buttongroup name="buttonGroup_4"/> |
|
1713 | 1723 |
<buttongroup name="buttonGroup_6"/> |
1714 | 1724 |
</buttongroups> |
1715 | 1725 |
</ui> |
내보내기 Unified diff