Exemple #1
0
 def load_devices(self):
     loader.load_engines_to_module(sys.modules["__main__"])
Exemple #2
0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import subcircuit.interfaces as inter
import subcircuit.sandbox as sb
from subcircuit.loader import load_engines_to_module
import sys


#  Suncircuit instance device needs access to all other devices:
load_engines_to_module(sys.modules[__name__])


class X(inter.MNADevice):
    """Subckt instance device (SPICE X)"""

    def __init__(self, nodes, subckt, **parameters):
        """Creates a new subckt instance device
        :param nodes: Device extrnal node names
        :param subckt: Subckt name
        :param parameters: Dictionary of parameters for the subcircuit instance
        :return: New subckt instance device
        """
        inter.MNADevice.__init__(self, nodes, 0, **parameters)
        self.subckt = subckt
        self.parameters = parameters