Пример #1
0
    def __init__(self, parent = None):
        Component.__init__(self, parent)
        self.vertical = False

        # range
        self.__valueStart = 0
        self.__valueEnd = 1
        
        # value
        self.__value = 0
        
        # snap
        self.snap = 0
                
        # thumb
        self.thumb = Thumb(self)
        self.bindData('gamma', self.thumb, 'gamma', dir = '->')
        self._thumbStartAnim = koan.anim.AnimTarget('decay', 0, 0, 0, self)
        self.thumbImage = ''
        self.thumbEffect = None
        #self.bindData('thumbImage', self.thumb, 'background')
        self.autoDirty( ['thumbImage'] )

        # drag / drop thumb
        # self.changeEvent('snap', self.__updateValue)
        self.autoRemove( self.thumb.bind('Capture Begin', self.onSlideStart) )
        self.autoRemove( self.thumb.bind('Capture Offset', self.onSlideMove) )
        self.autoRemove( self.thumb.bind('Capture End', self.onSlideStop) )
        # click to
        self.bind('Mouse Down', self.onSlideTo)

        self.__updateThumbSize()
        self.bind('Size Change', self.__updateThumbSize)
Пример #2
0
 def __init__(self, scheme = 'axisymmetric', **kwargs):
     # Initialize scheme-dependent attributes
     if scheme not in ['axisymmetric','two_column']:
         raise ValueError,'\n \n ++++ CliMT.dynamics: Scheme %s unknown' % scheme
     exec('self.__%s_dynamics__init__()' % string.lower(scheme))
     # Initialize fields etc. 
     Component.__init__(self, **kwargs)
Пример #3
0
 def __init__(self, dData):
     Component.__init__(self, "BOX:%s"%(dData['componentID']), False, 1)
     self._box = sf.RectangleShape((int(dData['width']),int(dData['height'])))
     self._box.position = (int(dData['x']),int(dData['y']))
     self._box.fill_color = sf.Color.WHITE
     self._box.outline_color = sf.Color.RED
     self._box.outline_thickness = 3.0
 def __init__(self):
     Component.__init__(self)
     self.tailNodes = []
     self.previousHeadX = 1
     self.previousHeadY = 1
     self.tailIndex = 0
     self.addNodeOnUpdate = False
Пример #5
0
    def __init__(self, parent=None):
        Component.__init__(self, parent)
        CaptureObject.__init__(self)
        self.vertical = True

        self.autoHide = False
        self.setRange(100, 10)
        self.changeEvent("autoHide", self.__fixVisible)
        self.changeEvent("fullSize", self.__fixVisible)
        self.changeEvent("viewSize", self.__fixVisible)

        self.__offset = 0  # 0 ~ 1
        self.thumbEffect = None
        self.thumbMinSize = 50
        self.thumbImage = ""
        self.isMouseOverThumb = False
        self.capture = False

        self.autoDirty(["viewSize", "fullSize", "thumbImage"])
        self.changeEvent("fullSize", self.__fixScroll)
        self.changeEvent("viewSize", self.__fixScroll)

        self.bind("Capture Begin", self.__onBeginScroll, postevent=False)
        self.bind("Capture Offset", self.__onScroll, postevent=False)
        self.bind("Capture End", self.__onEndScroll, postevent=False)
        self.bind("Mouse Move", self.__onMouseMove)
        self.bind("Mouse Leave", setattr, self, "isMouseOverThumb", False)
        self.__thumbStartAnim = koan.anim.AnimTarget("decay", 0, 0, 0, self)
Пример #6
0
    def __init__(self, parent = None):        
        Component.__init__(self, parent)
        TextBase.__init__(self)
        self.vscroll = False
        self.hscroll = False
        self.maxlen = -1
        self.bgColor = color.white

        self.margin = (2, 2, 2, 2)
        self.bind('Mouse Down', koan.action.PureAction(self.setFocus))

        self.__edit = koan.platform.CreateEdit(callback = self.callback)
        self.changeEvent('text', self.__onTextChanged, sync = False)
        self.changeEvent('text', self.invoke, 'Value Change', self)
        self.changeEvent('align', self.__onEditStyleChange)
        self.changeEvent('vscroll', self.__onEditStyleChange)
        self.changeEvent('hscroll', self.__onEditStyleChange)
        self.changeEvent('maxlen', self.__onEditMaxlenChange, sync = False)
        
        # font
        self.changeEvent('font', self.__onFontChanged, sync = False)
        self.changeEvent('fontSize', self.__onFontChanged, sync = False)
        self.changeEvent('fontColor', self.__onFontColorChange, sync = False)
        self.changeEvent('bgColor', self.__onBgColorChange, sync = False)
        self.bind('Visible Change', self.__onEditVisibleChange)        
        self.bind('Size Change', self.__updateEditWndPos)
        self.bind('Position Change', self.__updateEditWndPos)
        self.bind('Parent Position Change', self.__updateEditWndPos)
        self.bind('Focus Change', self.__onEditVisibleChange)
        
        child = self
        while parent != None:
            child.autoRemove(parent.bind('Parent Position Change', child.invoke, 'Parent Position Change', postevent = False))
            child = parent
            parent = child.parent
Пример #7
0
    def __init__(self, transfer_func, transfer_func_params, time_const_RC,
                 time_const_output, debug=False):
        Component.__init__(self, transfer_func, transfer_func_params,
                           0, time_const_output, debug)

        self.time_const_RC = time_const_RC
        self.input_pre = 0
Пример #8
0
    def __init__(self, parent = None, longFormat = False):        
        Component.__init__(self, parent)
        TextBase.__init__(self)

        self.iPlatform = subsys.GetLatestInterface('IPlatform')
        self.date = 2007, 1, 1
        self.margin = (2, 2, 2, 2)
        self.longFormat = longFormat
        self.bind('Mouse Down', koan.action.PureAction(self.setFocus))

        self.__datePicker = koan.platform.CreateDatePicker(callback = self.callback, longFormat = self.longFormat)
        self.window._window.AttachChild2( self.__datePicker.GetHWND() )

        #self.__datePicker.Show( False )
        self.changeEvent('text', self.invoke, 'Value Change', self)
        self.changeEvent('date', self.__onDateChange)
        self.changeEvent('font', self.__onFontChanged, sync = False)
        self.changeEvent('fontSize', self.__onFontChanged, sync = False)
        #koan.anim.Execute(0.3, self.__datePicker.Show, True)
        
        # font
        self.bind('Visible Change', self.__onEditVisibleChange)        
        self.bind('Size Change', self.__updateEditWndPos)
        self.bind('Position Change', self.__updateEditWndPos)
        self.bind('Parent Position Change', self.__updateEditWndPos)
        self.bind('Focus Change', self.__onEditVisibleChange)
        
        child = self
        while parent != None:
            child.autoRemove(parent.bind('Parent Position Change', child.invoke, 'Parent Position Change', postevent = False))
            child = parent
            parent = child.parent
Пример #9
0
    def __init__(self, dData):   #sComponentID, textureGrid, fDelay, iFrameWidth, iFrameHeight, iFramesWide, iFramesHigh):
        Component.__init__(self, "ANIMATION:%s"%(dData['componentID']), True, 2)

        #This animation starts off as inactive and will await a trigger from a system function
        self._bActive = False

        #This will denote the time in-between each frame of the animation in the textureGrid.
        self._fDelay = dData['delay']

        #This will tell us when it is time to update the frame.
        self._fAnim_Time = 0.0

        #The current frame on the texture grid (top-left)
        self._iCurrent_Frame = [0,0]

        #The texture grid details
        self._iFrame_Width = dData['frameWidth']
        self._iFrame_Height = dData['frameHeight']
        self._iFrames_Wide = dData['framesWide']
        self._iFrames_High = dData['framesHigh']

        #This holds the texture for the animation!
        self._Animation_Sprite = sf.Sprite(dData['Texture'][0])

        self._Animation_Sprite.set_texture_rect(sf.IntRect(0,0,self._iFrame_Width, self._iFrame_Height))
Пример #10
0
 def __init__(self, parent):
     Component.__init__(self, parent)
     TextBase.__init__(self)
     CheckBase.__init__(self)
     TipBase.__init__(self)
     self.command = ''
     self.changeEvent('checked', self.__onCheckChanged, postevent = False)
Пример #11
0
    def __init__(self, scheme = 'hard', **kwargs):
        # Initialize scheme-dependent attributes
        try: exec('self.__%s__init__()' % string.lower(scheme))
        except: raise ValueError,'\n \n ++++ CliMT.convection: Scheme "%s" unknown' % scheme

        # Initialize fields etc. 
        Component.__init__(self, **kwargs)
Пример #12
0
    def __init__(self, scheme='slab', **kwargs):
        # Initialize scheme-dependent attributes
        if   scheme == 'slab': self.__slab__init__()
        else: raise ValueError,'\n \n ++++ CliMT.ocean: Scheme %s unknown' % scheme

        # Initialize parameters, grid, fields etc
        Component.__init__(self, **kwargs)
Пример #13
0
	def __init__(self):
		Component.__init__(self)
		self.output = O()
		self.x = 0
		self.y = 0
		self.width = 100
		self.height = 100
Пример #14
0
 def __init__(self, owner, playergroup, enemygroup):
     Component.__init__(self, owner)
     
     self.playergroup = playergroup
     self.enemygroup = enemygroup
     
     # All entity list
     self.entitylist = []
Пример #15
0
 def __init__(self, parent = None):
     Component.__init__(self, parent)
     self.stretch = 'Fill'
     self.tabStop = False
     #self.scalemode = 'Both'        #wpf: StretchDirection
     self.__scale = 1, 1
     self.__offset = 0, 0
     self.autoStretch(['stretch'], ['Size Change', 'Child Add', 'Child Size Change'])
Пример #16
0
    def __init__(self, scheme = 'simple', **kwargs):

        # Initialize scheme-dependent attributes
        try: exec('self.__%s__init__()' % string.lower(scheme))
        except: raise ValueError,'\n \n ++++ CliMT.turbulence: Scheme %s unknown' % scheme

        # Initialize parameters, grid, fields etc
        Component.__init__(self, **kwargs)
Пример #17
0
 def __init__(self, **traits):
     Component.__init__(self, **traits)
     self._update_component_view_bounds()
     if 'zoom_tool' not in traits:
         self.zoom_tool = ViewportZoomTool(self)
     if self.enable_zoom:
         self._enable_zoom_changed(False, True)
     return
Пример #18
0
    def __init__(self, cShape, cBody, dData):
        Component.__init__(self, "CSHAPE:%s"%(dData['componentID']), False, 0)

        self._sDependent_Comp_Name = dData["dependentComponentName"]

        self._cShape = cShape

        self._cBody = cBody
Пример #19
0
 def __init__(self, **traits):
     if v_width == 0:
         self._init_images()
     Component.__init__(self, **traits)
     self._scrolling = self._zone = NO_SCROLL
     self._line_up_suffix = self._line_down_suffix = self._slider_suffix = ''
     self._style_changed(self.style)
     return
Пример #20
0
    def __init__(self, scheme = 'ccm3', **kwargs):
        # Initialize scheme-dependent attributes
        if scheme in ['gray','grey','graygas']: scheme='greygas'
        if scheme not in ['greygas','chou','ccm3','cam3', 'rrtm']:
            raise ValueError,'\n \n ++++ CliMT.radiation: Scheme %s unknown' % scheme
        exec('self.__%s__init__()' % string.lower(scheme))

        # Initialize fields etc. 
        Component.__init__(self, **kwargs)
Пример #21
0
    def __init__(self, expression):
        """Class constructor 

        @param expression: the expression we want to grep
        @type expression: String
        @todo: Should handle regular expressions
        """
        Component.__init__(self)
        self.expression = expression
Пример #22
0
 def __init__(self, time_const_RC, time_const_output, debug=False):
     """
     Initializes a LowpassFilter-object.
     @param time_const_RC Time constant as in a electrical low-pass filter.
     @param dt Based on wikipedia's description of a low-pass filter, the
     time-step dt is required for the transfer function.
     """
     Component.__init__(self, identity, [], 0, time_const_output, debug)
     self.time_const_RC = time_const_RC
Пример #23
0
    def __init__(self, dData):
        Component.__init__(self, "MESH:%s"%(dData["componentID"]), False, 0)
        self._mesh = [ [] for layer in xrange(config.CHUNK_LAYERS) ]

        #This is for linking this mesh with a texture within the Asset_Manager.
        self._lTileAtlas = []

        for i in xrange(config.CHUNK_LAYERS):
            self._lTileAtlas.append(dData.get("TileAtlas"+str(i), None))
 def __init__(self):
     Component.__init__(self)
     self.controls = {
         b'M': messages.MOVE_RIGHT,
         b'K': messages.MOVE_LEFT,
         b'H': messages.MOVE_UP,
         b'P': messages.MOVE_DOWN,
         b'x': messages.ADD_NODE
     }
Пример #25
0
	def __init__(self, _id, _label, _cap, _device1, _device2):
		Component.__init__(self, _id, _label)
		self.compType = 'link'
		self.totalCap = _cap
		self.availableCapUp = 0
		self.availableCapDown = 0
		self.device1 = _device1
		self.device2 = _device2
		self.flows = []
Пример #26
0
    def __init__( self, dData ):
        Component.__init__(self, "TILE:%s"%(dData['componentID']), False, 0)
        #Tells whether or not the tile is visible or not
        self._is_Active = False

        #Identifies the type of tile that is drawn (denotes tile IDs on the tile_atlas.)
        self._tileID = 0

        self._isTransparanent = True
Пример #27
0
	def __init__(self, _id, _label, _isHost):
		Component.__init__(self, _id, _label)
		self.compType = 'device'
		self.isHost = _isHost
		self.VMs = 0
		if _isHost:
			self.VMs = 4
		self.availableVMs = self.VMs
		self.links = []
Пример #28
0
 def __init__(self, util, bounding_box=None, background=None, visible=True):
     """ Initializer
     
     :param util: utility object
     :param bounding_box: container bounding box
     :param background: container background color
     :param visible: visibility flag, True - visible, False - invisible
     """
     Component.__init__(self, util, bb=bounding_box, bgr=background, v=visible)
     self.components = list()
Пример #29
0
 def __init__(self, obj, strip, uwidth=None, uheight=None, sprite_count=None):
     Component.__init__(self, obj)
     Sprite.__init__(self, strip, uwidth, uheight, sprite_count)
     self.po = self.obj.get_component('position')
     self.ph = self.obj.get_component('physics')
     self.obj.rect = self.obj.image.get_rect()
     self.obj.rect.topleft = self.po.pos.components
     self.attach_event('update', self.update)
     self.attach_event('turn', self.turn)
     self.dir = 90
Пример #30
0
    def __init__(self, parent = None):
        Component.__init__(self, parent)
        CaptureObject.__init__(self)
        self.useGlobalCapture = True
        self.tabStop = False

        self.bind('Mouse Enter', self.onChangeCursor, True)
        self.bind('Mouse Leave', self.onChangeCursor, False)
        self.parent.autoRemove( self.bind('Capture Begin', self.parent.invoke, 'Splitter Start', self, posetevent = False) )
        self.parent.autoRemove( self.bind('Capture Offset', self.parent.invoke, 'Splitter Move', self, posetevent = False) )
 def __init__(self, services, config):
     Component.__init__(self, services, config)
Пример #32
0
 def __init__(self, name='VirtualConnection', pos=QPoint(0, 0)):
     Component.__init__(self, name, pos)
     self.compType = TYPE_CONN_VIRTUAL
     self.addTerminal('IN', 1, TERM.CONN, QPointF(0, 0))
Пример #33
0
 def __init__(self, services, config):
     Component.__init__(self, services, config)
     print 'Created %s' % (self.__class__)
Пример #34
0
 def __init__(self, **kwargs):
     Component.__init__(self, **kwargs)
Пример #35
0
 def __init__(self, services, config):
     print('test_componet: Construct')
     Component.__init__(self, services, config)
     self.running_tasks = {}
 def __init__(self, ID):
     Component.__init__(self, ID, 'end_field', None)
Пример #37
0
 def __init__(self, services, config):
     Component.__init__(self, services, config)
     self.firstTime = True
     self.curTime = -1.0
     self.prevTime = -1.0
     print 'Created %s' % (self.__class__)
Пример #38
0
 def __init__(self, **kwargs):
     self.name = "Make ROOT tree"
     Component.__init__(self, **kwargs)
Пример #39
0
 def __init__(self, services, config):
     print('parent_init: Construct')
     Component.__init__(self, services, config)
Пример #40
0
 def __init__(self, tag, class_name, id, content, href, rel, referrerpolicy, target):
     """Initialize instance of A class with tag, class_name, id, href, rel, referrerpolicy, and target properties"""
     Component.__init__(self, tag, class_name, id, content)
     Ref.__init__(self, href, rel, referrerpolicy)
     self.target = target
Пример #41
0
 def __init__(self, ID, reflistname):
     Component.__init__(self, ID, 'reference_list', None)
     self.REFERENCELISTNAME = reflistname
     self.REFERENCELIST = {}
Пример #42
0
 def __init__(self, services, config):
     #self.timer = pytau.profileTimer('XL_worker', "", str(os.getpid()))
     #pytau.start(self.timer)
     Component.__init__(self, services, config)
     print 'Created %s' % (self.__class__)
Пример #43
0
 def __init__(self, services, config):
     Component.__init__(self, services, config)
     self.eq_worker = {'sim_name': None, 'init': None, 'driver': None}
Пример #44
0
 def __init__(self, dData):
     Component.__init__(self, "POS:%s"%(dData['componentID']), False, 0)
     self._position = [int(dData['positionX']), int(dData['positionY'])]
Пример #45
0
 def __init__(self, **kwargs):
     Component.__init__(self, **kwargs)
     self.command = "stdhep_" + self.name
Пример #46
0
 def __init__(self, services, config):
     print('dakota_ips_to_namelist: Construct')
     Component.__init__(self, services, config)
Пример #47
0
 def __init__(self, services, config):
     print('template_driver: Construct')
     Component.__init__(self, services, config)
     self.running_components = {}
Пример #48
0
 def __init__(self, **kwargs):
     self.command = "java"
     Component.__init__(self, **kwargs)
Пример #49
0
 def __init__(*args, **kw):
     Component.__init__(*args, **kw)
Пример #50
0
 def __init__(self, services, config):
     print('template_init: Construct')
     Component.__init__(self, services, config)
Пример #51
0
 def __init__(self, **kwargs):
     self.command = "gunzip"
     self.name = "gunzip"
     Component.__init__(self, **kwargs)
Пример #52
0
 def __init__(self, name, command=None, **kwargs):
     Component.__init__(self,
                        name,
                        command=command,
                        description='',
                        **kwargs)
Пример #53
0
    def __init__(self,
                 name="ODEDynamics",
                 gravity=9.81,
                 substeps=1,
                 cfm=None,
                 erp=None,
                 defaultcontactproperties=None,
                 enabled=True,
                 show_contacts=False,
                 contactmarkersize=0.1,
                 contactnormalsize=1.0,
                 collision_events=False,
                 auto_add=False,
                 auto_insert=True):
        """Constructor.

        \param name (\c str) Component name
        \param auto_add (\c bool) Automatically add the world objects to the simulation
        \param auto_insert (\c bool) Automatically add the component to the scene
        """
        Component.__init__(self, name=name, auto_insert=auto_insert)

        scene = getScene()

        self.substeps = substeps
        self.collision_events = collision_events

        self.world = ode.World()
        g = -gravity * scene.up
        self.world.setGravity(g)
        if cfm != None:
            self.world.setCFM(cfm)
        if erp != None:
            self.world.setERP(erp)

#        self.world.setAutoDisableFlag(True)

        self.enabled = enabled

        self.eventmanager = eventManager()
        self.eventmanager.connect(STEP_FRAME, self)
        self.eventmanager.connect(RESET, self.reset)

        # Space object
        self.space = ode.Space()

        # Joint group for the contact joints
        self.contactgroup = ode.JointGroup()

        # A dictionary with WorldObjects as keys and ODEBodies as values
        self.body_dict = {}
        # A list of all bodies
        self.bodies = []
        # A list of all joints
        self.joints = []

        # A dictionary with contact properties
        # Key is a 2-tuple (material1, material2). Value is a
        # ODEContactProperties object.
        # The value of (mat1, mat2) should always be the same than
        # the value of (mat2, mat1).
        self.contactprops = {}

        # Default contact properties
        if defaultcontactproperties == None:
            defaultcontactproperties = ODEContactProperties()
        self.defaultcontactprops = defaultcontactproperties

        self.show_contacts = show_contacts
        self.contactmarkersize = contactmarkersize
        self.contactnormalsize = contactnormalsize

        # A list of weakrefs to body manipulators
        self.body_manips = []

        # Debug statistics (the number of contacts per simulation step)
        self.numcontacts = 0

        # Automatically add world objects
        if auto_add:
            # Add all rigid bodies first...
            for obj in scene.worldRoot().iterChilds():
                try:
                    obj = protocols.adapt(obj, IRigidBody)
                    self.add(obj)
                except NotImplementedError:
                    pass

            # Then add all joints...
            for obj in scene.worldRoot().iterChilds():
                if isinstance(obj, ODEJointBase):
                    self.add(obj)
Пример #54
0
 def __init__(self, s0_time):
     Component.__init__(self, s0_time)
     self.set_outputs("job", None)
     self.set_initial_state(Gen_SO(s0_time, self))
Пример #55
0
 def __init__(self, **kwargs):
     self.name = "Tar files"
     self.command = "python"
     Component.__init__(self, **kwargs)
Пример #56
0
 def __init__(self, **kwargs):
     self.name = "HPS DST Maker"
     self.command = "dst_maker"
     Component.__init__(self, **kwargs)
Пример #57
0
 def __init__(self):
     Component.__init__(self, 'menu')
     self.menus = [MainScreen(self.messageboard)]
     self.menus[-1].display()
Пример #58
0
 def __init__(self, **kwargs):
     self.command = "mv"
     self.name = "mv"
     Component.__init__(self, **kwargs)
 def __init__(self, operands, operators):
     Component.__init__(self, ID, 'expression', None)
     self.OPPERANDS = operands
     self.OPERATORS = operators
Пример #60
0
 def __init__(self, minevents=0, **kwargs):
     self.name = "lhe_count"
     self.minevents = minevents
     Component.__init__(self, **kwargs)