(self, force_redraw=False)
Draw map of Roomba cleaning progress
Draw map of Roomba cleaning progress
Draw map of Roomba cleaning progress
def draw_map(self, force_redraw=False):
        '''
        Draw map of Roomba cleaning progress
        '''
        if (self.changed('pose') or self.changed('phase') or force_redraw) and self.drawmap:
            #program just started, initialize old_x_y
            if self.old_x_y is None:
                self.old_x_y, _ = self.offset_coordinates(self.co_ords)
            
            #set flags
            self.set_flags()
            if not self.bin_full:
                self.clear_flags('bin_full')
                
            if self.tanklvl is not None:
                if self.tanklvl < 100:
                    self.set_flags('tank_low')
                else:
                    self.clear_flags('tank_low')
            #make sure we have phase info
            if self.current_state is not None:
                self.render_map()
def draw_map ( self , force_redraw = False ) : if ( self . changed ( 'pose' ) or self . changed ( 'phase' ) or force_redraw ) and self . drawmap : #program just started, initialize old_x_y if self . old_x_y is None : self . old_x_y , _ = self . offset_coordinates ( self . co_ords ) #set flags self . set_flags ( ) if not self . bin_full : self . clear_flags ( 'bin_full' ) if self . tanklvl is not None : if self . tanklvl < 100 : self . set_flags ( 'tank_low' ) else : self . clear_flags ( 'tank_low' ) #make sure we have phase info if self . current_state is not None : self . render_map ( )