예제 #1
0
파일: servo.py 프로젝트: TLoebner/apbteam
 def __init__ (self, onto, model, coord = (0, 0), l = 1, start = 0,
         extent = pi / 2):
     Drawable.__init__ (self, onto)
     self.model = model
     self.coord = coord
     self.l = l
     self.start = start
     self.extent = extent
     self.model.register (self.__notified)
예제 #2
0
 def __init__ (self, onto, model):
     Drawable.__init__ (self, onto)
     self.model = model
     for e in model.corns:
         Corn (self, corn_attr[e.black], e)
     for e in model.tomatos:
         Tomato (self, dict (fill = RED), e)
     for e in model.oranges:
         Orange (self, dict (fill = ORANGE), e)
예제 #3
0
 def __init__ (self, onto, model):
     Drawable.__init__ (self, onto)
     self.model = model
     for e in self.model.coins:
         if e.level <= 2:
             Coin (self, e)
     for e in self.model.gold_bars:
         GoldBar (self, e)
     for e in self.model.coins:
         if e.level > 2:
             Coin (self, e)
예제 #4
0
 def __init__(self, onto, model):
     Drawable.__init__(self, onto)
     self.model = model
     for e in self.model.candles:
         Candle(self, e)
     for e in self.model.glasses:
         Glass(self, e)
     for e in self.model.plates:
         Plate(self, e)
     Cherries(self, self.model.cherries)
     for e in self.model.gifts:
         Gift(self, e)
예제 #5
0
파일: sorter.py 프로젝트: TLoebner/apbteam
 def __init__ (self, onto, sorter_model):
     Drawable.__init__ (self, onto)
     self.traps = [
             Servo (self, sorter_model.traps[0],
                 (-2.5, -1), 0.8, 0, pi/2),
             Servo (self, sorter_model.traps[1],
                 (-1.5, -0.9), 0.8, 0, pi/2),
             Servo (self, sorter_model.traps[2],
                 (-0.5, -0.8), 0.8, 0, pi/2),
             Servo (self, sorter_model.traps[3],
                 (0.5, -0.8), 0.8, pi, -pi/2),
             Servo (self, sorter_model.traps[4],
                 (1.5, -0.9), 0.8, pi, -pi/2),
             ]
     self.door = Servo (self, sorter_model.door,
             (-2.5, 1.3), 0.8, -pi/6, pi/3),
예제 #6
0
파일: clamp.py 프로젝트: TLoebner/apbteam
 def __init__ (self, onto, model):
     Drawable.__init__ (self, onto)
     self.model = model
     self.model.register (self.__notified)
예제 #7
0
 def __init__ (self, onto, model):
     Drawable.__init__ (self, onto)
     self.model = model
     self.model.register (self.__notified)
     self.door_model = model.elevator_door
     self.door_model.register (self.__door_notified)
예제 #8
0
파일: bridge.py 프로젝트: TLoebner/apbteam
 def __init__ (self, onto, model):
     Drawable.__init__ (self, onto)
     self.model = model
     self.model.register (self.update)
예제 #9
0
 def __init__ (self, onto, model):
     Drawable.__init__ (self, onto)
     self.model = model
     self.model.register (self.__notified)
     self.__colors = ('red', 'blue', 'green', 'yellow')
예제 #10
0
 def __init__ (self, onto, table_model):
     Drawable.__init__ (self, onto)
예제 #11
0
 def __init__ (self, onto, model):
     Drawable.__init__ (self, onto)
     self.model = model
     self.rays = [ ]
     for r in model.rays:
         self.rays.append (DistanceSensor (onto, r))
예제 #12
0
 def __init__ (self, onto, model):
     Drawable.__init__ (self, onto)
     self.model = model
     for p in model.pucks:
         Puck (self, puck_attr[p.color], p)
예제 #13
0
 def __init__ (self, onto):
     Drawable.__init__ (self, onto)
     self.table = Table ()
     self.a = (0, 0)
     self.b = (10, 10)
     self.result = None