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


Python Object.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
    def __init__(self):
        Object.__init__(self)
        config = CNCConfig()
        self.units = config.ReadFloat("ProgramUnits", 1.0)  # set to 25.4 for inches
        self.alternative_machines_file = config.Read("ProgramAlternativeMachinesFile", "")
        self.raw_material = RawMaterial()  # // for material hardness - to determine feeds and speeds.
        machine_name = config.Read("ProgramMachine", "emc2b")
        self.machine = self.GetMachine(machine_name)
        import wx

        default_output_file = (wx.StandardPaths.Get().GetTempDir() + "/test.tap").replace("\\", "/")
        self.output_file = config.Read(
            "ProgramOutputFile", default_output_file
        )  #  // NOTE: Only relevant if the filename does NOT follow the data file's name.
        self.output_file_name_follows_data_file_name = config.ReadBool(
            "OutputFileNameFollowsDataFileName", True
        )  #    // Just change the extension to determine the NC file name
        self.python_program = ""
        self.path_control_mode = config.ReadInt("ProgramPathControlMode", PATH_CONTROL_UNDEFINED)
        self.motion_blending_tolerance = config.ReadFloat(
            "ProgramMotionBlendingTolerance", 0.0
        )  # Only valid if m_path_control_mode == eBestPossibleSpeed
        self.naive_cam_tolerance = config.ReadFloat(
            "ProgramNaiveCamTolerance", 0.0
        )  # Only valid if m_path_control_mode == eBestPossibleSpeed
开发者ID:cyplo,项目名称:heekscnc,代码行数:27,代码来源:Program.py

示例2: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
    def __init__(self, whichType, position = None, velocity = None, acceleration = None, flipped = False, projectile = False):
        """
        Creates a basic Entity of a specific type.
        """
        Object.__init__(self, whichType, position, flipped = flipped)
        Entity.Entities.append(self)
        Object.Objects.pop(-1)
        
        #Collision
        self.collideState = None
        self.collidingLeft,self.collidingRight,self.collidingTop,self.collidingBottom = [False] * 4

        #Physics
        self.acceleration = acceleration
        if acceleration == None:
            self.acceleration = Vector()
        self.velocity = velocity
        if velocity == None:
            self.velocity = Vector()
        
        self.wallSliding = False
        self.slidingSide = None

        self.projectile = projectile
        self.destroy = False
开发者ID:Darthfett,项目名称:Jetpack-Man,代码行数:27,代码来源:Entity.py

示例3: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
    def __init__(self, name = '' ):
        Object.__init__( self, name )
        
        # Electrical Stuff
        self.port_dict   = {}
        self.net_dict    = {}
        self.inst_dict   = {}
        self.param_dict  = {}

        self.port_name_list = []
开发者ID:Harnesser,项目名称:wxDebuggy,代码行数:12,代码来源:Module.py

示例4: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
    def __init__(self, name = '', module_ref_name = '' ):

        Object.__init__( self, name ) 

        # Electrical Stuff
        self.module_ref_name = module_ref_name # String
        self.module_ref = None # vv.Module Instance
        self.port_dict  = {}
        self.param_dict = {}

        # Derived Electrical Stuff
        self.num_inputs  = 0
        self.num_outputs = 0
开发者ID:Harnesser,项目名称:wxDebuggy,代码行数:15,代码来源:Instance.py

示例5: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
	def __init__(self, path=None):
		"""Sets up and starts the `AppServer`.

		`path` is the working directory for the AppServer
		(directory in which AppServer is contained, by default)

		This method loads plugins, creates the Application object,
		and starts the request handling loop.

		"""
		self._running = 0
		self._startTime = time.time()

		global globalAppServer
		if globalAppServer:
			raise ProcessRunning('More than one AppServer'
				' or __init__() invoked more than once.')
		globalAppServer = self

		# Set up the import manager:
		self._imp = ImportManager()

		ConfigurableForServerSidePath.__init__(self)
		Object.__init__(self)
		if path is None:
			path = os.path.dirname(__file__) # os.getcwd()
		self._serverSidePath = os.path.abspath(path)
		self._webKitPath = os.path.abspath(os.path.dirname(__file__))
		self._webwarePath = os.path.dirname(self._webKitPath)

		self.recordPID()

		self._verbose = self.setting('Verbose')
		self._plugIns = []
		self._requestID = 0

		self.checkForInstall()
		self.config() # cache the config
		self.printStartUpMessage()
		sys.setcheckinterval(self.setting('CheckInterval'))
		self._app = self.createApplication()
		self.loadPlugIns()

		# @@ 2003-03 ib: shouldn't this just be in a subclass's __init__?
		if self.isPersistent():
			self._closeEvent = Event()
			self._closeThread = Thread(target=self.closeThread,
				name="CloseThread")
			# self._closeThread.setDaemon(1)
			self._closeThread.start()
		self._running = 1
开发者ID:akkmzack,项目名称:RIOS-8.5,代码行数:53,代码来源:AppServer.py

示例6: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
    def __init__(self, warehouse, uid, action_topic, cmd_vel_topic, scan_topic, odom_topic, amcl_topic, vision_topic, tf_prefix, robot_description):
        Agent.__init__(self, warehouse, uid, action_topic)
        Object.__init__(self, uid, shapely.geometry.Point(tuple(robot_description['pos'])), shapely.geometry.Polygon([tuple(v) for v in robot_description['footprint']]))
        Vessel.__init__(self, uid)
        self.orientation = 0 #radian
        rospy.Subscriber(cmd_vel_topic, geometry_msgs.msg.Twist, self.cmd_vel_handler)

        self.robot_description = robot_description
        
        if scan_topic:
            self.scan_pub = rospy.Publisher(scan_topic, sensor_msgs.msg.LaserScan)
            self.scan_data = sensor_msgs.msg.LaserScan()
            self.scan_data.header.frame_id = tf_prefix + '/base_link'
            self.scan_data.angle_min = self.robot_description['laser_angle_min']
            self.scan_data.angle_max = self.robot_description['laser_angle_max']
            self.scan_data.angle_increment = self.robot_description['laser_angle_increment']
            self.scan_data.range_min = self.robot_description['laser_range_min']
            self.scan_data.range_max = self.robot_description['laser_range_max']
        else:
            self.scan_pub = None
        if odom_topic:
            self.odom_pub = rospy.Publisher(odom_topic, nav_msgs.msg.Odometry)
            self.odom_broadcaster = tf.TransformBroadcaster()
            self.odom_data = nav_msgs.msg.Odometry()
            self.odom_data.header.frame_id = tf_prefix + '/odom'
            self.odom_data.child_frame_id = tf_prefix + '/base_link'
            self.init_pos = self.pos
            self.init_orientation = self.orientation
            self.init_time = rospy.Time.now()
        else:
            self.odom_pub = None
        if amcl_topic:
            self.amcl_pub = rospy.Publisher(amcl_topic, geometry_msgs.msg.PoseWithCovarianceStamped)
            self.amcl_data = geometry_msgs.msg.PoseWithCovarianceStamped()
            self.amcl_data.header.frame_id = '/map'
        else:
            self.amcl_pub = None
        self.vision_pub = rospy.Publisher(vision_topic, warehouse_simulator.msg.AbstractVision)
        
        for command in self.robot_description['actions'].keys():
            self.add_command(command)
        self.add_command('vel')
        
        self.battery = Battery(self.robot_description['battery_max_quantity'], self.robot_description['battery_max_quantity'], self.robot_description['battery_recharge_rate'])
        self.vel = geometry_msgs.msg.Twist()
        self.vel_odom = geometry_msgs.msg.Twist()
        self.vel_target = geometry_msgs.msg.Twist()
        
        self.broken = False
开发者ID:windywinter,项目名称:warehouse_simulator,代码行数:51,代码来源:Agent.py

示例7: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
	def __init__(self, sequence, \
			id, subtype, name, \
			desc, \
			parent, \
			contains, \
			modify_time, \
			*args, **kw):
		Object.__init__(self, sequence, id, subtype, name, desc, parent, contains, modify_time)

		assert subtype == self.subtype, "Type %s does not match this class %s" % (subtype, self.__class__)

		if len(self.properties) != len(args):
			raise TypeError("The args where not correct, they should be of length %s" % len(self.properties))

		for property, arg in zip(self.properties, args):
			self.length += property.length(arg)
			setattr(self, property.name, arg)
开发者ID:jmingtan,项目名称:tpclient-ogre,代码行数:19,代码来源:ObjectDesc.py

示例8: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
    def __init__(self,
                 name ='',
                 nettype = 'wire',
                 msb = 0,
                 lsb = 0
                 ):
        
        Object.__init__( self, name )
        
        self.nettype = nettype
        self.msb = msb
        self.lsb = lsb
        self.size = 0
        self.sigtype = 'normal' # or 'clock' or 'reset' - should be an enumneration
        self.module_ref  = None

        self.Calc_Size()
开发者ID:Harnesser,项目名称:wxDebuggy,代码行数:19,代码来源:Net.py

示例9: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
	def __init__(self, server, useSessionSweeper=1):
		"""Called only by `AppServer`, sets up the Application."""

		self._server = server
		self._serverSidePath = server.serverSidePath()

		self._imp = server._imp # the import manager

		ConfigurableForServerSidePath.__init__(self)
		Object.__init__(self)

		print 'Initializing Application...'
		print 'Current directory:', os.getcwd()

		if self.setting('PrintConfigAtStartUp'):
			self.printConfig()

		self.initVersions()
		self.initErrorPage()

		self._shutDownHandlers = []

		# Initialize TaskManager:
		if self._server.isPersistent():
			from TaskKit.Scheduler import Scheduler
			self._taskManager = Scheduler(1)
			self._taskManager.start()
		else:
			self._taskManager = None

		# Define this before initializing URLParser, so that contexts have a
		# chance to override this. Also be sure to define it before loading the
		# sessions, in case the loading of the sessions causes an exception.
		self._exceptionHandlerClass = ExceptionHandler

		self.initSessions()
		self.makeDirs()

		URLParser.initApp(self)
		self._rootURLParser = URLParser.ContextParser(self)

		self._running = 1

		if useSessionSweeper:
			self.startSessionSweeper()
开发者ID:akkmzack,项目名称:RIOS-8.5,代码行数:47,代码来源:Application.py

示例10: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
    def __init__(self, texture, frame_x = 1, frame_y = 1, clickable = False):
        Object.__init__(self, texture)
        self.position = (0, 0)

        self.frame_size = (1/float(frame_x), 1/float(frame_y))
        self.rect = (0, 0, self.frame_size[0], self.frame_size[1])
        self.pixel_size = (self.texture.pixel_size[0]/frame_x,
                           self.texture.pixel_size[1]/frame_y)

        self.width, self.height = self.pixel_size
        self.size = (self.width, self.height)

        self.frames = [frame_x, frame_y]
        self.current_frame = (frame_x, frame_y)
        self.reverse_animation = False

        if clickable:
            ImageObject.clickables.append(self)

        self.create_arrays()
开发者ID:dujodujo,项目名称:lemur,代码行数:22,代码来源:ImageObject.py

示例11: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
 def __init__(self, guid):
     Object.__init__(self, guid)
开发者ID:atrevorhess,项目名称:RhinoPy,代码行数:4,代码来源:Plane.py

示例12: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
 def __init__(self, name="Toon"):
     Object.__init__(self, name)
     self.setModel(ActorToon("neutral", False))
开发者ID:MrPieGuy1234,项目名称:ToonvillePrototype,代码行数:5,代码来源:Toon.py

示例13: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
    def __init__(self, texture, length):
        Object.__init__(self, texture)

        self.length = length
        self.position = (0, 0)
        self.create_arrays()
开发者ID:dujodujo,项目名称:lemur,代码行数:8,代码来源:BarObject.py

示例14: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
 def __init__(self,x,y):
     Object.__init__(self,x,y,POWERUP_RADIUS)
     self._color = (0,0,0)
     self._timer = 10
     self._type = 'BASIC'
开发者ID:tc30nguyen,项目名称:pyShotGame,代码行数:7,代码来源:powerup.py

示例15: __init__

# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
 def __init__(self):
     Object.__init__(self)
     self.active = True
     self.comment = ''
     self.title = self.TypeName()
     self.tool_number = 0
开发者ID:DavidNicholls,项目名称:heekscnc,代码行数:8,代码来源:Operation.py


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