コード例 #1
0
ファイル: color.py プロジェクト: andrewgalisa/mousetrap
    def __init__(self):
        Mapper.__init__(self, 200, 160)

        self.point = None
        self.border_with = 0
        """
        self.threshold = 1 # Threshold for mouse movement.  If any mouse movement is 
                           # smaller than self.threshold pixels (I guess) then the mouse is not moved.
                           # Trying to reduce jitteriness. Not working.
        self.same_location_count = 0 # Yeah this variable name is bad.  It means the number of times
                                     # that the cursor has been in the same location under the threshold.
        """
        self.connect("expose_event", self.expose_event)

        self.cfg = settings.load()

        algorithm_info = pocv.get_idm_inf("color")

        self.scale = self.cfg.get("color", "vscale")
コード例 #2
0
ファイル: color.py プロジェクト: amberheilman/mousetrap
    def __init__(self):
        Mapper.__init__(self, 200, 160)

        self.point       = None
        self.border_with = 0
        """
        self.threshold = 1 # Threshold for mouse movement.  If any mouse movement is 
                           # smaller than self.threshold pixels (I guess) then the mouse is not moved.
                           # Trying to reduce jitteriness. Not working.
        self.same_location_count = 0 # Yeah this variable name is bad.  It means the number of times
                                     # that the cursor has been in the same location under the threshold.
        """
        self.connect("expose_event", self.expose_event)
        
        self.cfg = settings.load()
    
        algorithm_info = pocv.get_idm_inf("color")
        
        self.scale = self.cfg.get("color", "vscale") 
コード例 #3
0
ファイル: controller.py プロジェクト: kevin-brown/mousetrap
    def start(self):
        """
        Starts the modules, views classes.

        Arguments:
        - self: The main object pointer.
        """
        if self.cfg is None:
            conf_created, self.cfg = settings.load()

        self.proc_args()

        if not self.dbusd.start():
            self.httpd.start()

        if self.cfg.getboolean("main", "startCam"):
            # Lets start the module
            idm = pocv.get_idm(self.cfg.get("main", "algorithm"))
            self.idm = idm.Module(self)
            self.idm.set_capture(self.cfg.getint("cam", "inputDevIndex"))

            #Will return false when cap.image() is false in ui/main
            GObject.timeout_add(150, self.update_frame)    #Thread that updates the image on the screen
            GObject.timeout_add(50, self.update_pointers)   #Thread that moves the mouse

            debug.info("mousetrap", "Idm loaded and started")

        # Lets build the interface
        self.itf = MainGui(self)
        self.itf.build_interface()
        self.itf.load_addons()

        if conf_created:
            from .ui import settings_gui
            settings_gui.showPreffGui(self)

        debug.info("mousetrap", "MouseTrap's Interface Built and Loaded")

        GObject.threads_init()
        self.loop.run()