Пример #1
0
    def __init__(self,
                 design: 'QDesign',
                 initiate=False,
                 render_template: Dict = None,
                 render_options: Dict = None):
        """
        Args:
            design (QDesign): The design
            initiate (bool): True to initiate the renderer.  Defaults to False.
            render_template (Dict, optional): Typically used by GUI for template options for GDS.  Defaults to None.
            render_options (Dict, optional): Used to override all options.  Defaults to None.
        """

        # TODO: check that the renderer has been loaded with load_renderer

        self.status = 'Not Init'

        if design is None:
            print(
                "INFO: A Qiskit Metal design was not provided. Creating an empty design instance"
                " to make the renderer proceed. (Developers: Remove need 4 dummy design, github Issue 631)"
            )
            design = designs.DesignPlanar({}, True)
        assert is_design(
            design), "Error, for the design argument you must provide a\
                                   a child instance of Metal QDesign class."

        self._design = design

        # Options
        self._options = Dict()
        self.update_options(render_options=render_options,
                            render_template=render_template)

        self.initiated = False
        if initiate:
            self.start()

        # Register as an instantiated renderer.
        QRenderer.__instantiated_renderers__[self.name] = self

        self.status = 'Init Completed'
Пример #2
0
    def __init__(self,
                 design: 'QDesign',
                 initiate=True,
                 render_template: Dict = None,
                 render_options: Dict = None):
        """
        Args:
            design (QDesign): The design
            initiate (bool): True to initiate the renderer.  Defaults to True.
            render_template (Dict, optional): Typically used by GUI for template options for GDS.  Defaults to None.
            render_options (Dict, optional):  Used to override all options.  Defaults to None.
        """

        # TODO: check that the renderer has been loaded with load_renderer

        self.status = 'Not Init'

        assert is_design(
            design), "Erorr, for the design argument you must provide a\
                                   a child instance of Metal QDesign class."

        self._design = design
        self.initiated = False

        if initiate:
            self.initate()

        # Register as an instantiated renderer.
        QRenderer.__instantiated_renderers__[self.name] = self

        # Options
        self._options = Dict()
        self.update_options(render_options=render_options,
                            render_template=render_template)

        self.status = 'Init Completed'