개정판 c519c6ed
test
Change-Id: I7cfe88800340769d77524b1fceec842d2f3058ff
DTI_PID/DTI_PID/Extends/TcpServer.py | ||
---|---|---|
2 | 2 |
from PyQt5.QtCore import QByteArray, QDataStream, QIODevice |
3 | 3 |
from PyQt5.QtWidgets import QApplication, QDialog |
4 | 4 |
from PyQt5.QtNetwork import QHostAddress, QTcpServer |
5 |
from App import App |
|
5 |
#from App import App
|
|
6 | 6 | |
7 | 7 | |
8 | 8 |
class TcpServer(QDialog): |
... | ... | |
31 | 31 |
# read incomming data |
32 | 32 |
instr = str(clientConnection.readAll().data(), encoding='utf-8') |
33 | 33 |
# TODO: do something |
34 |
''' |
|
35 |
mainWnd = App.mainWnd() |
|
34 | 36 |
data = instr |
35 | 37 |
if data: |
36 | 38 |
sData = data |
37 | 39 |
if sData != 'ProcessEnd': |
38 |
drawing_top = self.treeWidgetDrawingList.topLevelItem(0)
|
|
40 |
drawing_top = mainWnd.treeWidgetDrawingList.topLevelItem(0)
|
|
39 | 41 |
count = drawing_top.childCount() |
40 | 42 |
for idx in range(count): |
41 | 43 |
child = drawing_top.child(idx) |
... | ... | |
46 | 48 |
if sData == name.rsplit('.', 1)[0]: |
47 | 49 |
self.open_image_drawing(drawing) |
48 | 50 |
child.setCheckState(0, Qt.Checked) |
49 |
bContinue = False |
|
50 | 51 | |
51 | 52 |
HighLight() |
52 | 53 |
else: |
53 | 54 |
pass |
54 | 55 |
else: |
55 |
print('no data from', client_address) |
|
56 |
print('no data from') |
|
57 |
''' |
|
56 | 58 | |
57 | 59 |
# get the connection ready for clean up |
58 | 60 |
clientConnection.disconnected.connect(clientConnection.deleteLater) |
... | ... | |
84 | 86 |
# now disconnect connection. |
85 | 87 |
clientConnection.disconnectFromHost() |
86 | 88 | |
89 |
''' |
|
87 | 90 |
if data and sData == 'ProcessEnd': |
88 | 91 |
self.tcpServer.close() |
89 |
data_pane = App.mainWnd().ribbon.get_pane('Data')
|
|
92 |
data_pane = mainWnd.ribbon.get_pane('Data')
|
|
90 | 93 |
data_pane.ui.toolButtonPSN.setChecked(False) |
94 |
''' |
|
91 | 95 | |
96 |
''' |
|
92 | 97 |
def HighLight(): |
93 | 98 |
try: |
94 | 99 |
docData = AppDocData.instance() |
95 | 100 |
itemList = docData.selectView() |
96 |
text_items = [item for item in self.graphicsView.scene().items()
|
|
101 |
text_items = [item for item in App.mainWnd().graphicsView.scene().items()
|
|
97 | 102 |
if hasattr(item, 'uid') and str(item.uid) in itemList] |
98 | 103 | |
99 | 104 |
if text_items: |
100 | 105 |
from HighlightCommand import HighlightCommand |
101 | 106 |
#for item in text_items: |
102 | 107 |
# HighlightCommand(self.graphicsView).executePSN(item) |
103 |
HighlightCommand(self.graphicsView).executeForPSN(text_items)
|
|
108 |
HighlightCommand(App.mainWnd().graphicsView).executeForPSN(text_items)
|
|
104 | 109 |
|
105 | 110 |
finally: |
106 | 111 |
# 연결 모두 지움 |
107 |
print("HighLight") |
|
112 |
print("HighLight") |
|
113 |
''' |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
9 | 9 | |
10 | 10 |
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) |
11 | 11 |
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Commands')) |
12 |
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Extends')) |
|
12 | 13 |
from CreateCommand import CreateCommand |
13 | 14 |
import CropCommand |
14 | 15 |
import AreaOcrCommand |
... | ... | |
69 | 70 |
from DisplayColors import DisplayOptions |
70 | 71 |
from RecognitionDialog import QRecognitionDialog |
71 | 72 |
import uuid |
72 | ||
73 |
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Extends')) |
|
74 | 73 |
from TcpServer import TcpServer |
75 | 74 | |
76 | 75 |
내보내기 Unified diff