示例#1
0
 def __init__(self, par, topleft):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Led.png"))).convert()
     self.aan = pygame.image.load(
         resource_path(os.path.join("Items", "Ledaan.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.inA = ValueField(self, LOW, (16, 24))
     self.ins = [self.inA]
示例#2
0
 def __init__(self, par, value, topleft, countid="None"):
     self.countid = eval(countid)
     self.value = value
     self.aan = pygame.image.load(
         resource_path(os.path.join("Items", "WaardevakjeAan.png")))
     self.uit = pygame.image.load(
         resource_path(os.path.join("Items", "WaardevakjeUit.png")))
     tmp_rect = self.uit.get_rect()
     tmp_rect.topleft = topleft
     self.par = par
     self.id = self.par.par.idgen.next()
     self.surf = self.par.surf.subsurface(tmp_rect)
     self.topleft = topleft
     self.refresh()
示例#3
0
 def __init__(self, par, topleft):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Invertor.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.inA = ValueField(self, LOW, (8, 48))
     self.out = ValueField(self, HIGH, (144, 48))
     self.ins = [self.inA]
     self.outs = [self.out]
示例#4
0
 def __init__(self, par, topleft):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Drukknop.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.out = ValueField(self, LOW, (160, 24))
     self.inA = ButtonValue(self, LOW, (16, 24))
     self.outs = [self.out]
     self.ins = [self.inA]
示例#5
0
 def __init__(self, par, topleft=(0, 0)):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Transistor.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.out = AnalogValue(self, 5.0, (145, 25))
     self.inA = AnalogValue(self, 0.0, (9, 25))
     self.ins = [self.inA]
     self.outs = [self.out]
     self.refresh()
示例#6
0
 def __init__(self, par, topleft):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Ofpoort.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.inA = ValueField(self, LOW, (8, 24))
     self.inB = ValueField(self, LOW, (8, 72))
     self.out = ValueField(self, LOW, (144, 48))
     self.ins = [self.inA, self.inB]
     self.outs = [self.out]
示例#7
0
 def __init__(self, par, topleft, inA="None", inB="None", out="None"):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Geheugencel.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.inA = eval(inA) or ValueField(self, LOW, (8, 24))
     self.inB = eval(inB) or ValueField(self, LOW, (8, 72))
     self.out = eval(out) or ValueField(self, LOW, (144, 48))
     self.ins = [self.inA, self.inB]
     self.outs = [self.out]
示例#8
0
 def __init__(self, par, topleft=(0, 0)):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Sensor.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.out = AnalogValue(self, 0.0, (161, 41))
     self.inA = Slider(self, 2.5, (12, 41))
     self.ins = [self.inA]
     self.outs = [self.out]
     self.lasttextrect = (2, 2, 1, 1)
     self.refresh()
示例#9
0
 def __init__(self, par, topleft):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Comperator.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.out = ValueField(self, LOW, (144, 24))
     self.inA = AnalogValue(self, 0.0, (9, 25))
     self.inB = Slider(self, 2.5, (50, 74))
     self.ins = [self.inA, self.inB]
     self.outs = [self.out]
     self.lasttextrect = (2, 2, 1, 1)
     self.refresh()
示例#10
0
 def __init__(self, par, topleft, id=1):
     self.id = id
     self.im = pygame.image.load(
         resource_path(os.path.join("Items",
                                    "Pulsgenerator.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.inA = Slider(self, 1, (12, 24), mini=1, maxi=10)
     self.out = ValueField(self, LOW, (160, 24), countid=str(self.id))
     self.ins = [self.inA]
     self.outs = [self.out]
     self.lasttextrect = (2, 2, 1, 1)
     self.refresh()
示例#11
0
 def __init__(self, par, topleft):
     self.counter = 0
     self.previous_high = False
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Teller.png"))).convert()
     BordItem.__init__(self, par, topleft)
     self.inA = ValueField(self, LOW, (16, 16))
     self.inB = OnOffButtonValue(self, LOW, (16, 48))
     self.inC = ValueField(self, LOW, (16, 80))
     self.inD = ButtonValue(self, LOW, (149, 80))
     self.ins = [self.inA, self.inB, self.inC, self.inD]
     self.outA = ValueField(self, LOW, (304, 16))
     self.outB = ValueField(self, LOW, (272, 16))
     self.outC = ValueField(self, LOW, (240, 16))
     self.outD = ValueField(self, LOW, (208, 16))
     self.outs = [self.outA, self.outB, self.outC, self.outD]
     self.lasttextrect = (2, 2, 1, 1)
     self.refresh()
示例#12
0
 def __init__(self, par, value, topleft, width=115, mini=0.0, maxi=5.0):
     self.value = value
     self.width = width
     self.mini = mini
     self.maxi = maxi
     self.par = par
     self.id = self.par.par.idgen.next()
     self.topleft = topleft
     self.im = pygame.image.load(
         resource_path(os.path.join("Items",
                                    "Sliderachtergrond.png"))).convert()
     self.button = pygame.Surface((15, 15))
     self.button.fill(BLUE)
     self.image_rect = self.im.get_rect()
     self.image_rect.width = width
     self.im.set_clip(self.image_rect)
     self.image_rect.topleft = self.topleft
     self.surf = self.par.surf.subsurface(self.image_rect)
     self.cur_pos = None
     self.tmp_button = None
     self.refresh()
示例#13
0
 def __init__(self, par, topleft):
     self.im = pygame.image.load(
         resource_path(os.path.join("Items", "Uitleg.png"))).convert()
     BordItem.__init__(self, par, topleft)