개정판 15d26ccc
issue #000: getcolor modi
Change-Id: I32a0635ca82e42cc14f47acdf17d139824ab16fe
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
86 | 86 |
else: |
87 | 87 |
return False |
88 | 88 |
|
89 |
app_doc_data = AppDocData.instance() |
|
90 |
|
|
91 | 89 |
if DisplayOptions.DisplayByStreamNo == DisplayColors.instance().option and \ |
92 | 90 |
(issubclass(type(self), SymbolSvgItem) or type(self) is QEngineeringLineItem): |
91 |
app_doc_data = AppDocData.instance() |
|
93 | 92 |
res = check_stream_no_attribute() |
94 | 93 |
if res and res in app_doc_data._hmbColors: |
95 | 94 |
return app_doc_data._hmbColors[res] |
... | ... | |
109 | 108 |
return QEngineeringEquipmentItem.EQUIP_COLOR |
110 | 109 |
|
111 | 110 |
elif type(self) is QEngineeringInstrumentItem: |
112 |
if DisplayOptions.DisplayByLineType == DisplayColors.instance().option: |
|
113 |
if self.hover: |
|
111 |
if self.hover: |
|
114 | 112 |
return SymbolSvgItem.HOVER_COLOR |
115 |
elif not QEngineeringInstrumentItem.INST_COLOR: |
|
113 |
elif DisplayOptions.DisplayByLineType == DisplayColors.instance().option: |
|
114 |
if not QEngineeringInstrumentItem.INST_COLOR: |
|
116 | 115 |
app_doc_data = AppDocData.instance() |
117 | 116 |
configs = app_doc_data.getConfigs('Instrument', 'Color') |
118 | 117 |
QEngineeringInstrumentItem.INST_COLOR = configs[ |
119 | 118 |
0].value if configs else QEngineeringAbstractItem.DEFAULT_COLOR |
120 |
|
|
121 | 119 |
return QEngineeringInstrumentItem.INST_COLOR |
122 | 120 |
else: |
123 |
return SymbolSvgItem.HOVER_COLOR if self.hover else ( \ |
|
124 |
self.owner._color if self.owner and hasattr(self.owner, '_color') else self._color) |
|
121 |
return self.owner._color if self.owner and hasattr(self.owner, '_color') else self._color |
|
125 | 122 |
|
126 | 123 |
elif type(self) is SymbolSvgItem: |
127 | 124 |
return SymbolSvgItem.HOVER_COLOR if self.hover else ( \ |
128 | 125 |
self.owner._color if self.owner and hasattr(self.owner, '_color') else self._color) |
129 | 126 |
|
130 | 127 |
elif type(self) is QEngineeringLineItem: |
131 |
if DisplayOptions.DisplayByLineType == DisplayColors.instance().option: |
|
132 |
if self.hover: |
|
133 |
return QEngineeringAbstractItem.HOVER_COLOR |
|
134 |
elif self.isSelected(): |
|
135 |
return QEngineeringAbstractItem.SELECTED_COLOR |
|
128 |
if self.hover: |
|
129 |
return QEngineeringAbstractItem.HOVER_COLOR |
|
130 |
elif self.isSelected(): |
|
131 |
return QEngineeringAbstractItem.SELECTED_COLOR |
|
132 |
elif DisplayOptions.DisplayByLineType == DisplayColors.instance().option: |
|
133 |
if self.lineType in QEngineeringLineItem.LINE_TYPE_COLORS: |
|
134 |
return QEngineeringLineItem.LINE_TYPE_COLORS[self.lineType] |
|
136 | 135 |
else: |
137 |
if self.lineType in QEngineeringLineItem.LINE_TYPE_COLORS: |
|
136 |
app_doc_data = AppDocData.instance() |
|
137 |
configs = app_doc_data.getConfigs('LineTypes', self.lineType) |
|
138 |
if configs: |
|
139 |
tokens = configs[0].value.split(',') |
|
140 |
QEngineeringLineItem.LINE_TYPE_COLORS[self.lineType] = tokens[0] if len(tokens) == 4 else \ |
|
141 |
QEngineeringAbstractItem.DEFAULT_COLOR |
|
138 | 142 |
return QEngineeringLineItem.LINE_TYPE_COLORS[self.lineType] |
139 | 143 |
else: |
140 |
app_doc_data = AppDocData.instance() |
|
141 |
configs = app_doc_data.getConfigs('LineTypes', self.lineType) |
|
142 |
if configs: |
|
143 |
tokens = configs[0].value.split(',') |
|
144 |
QEngineeringLineItem.LINE_TYPE_COLORS[self.lineType] = tokens[0] if len(tokens) == 4 else \ |
|
145 |
QEngineeringAbstractItem.DEFAULT_COLOR |
|
146 |
return QEngineeringLineItem.LINE_TYPE_COLORS[self.lineType] |
|
147 |
else: |
|
148 |
return QEngineeringAbstractItem.DEFAULT_COLOR |
|
144 |
return QEngineeringAbstractItem.DEFAULT_COLOR |
|
149 | 145 |
else: |
150 | 146 |
if self.owner is None: |
151 |
if self.isSelected(): |
|
152 |
return QEngineeringAbstractItem.SELECTED_COLOR |
|
153 |
else: |
|
154 |
return QEngineeringAbstractItem.HOVER_COLOR if self.hover else ( |
|
155 |
self.owner.getColor() if (self.owner and hasattr(self.owner, '_color')) else self._color) |
|
147 |
return self._color |
|
156 | 148 |
else: |
157 |
if self.isSelected(): |
|
158 |
return QEngineeringAbstractItem.SELECTED_COLOR |
|
159 |
else: |
|
160 |
return self.owner.getColor() |
|
161 |
|
|
149 |
return self.owner.getColor() |
|
162 | 150 |
|
163 | 151 |
return QEngineeringAbstractItem.HOVER_COLOR if self.hover else ( |
164 | 152 |
self.owner.getColor() if (self.owner and hasattr(self.owner, '_color')) else self._color) |
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1452 | 1452 |
stroke.setWidth(15) |
1453 | 1453 |
return stroke.createStroke(path) |
1454 | 1454 |
|
1455 |
def paint(self, painter, option, widget):
|
|
1455 |
def paint(self, painter, options=None, widget=None):
|
|
1456 | 1456 |
"""override paint method""" |
1457 | 1457 |
color = self.getColor() |
1458 | 1458 |
self.setColor(color) |
1459 | 1459 |
|
1460 | 1460 |
painter.setPen(self.pen()) |
1461 | 1461 |
painter.drawLine(self.line()) |
1462 |
#QGraphicsLineItem.paint(self, painter, options, widget) |
|
1462 | 1463 |
|
1463 | 1464 |
if self.isSelected(): |
1464 | 1465 |
painter.setOpacity(0.7) |
DTI_PID/WebServer/run.py | ||
---|---|---|
1 | 1 |
from app import app |
2 | 2 |
|
3 | 3 |
if __name__ == '__main__': |
4 |
app.run(port=8080, debug=True, host='0.0.0.0')
|
|
4 |
app.run(port=8080, debug=False, host='0.0.0.0')
|
|
5 | 5 |
#app.run(debug=False) |
내보내기 Unified diff