ui/ImageView.py
def draw_ancillary_data(self):
        """
        Draw ancillary data on the image, if there is any
        :return: None
        """
        if 'ancillary_data' in self.moment.metadata.keys():
            ancillary_data = self.moment.metadata['ancillary_data']

            text_dict = {}

            if 'depth_meters' in ancillary_data:
                text_dict['Depth (m): {:<10.2f}'] = ancillary_data['depth_meters']

            if 'latitude' in ancillary_data:
                text_dict['Latitude: {:<10.3f}'] = ancillary_data['latitude']

            if 'longitude' in ancillary_data:
                text_dict['Longitude: {:<10.3f}'] = ancillary_data['longitude']

            if 'recorded_date' in self.moment.metadata.keys():
                text_dict['Recorded: {:<20}'] = self.moment.metadata['recorded_date'].replace('T', ' ').replace('Z', '')

            if 'video_data' not in self.moment.metadata.keys():
                video_data = get_video_data(self.moment.metadata['video_reference_uuid'])
                self.moment.metadata['video_data'] = video_data

            if self.moment.metadata['video_data'] and 'uri' in self.moment.metadata['video_data']:
                video_sequence_name = self.moment.metadata['video_data']['uri'].split(':')[-1]
                text_dict['Video: {:<10}'] = video_sequence_name

            text_str = ' '.join(k.format(v) for k, v in text_dict.items())
            text_item = self.scene().addText(text_str, QFont('Courier New'))
            text_item.setDefaultTextColor(QColor(255, 255, 255))
            text_item.setPos(10, self.height() - text_item.boundingRect().height() - 10)

        Draw ancillary data on the image, if there is any
        :return: None
        
Draw ancillary data on the image, if there is any
Draw ancillary data on the image if there is any
def draw_ancillary_data(self):
        if 'ancillary_data' in self.moment.metadata.keys():
            ancillary_data = self.moment.metadata['ancillary_data']
            text_dict = {}
            if 'depth_meters' in ancillary_data:
                text_dict['Depth (m): {:<10.2f}'] = ancillary_data['depth_meters']
            if 'latitude' in ancillary_data:
                text_dict['Latitude: {:<10.3f}'] = ancillary_data['latitude']
            if 'longitude' in ancillary_data:
                text_dict['Longitude: {:<10.3f}'] = ancillary_data['longitude']
            if 'recorded_date' in self.moment.metadata.keys():
                text_dict['Recorded: {:<20}'] = self.moment.metadata['recorded_date'].replace('T', ' ').replace('Z', '')
            if 'video_data' not in self.moment.metadata.keys():
                video_data = get_video_data(self.moment.metadata['video_reference_uuid'])
                self.moment.metadata['video_data'] = video_data
            if self.moment.metadata['video_data'] and 'uri' in self.moment.metadata['video_data']:
                video_sequence_name = self.moment.metadata['video_data']['uri'].split(':')[-1]
                text_dict['Video: {:<10}'] = video_sequence_name
            text_str = ' '.join(k.format(v) for k, v in text_dict.items())
            text_item = self.scene().addText(text_str, QFont('Courier New'))
            text_item.setDefaultTextColor(QColor(255, 255, 255))
            text_item.setPos(10, self.height() - text_item.boundingRect().height() - 10)
def draw_ancillary_data ( self ) : if 'ancillary_data' in self . moment . metadata . keys ( ) : ancillary_data = self . moment . metadata [ 'ancillary_data' ] text_dict = { } if 'depth_meters' in ancillary_data : text_dict [ 'Depth (m): {:<10.2f}' ] = ancillary_data [ 'depth_meters' ] if 'latitude' in ancillary_data : text_dict [ 'Latitude: {:<10.3f}' ] = ancillary_data [ 'latitude' ] if 'longitude' in ancillary_data : text_dict [ 'Longitude: {:<10.3f}' ] = ancillary_data [ 'longitude' ] if 'recorded_date' in self . moment . metadata . keys ( ) : text_dict [ 'Recorded: {:<20}' ] = self . moment . metadata [ 'recorded_date' ] . replace ( 'T' , ' ' ) . replace ( 'Z' , '' ) if 'video_data' not in self . moment . metadata . keys ( ) : video_data = get_video_data ( self . moment . metadata [ 'video_reference_uuid' ] ) self . moment . metadata [ 'video_data' ] = video_data if self . moment . metadata [ 'video_data' ] and 'uri' in self . moment . metadata [ 'video_data' ] : video_sequence_name = self . moment . metadata [ 'video_data' ] [ 'uri' ] . split ( ':' ) [ - 1 ] text_dict [ 'Video: {:<10}' ] = video_sequence_name text_str = ' ' . join ( k . format ( v ) for k , v in text_dict . items ( ) ) text_item = self . scene ( ) . addText ( text_str , QFont ( 'Courier New' ) ) text_item . setDefaultTextColor ( QColor ( 255 , 255 , 255 ) ) text_item . setPos ( 10 , self . height ( ) - text_item . boundingRect ( ) . height ( ) - 10 )
Draw ancillary data on the image, if there is any
Draw ancillary data on the image if there is any
"""
        Draw ancillary data on the image, if there is any
        :return: None
        """
None
self