本文整理汇总了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
示例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
示例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 = []
示例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
示例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
示例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
示例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)
示例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()
示例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()
示例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()
示例11: __init__
# 需要导入模块: from Object import Object [as 别名]
# 或者: from Object.Object import __init__ [as 别名]
def __init__(self, guid):
Object.__init__(self, guid)
示例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))
示例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()
示例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'
示例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