当前位置: 首页>>代码示例>>Python>>正文


Python Plugin.__init__方法代码示例

本文整理汇总了Python中plugin.Plugin.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Plugin.__init__方法的具体用法?Python Plugin.__init__怎么用?Python Plugin.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在plugin.Plugin的用法示例。


在下文中一共展示了Plugin.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self,g_pool,atb_pos=(0,0)):
        Plugin.__init__(self)

        self.window_should_open = False
        self.window_should_close = False
        self._window = None
        self.fullscreen = c_bool(0)
        self.realdata = c_bool(False)
        self.x = c_float(0)
        self.y = c_float(0)
        self.blink_time = c_float(1)
        self.should_blink = False
        self.blink_start = None

        atb_label = "android coordinate plugin"
        # Creating an ATB Bar.
        self._bar = atb.Bar(name =self.__class__.__name__, label=atb_label,
            help="ref detection parameters", color=(50, 50, 50), alpha=100,
            text='light', position=atb_pos,refresh=.3, size=(300, 100))
        self._bar.add_var("real data", self.realdata)
        self._bar.add_var("X", self.x)
        self._bar.define("min=0 max=1 step=0.01", "X")
        self._bar.add_var("Y", self.y)
        self._bar.define("min=0 max=1 step=0.01", "Y")
        self._bar.add_var("blink time", self.blink_time, min=0,max=10,step=0.05,help="Simulated blink time")
        # self._bar.define("min=0 max=10000 step=50", "blink time")
        self._bar.add_button("simulate blink", self.schedule_blink)
开发者ID:jpyy,项目名称:marker-app,代码行数:29,代码来源:AndroidPlugin.py

示例2: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self, g_pool, atb_pos=(0, 0)):
        Plugin.__init__(self)
        self.g_pool = g_pool
        self.first_img = None
        self.point = None
        self.count = 0
        self.detected = False
        self.active = False
        self.pos = None
        self.r = 40.0  # radius of circle displayed
        self.ref_list = []
        self.pupil_list = []

        atb_label = "calibrate using natural features"
        self._bar = atb.Bar(
            name=self.__class__.__name__,
            label=atb_label,
            help="ref detection parameters",
            color=(50, 50, 50),
            alpha=100,
            text="light",
            position=atb_pos,
            refresh=0.3,
            size=(300, 100),
        )
        self._bar.add_button("start/stop", self.start_stop, key="c")
开发者ID:DuongHoangThuy,项目名称:pupil,代码行数:28,代码来源:natural_features_calibration.py

示例3: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__( self, address="225.1.1.1", port=5200, interface="0.0.0.0" ):
        Plugin.__init__(self, "broadcast")

        self.address   = address
        self.port      = port
        self.interface = interface

        try:
            # Instantiate a UDP socket
            self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)

            # Allow address reuse
            self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

            # Set the packets TTL
            self.sock.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_TTL, 1)

            # Do not loop messages back to the local sockets
            self.sock.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_LOOP, 0)

            # Bind to the port
            self.sock.bind(('', self.port))

            # Set the interface to perform the multicast on
            self.sock.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_IF, socket.inet_aton(self.interface))

            # Apply for messages sent to the specified address
            self.sock.setsockopt(socket.SOL_IP,
                                 socket.IP_ADD_MEMBERSHIP,
                                 socket.inet_aton(self.address) + socket.inet_aton(self.interface))

            self._initialized = True

        except socket.error:
            pass
开发者ID:lemontongs,项目名称:AllSpark,代码行数:37,代码来源:message_broadcast.py

示例4: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self,g_pool,atb_pos=(0,0)):
        Plugin.__init__(self)
        self.collect_new = False
        self.calculated = False
        self.obj_grid = _gen_pattern_grid((4, 11))
        self.img_points = []
        self.obj_points = []
        self.count = 10
        self.img_shape = None

        self.display_grid = _make_grid()


        self.window_should_open = False
        self.window_should_close = False
        self._window = None
        self.fullscreen = c_bool(0)
        self.monitor_idx = c_int(0)
        self.monitor_handles = glfwGetMonitors()
        self.monitor_names = [glfwGetMonitorName(m) for m in self.monitor_handles]
        monitor_enum = atb.enum("Monitor",dict(((key,val) for val,key in enumerate(self.monitor_names))))
        #primary_monitor = glfwGetPrimaryMonitor()

        atb_label = "estimate camera instrinsics"
        # Creating an ATB Bar is required. Show at least some info about the Ref_Detector
        self._bar = atb.Bar(name =self.__class__.__name__, label=atb_label,
            help="ref detection parameters", color=(50, 50, 50), alpha=100,
            text='light', position=atb_pos,refresh=.3, size=(300, 100))
        self._bar.add_var("monitor",self.monitor_idx, vtype=monitor_enum)
        self._bar.add_var("fullscreen", self.fullscreen)
        self._bar.add_button("  show pattern   ", self.do_open, key='c')
        self._bar.add_button("  Capture Pattern", self.advance, key="SPACE")
        self._bar.add_var("patterns to capture", getter=self.get_count)
开发者ID:Denise8,项目名称:pupil,代码行数:35,代码来源:camera_intrinsics_estimation.py

示例5: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self,data):
        # call the plugin basic initializations
        Plugin.__init__(self,data)

        # set the name of your plugin
        self.setName("end_optimum_value_kruskal",
        "Make non-parametric over ALL tests.")
开发者ID:BackupTheBerlios,项目名称:ometah,代码行数:9,代码来源:end_optimum_value_kruskal.py

示例6: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
	def __init__(self):
		Plugin.__init__(self)
		self.dispatcher = Dispatcher()
		self.dispatcher.define('learn',  self.cmdDefine, access='member', argc=2)
		self.dispatcher.define('define', self.cmdDefine, access='member', argc=2)
		self.dispatcher.define('forget', self.cmdForget, access='member', argc=1)
		self.dispatcher.define('definfo', self.cmdDefInfo, access='moderator', argc=1)
开发者ID:Corgano,项目名称:pyrefly,代码行数:9,代码来源:dictionary.py

示例7: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self, global_calibrate,shared_pos,screen_marker_pos,screen_marker_state,atb_pos=(0,0)):
        Plugin.__init__(self)
        self.active = False
        self.detected = False
        self.publish = False
        self.global_calibrate = global_calibrate
        self.global_calibrate.value = False
        self.shared_pos = shared_pos
        self.pos = 0,0 # 0,0 is used to indicate no point detected
        self.smooth_pos = 0.,0.
        self.smooth_vel = 0.
        self.sample_site = (-2,-2)
        self.counter = 0
        self.counter_max = 30
        self.candidate_ellipses = []
        self.show_edges = c_bool(0)
        self.aperture = c_int(7)
        self.dist_threshold = c_int(10)
        self.area_threshold = c_int(30)


        atb_label = "calibrate using handheld marker"
        # Creating an ATB Bar is required. Show at least some info about the Ref_Detector
        self._bar = atb.Bar(name = self.__class__.__name__, label=atb_label,
            help="ref detection parameters", color=(50, 50, 50), alpha=100,
            text='light', position=atb_pos,refresh=.3, size=(300, 100))
        self._bar.add_button("start", self.start, key='c')
开发者ID:Flavsditz,项目名称:projects,代码行数:29,代码来源:manual_marker_calibration.py

示例8: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self, g_pool,atb_pos=(0,0)):
        Plugin.__init__(self)
        self.active = False
        self.detected = False
        self.g_pool = g_pool
        self.pos = None
        self.smooth_pos = 0.,0.
        self.smooth_vel = 0.
        self.sample_site = (-2,-2)
        self.counter = 0
        self.counter_max = 30
        self.candidate_ellipses = []
        self.show_edges = c_bool(0)
        self.aperture = 7
        self.dist_threshold = c_int(10)
        self.area_threshold = c_int(30)
        self.world_size = None

        self.stop_marker_found = False
        self.auto_stop = 0
        self.auto_stop_max = 30
        atb_label = "calibrate using handheld marker"
        # Creating an ATB Bar is required. Show at least some info about the Ref_Detector
        self._bar = atb.Bar(name = self.__class__.__name__, label=atb_label,
            help="ref detection parameters", color=(50, 50, 50), alpha=100,
            text='light', position=atb_pos,refresh=.3, size=(300, 100))
        self._bar.add_button("start/stop", self.start_stop, key='c')
        self._bar.add_var("show edges",self.show_edges, group="Advanced")
开发者ID:WillemVlakveld,项目名称:pupil,代码行数:30,代码来源:manual_marker_calibration.py

示例9: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
 def __init__(self, teh_bot):
     Plugin.__init__(self, teh_bot)
     random.seed()
     self.command_dictionary = {
                           "choice": self.random,
                           "question": self.question,
                           "random": self.random,
                           "scale": self.scale,
                           }
     self.command_info = {
                          "question": [
                                       "  %squestion QUESTION" % self.command_prefix,
                                       "Returns a positive or a negative response to your question",
                                       ],
                          "scale":    [
                                       "  %sscale STATEMENT" % self.command_prefix,
                                       "  %sscale" % self.command_prefix,
                                       "Scales your statment in procent",
                                       "(random number between 1 and 100)",
                                       ],
                          "random":    [
                                        "  %srandom CHOICE1 CHOICE2 CHOICE3" % self.command_prefix,
                                        "  %srandom CHOICE1, CHOICE2, CHOICE3" % self.command_prefix,
                                        "  %srandom CHOICE1 or CHOICE2 or CHOICE3" % self.command_prefix,
                                        "Makes a random choice of the ones provided",
                                        "  %srandom NUMBER1 - NUMBER2" % self.command_prefix,
                                        "  %srandom NUMBER1 to NUMBER2" % self.command_prefix,
                                        "Selects a random number between the two provided",
                                        ],
                          }
开发者ID:edholland,项目名称:kagami-bot,代码行数:32,代码来源:commands.py

示例10: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self,data):
        # call the plugin basic initializations
        Plugin.__init__(self,data)

        # set the name of your plugin
        self.setName("iteration_all_value_quantilebox",
        "For each Test, plot the sequence of iterations (for any run) as a set \
        of quantile boxes. So we have one graphic for each Test.")
开发者ID:BackupTheBerlios,项目名称:ometah,代码行数:10,代码来源:iteration_all_value_quantilebox.py

示例11: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self,data):
        # call the plugin basic initializations
        Plugin.__init__(self,data)

        # set the name of your plugin
        self.setName("iteration_all_value_median_logarithmic",
        "Convergence graph over iterations : plot median error of each run for \
        a given iteration, using logarithmic scale.")
开发者ID:BackupTheBerlios,项目名称:ometah,代码行数:10,代码来源:iteration_all_value_median_logarithmic.py

示例12: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self,data):
        # call the plugin basic initializations
        Plugin.__init__(self,data)

        # set the name of your plugin
        self.setName("end_optimum_value_successrate",
        "Plot the graph of success rates, considering a Test as a success when \
        the given precision of the problem is reached.")
开发者ID:BackupTheBerlios,项目名称:ometah,代码行数:10,代码来源:end_optimum_value_successrate.py

示例13: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self, plugin_name, config=None, object_group=None):
        Thread.__init__(self, name=plugin_name)
        Plugin.__init__(self, config=config, object_group=object_group, plugin_name=plugin_name)

        self._run_lock    = Lock()
        self._running     = False
        self.logger       = logging.getLogger('allspark.' + plugin_name)
        self.daemon       = True  # thread dies with program
开发者ID:lemontongs,项目名称:AllSpark,代码行数:10,代码来源:thread_base.py

示例14: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self, session_str, fps, img_shape, shared_record, eye_tx):
        Plugin.__init__(self)
        self.session_str = session_str
        self.base_path = os.path.join(os.path.abspath(__file__).rsplit('pupil_src', 1)[0], "recordings")
        self.shared_record = shared_record
        self.frame_count = 0
        self.timestamps = []
        self.eye_tx = eye_tx

        self.start_time = time()
        # set up base folder called "recordings"
        try:
            os.mkdir(self.base_path)
        except:
            print "recordings folder already exists, using existing."

        session = os.path.join(self.base_path, self.session_str)
        try:
            os.mkdir(session)
        except:
            print "recordings session folder already exists, using existing."

        # set up self incrementing folder within session folder
        counter = 0
        while True:
            self.path = os.path.join(self.base_path, session, "%03d/" % counter)
            try:
                os.mkdir(self.path)
                break
            except:
                print "We dont want to overwrite data, incrementing counter & trying to make new data folder"
                counter += 1

        self.meta_info_path = os.path.join(self.path, "info.csv")

        with open(self.meta_info_path, 'w') as f:
            f.write("Pupil Recording Name:\t"+self.session_str+ "\n")
            f.write("Start Date: \t"+ strftime("%d.%m.%Y", localtime(self.start_time))+ "\n")
            f.write("Start Time: \t"+ strftime("%H:%M:%S", localtime(self.start_time))+ "\n")



        video_path = os.path.join(self.path, "world.avi")
        self.writer = cv2.VideoWriter(video_path, cv2.cv.CV_FOURCC(*'DIVX'), fps, (img_shape[1], img_shape[0]))
        self.height = img_shape[0]
        self.width = img_shape[1]
        # positions path to eye process
        self.shared_record.value = True
        self.eye_tx.send(self.path)

        atb_pos = (10, 540)
        self._bar = atb.Bar(name = self.__class__.__name__, label='REC: '+session_str,
            help="capture recording control", color=(220, 0, 0), alpha=150,
            text='light', position=atb_pos,refresh=.3, size=(300, 80))
        self._bar.rec_name = create_string_buffer(512)
        self._bar.add_var("rec time",self._bar.rec_name, getter=lambda: create_string_buffer(self.get_rec_time_str(),512), readonly=True)
        self._bar.add_button("stop", self.stop_and_destruct, key="s", help="stop recording")
        self._bar.define("contained=true")
开发者ID:Flavsditz,项目名称:projects,代码行数:60,代码来源:recorder.py

示例15: __init__

# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import __init__ [as 别名]
    def __init__(self,data):
        # call the plugin basic initializations
        Plugin.__init__(self,data)

        # set the name of your plugin
        self.setName("end_optimum_solution_points","Plot optima and the optimum in their neighborhood plan, PCA used if dimension > 2")
        
        # eigen vectors weight for the tests
        self.__eigenv = []
开发者ID:BackupTheBerlios,项目名称:ometah,代码行数:11,代码来源:end_optimum_solution_points.py


注:本文中的plugin.Plugin.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。