개정판 3f1d6793
issue #563: spec break string type supported
Change-Id: Id6b71d1125af42f4863de4e3492f0a74025b2ee6
DTI_PID/DTI_PID/ItemPropertyTableWidget.py | ||
---|---|---|
517 | 517 |
if key.Attribute == 'UpStream' or key.Attribute == 'DownStream': |
518 | 518 |
UpDownItem = QTableWidgetItem('{}'.format('None' if value is None else value)) |
519 | 519 |
self.setItem(row, 3, UpDownItem) |
520 |
elif key.AttributeType == 'Spec': |
|
520 |
else: # elif key.AttributeType == 'Spec':
|
|
521 | 521 |
self.setItem(row, 3, QTableWidgetItem(str(value)[1:-1])) |
522 | 522 |
else: |
523 | 523 |
self.setItem(row, 3, value_item) |
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
656 | 656 |
symbol = docdata.getSymbolByQuery('name', svgFileName) |
657 | 657 |
svgFilePath = os.path.join(docdata.getCurrentProject().getSvgFilePath(), symbol.getType(), svgFileName + '.svg') |
658 | 658 |
|
659 |
specBreakAttrsFull = [attr for attr in docdata.getSymbolAttribute('Segment Breaks') if attr.Target == 'ALL' and attr.AttributeType == 'Spec']
|
|
659 |
specBreakAttrsFull = [attr for attr in docdata.getSymbolAttribute('Segment Breaks') if attr.Target == 'ALL' and (attr.AttributeType == 'Spec' or attr.AttributeType == 'String')]
|
|
660 | 660 |
specBreakAttrs = [attr.Attribute for attr in specBreakAttrsFull] |
661 | 661 |
|
662 | 662 |
line_ends = [] |
DTI_PID/DTI_PID/SpecBreakDialog.py | ||
---|---|---|
36 | 36 |
if self.ui.tableWidgetSpec.rowCount() is not 0: |
37 | 37 |
row = 0 |
38 | 38 |
for attr in self.attrsKey: |
39 |
if attr.AttributeType != 'Spec': continue
|
|
39 |
if not (attr.AttributeType == 'Spec' or attr.AttributeType == 'String'): continue
|
|
40 | 40 |
value = self.attrs[attr] |
41 | 41 |
propertyComboBox = self.makePropertyComboBox() |
42 | 42 |
self.ui.tableWidgetSpec.setCellWidget(row, 0, propertyComboBox) |
... | ... | |
82 | 82 |
|
83 | 83 |
def makeValueWidget(self, tableName): |
84 | 84 |
''' |
85 |
@brief return Value combobox
|
|
85 |
@brief return Value widget
|
|
86 | 86 |
@author euisung |
87 | 87 |
@date 2019.01.16 |
88 | 88 |
''' |
89 |
spec = False |
|
90 |
attrs = AppDocData.instance().getSymbolAttribute('Segment Breaks') |
|
91 |
for attr in attrs: |
|
92 |
if attr.Attribute == tableName: |
|
93 |
if attr.AttributeType == 'Spec': |
|
94 |
spec = True |
|
95 |
break |
|
96 |
|
|
89 | 97 |
if tableName == 'NominalDiameter': |
90 | 98 |
return self.makeNominalDiameterComboBox() |
91 | 99 |
|
92 |
docData = AppDocData.instance() |
|
93 |
tableDatas = docData.getCodeTable(tableName) |
|
94 |
tableDatas = sorted(tableDatas, key=lambda data:data[1]) |
|
95 |
if tableDatas is not None: |
|
100 |
if spec: |
|
101 |
docData = AppDocData.instance() |
|
102 |
tableDatas = docData.getCodeTable(tableName) |
|
103 |
tableDatas = sorted(tableDatas, key=lambda data:data[1]) |
|
104 |
else: |
|
105 |
tableDatas = None |
|
106 |
|
|
107 |
if tableDatas: |
|
96 | 108 |
valueComboBox = QComboBox(self) |
97 | 109 |
for value in tableDatas: |
98 | 110 |
valueComboBox.addItem(value[1]) |
... | ... | |
182 | 194 |
try: |
183 | 195 |
from SymbolAttr import SymbolAttr |
184 | 196 |
for key in list(self.attrsKey): |
185 |
if key.AttributeType == 'Spec': |
|
197 |
if key.AttributeType == 'Spec' or key.AttributeType == 'String':
|
|
186 | 198 |
del self.attrs[key] |
187 | 199 |
for row in range(self.ui.tableWidgetSpec.rowCount()): |
188 | 200 |
attrs = AppDocData.instance().getSymbolAttribute('Segment Breaks') |
내보내기 Unified diff