개정판 86acfb53
issue #366: fix line type
Change-Id: I88506a4850b6d4f44ed6a94ebd3318f268d9332c
DTI_PID/DTI_PID/Commands/PlaceLineCommand.py | ||
---|---|---|
72 | 72 |
self._line_type = selected.parentItem().lineType |
73 | 73 |
elif issubclass(type(selected.parentItem()), SymbolSvgItem): |
74 | 74 |
for idx, conn in enumerate(selected.parentItem().connectors): |
75 |
if selected is conn: |
|
75 |
if selected is conn and selected.parentItem().conn_type:
|
|
76 | 76 |
self._line_type = selected.parentItem().conn_type[idx] |
77 | 77 |
break |
78 | 78 |
# up to here |
DTI_PID/DTI_PID/ReplaceSymbolDialog.py | ||
---|---|---|
40 | 40 |
find_symbol = self.ui.comboBoxFind.currentText() |
41 | 41 |
replace_symbol = self.ui.comboBoxReplace.currentText() |
42 | 42 |
|
43 |
conditions = [[text for text in self.ui.plainTextEdit.toPlainText().split('\n')]] |
|
44 |
|
|
43 | 45 |
if self.ui.radioButtonReplace.isChecked(): |
44 | 46 |
# replace |
45 | 47 |
symbol_items = [item for item in self.view.scene().items() |
... | ... | |
50 | 52 |
return |
51 | 53 |
|
52 | 54 |
for old_symbol in symbol_items: |
55 |
target = False |
|
56 |
for condition in conditions: |
|
57 |
if not eval(condition): |
|
58 |
break |
|
59 |
if not target: |
|
60 |
continue |
|
61 |
|
|
53 | 62 |
scenePos = old_symbol.mapToScene(old_symbol.transformOriginPoint()) |
54 | 63 |
old_symbol.transfer.onRemoved.emit(old_symbol) |
55 |
|
|
64 |
|
|
56 | 65 |
svg = self.view.createSymbolObject(replace_symbol) |
57 | 66 |
self.view.matchSymbolToLine(svg, scenePos, angle=old_symbol.angle, flip=old_symbol.flip) |
67 |
svg.bind_close_items() |
|
58 | 68 |
|
59 | 69 |
else: |
60 | 70 |
# insert |
내보내기 Unified diff