개정판 5e476286
issue #1048 input value 변경 시 Output 글자색 변경
Change-Id: Id4d18c23cce901ec47b4241e457d49f5e89256a8
HYTOS/HYTOS/Compressor.py | ||
---|---|---|
56 | 56 |
self.ui = Compressor_UI.Ui_CompressorDialog() |
57 | 57 |
self.ui.setupUi(self) |
58 | 58 |
self._item = None |
59 |
self._modified = False |
|
59 | 60 |
|
60 | 61 |
self.ui.lineEdit_Suc_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Suc_Pressure)) |
61 | 62 |
self.ui.lineEdit_Dis_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Dis_Pressure)) |
... | ... | |
71 | 72 |
self.ui.lineEdit_TagNo.setFocus() |
72 | 73 |
self.set_controls() |
73 | 74 |
self.load_data() |
75 |
self.exec_() |
|
74 | 76 |
|
75 |
return self.exec_()
|
|
77 |
return self._modified
|
|
76 | 78 |
|
77 | 79 |
def initialize(self): |
78 | 80 |
self.ui.label_Img_In.setVisible(False) |
... | ... | |
108 | 110 |
self.ui.lineEdit_Suc_Pressure.setEnabled(True) |
109 | 111 |
self.ui.lineEdit_Suc_Elevation.setEnabled(True) |
110 | 112 |
|
113 |
def is_modified(self): |
|
114 |
""" Tag No 도 Output Explorer에 사용되기에 Modified 적용""" |
|
115 |
old_tag_no = self.ui.lineEdit_TagNo.placeholderText() |
|
116 |
new_tag_no = self.ui.lineEdit_TagNo.text() |
|
117 |
if old_tag_no != new_tag_no: |
|
118 |
self._modified = True |
|
119 |
return |
|
120 |
|
|
121 |
old_pressure = self.ui.lineEdit_Dis_Pressure.placeholderText() |
|
122 |
new_pressure = self.ui.lineEdit_Dis_Pressure.text() |
|
123 |
if old_pressure != new_pressure: |
|
124 |
self._modified = True |
|
125 |
return |
|
126 |
|
|
127 |
old_elevation = self.ui.lineEdit_Dis_Elevation.placeholderText() |
|
128 |
new_elevation = self.ui.lineEdit_Dis_Elevation.text() |
|
129 |
if old_elevation != new_elevation: |
|
130 |
self._modified = True |
|
131 |
return |
|
132 |
|
|
133 |
old_pressure = self.ui.lineEdit_Suc_Pressure.placeholderText() |
|
134 |
new_pressure = self.ui.lineEdit_Suc_Pressure.text() |
|
135 |
if old_pressure != new_pressure: |
|
136 |
self._modified = True |
|
137 |
return |
|
138 |
|
|
139 |
old_elevation = self.ui.lineEdit_Suc_Elevation.placeholderText() |
|
140 |
new_elevation = self.ui.lineEdit_Suc_Elevation.text() |
|
141 |
if old_elevation != new_elevation: |
|
142 |
self._modified = True |
|
143 |
return |
|
144 |
|
|
111 | 145 |
def load_data(self): |
112 | 146 |
""" load tag no and nozzle data """ |
113 | 147 |
tag_no = self._item.tag_no |
114 | 148 |
if tag_no != 'None' and is_not_blank(tag_no): |
115 | 149 |
self.ui.lineEdit_TagNo.setText(tag_no) |
150 |
self.ui.lineEdit_TagNo.setPlaceholderText(tag_no) |
|
116 | 151 |
|
117 | 152 |
app_doc_data = AppDocData.instance() |
118 | 153 |
drawing = app_doc_data.activeDrawing |
... | ... | |
129 | 164 |
if pressure is not None: |
130 | 165 |
if index == 1: |
131 | 166 |
self.ui.lineEdit_Dis_Pressure.setText(str(convert_to_fixed_point(pressure))) |
167 |
self.ui.lineEdit_Dis_Pressure.setPlaceholderText(str(convert_to_fixed_point(pressure))) |
|
132 | 168 |
elif index == 2: |
133 | 169 |
self.ui.lineEdit_Suc_Pressure.setText(str(convert_to_fixed_point(pressure))) |
170 |
self.ui.lineEdit_Suc_Pressure.setPlaceholderText(str(convert_to_fixed_point(pressure))) |
|
134 | 171 |
|
135 | 172 |
elevation = connector.data.elevation |
136 | 173 |
if elevation is not None: |
137 | 174 |
if index == 1: |
138 | 175 |
self.ui.lineEdit_Dis_Elevation.setText(str(convert_to_fixed_point(elevation))) |
176 |
self.ui.lineEdit_Dis_Elevation.setPlaceholderText(str(convert_to_fixed_point(elevation))) |
|
139 | 177 |
elif index == 2: |
140 | 178 |
self.ui.lineEdit_Suc_Elevation.setText(str(convert_to_fixed_point(elevation))) |
179 |
self.ui.lineEdit_Suc_Elevation.setPlaceholderText(str(convert_to_fixed_point(elevation))) |
|
141 | 180 |
|
142 | 181 |
def accept(self): |
182 |
""" check changed value """ |
|
183 |
self.is_modified() |
|
184 |
|
|
143 | 185 |
""" set tag no and nozzle data """ |
144 | 186 |
from EngineeringConnectorItem import NozzleData |
145 | 187 |
tag_no = self.ui.lineEdit_TagNo.text() |
내보내기 Unified diff