qcc_kplugin.simview =================== .. py:module:: qcc_kplugin.simview .. autoapi-nested-parse:: The sim-group overlay: what a Simulate (or a saved ``sim_groups`` entry) renders, drawn over the layout. It is a set of KLayout markers on the view, like the other overlays of the plugin: never a fab layer, never in an export, a PNG of the view made by KLayout's own tools aside. What it shows comes from ``qcc sim preview`` (the library's ``guiflow.preview_groups``, which runs the same ``build_simulation`` as the export, so the box, the ports and the routes are the ones of the job folder; nothing is written): * the **box** (purple) with its group, analysis and size; * the **components** that are selected (green frames), the routes that stay in the simulation (green lines; a grey one is only passing through the box, like the feedline that the box cuts) and the other components that reach into the box (grey, dashed); * the **ports**: a junction (red), a 50 ohm edge or pad termination (blue), a cut route's stub port (orange, the stub drawn from the component's port). Two uses: the **Simulate dialog** shows the preview of what will be simulated for the chosen analysis (a temporary overlay, gone when the dialog closes), and the panel's **Sim groups** tab shows a saved group (it stays until hidden and follows the design: a rebuild draws it again, a design that changed is previewed again). Attributes ---------- .. autoapisummary:: qcc_kplugin.simview.STATE Functions --------- .. autoapisummary:: qcc_kplugin.simview.busy qcc_kplugin.simview.cancel qcc_kplugin.simview.clear qcc_kplugin.simview.command qcc_kplugin.simview.draw qcc_kplugin.simview.end_temp qcc_kplugin.simview.poll qcc_kplugin.simview.request qcc_kplugin.simview.show qcc_kplugin.simview.summary Module Contents --------------- .. py:function:: busy() -> bool .. py:function:: cancel() -> None .. py:function:: clear(unpin: bool = True) -> None Remove the overlay (and forget the saved group the panel was showing). .. py:function:: command(spec: dict) -> list[str] ``qcc sim preview`` arguments of ``spec``: ``names`` (instances / routes), ``analysis``, ``default`` / ``whole`` (no names), ``group`` (a saved group, its own selection), ``margin``. .. py:function:: draw(data: dict | None) -> int Draw ``data`` (a ``qcc sim preview`` result) on the design's view; returns the number of markers. ``None`` clears. .. py:function:: end_temp() -> None The Simulate dialog closed: back to the saved group the panel shows, or nothing. .. py:function:: poll() -> None Collect the finished preview (a timer calls this). .. py:function:: request(spec: dict, done=None, temp: bool = False) -> bool Run ``qcc sim preview`` in the background and draw the result. ``done(data, error)`` follows (``error`` is the message of a failed preview, then nothing is drawn). ``temp``: the Simulate dialog's overlay (see :func:`end_temp`). A request that is still running is dropped. Returns False without a design. .. py:function:: show(data: dict, spec: dict | None = None, pin: bool = False) -> None .. py:function:: summary(group: dict) -> str One line for a preview box: the group, the box size and what its ports are. .. py:data:: STATE :type: dict