MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _next_id

Method _next_id

SLiCAP/schematic/canvas.py:530–538  ·  view source on GitHub ↗
(self, symbol_name: str)

Source from the content-addressed store, hash-verified

528 self.placing_cancelled.emit()
529
530 def _next_id(self, symbol_name: str) -> str:
531 # Number per-PREFIX (not per-symbol): symbols that share a refdes prefix
532 # — every subcircuit block uses 'X', and e.g. nmos/pmos both use 'M' —
533 # must draw from one counter so their refdes never collide. from_data
534 # seeds these counters with the same key (keep them in sync).
535 prefix = SYMBOL_PREFIX.get(symbol_name, "X")
536 n = self._counters.get(prefix, 1)
537 self._counters[prefix] = n + 1
538 return f"{prefix}{n}"
539
540 def start_junction_placement(self):
541 self._end_wire(commit=False)

Callers 2

_commit_pasteMethod · 0.95
mousePressEventMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected