Exemple #1
0
class Module:
    def __init__(self):
        self.comm = Comm()

    def process(self):
        self.comm.send(FrameType.BUTTON_STATE, (1, 2, 3))

        while self.comm.has_data():
            print(self.comm.get_data())
            print()
Exemple #2
0
def main():
    module = CLIController(Comm(), ["modules/swarm_ui/module/commands.json"])

    while not should_stop and not module.stopped:
        module.process()
        sleep(0.05)

    module.stop()
Exemple #3
0
def main():
    """symbolic main"""
    print("Starting application...\n")
    module = Module(Comm())
    print("Module created...")
    register_signal_callback(module.stop)
    with module:
        while not module.stopped:
            module.process()
            sleep(0.05)
Exemple #4
0
def main():

    print("Starting application...\n")
    module = Module(Comm())
    print("Module created...")

    while not SHOULD_STOP:
        module.process()
        sleep(0.05)

    module.stop()
Exemple #5
0
def main():
    "entry point of the application"

    print("Starting application...\n")
    module = Module(Comm())
    register_signal_callback(module.stop)
    print("Module created...")
    with module:
        while not module.stopped:
            module.process()
            time.sleep(0.05)
Exemple #6
0
def main():
    """
    Main function that starts the module

    :return:
    """
    print("Starting application...\n")
    module = Module(Comm(), TestButton())
    print("Module created...")

    register_signal_callback(module.stop)

    with module:
        while not module.stopped:
            module.process()
            sleep(0.05)
Exemple #7
0
 def __init__(self):
     self.comm = Comm()