Пример #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, (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()
Пример #2
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()
Пример #3
0
    def setup(self, all_sprites):
        #relay setup
        # get configuration from file
        pins_df=pd.read_csv("data/buttons.csv")
        self.all_sprites=all_sprites
        
        self.total_banks=pins_df['group'].max()
        #loop through each cluster
        for i in range(pins_df['group'].max()):
            #create arrays for labels, power/reset buttons
            self.cluster_node_labels.append([])
            self.cluster_node_pwr_buttons.append([])
            self.cluster_node_reset_buttons.append([])
            self.status_labels.append([])
        
        #Elbow up-down buttons
        all_sprites.add(ModernElbowTop(colours.TRANSPARENT, (77,15), "", handler=self.changeClusterUp), layer=1)
        all_sprites.add(ModernElbowBottom(colours.TRANSPARENT, (400,15), "", handler=self.changeClusterDown), layer=1)

        for i in range(len(pins_df)):
            button=None
            label=None
            controller=self.relay_controllers[i]

            #create relevant button and add it to all_sprites and button array
            #buttons not in group 1 hidden by default
            #labels are created at same time as power buttons
            if pins_df['type'][i]=='power':
                name=pins_df['name'][i]
                button=RelayPowerButton(colours.PURPLE, (self.content_ypos+(self.content_yinterval*(int(pins_df['computer_number'][i])-1)), self.pwr_button_xpos), "POWER", controller, self.relayButtonHandler)
                self.cluster_node_pwr_buttons[int(pins_df['group'][i])-1].append(button)
                label=DescText(colours.WHITE, ((self.content_ypos+5)+(self.content_yinterval*(int(pins_df['computer_number'][i])-1)), self.label_xpos), name)
                statuslabel=DescText(colours.RED, (self.content_ypos+5)+(self.content_yinterval*(int(pins_df['computer_number'][i])-1)+20, self.label_xpos), "OFFLINE")
                self.cluster_node_labels[pins_df['group'][i]-1].append(label)
                self.status_labels[pins_df['group'][i]-1].append(statuslabel)
                all_sprites.add(label, layer=4)
                all_sprites.add(statuslabel, layer=4)
                print(nodes[i-((pins_df['group'][i]-1)*4)].ip_address)
                #nodes[i-((pins_df['group'][i]-1)*4)].statuslabel=statuslabel

            #create reset buttons
            else:
                button=RelayResetButton(colours.WHITE, (self.content_ypos+(self.content_yinterval*(int(pins_df['computer_number'][i])-1)), self.reset_button_xpos), "RESET", controller, self.relayButtonHandler)
                self.cluster_node_reset_buttons[int(pins_df['group'][i])-1].append(button)
            all_sprites.add(button, layer=4)

            #set buttons not in group to not be visible
            if not int(pins_df['group'][i])==1:
                button.visible=False
                statuslabel.Visible=False
                if not label==None:
                    label.visible=False
        
        
        # background image
        all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_1_modern.png"),
                        layer=0)

        # panel text
        #all_sprites.add(YukonText(colours.BLUEDARK, (117, 90), "UP"),
        #                layer=1)
        #all_sprites.add(YukonText(colours.BLUEDARK, (420, 65), "dOWN"),
        #                layer=1)
        self.title_text=LcarsText(colours.WHITE, (10, 135), "CLUSTER CONTROL", 2)                
        all_sprites.add(self.title_text,
                        layer=1)
        all_sprites.add(LcarsBlockMedium(colours.TRANSPARENT, (145, 16), "CONTROL", self.showControlHandler),
                        layer=1)
        all_sprites.add(LcarsBlockSmall(colours.WHITE, (211, 16), "STATUS", self.showStatusHandler),
                        layer=1)
        all_sprites.add(LcarsBlockLarge(colours.WHITE, (249, 16), "SETTINGS", self.showSettingsHandler),
                        layer=1)

        self.ip_address = LcarsText(colours.BLUEDARK, (446, 505),
                                    ":: NODE | "+get_ip_address_string()+" ::", 1.13)
        all_sprites.add(self.ip_address, layer=1)
        
        self.bank_number_text = LcarsText(colours.BLUEDARK, (79, 331),
                                    "BANK   "+str(self.bank_number), 1.1)
        all_sprites.add(self.bank_number_text, layer=1)

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

        # buttons
        all_sprites.add(SideBlockSmall(colours.BLUEMID, (447, 690), "LOGOUT", self.logoutHandler),
                        layer=1)

        #all_sprites.add(LcarsMoveToMouse(colours.WHITE), layer=1)
        self.beep1 = Sound("assets/audio/panel/201.wav")
        Sound("assets/audio/panel/220.wav").play()
        
        #ensure only first page displayed
        for sprite in all_sprites.get_sprites_from_layer(5):
            sprite.visible=False
        for sprite in all_sprites.get_sprites_from_layer(6):
            sprite.visible=False
Пример #4
0
    def setup(self, all_sprites):
        self.state=0
     
        ############ Start base screen #############

        ### BASE_ui

        all_sprites.add(LcarsBackgroundImage(),layer=0)
        self.ui_screen_base = all_sprites.get_sprites_from_layer(0)

        all_sprites.add(LcarsElbow(colours.BLUE5, 1, (175, 39)), layer=1)
        all_sprites.add(LcarsElbow(colours.BLUE5, 0, (975, 39)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(175, 314), rectSize=(355, 43)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(1004, 314), rectSize=(396, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE8, pos=(175, 675), rectSize=(243, 43)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE7, pos=(1004, 716), rectSize=(150, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE4, pos=(175, 924), rectSize=(62, 43)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE4, pos=(1004, 872), rectSize=(226, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(175, 992), rectSize=(286, 21)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE6, pos=(1004, 1104), rectSize=(549, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE7, pos=(175, 1284), rectSize=(636, 43)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE7, pos=(1004, 1659), rectSize=(261, 43)), layer=1)

        all_sprites.add(LcarsElbow(colours.BLUE6, 0, (97, 39)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE6, pos=(23, 39), rectSize=(243, 74)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE6, pos=(126, 315), rectSize=(963, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE7, pos=(126, 1284), rectSize=(400, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE4, pos=(126, 1690), rectSize=(230, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(0, 39), rectSize=(243, 17)), layer=1)

        all_sprites.add(LcarsText(colours.BLACK, (34, 90), "LCARS 702"),layer=10)

        self.ip_address = LcarsText(colours.BLACK, (996, 1248), get_ip_address_string(),.9)
        all_sprites.add(self.ip_address, layer=10)

        ###

        ### Display text on a seperate layer for changing later
	
        self.title_text = LcarsText(colours.BLUE1, (0, 324), "TR-540 MK I", 2)
        all_sprites.add(self.title_text,layer=10)

        self.stardate = LcarsText(colours.BLUE5, (27, 912), "STAR DATE 2311.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        ###

	    ### Side buttons

	    ## uses layers 2

        all_sprites.add(LcarsBlockSmall(colours.COM1, (253, 39), "MAIN",self.mainHandler), layer=2)
        self.tab1 = LcarsTab(colours.COM1, 2, (253, 288), self.mainHandler)
        all_sprites.add(self.tab1, layer=2)
        all_sprites.add(LcarsBlockSmall(colours.COM1, (336, 39), "SENSORS",self.sensorHandler), layer=2)
        all_sprites.add(LcarsTab(colours.COM1, 2, (336, 288), self.sensorHandler), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.COM1, (419, 39), "LIBRARY",self.libraryHandler), layer=2)
        all_sprites.add(LcarsTab(colours.COM1, 2, (419, 288),self.libraryHandler), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE6, (502, 39), "TOGGLE"), layer=2)
        all_sprites.add(LcarsTab(colours.COM2, 2, (502, 288)), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE6, (585, 39), "TOGGLE 2"), layer=2)
        all_sprites.add(LcarsTab(colours.COM2, 2, (585, 288)), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE6, (668, 39), "MEDIA",self.mediaHandler), layer=2)
        all_sprites.add(LcarsTab(colours.COM2, 2, (668, 288)), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE6, (751, 39), "ITEM"), layer=2)
        all_sprites.add(LcarsTab(colours.COM2, 2, (751, 288)), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE6, (834, 39), "ITEM"), layer=2)
        all_sprites.add(LcarsTab(colours.COM2, 2, (834, 288)), layer=2)

        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(917, 39), rectSize=(243, 58)), layer=2) ### buffer to fill out the column

        ###

        ### buttons
        all_sprites.add(LcarsButton(colours.BLUE5, (25, 1706), "LOGOUT", self.logoutHandler), layer=3)
        
        self.ui_screen_info = all_sprites.get_sprites_from_layer(1)        
        self.ui_screen_buttons = all_sprites.get_sprites_from_layer(2)
        self.ui_screen_logout = all_sprites.get_sprites_from_layer(3)
        self.ui_screen_test = self.ui_screen_info
        self.ui_screen_test.extend(self.ui_screen_buttons)
        self.ui_screen_test.extend(self.ui_screen_logout)
        
        self.ra1=red_alert(self.ui_screen_buttons[6],self.ui_screen_info)
        self.ra2=inout_alert(self.ui_screen_buttons[8],self.ui_screen_test,colours.OdyY)

    	### sound effects
        self.beep1 = Sound("assets/audio/panel/201.wav")
Пример #5
0
    def setup(self, all_sprites):
        self.state=0
     
        ############ Start base screen #############

        ### BASE_ui

        all_sprites.add(LcarsBackgroundImage(),layer=0)
        self.ui_screen_base = all_sprites.get_sprites_from_layer(0)

        all_sprites.add(LcarsElbow(colours.BLUE5, 1, (175, 39)), layer=1)
        all_sprites.add(LcarsElbow(colours.BLUE5, 0, (975, 39)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(175, 314), rectSize=(355, 43)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(1004, 314), rectSize=(396, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE8, pos=(175, 675), rectSize=(243, 43)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE7, pos=(1004, 716), rectSize=(150, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE4, pos=(175, 924), rectSize=(62, 43)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE4, pos=(1004, 872), rectSize=(226, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(175, 992), rectSize=(286, 21)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE6, pos=(1004, 1104), rectSize=(549, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE7, pos=(175, 1284), rectSize=(636, 43)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE7, pos=(1004, 1659), rectSize=(261, 43)), layer=1)

        all_sprites.add(LcarsElbow(colours.BLUE6, 0, (97, 39)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE6, pos=(23, 39), rectSize=(243, 74)), layer=1)
        all_sprites.add(LcarsImageBlock(colours.BLUE6, pos=(126, 315), rectSize=(963, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE7, pos=(126, 1284), rectSize=(400, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE4, pos=(126, 1690), rectSize=(230, 43)), layer=1)

        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(0, 39), rectSize=(243, 17)), layer=1)

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

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

        ###

        ### Display text on a seperate layer for changing later
	
        self.title_text = LcarsText(colours.BLUE1, (0, 324), "TR-540 MK I", 2)
        all_sprites.add(self.title_text,layer=1)

        self.stardate = LcarsText(colours.BLUE5, (27, 912), "STAR DATE 2311.05 17:54:32", 1.5)
        self.lastClockUpdate = 0
        all_sprites.add(self.stardate, layer=1)

        ###

        ### Group UI 

        self.ui_screen_info = all_sprites.get_sprites_from_layer(1)

        
        ###

	### Side buttons

	### uses layers 2

        all_sprites.add(LcarsBlockSmall(colours.BLUE1, (253, 39), "MAIN",self.mainHandler), layer=2)
        all_sprites.add(LcarsTab(colours.RED1, 2, (253, 288), self.mainHandler), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE2, (336, 39), "DS18B20", self.ds18b20Handler), layer=2)
        all_sprites.add(LcarsTab(colours.RED2, 2, (336, 288), self.ds18b20Handler), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE3, (419, 39), "CPU",self.CPUHandler), layer=2)
        all_sprites.add(LcarsTab(colours.RED3, 2, (419, 288),self.CPUHandler), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE4, (502, 39), "ITEM"), layer=2)
        all_sprites.add(LcarsTab(colours.RED4, 2, (502, 288)), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE5, (585, 39), "ITEM"), layer=2)
        all_sprites.add(LcarsTab(colours.RED5, 2, (585, 288)), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE6, (668, 39), "SENSORS"), layer=2)
        all_sprites.add(LcarsTab(colours.RED6, 2, (668, 288)), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE7, (751, 39), "BASE", self.baseHandler), layer=2)
        all_sprites.add(LcarsTab(colours.RED7, 2, (751, 288), self.baseHandler), layer=2)
        all_sprites.add(LcarsBlockSmall(colours.BLUE8, (834, 39), "MAIN", self.mainHandler), layer=2)
        all_sprites.add(LcarsTab(colours.RED8, 2, (834, 288), self.mainHandler), layer=2)

        all_sprites.add(LcarsImageBlock(colours.BLUE5, pos=(917, 39), rectSize=(243, 58)), layer=2) ### buffer to fill out the column

        self.ui_screen_buttons = all_sprites.get_sprites_from_layer(2)

        ###

        ### buttons
        all_sprites.add(LcarsButton(colours.BLUE5, (25, 1706), "LOGOUT", self.logoutHandler), layer=3)

        self.ui_screen_logout = all_sprites.get_sprites_from_layer(3)

	### sound effects
        self.beep1 = Sound("assets/audio/panel/201.wav")
        #Sound("assets/audio/panel/220.wav").play()

        #DS18B20 display
        self.ds18b20sensor = LcarsText(colours.BLUE5,(224,400)," Sensor XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",1.5)
        self.ds18b20sensor.visible=False
        self.sensor = W1ThermSensor()
        all_sprites.add(self.ds18b20sensor, layer=4)

	#CPU temp
        self.cpuSensor = LcarsText(colours.BLUE5,(364,400)," Core XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",1.5)
        self.cpuSensor.visible=False
        all_sprites.add(self.cpuSensor,layer=5)
Пример #6
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)

        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()