개정판 e2601fcd
fix
Change-Id: I66cad21029202e32156afbb8207f6c00b42d4a4f
DTI_PID/DTI_PID/OPCRelationDialog.py | ||
---|---|---|
204 | 204 |
|
205 | 205 |
opc['tag'] = item |
206 | 206 |
|
207 |
def on_source_opc_changed(self, current, previous): |
|
207 |
def on_source_opc_changed(self, current, previous=None, forExcel=False):
|
|
208 | 208 |
""" list up target opc list """ |
209 | 209 |
self.load_line_no_keys() |
210 | 210 |
|
... | ... | |
219 | 219 |
and opc['Index'] != symbol_connection_index] |
220 | 220 |
self.ui.tableWidgetTarget.setRowCount(len(opcs)) |
221 | 221 |
row = 0 |
222 |
for opc in opcs: |
|
223 |
isUsed = False |
|
224 |
for _row in range(self.ui.tableWidgetSource.rowCount()): |
|
225 |
_item = self.ui.tableWidgetSource.item(_row, 6) |
|
226 |
if _item and _item.text() == opc['OPC']: |
|
227 |
isUsed = True |
|
228 |
break |
|
229 |
|
|
230 |
item = QTableWidgetItem(opc['Drawing']) |
|
231 |
item.setFlags(Qt.ItemIsEnabled) |
|
232 |
item.tag = opc['tag'] |
|
233 |
self.ui.tableWidgetTarget.setItem(row, 0, item) |
|
234 |
item = QTableWidgetItem(opc['Line No']) |
|
235 |
item.setFlags(Qt.ItemIsEnabled) |
|
236 |
self.ui.tableWidgetTarget.setItem(row, 1, item) |
|
237 |
item = QTableWidgetItem(opc['Symbol']) |
|
238 |
item.setFlags(Qt.ItemIsEnabled) |
|
239 |
self.ui.tableWidgetTarget.setItem(row, 2, item) |
|
240 |
item = QTableWidgetItem(opc['OPC']) |
|
241 |
item.setFlags(Qt.ItemIsEnabled) |
|
242 |
self.ui.tableWidgetTarget.setItem(row, 3, item) |
|
243 |
if isUsed: |
|
244 |
item.setBackground(Qt.yellow) |
|
245 |
row += 1 |
|
222 |
if not forExcel: |
|
223 |
for opc in opcs: |
|
224 |
isUsed = False |
|
225 |
for _row in range(self.ui.tableWidgetSource.rowCount()): |
|
226 |
_item = self.ui.tableWidgetSource.item(_row, 6) |
|
227 |
if _item and _item.text() == opc['OPC']: |
|
228 |
isUsed = True |
|
229 |
break |
|
230 |
|
|
231 |
item = QTableWidgetItem(opc['Drawing']) |
|
232 |
item.setFlags(Qt.ItemIsEnabled) |
|
233 |
item.tag = opc['tag'] |
|
234 |
self.ui.tableWidgetTarget.setItem(row, 0, item) |
|
235 |
item = QTableWidgetItem(opc['Line No']) |
|
236 |
item.setFlags(Qt.ItemIsEnabled) |
|
237 |
self.ui.tableWidgetTarget.setItem(row, 1, item) |
|
238 |
item = QTableWidgetItem(opc['Symbol']) |
|
239 |
item.setFlags(Qt.ItemIsEnabled) |
|
240 |
self.ui.tableWidgetTarget.setItem(row, 2, item) |
|
241 |
item = QTableWidgetItem(opc['OPC']) |
|
242 |
item.setFlags(Qt.ItemIsEnabled) |
|
243 |
self.ui.tableWidgetTarget.setItem(row, 3, item) |
|
244 |
if isUsed: |
|
245 |
item.setBackground(Qt.yellow) |
|
246 |
row += 1 |
|
246 | 247 |
|
247 | 248 |
def on_line_no_target_clicked(self): |
248 | 249 |
from PSNLineNoAttrTargetDialog import PSNLineNoAttrTargetDialog |
... | ... | |
497 | 498 |
thin = Side(border_style='thin', color='000000') |
498 | 499 |
border = Border(left=thin, right=thin, top=thin, bottom=thin) |
499 | 500 |
|
500 |
for col in range(table.columnCount()): |
|
501 |
for row in range(table.rowCount()): |
|
501 |
row_offset = 0 |
|
502 |
for row in range(table.rowCount()): |
|
503 |
for col in range(table.columnCount()): |
|
502 | 504 |
try: |
503 |
text = str(table.item(row, col).text()) |
|
504 |
color = table.item(row, col).background().color() |
|
505 |
text = str(table.item(row + row_offset, col).text())
|
|
506 |
color = table.item(row + row_offset, col).background().color()
|
|
505 | 507 |
if color == Qt.cyan or color == Qt.magenta or color == Qt.red or color == Qt.yellow: |
506 |
sheet.cell(row + 2, col + 1).fill = PatternFill(patternType='solid', fill_type='solid', |
|
508 |
sheet.cell(row + 2 + row_offset, col + 1).fill = PatternFill(patternType='solid', fill_type='solid',
|
|
507 | 509 |
fgColor=Color(color.name().replace('#', ''))) |
508 |
sheet.cell(row + 2, col + 1, text) |
|
509 |
sheet.cell(row=row + 2, column=col + 1).border = border |
|
510 |
sheet.cell(row + 2 + row_offset, col + 1, text)
|
|
511 |
sheet.cell(row=row + 2 + row_offset, column=col + 1).border = border
|
|
510 | 512 |
except AttributeError: |
511 | 513 |
pass |
512 | 514 |
except Exception as ex: |
내보내기 Unified diff