MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _end_wire

Method _end_wire

SLiCAP/schematic/canvas.py:924–939  ·  view source on GitHub ↗
(self, *, commit: bool)

Source from the content-addressed store, hash-verified

922 self._refresh_preview(self._last_cursor)
923
924 def _end_wire(self, *, commit: bool):
925 if self._wire_preview is not None:
926 self.removeItem(self._wire_preview)
927 self._wire_preview = None
928 committed = commit and len(self._wire_points) >= 2
929 if committed:
930 self._push_undo()
931 self.addItem(WireItem(self._wire_points))
932 self._wire_points = []
933 if self._mode == _Mode.WIRING:
934 self._mode = _Mode.NORMAL
935 self.wire_mode_ended.emit()
936 if committed:
937 self._sync_junctions()
938 self._remove_short_circuit_wires()
939 self._sync_junctions()
940
941 def _refresh_preview(self, cursor: QPointF | None):
942 self._last_cursor = cursor

Callers 15

_start_paste_ghostMethod · 0.95
start_placementMethod · 0.95
start_text_placementMethod · 0.95
start_image_placementMethod · 0.95
start_latex_placementMethod · 0.95

Calls 4

_push_undoMethod · 0.95
_sync_junctionsMethod · 0.95
WireItemClass · 0.85

Tested by

no test coverage detected