def __init__(self, position, size, line_width=2, **kw): Stimulus.__init__(self, **kw) ul = (position[0] - size[0] / 2., position[1]) add = lambda a, b: map(operator.add, a, b) self._vertices = [[ul[0], ul[1], 0], [ul[0] + size[0], ul[1], 0], [ul[0] + size[0], ul[1] + size[1], 0], [ul[0], ul[1] + size[1], 0]] self._color = Color('red') self._gl_color = gl.glColor3f if len(self._color) == 3 else gl.glColor4f self._line_width = line_width
class Panel: """Information for a panel in the grid """ def __init__(self, position, size, coords, on=0, label=''): """Accept a position, size, and label for each panel, and infer some other measurements """ self.position = position self.size = size self.coords = coords self.label = label self.stimulus = Stimulus() self.left = position[0] self.bottom = position[1] self.width = size[0] self.height = size[1] self.right = self.left + self.width self.top = self.bottom + self.height self.center = (self.left + self.width / 2, self.bottom + self.height / 2) def draw(self, t=None): """Draw the stimulus Arguments: - `self`: """ self.stimulus.draw() def turn_on(self, t=None): """Set stimulus.on to 1 if it exists """ try: self.stimulus.on = 1 except: pass def turn_off(self, t=None): """Set stimulus.on to 0 if it exists Arguments: - `self`: """ try: self.stimulus.off = 0 except: pass
class Panel: """Information for a panel in the grid """ def __init__(self, position, size, coords, on = 0, label = ''): """Accept a position, size, and label for each panel, and infer some other measurements """ self.position = position self.size = size self.coords = coords self.label = label self.stimulus = Stimulus() self.left = position[0] self.bottom = position[1] self.width = size[0] self.height = size[1] self.right = self.left + self.width self.top = self.bottom + self.height self.center = (self.left + self.width/2, self.bottom + self.height/2) def draw(self, t = None): """Draw the stimulus Arguments: - `self`: """ self.stimulus.draw() def turn_on(self, t = None): """Set stimulus.on to 1 if it exists """ try: self.stimulus.on = 1 except: pass def turn_off(self, t = None): """Set stimulus.on to 0 if it exists Arguments: - `self`: """ try: self.stimulus.off = 0 except: pass
def __init__(self, position, size, coords, on=0, label=''): """Accept a position, size, and label for each panel, and infer some other measurements """ self.position = position self.size = size self.coords = coords self.label = label self.stimulus = Stimulus() self.left = position[0] self.bottom = position[1] self.width = size[0] self.height = size[1] self.right = self.left + self.width self.top = self.bottom + self.height self.center = (self.left + self.width / 2, self.bottom + self.height / 2)
def __init__(self, position, size, coords, on = 0, label = ''): """Accept a position, size, and label for each panel, and infer some other measurements """ self.position = position self.size = size self.coords = coords self.label = label self.stimulus = Stimulus() self.left = position[0] self.bottom = position[1] self.width = size[0] self.height = size[1] self.right = self.left + self.width self.top = self.bottom + self.height self.center = (self.left + self.width/2, self.bottom + self.height/2)
def __init__(self, checksPerCall=25, sleepPerCheck=0.01, **kw): Stimulus.__init__(self, **kw) self.checksPerCall = checksPerCall self.sleepPerCheck = sleepPerCheck
def __init__(self, **kw): Stimulus.__init__(self, **kw) self.parameters.colorindex = np.zeros(self.parameters.grid) self.parameters.colorindex.fill(0.5)
def __init__(self,**kw): Stimulus.__init__(self,**kw) self.parameters.colorindex = np.zeros(self.parameters.grid) self.parameters.colorindex.fill(0.5)