개정판 7f4dbe9e
issue #1058 계산 전/후 결과 표시 - govern line 표시
Change-Id: Id425ca559a8d868b76962347de00a4f31362a8ca
HYTOS/HYTOS/Commands/HydroCalculationCommand.py | ||
---|---|---|
247 | 247 |
|
248 | 248 |
def stream_input(self): |
249 | 249 |
from AppDocData import AppDocData |
250 |
from EngineeringStreamlineItem import QEngineeringStreamlineItem |
|
251 |
|
|
250 | 252 |
try: |
251 | 253 |
""" update pressure drop and pressure of stream data """ |
252 | 254 |
|
253 | 255 |
govern_loop = self.get_govern_loop() |
254 | 256 |
|
257 |
if govern_loop is not None: |
|
258 |
for item in govern_loop.items: |
|
259 |
if type(item) is QEngineeringStreamlineItem: |
|
260 |
item.governing_case = True |
|
261 |
|
|
255 | 262 |
app_doc_data = AppDocData.instance() |
256 | 263 |
for hmb in app_doc_data.activeDrawing.hmbTable._hmbs: |
257 | 264 |
matches = [loop for loop in self.loops if |
HYTOS/HYTOS/Shapes/EngineeringStreamlineItem.py | ||
---|---|---|
22 | 22 |
class QEngineeringStreamlineItem(QGraphicsPathItem, QEngineeringAbstractItem): |
23 | 23 |
""" This is EngineeringStreamlineItem Class """ |
24 | 24 |
|
25 |
ARROW_SIZE = 5 |
|
25 |
ARROW_SIZE = 15
|
|
26 | 26 |
ZVALUE = 50 |
27 | 27 |
OFFSET = 10 |
28 | 28 |
onRemoved = pyqtSignal(QGraphicsItem) |
... | ... | |
59 | 59 |
self._mixed_pressure_variation = None |
60 | 60 |
self._vapor_pressure_gradient = None |
61 | 61 |
|
62 |
self.governing_case = False |
|
63 |
|
|
62 | 64 |
self.transfer = Transfer() |
63 | 65 |
self.setZValue(QEngineeringStreamlineItem.ZVALUE) |
64 | 66 |
except Exception as ex: |
... | ... | |
852 | 854 |
|
853 | 855 |
def paint(self, painter, option, widget): |
854 | 856 |
""" override paint method """ |
857 |
|
|
858 |
_pen = self.pen() |
|
859 |
_pen.setWidthF(4 if self.governing_case else 1) |
|
855 | 860 |
if self.isSelected(): |
856 | 861 |
hilightColor = QColor(255, 0, 0, 127) |
857 |
focuspen = QPen(Qt.DotLine) |
|
858 |
focuspen.setColor(hilightColor) |
|
859 |
focuspen.setWidthF(3) |
|
860 |
painter.setPen(focuspen) |
|
862 |
_pen.setColor(hilightColor) |
|
863 |
painter.setPen(_pen) |
|
861 | 864 |
painter.drawPath(self.path()) |
862 | 865 |
else: |
863 | 866 |
color = '#FF0000' if self.validate() else self.getColor() |
864 | 867 |
self.setColor(color) |
865 |
QGraphicsPathItem.paint(self, painter, option, widget) |
|
868 |
painter.setPen(_pen) |
|
869 |
painter.drawPath(self.path()) |
|
870 |
# QGraphicsPathItem.paint(self, painter, option, widget) |
|
866 | 871 |
|
867 | 872 |
''' |
868 | 873 |
@brief Return real item position |
내보내기 Unified diff