Exemple #1
0
 def _setup_subscribers(self) -> None:
     subscribers = [
         Subscriber("FramerateChangeRequest", function=self.set_framerate),
         Subscriber("ResolutionChangeRequest",
                    function=self.set_resolution),
     ]
     for subscriber in subscribers:
         PUBLISHER.register_subscriber(subscriber)
Exemple #2
0
 def _setup_subscribers(self) -> None:
     subscribers = [
         Subscriber("ImageSelectionRequest", function=self.image_selection),
         Subscriber("ImageResetRequest", function=self.image_reset),
         Subscriber("ImageSaveRequest", function=self.image_save),
         Subscriber("ImageLoadingError", function=self.image_loading_error),
     ]
     for subscriber in subscribers:
         PUBLISHER.register_subscriber(subscriber)
Exemple #3
0
 def _setup_subscribers(self) -> None:
     subscribers = [
         Subscriber("ImageChangeRequest", function=self.change_image),
         Subscriber("ImageUpdateRequest", function=self.update_image),
         Subscriber("ImagePixelReplaceRequest",
                    function=self.replace_pixels),
     ]
     for subscriber in subscribers:
         PUBLISHER.register_subscriber(subscriber)
Exemple #4
0
 def _setup_subscribers(self) -> None:
     subscribers = [
         Subscriber("MazeSolveRequest", function=self.maze_solve),
         Subscriber("MazeStopRequest", function=self.maze_stop),
         Subscriber("MazeResumeRequest", function=self.maze_resume),
         Subscriber("MazeCancelRequest", function=self.maze_reset),
         Subscriber("MazeSolveDone", function=self.maze_solve_done),
     ]
     for subscriber in subscribers:
         PUBLISHER.register_subscriber(subscriber)
Exemple #5
0
 def _setup_subscribers(self) -> None:
     subscribers = [
         Subscriber("PointChangeRequest", function=self.set_status),
         Subscriber("ImageClicked", function=self.set_point),
         Subscriber(
             "ImageChangeRequest",
             function=lambda *args, **kwargs: self.reset_points(),
         ),
     ]
     for subscriber in subscribers:
         PUBLISHER.register_subscriber(subscriber)
Exemple #6
0
from mazesolver.controller import ApplicationController
from mazesolver.gui import ApplicationGui
from mazesolver.solver import Solver
from mazesolver.pubsub import PUBLISHER, ProcessSubscriber
from mazesolver.image import MazeImage

if __name__ == "__main__":
    image = MazeImage()
    controller = ApplicationController(image)
    gui = ApplicationGui(image)
    solver = Solver()
    subscriber = ProcessSubscriber("Maze", worker=solver)
    PUBLISHER.register_subscriber(subscriber)
    gui.start()
Exemple #7
0
 def _setup_subscribers(self) -> None:
     subscribers = [
         Subscriber("FramerateResetRequest", function=self.reset)
     ]
     for subscriber in subscribers:
         PUBLISHER.register_subscriber(subscriber)