(self, roomba_size)
Initialize all map items (base maps, overlay, icons fonts etc)
Initialize all map items (base maps, overlay, icons fonts etc)
Initialize all map items ( base maps overlay icons fonts etc )
def initialise_map(self, roomba_size):
        '''
        Initialize all map items (base maps, overlay, icons fonts etc)
        '''
        # get base image of Roomba path
        #self.load_existing_maps()
        if self.base is None:
            self.base = self.make_blank_image(self.mapSize[0], self.mapSize[1])
            self.roomba_problem = self.make_blank_image()

            self.previous_map_no_text = None
            self.map_no_text = self.load_image('map_notext.png', True)
        # save x and y center of image, for centering of final map image
        self.cx = self.base.size[0] // 2
        self.cy = self.base.size[1] // 2

        #set dock home position
        self.home_pos = (
            self.mapSize[0] // 2 + self.mapSize[2],
            self.mapSize[1] // 2 + self.mapSize[3])
        self.log.info("MAP: home_pos: ({},{})".format(self.home_pos[0], self.home_pos[1]))
            
        self.dock_position = (
            self.home_pos[0] - self.icons['home'].size[0] // 2,
            self.home_pos[1] - self.icons['home'].size[1] // 2)

        self.log.info("MAP: Initialisation complete")
def initialise_map ( self , roomba_size ) : # get base image of Roomba path #self.load_existing_maps() if self . base is None : self . base = self . make_blank_image ( self . mapSize [ 0 ] , self . mapSize [ 1 ] ) self . roomba_problem = self . make_blank_image ( ) self . previous_map_no_text = None self . map_no_text = self . load_image ( 'map_notext.png' , True ) # save x and y center of image, for centering of final map image self . cx = self . base . size [ 0 ] // 2 self . cy = self . base . size [ 1 ] // 2 #set dock home position self . home_pos = ( self . mapSize [ 0 ] // 2 + self . mapSize [ 2 ] , self . mapSize [ 1 ] // 2 + self . mapSize [ 3 ] ) self . log . info ( "MAP: home_pos: ({},{})" . format ( self . home_pos [ 0 ] , self . home_pos [ 1 ] ) ) self . dock_position = ( self . home_pos [ 0 ] - self . icons [ 'home' ] . size [ 0 ] // 2 , self . home_pos [ 1 ] - self . icons [ 'home' ] . size [ 1 ] // 2 ) self . log . info ( "MAP: Initialisation complete" )