개정판 c82b5644
issue #563: set uid type of item to UUID, fixed run flow direction
Change-Id: I9c6299b728fad4cc50c2c08592abe88d5dda6df3
DTI_PID/DTI_PID/Shapes/EngineeringRunItem.py | ||
---|---|---|
1 |
# coding: utf-8 |
|
2 |
""" This is engineering run item moduel """ |
|
3 |
|
|
1 | 4 |
import sys |
2 | 5 |
import os.path |
3 | 6 |
import copy |
... | ... | |
15 | 18 |
from EngineeringAbstractItem import QEngineeringAbstractItem |
16 | 19 |
|
17 | 20 |
class QEngineeringRunItem(QEngineeringAbstractItem): |
21 |
""" This is engineering run item class """ |
|
22 |
|
|
18 | 23 |
def __init__(self): |
19 | 24 |
import uuid |
20 | 25 |
QEngineeringAbstractItem.__init__(self) |
... | ... | |
55 | 60 |
self._items = value |
56 | 61 |
|
57 | 62 |
def explode(self): |
58 |
""" explode run """ |
|
63 |
""" explode run and subtract it from line no """
|
|
59 | 64 |
try: |
60 | 65 |
for item in self.items: |
61 | 66 |
item.owner = None |
... | ... | |
91 | 96 |
for at in range(len(self.items)): |
92 | 97 |
if type(self.items[at]) is QEngineeringLineItem and at > 0: |
93 | 98 |
self.items[at].arrange_flow_direction(self.items[at-1]) |
99 |
elif type(self.items[at]) is QEngineeringLineItem and len(self.items) > 1: |
|
100 |
self.items[at].arrange_flow_direction(self.items[at+1]) |
|
101 |
self.items[at].reverse() |
|
94 | 102 |
|
95 | 103 |
def reverse(self): |
96 | 104 |
""" reverse line's flow direction """ |
97 | 105 |
from EngineeringLineItem import QEngineeringLineItem |
98 | 106 |
|
107 |
self.items.reverse() |
|
99 | 108 |
for at in range(len(self.items)): |
100 | 109 |
if type(self.items[at]) is QEngineeringLineItem: |
101 | 110 |
self.items[at].reverse() |
... | ... | |
153 | 162 |
|
154 | 163 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
155 | 164 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
165 |
return None |
|
156 | 166 |
|
157 | 167 |
return node |
내보내기 Unified diff