Exemplo n.º 1
0
    def setup(self, all_sprites):
        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1b.png"),
                        layer=0)

        # panel text
        all_sprites.add(LcarsText(colours.BLACK, (11, 52), "LCARS 105"),
                        layer=1)
        all_sprites.add(LcarsText(colours.ORANGE, (0, 135), "DATA INTERFACE",
                                  2),
                        layer=1)
        all_sprites.add(LcarsText(colours.BLACK, (183, 74), "LIGHTS"), layer=1)
        all_sprites.add(LcarsText(colours.BLACK, (222, 57), "CAMERAS"),
                        layer=1)
        all_sprites.add(LcarsText(colours.BLACK, (372, 70), "ENERGY"), layer=1)
        all_sprites.add(LcarsText(
            colours.BLACK, (444, 612),
            socket.gethostbyname(socket.gethostname()).replace(".", " ")),
                        layer=1)

        # info text
        all_sprites.add(LcarsText(colours.WHITE, (192, 130), "EVENT LOG:",
                                  1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (244, 130), "acpi", 1),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (286, 130), "uptime", 1),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (330, 130), "fqdn", 1),
                        layer=3)
        self.info_text = all_sprites.get_sprites_from_layer(3)

        # date display
        self.stardate = LcarsText(colours.BLUE, (12, 380),
                                  "STAR DATE 2711.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        # buttons
        all_sprites.add(LcarsButton(colours.RED_BROWN, (6, 662), "LOGOUT",
                                    self.logoutHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.BEIGE, (107, 127), "SENSORS",
                                    self.sensorsHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PURPLE, (107, 262), "GAUGES",
                                    self.gaugesHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PEACH, (107, 398), "WEATHER",
                                    self.weatherHandler),
                        layer=4)

        # gadgets
        all_sprites.add(LcarsGifImage("assets/gadgets/fwscan.gif", (277, 556),
                                      100),
                        layer=1)

        self.sensor_gadget = LcarsGifImage("assets/gadgets/lcars_anim2.gif",
                                           (235, 150), 100)
        self.sensor_gadget.visible = False
        all_sprites.add(self.sensor_gadget, layer=2)

        self.dashboard = LcarsImage("assets/gadgets/dashboard.png", (187, 232))
        self.dashboard.visible = False
        all_sprites.add(self.dashboard, layer=2)

        self.weather = LcarsImage("assets/weather.jpg", (188, 122))
        self.weather.visible = False
        all_sprites.add(self.weather, layer=2)

        #all_sprites.add(LcarsMoveToMouse(colours.WHITE), layer=1)
        self.beep1 = Sound("assets/audio/panel/201.wav")
        Sound("assets/audio/panel/220.wav").play()
Exemplo n.º 2
0
    def setup(self, all_sprites):
        UserInterface.lastEventTime = datetime.now().timestamp(
        ) + config.SCREENSAVER_TIMEOUT_SECONDS

        if UserInterface.Authorised == False:
            self.callScreen(ScreenAuthorize())

        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1b.png"),
                        layer=0)

        # panel text
        all_sprites.add(LcarsText(colours.BLACK, (15, 44), "LCARS 105"),
                        layer=1)

        all_sprites.add(LcarsText(colours.ORANGE, (0, 135), "HOME AUTOMATION",
                                  2),
                        layer=1)
        all_sprites.add(LcarsBlockMedium(colours.RED_BROWN, (145, 16),
                                         "LIGHTS"),
                        layer=1)
        all_sprites.add(LcarsBlockSmall(colours.ORANGE, (211, 16), "CAMERAS"),
                        layer=1)
        all_sprites.add(LcarsBlockLarge(colours.BEIGE, (249, 16), "ENERGY"),
                        layer=1)

        self.ip_address = LcarsText(colours.BLACK, (444, 520),
                                    get_ip_address_string())
        all_sprites.add(self.ip_address, layer=1)

        # info text
        all_sprites.add(LcarsText(colours.WHITE, (192, 174), "EVENT LOG:",
                                  1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (244, 174),
                                  "2 ALARM ZONES TRIGGERED", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (286, 174),
                                  "14.3 kWh USED YESTERDAY", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (330, 174),
                                  "1.3 Tb DATA USED THIS MONTH", 1.5),
                        layer=3)
        self.info_text = all_sprites.get_sprites_from_layer(3)

        # date display
        self.stardate = LcarsText(colours.BLUE, (12, 380),
                                  "STAR DATE 2311.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        # buttons
        all_sprites.add(LcarsButton(colours.RED_BROWN, (6, 662), "LOGOUT",
                                    self.logoutHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.BEIGE, (107, 127), "SENSORS",
                                    self.sensorsHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PURPLE, (107, 262), "GAUGES",
                                    self.gaugesHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PEACH, (107, 398), "WEATHER",
                                    self.weatherHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PEACH, (108, 536), "HOME",
                                    self.homeHandler),
                        layer=4)

        # gadgets
        all_sprites.add(LcarsGifImage("assets/gadgets/fwscan.gif", (277, 556),
                                      100),
                        layer=1)

        self.sensor_gadget = LcarsGifImage("assets/gadgets/lcars_anim2.gif",
                                           (235, 150), 100)
        self.sensor_gadget.visible = False
        all_sprites.add(self.sensor_gadget, layer=2)

        self.dashboard = LcarsImage("assets/gadgets/dashboard.png", (187, 232))
        self.dashboard.visible = False
        all_sprites.add(self.dashboard, layer=2)

        self.weather = LcarsImage("assets/weather.jpg", (188, 122))
        self.weather.visible = False
        all_sprites.add(self.weather, layer=2)

        #all_sprites.add(LcarsMoveToMouse(colours.WHITE), layer=1)
        self.beep1 = Sound("assets/audio/panel/201.wav")
        Sound("assets/audio/panel/220.wav").play()
        # Background warp core sound
        Sound("assets/audio/voy_core_1.wav").play(-1)
Exemplo n.º 3
0
    def setup(self, all_sprites):
        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1b.png"),
                        layer=0)

        # panel text
        all_sprites.add(LcarsText(colours.BLACK, (15, 44), "LCARS 105"),
                        layer=1)
        all_sprites.add(LcarsText(colours.ORANGE, (0, 135), "HOME AUTOMATION",
                                  2),
                        layer=1)
        all_sprites.add(LcarsBlockMedium(colours.RED_BROWN, (145, 16),
                                         "LIGHTS"),
                        layer=1)
        all_sprites.add(LcarsBlockSmall(colours.ORANGE, (211, 16), "CAMERAS"),
                        layer=1)
        all_sprites.add(LcarsBlockLarge(colours.BEIGE, (249, 16), "ENERGY"),
                        layer=1)
        all_sprites.add(LcarsText(colours.BLACK, (444, 612), "192 168 0 3"),
                        layer=1)

        # info text
        all_sprites.add(LcarsText(colours.WHITE, (192, 174), "EVENT LOG:",
                                  1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (244, 174),
                                  "2 ALARM ZONES TRIGGERED", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (286, 174),
                                  "14.3 kWh USED YESTERDAY", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (330, 174),
                                  "1.3 Tb DATA USED THIS MONTH", 1.5),
                        layer=3)
        self.info_text = all_sprites.get_sprites_from_layer(3)

        # date display
        self.stardate = LcarsText(colours.BLUE, (12, 380),
                                  "STAR DATE 2711.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        # buttons
        all_sprites.add(LcarsButton(colours.RED_BROWN, (6, 662), "LOGOUT",
                                    self.logoutHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.BEIGE, (107, 127), "SENSORS",
                                    self.sensorsHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PURPLE, (107, 262), "GAUGES",
                                    self.gaugesHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PEACH, (107, 398), "WEATHER",
                                    self.weatherHandler),
                        layer=4)

        # gadgets
        all_sprites.add(LcarsGifImage("assets/gadgets/fwscan.gif", (277, 556),
                                      100),
                        layer=1)

        self.sensor_gadget = LcarsGifImage("assets/gadgets/lcars_anim2.gif",
                                           (235, 150), 100)
        self.sensor_gadget.visible = False
        all_sprites.add(self.sensor_gadget, layer=2)

        self.dashboard = LcarsImage("assets/gadgets/dashboard.png", (187, 232))
        self.dashboard.visible = False
        all_sprites.add(self.dashboard, layer=2)

        self.weather = LcarsImage("assets/weather.jpg", (188, 122))
        self.weather.visible = False
        all_sprites.add(self.weather, layer=2)

        #all_sprites.add(LcarsMoveToMouse(colours.WHITE), layer=1)
        self.beep1 = Sound("assets/audio/panel/201.wav")
        Sound("assets/audio/panel/220.wav").play()
Exemplo n.º 4
0
    def setup(self, all_sprites):
        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1b.png"),
                        layer=0)

        # panel text
        all_sprites.add(LcarsText(colours.BLACK, (34, 90), "LCARS 702"),
                        layer=1)

        all_sprites.add(LcarsText(colours.ORANGE, (0, 304), "HOME AUTOMATION",
                                  1.5),
                        layer=1)
        all_sprites.add(LcarsBlockMedium(colours.RED_BROWN, (327, 39),
                                         "LIGHTS"),
                        layer=1)
        all_sprites.add(LcarsBlockSmall(colours.ORANGE, (475, 39), "CAMERAS"),
                        layer=1)
        all_sprites.add(LcarsBlockLarge(colours.BEIGE, (561, 39), "ENERGY"),
                        layer=1)

        self.ip_address = LcarsText(colours.BLACK, (999, 1248),
                                    get_ip_address_string())
        all_sprites.add(self.ip_address, layer=1)

        # info text
        all_sprites.add(LcarsText(colours.WHITE, (432, 418), "EVENT LOG:",
                                  1.25),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (549, 418),
                                  "2 ALARM ZONES TRIGGERED", 1.25),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (644, 418),
                                  "14.3 kWh USED YESTERDAY", 1.25),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (743, 418),
                                  "1.3 Tb DATA USED THIS MONTH", 1.25),
                        layer=3)
        self.info_text = all_sprites.get_sprites_from_layer(3)

        # date display
        self.stardate = LcarsText(colours.BLUE, (27, 912),
                                  "STAR DATE 2311.05 17:54:32", 1.25)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        # buttons
        all_sprites.add(LcarsButton(colours.RED_BROWN, (14, 1589), "LOGOUT",
                                    self.logoutHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.BEIGE, (241, 305), "SENSORS",
                                    self.sensorsHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PURPLE, (241, 629), "GAUGES",
                                    self.gaugesHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PEACH, (241, 956), "WEATHER",
                                    self.weatherHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PEACH, (241, 1287), "HOME",
                                    self.homeHandler),
                        layer=4)

        # gadgets
        all_sprites.add(LcarsGifImage("assets/gadgets/fwscan.gif", (624, 1335),
                                      100),
                        layer=1)

        self.sensor_gadget = LcarsGifImage("assets/gadgets/lcars_anim3.gif",
                                           (529, 360), 100)
        self.sensor_gadget.visible = False
        all_sprites.add(self.sensor_gadget, layer=2)

        self.dashboard = LcarsImage("assets/gadgets/dashboard.png", (421, 557))
        self.dashboard.visible = False
        all_sprites.add(self.dashboard, layer=2)

        self.weather = LcarsImage("assets/weather.jpg", (423, 293))
        self.weather.visible = False
        all_sprites.add(self.weather, layer=2)

        #all_sprites.add(LcarsMoveToMouse(colours.WHITE), layer=1)
        self.beep1 = Sound("assets/audio/panel/201.wav")
        Sound("assets/audio/panel/220.wav").play()
Exemplo n.º 5
0
    def setup(self, all_sprites):
        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1b.png"),
                        layer=0)
	# Image reference
	WINTERPARKSNOW = cStringIO.StringIO(urllib.urlopen("http://cams.winterparkresort.com/winter-park-basecam.jpg").read())
	WINTERPARKSNOW2 = Image.open(WINTERPARKSNOW)
	WINTERPARK2 = WINTERPARKSNOW2.resize((380,232), Image.ANTIALIAS)
	WINTERPARK2.save("WINTERPARKSNOW.jpg")
	KEYSTONESNOW = cStringIO.StringIO(urllib.urlopen("http://common.snow.com/mtncams/riverrun.jpg").read())
        KEYSTONESNOW2 = Image.open(KEYSTONESNOW)
        KEYSTONE2 = KEYSTONESNOW2.resize((380,232), Image.ANTIALIAS)
        KEYSTONE2.save("KEYSTONESNOW.jpg")      
	BRECKENRIDGESNOW = cStringIO.StringIO(urllib.urlopen("http://common.snow.com/Mtncams/brecksnowcam.jpg").read())
        BRECKENRIDGESNOW2 = Image.open(BRECKENRIDGESNOW)
        BRECKENRIDGE2 = BRECKENRIDGESNOW2.resize((380,232), Image.ANTIALIAS)
        BRECKENRIDGE2.save("BRECKENRIDGESNOW.jpg")


        # panel text
        all_sprites.add(LcarsText(colours.BLACK, (15, 44), "COLORADO"),
                        layer=1)
        all_sprites.add(LcarsText(colours.ORANGE, (0, 135), "SNOW REPORT", 2),
                        layer=1)
        all_sprites.add(LcarsBlockMedium(colours.RED_BROWN, (145, 16), "WEATHER"),
                        layer=1)
        all_sprites.add(LcarsBlockSmall(colours.ORANGE, (211, 16), "CAMERAS"),
                        layer=1)
        all_sprites.add(LcarsBlockLarge(colours.BEIGE, (249, 16), "ENERGY"),
                        layer=1)
        all_sprites.add(LcarsText(colours.BLACK, (444, 612), "172 18 0 99"),
                        layer=1)

        # info text
        all_sprites.add(LcarsText(colours.WHITE, (192, 174), "RESORT OPENING DAY:", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (244, 174), "WINTER PARK: NOVEMBER 15, 2017", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (286, 174), "ARAPAHOE BASEN: MID OCTOBER", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (330, 174), "KEYSTONE: NOVEMBER 10, 2017", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (370, 174), "BRECKENRIDGE:  NOVEMBER 10, 2017", 1.5),
                        layer=3)
        self.info_text = all_sprites.get_sprites_from_layer(3)

        # date display
        self.stardate = LcarsText(colours.BLUE, (12, 380), "STAR DATE 2711.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        # buttons        
        all_sprites.add(LcarsButton(colours.RED_BROWN, (6, 662), "LOGOUT", self.logoutHandler),
                        layer=4)
        #all_sprites.add(LcarsButton(colours.BEIGE, (107, 127), "DASHBOARD", self.sensorsHandler),
        #                layer=4)
        all_sprites.add(LcarsButton(colours.PURPLE, (107, 262), "BRECKENRIDGE", self.sensorsHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.BEIGE, (107, 127), "KEYSTONE", self.gaugesHandler),
                        layer=4)
        #all_sprites.add(LcarsButton(colours.PEACH, (107, 398), "WINTER PARK", self.weatherHandler),
        #                layer=4)
        all_sprites.add(LcarsButton(colours.PEACH, (107, 398), "WINTER PARK", self.weatherHandler),
                        layer=4)

        # gadgets        
        all_sprites.add(LcarsGifImage("assets/gadgets/fwscan.gif", (277, 556), 100), layer=1)
        
        self.sensor_gadget = LcarsImage ("BRECKENRIDGESNOW.jpg", (200, 130)) 
        self.sensor_gadget.visible = False
        all_sprites.add(self.sensor_gadget, layer=2)

        self.dashboard = LcarsImage("KEYSTONESNOW.jpg", (200, 130))
        self.dashboard.visible = False
        all_sprites.add(self.dashboard, layer=2) 

        self.weather = LcarsImage("WINTERPARKSNOW.jpg", (200, 130))
	self.weather.visible = False
        all_sprites.add(self.weather, layer=2) 

        self.gauges = LcarsImage("KEYSTONESNOW.jpg", (200, 130))
        self.gauges.visible = False
        all_sprites.add(self.weather, layer=2)

        #all_sprites.add(LcarsMoveToMouse(colours.WHITE), layer=1)
        self.beep1 = Sound("assets/audio/panel/201.wav")
        Sound("assets/audio/panel/220.wav").play()
Exemplo n.º 6
0
    def setup(self, all_sprites):
        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1.png"),
                        layer=0)

        # panel text
        all_sprites.add(LcarsText(colours.BLACK, (15, 44), "LCARS 105"),
                        layer=1)
        all_sprites.add(LcarsText(colours.ORANGE, (0, 135), "DynSlide Top 10",
                                  2),
                        layer=1)
        all_sprites.add(LcarsBlockMedium(colours.RED_BROWN, (145, 16),
                                         "TOP 10", self.logoutHandler),
                        layer=1)
        all_sprites.add(LcarsBlockSmall(colours.ORANGE, (211, 16), "STATS"),
                        layer=1)
        all_sprites.add(LcarsBlockLarge(colours.BEIGE, (249, 16),
                                        "LAST SLIDE"),
                        layer=1)
        all_sprites.add(LcarsText(colours.BLACK, (444, 612), "192 168 0 3"),
                        layer=1)

        # Leader Board
        rows = get_leaderboard()
        i = 0
        for row in rows:

            y = 107 + int(i / 5) * 180
            x = 130 + i % 5 * 130
            text = "#" + str(i + 1) + " - " + str(row[2] * 3)

            all_sprites.add(LcarsText(colours.WHITE, (y + 90, x), text, 1.5))

            # self.dashboard = LcarsImage("65573701.jpg", (y, x))
            img = LcarsImage(str(row[0]) + ".jpg", (y, x))
            #print img.image #.__dict__ # img.image.transform.scale(picture, (1280, 720))
            # img_scaled = pygame.transform.scale(img.image, (10,10))
            img.image = pygame.transform.scale(img.image, (120, 90))
            all_sprites.add(img, layer=2)

            i += 1

        self.info_text = all_sprites.get_sprites_from_layer(3)

        # date display
        self.stardate = LcarsText(colours.BLUE, (12, 380),
                                  "STAR DATE 2711.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        self.sensor_gadget = LcarsGifImage("assets/gadgets/lcars_anim2.gif",
                                           (235, 150), 100)
        self.sensor_gadget.visible = False
        all_sprites.add(self.sensor_gadget, layer=2)

        self.dashboard = LcarsImage("assets/gadgets/dashboard.png", (187, 232))
        self.dashboard.visible = False
        all_sprites.add(self.dashboard, layer=2)

        self.weather = LcarsImage("assets/weather.jpg", (188, 122))
        self.weather.visible = False
        all_sprites.add(self.weather, layer=2)

        #all_sprites.add(LcarsMoveToMouse(colours.WHITE), layer=1)
        self.beep1 = Sound("assets/audio/panel/201.wav")
        Sound("assets/audio/panel/220.wav").play()
Exemplo n.º 7
0
    def setup(self, all_sprites):
        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1.png"),
                        layer=0)

        # panel text
        all_sprites.add(LcarsText(colours.BLACK, (15, 44), "LCARS 105"),
                        layer=1)
        all_sprites.add(LcarsText(colours.ORANGE, (0, 135), "HOME AUTOMATION",
                                  2),
                        layer=1)
        # ----------- Main Menu Buttons - move when more than one screen, move to parent class
        all_sprites.add(LcarsBlockMedium(colours.RED_BROWN, (145, 16), "MAIN"),
                        layer=1)
        all_sprites.add(LcarsBlockSmall(colours.ORANGE, (211, 16), "SETTINGS"),
                        layer=1)
        all_sprites.add(LcarsBlockLarge(colours.BEIGE, (249, 16), "ENERGY"),
                        layer=1)

        # ----------- Main Menu Buttons End
        all_sprites.add(LcarsText(colours.BLACK, (444, 612), "192 168 0 3"),
                        layer=1)

        # date display
        self.stardate = LcarsText(colours.BLUE, (12, 380),
                                  "STAR DATE 2711.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        # sub buttons - layer 2
        # Distance of 135 on y axis seems good
        # Move to super class
        all_sprites.add(LcarsButton(colours.RED_BROWN, (6, 662), "LOGOUT",
                                    self.logoutHandler),
                        layer=2)
        # -----------------------------------------------------------------------------------------
        all_sprites.add(LcarsButton(colours.BEIGE, (107, 127), "LIGHTS",
                                    self.lights_handler),
                        layer=2)
        all_sprites.add(LcarsButton(colours.PURPLE, (107, 262), "AUDIO",
                                    self.audio_handler),
                        layer=2)
        all_sprites.add(LcarsButton(colours.PEACH, (107, 398), "SENSORS",
                                    self.sensors_handler),
                        layer=2)
        all_sprites.add(LcarsButton(colours.ORANGE, (107, 533), "PENDING",
                                    self.sensors_handler),
                        layer=2)

        # Audio -------------------------------------------------------------------------------
        # Move to own section
        # Audio Buttons - layer 4
        audio.initialize(self, all_sprites)
        # all_sprites.add(LcarsButton(colours.PEACH, (200, 127), "VAL", self.audio_handler_play_val),
        # layer=4)
        lights.initialize(self, all_sprites)
        # self.section_audio_sprites = all_sprites.get_sprites_from_layer(4)

        # Audio Logic
        # self.section_audio_sources_val = vlc.MediaPlayer("http://radio.doubleclic.fr/radiovaldisere.mp3")
        # self.section_audio_radio_image = LcarsImage("assets/make_it_snow.jpg", (150, 122))
        # self.section_audio_radio_image.visible = False
        # all_sprites.add(self.section_audio_radio_image, layer=4)

        # -------------------------------------------------------------------------------------

        # gadgets

        self.weather = LcarsImage("assets/weather.jpg", (188, 122))
        self.weather.visible = False
        all_sprites.add(self.weather, layer=2)

        # all_sprites.add(LcarsMoveToMouse(colours.WHITE), layer=1)
        self.beep1 = Sound("assets/audio/panel/201.wav")
        Sound("assets/audio/panel/220.wav").play()
Exemplo n.º 8
0
    def setup(self, all_sprites):
        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1.png"),
                        layer=0)

        # panel text
        all_sprites.add(LcarsText(colours.BLACK, (15, 44), "DYN"), layer=1)
        all_sprites.add(LcarsText(colours.ORANGE, (0, 135), "ELECTRIC SLIDE",
                                  2),
                        layer=1)

        all_sprites.add(LcarsBlockMedium(colours.RED_BROWN, (145, 16),
                                         "TOP 10"),
                        layer=1)
        all_sprites.add(LcarsBlockSmall(colours.ORANGE, (211, 16), "PICTURE"),
                        layer=1)
        all_sprites.add(LcarsBlockLarge(colours.BEIGE, (249, 16), "ENERGY"),
                        layer=1)

        # Get ip address of machine
        ip = [
            l for l in (
                [
                    ip
                    for ip in socket.gethostbyname_ex(socket.gethostname())[2]
                    if not ip.startswith("127.")
                ][:1],
                [[(s.connect(('8.8.8.8', 53)), s.getsockname()[0], s.close())
                  for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]
                  ][0][1]]) if l
        ][0][0]
        all_sprites.add(LcarsText(colours.BLACK, (444, 612), ip), layer=1)

        # info text
        all_sprites.add(LcarsText(colours.WHITE, (192, 174), "TOP 10", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (222, 174), "one", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (252, 174), "two", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (282, 174), "three", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (312, 174), "four", 1.5),
                        layer=3)
        all_sprites.add(LcarsText(colours.BLUE, (342, 174), "five", 1.5),
                        layer=3)
        self.info_text = all_sprites.get_sprites_from_layer(3)

        # date display (get's set to date in update())
        self.stardate = LcarsText(colours.BLUE, (12, 380),
                                  "STAR DATE 2711.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        # buttons
        all_sprites.add(LcarsButton(colours.RED_BROWN, (6, 662), "LOGOUT",
                                    self.logoutHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.BEIGE, (107, 127), "TOP 10",
                                    self.sensorsHandler),
                        layer=4)
        all_sprites.add(LcarsButton(colours.PURPLE, (107, 262), "LAST",
                                    self.gaugesHandler),
                        layer=4)
        # all_sprites.add(LcarsButton(colours.PEACH, (107, 398), "WEATHER", self.weatherHandler), layer=4)

        # gadgets
        # all_sprites.add(LcarsGifImage("assets/gadgets/fwscan.gif", (277, 556), 100), layer=1)

        self.sensor_gadget = LcarsGifImage("assets/gadgets/lcars_anim2.gif",
                                           (235, 150), 100)
        self.sensor_gadget.visible = False
        all_sprites.add(self.sensor_gadget, layer=2)

        self.dashboard = LcarsImage("assets/gadgets/dashboard.png", (187, 232))
        self.dashboard.visible = False
        all_sprites.add(self.dashboard, layer=2)