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

Method __init__

SLiCAP/schematic/model_item.py:27–47  ·  view source on GitHub ↗
(self, model_name: str, model_type: str, simulator: str,
                 params: list,
                 preamble_path: str = "",
                 display_width: int = 200, display_height: int = 80,
                 pos: QPointF = QPointF(0, 0))

Source from the content-addressed store, hash-verified

25 """
26
27 def __init__(self, model_name: str, model_type: str, simulator: str,
28 params: list,
29 preamble_path: str = "",
30 display_width: int = 200, display_height: int = 80,
31 pos: QPointF = QPointF(0, 0)):
32 super().__init__()
33 self.model_name: str = model_name
34 self.model_type: str = model_type
35 self.simulator: str = simulator
36 self.params: list = list(params)
37 self.preamble_path: str = preamble_path
38 self._svg_bytes: bytes | None = None
39 self.display_width: int = display_width
40 self.display_height: int = display_height
41 self.setPos(pos)
42 self.setFlag(QGraphicsItem.ItemIsSelectable)
43 self.setFlag(QGraphicsItem.ItemIsMovable)
44 self.setFlag(QGraphicsItem.ItemSendsGeometryChanges)
45 self._renderer = None
46 _live_model_items.add(self)
47 self._load_renderer()
48
49 def rescale(self, ratio: float) -> None:
50 self.prepareGeometryChange()

Callers

nothing calls this directly

Calls 1

_load_rendererMethod · 0.95

Tested by

no test coverage detected