Exemple #1
0
 def HWSetup(self):
     mimo.set_led_brightness(50)
     mimo.set_material_buttons_light([3, 255, 80, 80, 4, 80, 255, 80])
     mimo.set_material_buttons_mode([3, 1, 4, 1])
     mimo.set_material_buttons_lock_status(
         [0, 1, 1, 1, 2, 1, 5, 1, 6, 1, 7, 1])
     mimo.set_tunners_enable_status(False)
     mimo.set_buttons_enable_status(True, False)
Exemple #2
0
 def SetupMimo(self):
     mimo.set_led_brightness(150)
     mimo.set_buttons_enable_status(True, False)
     mimo.set_material_ligths_on([0,0, 1,0, 2,0, 3,0, 4,0, 5,0, 6,0, 7,0, 8,0, 9,0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, 26,0, 27,0])
     mimo.set_optimization_ligths_on([0,0, 1,0, 2,0, 3,0, 4,0])
 
     mimo.set_material_buttons_mode([0,1, 1,1, 2,1, 3,1, 4,1, 5,1, 6,0, 7,0])
     mimo.set_independent_lights(True, True)
     mimo.set_material_leds_color([7, 0xf7, 0x5a, 0xff])
Exemple #3
0
    def DisplayResults(self):
        self.popup_active = True
        performance_text = ""
        bonus_text = ""
        if constants.language == 'en':
            if self.score < 0.2:
                performance_text = "Optimization Shut Down"
                bonus_text = "-10 seconds"
            elif self.score < 0.4:
                performance_text = "Sluggish Performance"
                bonus_text = "Continue The Test"
            elif self.score < 0.6:
                performance_text = "Poor Execution"
                bonus_text = "Idleness Is Fatal Only To The Mediocre"
            elif self.score < 0.8:
                performance_text = "Broadcast Reach Enhanced"
                bonus_text = "10 seconds bonus"
            else:
                performance_text = "Edition Optimized!"
                bonus_text = "20 seconds bonus"
        elif constants.language == 'es':
            if self.score < 0.2:
                performance_text = "optimización detenida"
                bonus_text = "-10 segundos"
            elif self.score < 0.4:
                performance_text = "rendimiento lento"
                bonus_text = "continuar con la prueba"
            elif self.score < 0.6:
                performance_text = "mala ejecución"
                bonus_text = "la inactividad es fatal sólo para el mediocre"
            elif self.score < 0.8:
                performance_text = "alcance de transmisión aumentado"
                bonus_text = "10 segundos de bonificación"
            else:
                performance_text = "¡noticia optimizada!"
                bonus_text = "20 segundos de bonificación"
        self.popup_description.SetText(performance_text)
        self.bonus_text.SetText(bonus_text)

        mimo.set_buttons_enable_status(True, False)
        mimo.set_material_buttons_mode([6, 0])
        mimo.set_material_buttons_light([6, 0x27, 0xff, 0x93])
        mimo.set_material_buttons_active_status([6, 1])
Exemple #4
0
    def __init__(self):
        SceneBase.__init__(self)
        mimo.reset()

        self.logo = utils.Sprite('assets/sprites/logo_MCorp.png', 1280 / 2,
                                 720 / 2)
        self.logo.opacity = 0

        self.sfx_mimo_logo = utils.get_sound(
            'assets/audio/SFX/M_OS/UI_Booth.ogg')

        self.AddTween("easeInOutSine", 2, self.logo, "opacity", 0, 255, 1)
        self.AddTrigger(1, self.sfx_mimo_logo, 'play')

        # check ring and bulbs leds
        factor = 0.1
        loops = 50
        n_leds = 20
        leds = list(range(8, 28))
        for index in range(0, n_leds * loops):
            led_i = leds[index % n_leds]
            self.AddTrigger((1.5 + index) * factor, mimo,
                            'set_material_leds_color', [
                                led_i,
                                int(random.random() * 255),
                                int(random.random() * 255),
                                int(random.random() * 255)
                            ])
            self.AddTrigger((1.5 + index + 0.9) * factor, mimo,
                            'set_material_leds_color', [led_i, 0, 0, 0])

        # check buttons and backlight buttons.
        mimo.set_buttons_enable_status(True, True)
        mimo.set_independent_lights(False, False)
        mimo.set_led_brightness(120)
        mimo.set_material_buttons_lock_status(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0])
        mimo.set_material_buttons_mode(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0])
        mimo.set_optimization_buttons_lock_status(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0])
        mimo.set_optimization_buttons_mode([0, 0, 1, 0, 2, 0, 3, 0, 4, 0])

        # activate knobs
        mimo.set_tunners_enable_status(True)

        # create matrix sprite
        self.testSprite = AnimatedNeoSprite('assets/palomita.png')

        self.label = TextNeoSprite("people")
        self.label.y = 2

        font = pygame.font.Font("assets/fonts/VCR_OSD_MONO_1.001.ttf", 36)
        self.title = utils.Text("Hello Machinaria!", font)
        self.title.opacity = 0
        self.title.SetPosition(400, 200)
        self.AddTween("easeInOutSine", 2, self.title, "opacity", 0, 255, 1)

        # check lcd screens
        for index in range(0, 6):
            mimo.lcd_display_at(index, 'id' + str(index) + '- line 1', 1)
            mimo.lcd_display_at(index, 'id' + str(index) + '- line 2', 2)
Exemple #5
0
 def SetupMimo(self):
     mimo.set_led_brightness(150)
     mimo.set_buttons_enable_status(True, False)
     mimo.set_independent_lights(False, True)
     mimo.set_material_buttons_mode([0,0, 1,0, 2,0, 3,0, 4,0, 5,0, 6,0, 7,0])
     mimo.set_material_buttons_active_status([0,0, 1,0, 2,0, 3,0, 4,0, 5,0, 6,0, 7,0])
Exemple #6
0
    def __init__(self):
        SceneBase.__init__(self)
        mimo.reset()

        self.logo = utils.Sprite('assets/sprites/logo_MCorp.png', 1280 / 2,
                                 720 / 2)
        self.logo.opacity = 0

        self.sfx_mimo_logo = utils.get_sound('assets/audio/SFX/MimoLogo.ogg')

        self.AddTween("easeInOutSine", 2, self.logo, "opacity", 0, 255, 1)
        self.AddTrigger(1, self.sfx_mimo_logo, 'play')

        #self.comm.opt.set_led_brightness(50)
        #mimo.set_led_brightness(250)
        #self.comm.opt.lock_buttons([3, 0, 4, 0])
        #mimo.set_optimization_leds_color([0, 255, 0, 0])
        #mimo.set_optimization_leds_color([1, 0, 255, 0])
        #mimo.set_optimization_leds_color([2, 0, 0, 255])
        #mimo.set_optimization_leds_color([3, 255, 0, 0])
        #mimo.set_optimization_leds_color([4, 255, 255, 255])
        #mimo.set_independent_lights(False, True)
        #mimo.set_independent_lights(True, True)
        #mimo.set_buttons_enable_status(True, True)
        #mimo.set_optimization_buttons_lock_status([0,0,1,0,2,0,3,0,4,0])
        #mimo.set_material_buttons_lock_status([0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0])
        #mimo.set_tunners_enable_status(False)
        #mimo.set_optimization_leds_color([2, 255,0,255])
        #mimo.set_optimization_leds_color([5, 255,0,255])
        #mimo.set_optimization_leds_color([19, 255,0,255])
        #mimo.set_optimization_leds_color([27, 255,0,0])
        #mimo.set_optimization_leds_color([28, 255,255])
        #mimo.set_optimization_leds_color([29, 255,0,255])
        #mimo.set_optimization_leds_color([30, 255,0,255])
        factor = 0.05
        loops = 100
        n_leds = 64 + 5
        #for index in range(0, n_leds*loops):
        #    self.AddTrigger((1+index)*factor, mimo, 'set_optimization_leds_color', [index%n_leds, int(random.random()*255), int(random.random()*255), int(random.random()*255)])
        #    self.AddTrigger((1+index+0.9)*factor, mimo, 'set_optimization_leds_color', [index%n_leds, 0, 0, 0])

        n_leds = 64
        leds = list(range(0, 64))
        #for index in range(0, n_leds*loops):
        #    led_i = leds[index%n_leds] + 5
        #    self.AddTrigger((1.5+index)*factor, mimo, 'set_optimization_leds_color', [led_i, int(random.random()*255), int(random.random()*255), int(random.random()*255)])
        #    self.AddTrigger((1.5+index+0.9)*factor, mimo, 'set_optimization_leds_color', [led_i, 0, 0, 0])
        #self.comm.opt.activate_buttons(True)
        mimo.set_buttons_enable_status(True, True)
        mimo.set_independent_lights(False, False)
        mimo.set_led_brightness(250)
        mimo.set_material_buttons_lock_status(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0])
        mimo.set_material_buttons_mode(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0])
        mimo.set_optimization_buttons_lock_status(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0])
        mimo.set_optimization_buttons_mode([0, 0, 1, 0, 2, 0, 3, 0, 4, 0])
        #self.comm.opt.activate_tunners(False)
        #mimo.set_tunners_enable_status(False)
        #self.comm.opt.set_independent_lights(False)
        #self.comm.opt.clean_matrix()
        #graphics.clear()

        #self.AddTrigger(0, self.comm.mat, 'set_led_light', [1, 125, 125, 0, 1, 255, 255, 0])
        #self.AddTrigger(1, mimo, 'set_material_leds_color', [0, 125, 125, 0, 1, 255, 255, 0])
        #self.AddTrigger(2, self.comm.mat, 'set_led_light', [7, 0, 255, 0])
        #self.AddTrigger(2, mimo, 'set_material_leds_color', [7, 0, 255, 0])
        #self.AddTrigger(3, self.comm.opt, 'set_led_light', [0, 255, 0, 0])
        # debe prender el led del boton de  optimizacion 0
        #self.AddTrigger(3, mimo, 'set_optimization_leds_color', [10, 255, 0, 0])

        mimo.set_tunners_enable_status(True)
        #self.testSprite = AnimatedNeoSprite('assets/tilesprite.png')
        self.testSprite = AnimatedNeoSprite('assets/palomita.png')
        #self.testSprite.setFrameRate(8)
        #self.testSprite.playing = True
        self.label = TextNeoSprite("people")
        #
        self.label.y = 2
        #
        font = pygame.font.Font("assets/fonts/VCR_OSD_MONO_1.001.ttf", 36)
        self.title = utils.Text("Hello Machinaria!", font)
        self.title.opacity = 0
        self.title.SetPosition(400, 200)
        self.AddTween("easeInOutSine", 2, self.title, "opacity", 0, 255, 1)
Exemple #7
0
 def HWSetup(self):
     mimo.set_material_buttons_mode([0, 0, 1, 0, 2, 0, 5, 0, 6, 0, 7, 0])
     mimo.set_material_buttons_lock_status(
         [0, 1, 1, 1, 2, 1, 5, 1, 6, 1, 7, 1])