Пример #1
0
    def __init__(self, name, pin):
        """
        Constructor.

        :param name: String, name of the brick
        :param pin: Integer, pin where the brick is connected
        :return:
        """
        NamedElement.__init__(self, name)
        self.pin = pin
Пример #2
0
    def __init__(self, name, pin):
        """
        Constructor.

        :param name: String, name of the brick
        :param pin: Integer, pin where the brick is connected
        :return:
        """
        NamedElement.__init__(self, name)
        self.pin = pin
Пример #3
0
    def __init__(self, name, actions=(), transition=None):
        """
        Constructor.

        :param name: String, name of the state
        :param actions: List[Action], sequence of actions to do when entering the state (size should be > 0)
        :param transition: Transition, unique outgoing transition
        :return:
        """
        NamedElement.__init__(self, name)
        self.transition = transition
        self.actions = actions
Пример #4
0
    def __init__(self, name, bricks=(), states=()):
        """
        Constructor.

        :param name: String, the name of the application
        :param bricks: List[Brick], bricks over which the application operates
        :param states: List[State], states of the application with the first one being the initial state
        :return:
        """
        NamedElement.__init__(self, name)
        self.bricks = bricks
        self.states = states
Пример #5
0
    def __init__(self, name, bricks=(), states=()):
        """
        Constructor.

        :param name: String, the name of the application
        :param bricks: List[Brick], bricks over which the application operates
        :param states: List[State], states of the application with the first one being the initial state
        :return:
        """
        NamedElement.__init__(self, name)
        self.bricks = bricks
        self.states = states
Пример #6
0
    def __init__(self, name, bricks=(), states=(), modes=(), printer = None):
        """
        Constructor.

        :param name: String, the name of the application
        :param bricks: List[Brick], bricks over which the application operates
        :param states: List[State], states of the application with the first one being the initial state
        :param modes: List[Mode], modes of the application with the first one being the initial mode
        :return:
        """
        NamedElement.__init__(self, name)
        self.printer = printer
        self.bricks = bricks
        self.states = states
        self.modes = modes #check if modes is empty because generated code will be different 
Пример #7
0
    def __init__(self,
                 name: str,
                 bricks: tuple = (),
                 modes: tuple = (),
                 monitor: Monitor = None):
        """
        Constructor.

        :param name: String, the name of the application
        :param bricks: List[Brick], bricks over which the application operates
        :param states: List[State], states of the application with the first one being the initial state
        :return:
        """
        NamedElement.__init__(self, name)
        self.bricks: tuple = bricks
        self.modes: tuple = modes
        self.monitor: Monitor = monitor
Пример #8
0
    def __init__(self, name, transitions: tuple = (), states: tuple = ()):

        NamedElement.__init__(self, name)
        self.transitions: tuple = transitions
        self.states: tuple = states
Пример #9
0
 def __init__(self, name, state, transition=None):
     NamedElement.__init__(self, name)
     self.transitions = []
     self.transitions.append(transition)
     self.initState = state