CPP-TOOLBOX
Loading...
Searching...
No Matches
parse_logs.TimelineVisualizer Class Reference

Public Member Functions

 __init__ (self, Section root_section, str build_direction="up", float ndc_units_per_second=0.5, bool use_custom_root_section_height=True, float custom_root_section_height=0.01, float base_timeline_position_y=0, bool draw_timeline=True, float timeline_tick_width=0.01, float timeline_tick_height=0.1, Optional[str] custom_start_time=None)
 
 from_config (cls, "Section" root_section, str config_path)
 
float time_to_x (self, datetime timestamp)
 
tuple generate_color (self, int depth, int index=0)
 
 draw_base_timeline (self)
 
 draw_ticks (self)
 
float get_depth_scale (self, int depth)
 
float get_event_width_depth_based (self, float root_section_width, int depth)
 
float get_event_width_aspect_ratio_based (self, float section_width)
 
float get_section_rect_height_depth_based (self, float root_section_width, int depth)
 
float get_section_rect_height_aspect_ratio_based (self, float section_width)
 
tuple[float, float, float] draw_section_rect (self, Section section, int depth, int section_index, float bottom_y_section, float root_section_width, float height_is_depth_based=True)
 
 group_event_sequences (self, "Section" section)
 
 draw_event_sequence_annotations (self, List[Event] event_sequence, Section parent_section, int depth, float parent_section_rect_center_y, float parent_section_rect_width, float parent_section_rect_height, float root_section_width, float height_is_depth_based=True)
 
 process_section (self, Section section, int depth, float bottom_y_current_section, int section_index_for_labelling=0, float root_section_width=-1, float height_is_depth_based=False)
 
List[str] generate (self)
 
List[str] save (self, str filename="timeline_visualization.txt")
 

Public Attributes

 root_section = root_section
 
list commands = []
 
list used_text_areas = []
 
int build_direction_factor = "down" else 1
 
 ndc_units_per_second = ndc_units_per_second
 
 use_custom_root_section_height = use_custom_root_section_height
 
 custom_root_section_height = custom_root_section_height
 
 base_timeline_position_y = base_timeline_position_y
 
 draw_timeline = draw_timeline
 
 timeline_tick_width = timeline_tick_width
 
 timeline_tick_height = timeline_tick_height
 
datetime start_time = parse_spdlog_time(custom_start_time)
 
datetime end_time = root_section.end_time
 
tuple total_duration
 

Constructor & Destructor Documentation

◆ __init__()

parse_logs.TimelineVisualizer.__init__ ( self,
Section root_section,
str build_direction = "up",
float ndc_units_per_second = 0.5,
bool use_custom_root_section_height = True,
float custom_root_section_height = 0.01,
float base_timeline_position_y = 0,
bool draw_timeline = True,
float timeline_tick_width = 0.01,
float timeline_tick_height = 0.1,
Optional[str] custom_start_time = None )

Member Function Documentation

◆ draw_base_timeline()

parse_logs.TimelineVisualizer.draw_base_timeline ( self)

◆ draw_event_sequence_annotations()

parse_logs.TimelineVisualizer.draw_event_sequence_annotations ( self,
List[Event] event_sequence,
Section parent_section,
int depth,
float parent_section_rect_center_y,
float parent_section_rect_width,
float parent_section_rect_height,
float root_section_width,
float height_is_depth_based = True )

◆ draw_section_rect()

tuple[float, float, float] parse_logs.TimelineVisualizer.draw_section_rect ( self,
Section section,
int depth,
int section_index,
float bottom_y_section,
float root_section_width,
float height_is_depth_based = True )

◆ draw_ticks()

parse_logs.TimelineVisualizer.draw_ticks ( self)

◆ from_config()

parse_logs.TimelineVisualizer.from_config ( cls,
"Section" root_section,
str config_path )
Factory method to create a TimelineVisualizer from a JSON config file.

Note that the config file's syntax is just json with the key being the TimelineVisualizer attribute and the value the value you want to use.

◆ generate()

List[str] parse_logs.TimelineVisualizer.generate ( self)

◆ generate_color()

tuple parse_logs.TimelineVisualizer.generate_color ( self,
int depth,
int index = 0 )

◆ get_depth_scale()

float parse_logs.TimelineVisualizer.get_depth_scale ( self,
int depth )

◆ get_event_width_aspect_ratio_based()

float parse_logs.TimelineVisualizer.get_event_width_aspect_ratio_based ( self,
float section_width )

◆ get_event_width_depth_based()

float parse_logs.TimelineVisualizer.get_event_width_depth_based ( self,
float root_section_width,
int depth )

◆ get_section_rect_height_aspect_ratio_based()

float parse_logs.TimelineVisualizer.get_section_rect_height_aspect_ratio_based ( self,
float section_width )

◆ get_section_rect_height_depth_based()

float parse_logs.TimelineVisualizer.get_section_rect_height_depth_based ( self,
float root_section_width,
int depth )

◆ group_event_sequences()

parse_logs.TimelineVisualizer.group_event_sequences ( self,
"Section" section )

◆ process_section()

parse_logs.TimelineVisualizer.process_section ( self,
Section section,
int depth,
float bottom_y_current_section,
int section_index_for_labelling = 0,
float root_section_width = -1,
float height_is_depth_based = False )

◆ save()

List[str] parse_logs.TimelineVisualizer.save ( self,
str filename = "timeline_visualization.txt" )

◆ time_to_x()

float parse_logs.TimelineVisualizer.time_to_x ( self,
datetime timestamp )

Member Data Documentation

◆ base_timeline_position_y

parse_logs.TimelineVisualizer.base_timeline_position_y = base_timeline_position_y

◆ build_direction_factor

parse_logs.TimelineVisualizer.build_direction_factor = "down" else 1

◆ commands

list parse_logs.TimelineVisualizer.commands = []

◆ custom_root_section_height

parse_logs.TimelineVisualizer.custom_root_section_height = custom_root_section_height

◆ draw_timeline

parse_logs.TimelineVisualizer.draw_timeline = draw_timeline

◆ end_time

datetime parse_logs.TimelineVisualizer.end_time = root_section.end_time

◆ ndc_units_per_second

parse_logs.TimelineVisualizer.ndc_units_per_second = ndc_units_per_second

◆ root_section

parse_logs.TimelineVisualizer.root_section = root_section

◆ start_time

datetime parse_logs.TimelineVisualizer.start_time = parse_spdlog_time(custom_start_time)

◆ timeline_tick_height

parse_logs.TimelineVisualizer.timeline_tick_height = timeline_tick_height

◆ timeline_tick_width

parse_logs.TimelineVisualizer.timeline_tick_width = timeline_tick_width

◆ total_duration

tuple parse_logs.TimelineVisualizer.total_duration
Initial value:
= (
self.end_time - self.start_time
).total_seconds() * 1e6

◆ use_custom_root_section_height

parse_logs.TimelineVisualizer.use_custom_root_section_height = use_custom_root_section_height

◆ used_text_areas

list parse_logs.TimelineVisualizer.used_text_areas = []

The documentation for this class was generated from the following file: