개정판 9d0da00d
issue #563: fix opc attr sort
Change-Id: I10f805de71f45a3c870ff95ef32e0f6d934ba778
DTI_PID/DTI_PID/Shapes/QEngineeringOPCItem.py | ||
---|---|---|
156 | 156 |
from EngineeringTextItem import QEngineeringTextItem |
157 | 157 |
|
158 | 158 |
allowed_error = 0.01 |
159 |
''' |
|
159 | 160 |
if abs(0 - self.angle) < allowed_error: |
160 | 161 |
return sorted([x for x in self.associations() if issubclass(type(x), QEngineeringTextItem)], key=lambda attr: attr.loc[1]) # sort by y coordinate |
161 | 162 |
elif abs(3.14 - self.angle) < allowed_error: |
... | ... | |
166 | 167 |
return sorted([x for x in self.associations() if issubclass(type(x), QEngineeringTextItem)], key=lambda attr: attr.loc[0]) # sort by x coordinate |
167 | 168 |
else: |
168 | 169 |
return sorted([x for x in self.associations() if issubclass(type(x), QEngineeringTextItem)], key=lambda attr: attr.loc[1]) # sort by y coordinate |
170 |
''' |
|
171 |
if abs(0 - self.angle) < allowed_error or abs(3.14 - self.angle) < allowed_error: |
|
172 |
return sorted([x for x in self.associations() if issubclass(type(x), QEngineeringTextItem)], key=lambda attr: attr.loc[1]) |
|
173 |
elif abs(1.57 - self.angle) < allowed_error or abs(4.71 - self.angle) < allowed_error: |
|
174 |
return sorted([x for x in self.associations() if issubclass(type(x), QEngineeringTextItem)], key=lambda attr: attr.loc[0]) |
|
175 |
else: |
|
176 |
return sorted([x for x in self.associations() if issubclass(type(x), QEngineeringTextItem)], key=lambda attr: attr.loc[1]) |
|
169 | 177 |
|
170 | 178 |
''' |
171 | 179 |
@brief generate xml code for attribute |
내보내기 Unified diff