개정판 4aa060ea
issue #1202: calculate press drop
Change-Id: I70e77a77f03ea80410da0f9b838b5b29c0be95d9
HYTOS/HYTOS/Shapes/EngineeringConnectorItem.py | ||
---|---|---|
26 | 26 |
self.elevation = None |
27 | 27 |
self.over_design_cv = None |
28 | 28 |
|
29 |
def parse(self, row): |
|
30 |
""" parse given row """ |
|
31 |
|
|
32 |
if row['Pressure']: |
|
33 |
self.pressure = float(row['Pressure']) |
|
34 |
if row['Pressure_Drop']: |
|
35 |
self.pressure_drop = float(row['Pressure_Drop']) |
|
36 |
if row['Elevation']: |
|
37 |
self.elevation = float(row['Elevation']) |
|
38 |
if row['Over_Design_CV']: |
|
39 |
self.over_design_cv = float(row['Over_Design_CV']) |
|
40 |
|
|
29 | 41 |
""" |
30 | 42 |
A {ConnectorItem} is the graphical representation of a {Symbol.Connectors}. |
31 | 43 |
""" |
... | ... | |
60 | 72 |
self._connected_at = QEngineeringAbstractItem.CONNECTED_AT_PT # default value is connected at pt |
61 | 73 |
self.connectPoint = None |
62 | 74 |
self._hoverItem = None |
63 |
self._nozzle_data = None
|
|
75 |
self._data = None |
|
64 | 76 |
|
65 | 77 |
self.setAcceptHoverEvents(True) |
66 | 78 |
self.transfer = Transfer() |
... | ... | |
93 | 105 |
return res |
94 | 106 |
|
95 | 107 |
@property |
96 |
def nozzle_data(self):
|
|
108 |
def data(self): |
|
97 | 109 |
""" getter of nozzle data """ |
98 |
return self._nozzle_data
|
|
110 |
return self._data |
|
99 | 111 |
|
100 |
@nozzle_data.setter
|
|
101 |
def nozzle_data(self, value):
|
|
112 |
@data.setter |
|
113 |
def data(self, value): |
|
102 | 114 |
""" setter of nozzle data """ |
103 |
self._nozzle_data = value
|
|
115 |
self._data = value |
|
104 | 116 |
|
105 | 117 |
@property |
106 | 118 |
def elevation(self): |
107 | 119 |
""" return elevation """ |
108 |
return self._nozzle_data.elevation
|
|
120 |
return self.data.elevation |
|
109 | 121 |
|
110 | 122 |
@property |
111 | 123 |
def press_drop(self): |
... | ... | |
476 | 488 |
|
477 | 489 |
cols = ['Points_UID', 'Pressure', 'Pressure_Drop', 'Elevation', 'Over_Design_CV'] |
478 | 490 |
values = ['?', '?', '?', '?', '?'] |
479 |
if self.nozzle_data:
|
|
491 |
if self.data: |
|
480 | 492 |
|
481 |
pressure = self.nozzle_data.pressure
|
|
493 |
pressure = self.data.pressure |
|
482 | 494 |
if pressure is None: |
483 | 495 |
pressure = None |
484 | 496 |
else: |
485 | 497 |
pressure = float(pressure) |
486 | 498 |
|
487 |
pressure_drop = self.nozzle_data.pressure_drop
|
|
499 |
pressure_drop = self.data.pressure_drop |
|
488 | 500 |
if pressure_drop is None: |
489 | 501 |
pressure_drop = None |
490 | 502 |
else: |
491 | 503 |
pressure_drop = float(pressure_drop) |
492 | 504 |
|
493 |
elevation = self.nozzle_data.elevation
|
|
505 |
elevation = self.data.elevation |
|
494 | 506 |
if elevation is None: |
495 | 507 |
elevation = None |
496 | 508 |
else: |
497 | 509 |
elevation = float(elevation) |
498 | 510 |
|
499 |
over_design_cv = self.nozzle_data.over_design_cv
|
|
511 |
over_design_cv = self.data.over_design_cv |
|
500 | 512 |
if over_design_cv is None: |
501 | 513 |
over_design_cv = None |
502 | 514 |
else: |
내보내기 Unified diff