개정판 f28d5e17
issue #000: equipment color
Change-Id: Ie04cd89d426fc683ff34987a63d804a187f806bf
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
219 | 219 |
|
220 | 220 |
configs = docData.getConfigs('Instrument', 'Color') |
221 | 221 |
self.ui.pushButtonInstrumentColor.setStyleSheet('background-color:{}'.format(configs[0].value if configs else QEngineeringAbstractItem.DEFAULT_COLOR)) |
222 |
configs = docData.getConfigs('Equipment', 'Color') |
|
223 |
self.ui.pushButtonEquipColor.setStyleSheet('background-color:{}'.format(configs[0].value if configs else QEngineeringAbstractItem.DEFAULT_COLOR)) |
|
222 | 224 |
configs = docData.getConfigs('Symbol Style', 'Opacity') |
223 | 225 |
self.ui.spinBoxSymbolOpacity.setValue(int(configs[0].value) if configs else 50) |
224 | 226 |
|
... | ... | |
274 | 276 |
self.ui.pushButtonDeleteProperty.clicked.connect(self.removeSelectedItem) |
275 | 277 |
self.ui.radioButtonFixedSize.toggled.connect(self.onFixedSizeToggled) |
276 | 278 |
self.ui.pushButtonInstrumentColor.clicked.connect(self.change_instrument_color) |
279 |
self.ui.pushButtonEquipColor.clicked.connect(self.change_equipment_color) |
|
277 | 280 |
self.ui.tableWidgetLineTypes.cellDoubleClicked.connect(self.cell_double_clicked) |
278 | 281 |
self.ui.tableWidgetColorProperty.cellDoubleClicked.connect(self.cellDoubleClick) |
279 | 282 |
self.ui.comboBoxColorOption.currentIndexChanged.connect(self.currentIndexChanged) |
... | ... | |
479 | 482 |
if color.isValid(): |
480 | 483 |
item = self.ui.pushButtonInstrumentColor.setStyleSheet('background-color:{}'.format(color.name())) |
481 | 484 |
|
485 |
def change_equipment_color(self): |
|
486 |
""" change instrument's color """ |
|
487 |
color = QColorDialog.getColor(self.ui.pushButtonEquipColor.palette().button().color()) |
|
488 |
if color.isValid(): |
|
489 |
item = self.ui.pushButtonEquipColor.setStyleSheet('background-color:{}'.format(color.name())) |
|
490 |
|
|
482 | 491 |
def cell_double_clicked(self, row, column): |
483 | 492 |
""" change line type's color or change line type's conditions """ |
484 | 493 |
if column == 1: |
... | ... | |
596 | 605 |
def accept(self): |
597 | 606 |
from NominalPipeSize import NominalPipeSizeTable |
598 | 607 |
from LineTypeConditions import LineTypeConditions |
608 |
from EngineeringInstrumentItem import QEngineeringInstrumentItem |
|
609 |
from EngineeringEquipmentItem import QEngineeringEquipmentItem |
|
599 | 610 |
|
600 | 611 |
try: |
601 | 612 |
docData = AppDocData.instance() |
... | ... | |
684 | 695 |
|
685 | 696 |
# save symbol opacity - 2019.04.18 added by humkyung |
686 | 697 |
configs.append(Config('Instrument', 'Color', self.ui.pushButtonInstrumentColor.palette().color(QPalette.Background).name())) |
698 |
QEngineeringInstrumentItem.INST_COLOR = None |
|
699 |
configs.append(Config('Equipment', 'Color', self.ui.pushButtonEquipColor.palette().color(QPalette.Background).name())) |
|
700 |
QEngineeringEquipmentItem.EQUIP_COLOR = None |
|
687 | 701 |
configs.append(Config('Symbol Style', 'Opacity', str(self.ui.spinBoxSymbolOpacity.value()))) |
688 | 702 |
|
689 | 703 |
font = self.ui.fontComboBox.currentFont() |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
127 | 127 |
self._by_line_no.toggled.connect(self.display_colors) |
128 | 128 |
layout.addWidget(self._by_line_no) |
129 | 129 |
self._by_line_type = QRadioButton() |
130 |
self._by_line_type.setText('By Line Type')
|
|
130 |
self._by_line_type.setText('By Type') |
|
131 | 131 |
layout.addWidget(self._by_line_type) |
132 | 132 |
self._display_widget.setLayout(layout) |
133 | 133 |
self.EditToolbar.insertWidget(None, self._display_widget) |
DTI_PID/DTI_PID/Shapes/EngineeringEquipmentItem.py | ||
---|---|---|
20 | 20 |
clicked = pyqtSignal(QGraphicsSvgItem) |
21 | 21 |
ZVALUE = 10 |
22 | 22 |
EQUIP_COLUMN_LIST = None |
23 |
EQUIP_COLOR = None |
|
23 | 24 |
|
24 | 25 |
def __init__(self, path, uid=None, flip=0): |
25 | 26 |
from SymbolAttr import SymbolProp |
... | ... | |
114 | 115 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
115 | 116 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
116 | 117 |
|
118 |
def getColor(self): |
|
119 |
""" return equipment's color """ |
|
120 |
from AppDocData import AppDocData |
|
121 |
from DisplayColors import DisplayColors |
|
122 |
from DisplayColors import DisplayOptions |
|
123 |
from EngineeringAbstractItem import QEngineeringAbstractItem |
|
124 |
from EngineeringLineItem import QEngineeringLineItem |
|
125 |
|
|
126 |
if DisplayOptions.DisplayByLineType == DisplayColors.instance().option: |
|
127 |
if self.hover: |
|
128 |
return SymbolSvgItem.HOVER_COLOR |
|
129 |
elif not QEngineeringEquipmentItem.EQUIP_COLOR: |
|
130 |
app_doc_data = AppDocData.instance() |
|
131 |
configs = app_doc_data.getConfigs('Equipment', 'Color') |
|
132 |
QEngineeringEquipmentItem.EQUIP_COLOR = configs[0].value if configs else QEngineeringAbstractItem.DEFAULT_COLOR |
|
133 |
|
|
134 |
return QEngineeringEquipmentItem.EQUIP_COLOR |
|
135 |
else: |
|
136 |
return SymbolSvgItem.getColor(self) |
|
137 |
|
|
117 | 138 |
''' |
118 | 139 |
@brief get attributes |
119 | 140 |
@author humkyung |
내보내기 Unified diff