7
7
8
8
class TrackPainter :
9
9
def __init__ (self ):
10
- self .track_colour = Colours .TRACK_GREY
10
+ self ._track_colour = Colours .TRACK_GREY
11
11
12
- self .waypoint_major_size = 0
13
- self .waypoint_minor_size = 0
12
+ self ._waypoint_major_size = 0
13
+ self ._waypoint_minor_size = 0
14
14
15
- self .waypoints_on = True
16
- self .waypoint_labels_on = False
17
- self .grid_on = False
18
- self .annotations_on = False
19
- self .sectors_on = False
15
+ self ._waypoints_on = True
16
+ self ._waypoint_labels_on = False
17
+ self ._grid_on = False
18
+ self ._annotations_on = False
19
+ self ._sectors_on = False
20
20
21
- self .drawing_order = [ "G" , "A" , "T" , "N" ]
21
+ self ._drawing_order = ["G" , "A" , "T" , "N" ]
22
22
23
23
self .set_track_colour_grey ()
24
24
self .set_waypoint_sizes_micro ()
25
25
26
- self .zoom_x = None
27
- self .zoom_y = None
28
- self .zoom_x2 = None
29
- self .zoom_y2 = None
30
-
31
- self .zoom_in = False
26
+ # Moves elsewhere
27
+ # self.zoom_x = None
28
+ # self.zoom_y = None
29
+ # self.zoom_x2 = None
30
+ # self.zoom_y2 = None
31
+ #
32
+ # self.zoom_in = False
32
33
33
34
def set_track_colour_grey (self ):
34
- self .track_colour = Colours .TRACK_GREY
35
+ self ._track_colour = Colours .TRACK_GREY
35
36
36
37
def set_track_colour_blue (self ):
37
- self .track_colour = Colours .TRACK_BLUE
38
+ self ._track_colour = Colours .TRACK_BLUE
38
39
39
40
def set_waypoint_sizes_large (self ):
40
- self .waypoint_minor_size = 5
41
- self .waypoint_major_size = 9
42
- self .waypoints_on = True
41
+ self ._waypoint_minor_size = 5
42
+ self ._waypoint_major_size = 9
43
+ self ._waypoints_on = True
43
44
44
45
def set_waypoint_sizes_small (self ):
45
- self .waypoint_minor_size = 3
46
- self .waypoint_major_size = 5
47
- self .waypoints_on = True
46
+ self ._waypoint_minor_size = 3
47
+ self ._waypoint_major_size = 5
48
+ self ._waypoints_on = True
48
49
49
50
def set_waypoint_sizes_micro (self ):
50
- self .waypoint_minor_size = 2
51
- self .waypoint_major_size = 3
52
- self .waypoints_on = True
51
+ self ._waypoint_minor_size = 2
52
+ self ._waypoint_major_size = 3
53
+ self ._waypoints_on = True
53
54
54
55
def set_waypoints_off (self ):
55
- self .waypoints_on = False
56
+ self ._waypoints_on = False
56
57
57
58
def set_waypoint_labels_on (self ):
58
- self .waypoint_labels_on = True
59
+ self ._waypoint_labels_on = True
59
60
60
61
def set_waypoint_labels_off (self ):
61
- self .waypoint_labels_on = False
62
+ self ._waypoint_labels_on = False
62
63
63
64
def set_grid_front (self ):
64
- self .grid_on = True
65
- self .drawing_order .remove ("G" )
66
- self .drawing_order .append ("G" )
65
+ self ._grid_on = True
66
+ self ._drawing_order .remove ("G" )
67
+ self ._drawing_order .append ("G" )
67
68
68
69
def set_grid_back (self ):
69
- self .grid_on = True
70
- self .drawing_order .remove ("G" )
71
- self .drawing_order .insert (0 , "G" )
70
+ self ._grid_on = True
71
+ self ._drawing_order .remove ("G" )
72
+ self ._drawing_order .insert (0 , "G" )
72
73
73
74
def set_grid_off (self ):
74
- self .grid_on = False
75
+ self ._grid_on = False
75
76
76
77
def set_track_front (self ):
77
- self .drawing_order .remove ("T" )
78
- self .drawing_order .append ("T" )
78
+ self ._drawing_order .remove ("T" )
79
+ self ._drawing_order .append ("T" )
79
80
80
81
def set_track_back (self ):
81
- self .drawing_order .remove ("T" )
82
- self .drawing_order .insert (0 , "T" )
82
+ self ._drawing_order .remove ("T" )
83
+ self ._drawing_order .insert (0 , "T" )
83
84
84
85
def set_analyze_front (self ):
85
- self .drawing_order .remove ("A" )
86
- self .drawing_order .append ("A" )
86
+ self ._drawing_order .remove ("A" )
87
+ self ._drawing_order .append ("A" )
87
88
88
89
def set_analyze_back (self ):
89
- self .drawing_order .remove ("A" )
90
- self .drawing_order .insert (0 , "A" )
90
+ self ._drawing_order .remove ("A" )
91
+ self ._drawing_order .insert (0 , "A" )
91
92
92
93
def set_annotations_front (self ):
93
- self .annotations_on = True
94
- self .drawing_order .remove ("N" )
95
- self .drawing_order .append ("N" )
94
+ self ._annotations_on = True
95
+ self ._drawing_order .remove ("N" )
96
+ self ._drawing_order .append ("N" )
96
97
97
98
def set_annotations_back (self ):
98
- self .annotations_on = True
99
- self .drawing_order .remove ("N" )
100
- self .drawing_order .insert (0 , "N" )
99
+ self ._annotations_on = True
100
+ self ._drawing_order .remove ("N" )
101
+ self ._drawing_order .insert (0 , "N" )
101
102
102
103
def set_annotations_off (self ):
103
- self .annotations_on = False
104
+ self ._annotations_on = False
104
105
105
106
def set_sectors_on (self ):
106
- self .sectors_on = True
107
+ self ._sectors_on = True
107
108
108
109
def set_sectors_off (self ):
109
- self .sectors_on = False
110
+ self ._sectors_on = False
110
111
111
112
def draw (self , track_canvas : TrackAnalysisCanvas , current_track : Track , episode_filter : EpisodeFilter ):
112
113
# analyzer.recalculate()
@@ -120,32 +121,32 @@ def draw(self, track_canvas: TrackAnalysisCanvas, current_track: Track, episode_
120
121
# else:
121
122
# current_track.configure_track_graphics(track_graphics)
122
123
123
- for do in self .drawing_order :
124
- if do == "G" and self .grid_on :
124
+ for do in self ._drawing_order :
125
+ if do == "G" and self ._grid_on :
125
126
current_track .draw_grid (track_canvas , Colours .GRID_GREY )
126
127
127
128
if do == "T" :
128
- current_track .draw_track_edges (track_canvas , self .track_colour )
129
+ current_track .draw_track_edges (track_canvas , self ._track_colour )
129
130
if episode_filter .filter_complete_section :
130
131
(start , finish ) = episode_filter .filter_complete_section
131
- current_track .draw_section_highlight (track_canvas , self .track_colour , start , finish )
132
-
133
- current_track .draw_starting_line (track_canvas , self .track_colour )
134
- if self .sectors_on :
135
- current_track .draw_sector_dividers (track_canvas , self .track_colour )
136
- current_track .draw_sector_labels (track_canvas , self .track_colour )
137
- if self .waypoints_on :
138
- current_track .draw_waypoints (track_canvas , self .track_colour , self .waypoint_minor_size ,
139
- self .waypoint_major_size )
140
- if self .waypoint_labels_on :
141
- current_track .draw_waypoint_labels (track_canvas , self .track_colour , 9 )
132
+ current_track .draw_section_highlight (track_canvas , self ._track_colour , start , finish )
133
+
134
+ current_track .draw_starting_line (track_canvas , self ._track_colour )
135
+ if self ._sectors_on :
136
+ current_track .draw_sector_dividers (track_canvas , self ._track_colour )
137
+ current_track .draw_sector_labels (track_canvas , self ._track_colour )
138
+ if self ._waypoints_on :
139
+ current_track .draw_waypoints (track_canvas , self ._track_colour , self ._waypoint_minor_size ,
140
+ self ._waypoint_major_size )
141
+ if self ._waypoint_labels_on :
142
+ current_track .draw_waypoint_labels (track_canvas , self ._track_colour , 9 )
142
143
143
144
# if do == "A":
144
145
# if background_analyser:
145
146
# background_analyser.redraw()
146
147
# analyzer.redraw()
147
148
148
- if do == "N" and self .annotations_on :
149
+ if do == "N" and self ._annotations_on :
149
150
current_track .draw_annotations (track_canvas )
150
151
151
152
# def zoom_set(self, track_graphics, x, y, x2, y2):
0 commit comments