Skip to content

Commit 835276c

Browse files
committed
#187 - Baby steps towards Open File Dialog - need to fix formatting and buttons, but integration is good
1 parent c638381 commit 835276c

File tree

4 files changed

+267
-12
lines changed

4 files changed

+267
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#
2+
# DeepRacer Guru
3+
#
4+
# Version 3.0 onwards
5+
#
6+
# Copyright (c) 2021 dmh23
7+
#
8+
9+
from prototype_ui.track_v4 import Track
10+
import src.personalize.configuration.personal_track_annotations as config
11+
12+
13+
class HotRodSuperSpeedwayClockwiseTrack(Track):
14+
def __init__(self):
15+
super().__init__()
16+
17+
self._ui_name = "Hot Rod Super Speedway (New - Clockwise)"
18+
self._ui_description = "The Hot Rod Super Speedway adds pro difficulty to the short track counterpart. With a length of 59.69m, the speed loving arch is replaced by 4 short straightaways coupled with variable angle turns. Skillful racers may bisect the chicanes to extending speed generating opportunities and pull away from the pack."
19+
self._ui_length_in_m = 59.69 # metres
20+
self._ui_width_in_cm = 107 # centimetres
21+
self._world_name = "arctic_pro_cw"
22+
self._track_sector_dividers = [35, 72, 114, 152]
23+
self._annotations = config.hot_rod_super_speedway_cw_annotations
24+
self._track_width = 1.066
25+
26+
self._track_waypoints = [(6.619300033710324, 3.690140667829708), (6.919763233325803, 3.6574257048704184),
27+
(7.218042995593869, 3.609760824117855), (7.502468492648923, 3.51003331271191),
28+
(7.726115610263669, 3.312033716116146), (7.810499336383664, 3.0254631671049155),
29+
(7.776380207202756, 2.7263587149717368), (7.6607598325231905, 2.44804019061108),
30+
(7.483158733508908, 2.203957203302578), (7.261891510150754, 1.9986681970693625),
31+
(7.005032922885739, 1.8401331934072531), (6.722357418201291, 1.734268787775234),
32+
(6.424557830951535, 1.6851387652494467), (6.122362997196042, 1.6814346942045248),
33+
(5.820130493305051, 1.6808267864324606), (5.517897512576901, 1.6807256969549216),
34+
(5.215664770267331, 1.6813172730543173), (4.913432981632077, 1.6822552713491477),
35+
(4.611203100345456, 1.6834977301694907), (4.308977510593259, 1.685661736402706),
36+
(4.006756927631223, 1.6883991989233054), (3.7045393249014253, 1.6915152105428732),
37+
(3.4023354312399263, 1.6956802043058432), (3.1001469155767793, 1.7008612188436545),
38+
(2.7981833478430147, 1.7121137413122214), (2.4964908620336885, 1.7294492754079855),
39+
(2.1945473214605684, 1.719509724054531), (1.8977473637083406, 1.6664942535497702),
40+
(1.6601214071730013, 1.485968771848873), (1.5317214390257234, 1.2152991923429526),
41+
(1.5556349417188997, 0.9182824524976767), (1.6890529057005281, 0.6473380061723746),
42+
(1.8493548294523592, 0.39136535627026925), (2.028443958423459, 0.14792621460934052),
43+
(2.2152153512457247, -0.08968347730855575), (2.4014333745458956, -0.32772842003773084),
44+
(2.581623341701352, -0.5703565892837488), (2.7542433997610445, -0.8184201982877695),
45+
(2.9605074187734957, -1.0385872391126596), (3.204863931796872, -1.2158289519212686),
46+
(3.47335543837341, -1.3540432122610055), (3.758198883197629, -1.4545814362428628),
47+
(4.053451921604001, -1.5180832115076028), (4.354465868137204, -1.543805774774357),
48+
(4.656615879199826, -1.541263279046818), (4.957712795398557, -1.5157888499162637),
49+
(5.257970955036008, -1.4870693055055582), (5.560685064456784, -1.4957856503389322),
50+
(5.863636877200925, -1.5080759790800058), (6.166098978183591, -1.5129998293779336),
51+
(6.468175317905271, -1.5121402707956277), (6.770348932407224, -1.5127517548463785),
52+
(7.072579052112424, -1.514195736970707), (7.374808218143308, -1.5156402555368387),
53+
(7.67695822920593, -1.52162533673267), (7.974213983676755, -1.57425224455814),
54+
(8.25612583365234, -1.6822252241037332), (8.512551691196286, -1.8415302601716959),
55+
(8.734216596744382, -2.046460327234074), (8.912975217960202, -2.28972619446735),
56+
(9.04335727896484, -2.5620172587297403), (9.127966787479245, -2.851824697580143),
57+
(9.161175157687985, -3.151811179246708), (9.139048483035886, -3.4528083172700845),
58+
(9.061984445712888, -3.744592842187687), (8.920734789035642, -4.010817226495548),
59+
(8.708838846347653, -4.224648412790104), (8.441910173557126, -4.364076313104435),
60+
(8.147164728305661, -4.4279246893785436), (7.845434572360837, -4.428677615251346),
61+
(7.5446781178930635, -4.401037749376102), (7.24312033858093, -4.380840238656803),
62+
(6.941571380756223, -4.360521253671451), (6.640037443301999, -4.3399751749895055),
63+
(6.338525917194211, -4.319099244203373), (6.037043239734494, -4.297813829507633),
64+
(5.735595848224484, -4.276038822259708), (5.434174921176755, -4.253894266214176),
65+
(5.132775928638303, -4.2314583626649815), (4.831410553119504, -4.208569821443363),
66+
(4.53009691443237, -4.1850151387117345), (4.228862430713498, -4.160472449388309),
67+
(3.92774095740112, -4.134576257791324), (3.6268298884847994, -4.106348809327884),
68+
(3.3266788979986543, -4.071166810121341), (3.0284998675802584, -4.021857198800846),
69+
(2.735557462833249, -3.9488587942979776), (2.465326931140744, -3.8153807488344156),
70+
(2.2327648660162325, -3.6230922308824502), (2.027989949844205, -3.4009547797105752),
71+
(1.8283779283979769, -3.1742072668931924), (1.5986834427336092, -2.978280243005558),
72+
(1.3355744143942263, -2.830876287545965), (1.0438334008673067, -2.757095274057194),
73+
(0.7419834097841616, -2.7430278626344644), (0.44023924674781134, -2.725845274057194),
74+
(0.138491298816529, -2.708727773752018), (-0.163273072057045, -2.691901263322636),
75+
(-0.46503976378647394, -2.6751167145631753), (-0.7668010631581907, -2.658235844697758),
76+
(-1.0685611704370146, -2.641332801904484), (-1.3703176120301848, -2.624365862932011),
77+
(-1.6720630863687163, -2.6072062817476236), (-1.973788593151248, -2.589692291345402),
78+
(-2.27549812588898, -2.5719093647859537), (-2.5772056320687895, -2.55409866246204),
79+
(-2.8788960913201933, -2.5359923211000406), (-3.1783987024804716, -2.498302754487797),
80+
(-3.4655805567285185, -2.405420776929661), (-3.7323370913049345, -2.2640058365724527),
81+
(-3.9752716759225493, -2.0845718351266824), (-4.194540713169253, -1.8767732945344888),
82+
(-4.392367575504458, -1.6484007206819498), (-4.571483586170352, -1.405037280645176),
83+
(-4.734605644085086, -1.150652047719761), (-4.8844085672876005, -0.8881845441720926),
84+
(-5.0269466379663115, -0.6216759351156198), (-5.206317756511844, -0.37970611872892013),
85+
(-5.438599441387332, -0.18782706233481994), (-5.714106176235354, -0.06541628810386291),
86+
(-6.009161565639651, -0.0010200706384622116),
87+
(-6.3100701311608915, 0.018783781204418037),
88+
(-6.599644039013064, -0.06182796927909484), (-6.851443622448123, -0.22744473489741912),
89+
(-7.070154044963992, -0.4358148914835893), (-7.295429561474002, -0.6368217137716257),
90+
(-7.551499460079349, -0.7966631469390832), (-7.831906650402225, -0.9083172050378763),
91+
(-8.12756213937012, -0.969247337903782), (-8.429288480617679, -0.9805848565957986),
92+
(-8.729261491634524, -0.9461147901676141), (-9.019480321743167, -0.8632234004400217),
93+
(-9.28315648827759, -0.717466783251568), (-9.480392072536624, -0.4913331237695657),
94+
(-9.567549798824466, -0.20422327193240752), (-9.54670104775635, 0.09622022089739213),
95+
(-9.445052717067874, 0.38006177124758134), (-9.32379541192261, 0.6569033446647681),
96+
(-9.202591989376224, 0.9337690803148306), (-9.081736657955325, 1.2107864352800406),
97+
(-8.96059903893677, 1.48768121329327), (-8.840049836971438, 1.7648322018720664),
98+
(-8.701108548977054, 2.031746152315334), (-8.493853662349856, 2.2507576974966086),
99+
(-8.239468191005862, 2.4125372799970664), (-7.953809116222535, 2.50932222929974),
100+
(-7.654212091304936, 2.545627239618496), (-7.352666471340335, 2.530429187689022),
101+
(-7.0569995382806425, 2.4692367347814597), (-6.762902114727176, 2.39958626357098),
102+
(-6.46814904008118, 2.3327676686384238), (-6.172814462520755, 2.2685656580068625),
103+
(-5.8770795801660185, 2.206232193384365), (-5.580870483257449, 2.146193269167141),
104+
(-5.284274432994998, 2.0880982312299765), (-4.987110469677127, 2.0329842599966086),
105+
(-4.689399335720218, 1.9809082182981528), (-4.389588449337161, 1.9442226919271506),
106+
(-4.087609622814334, 1.9483406576253928), (-3.789084050991214, 1.9940722021200217),
107+
(-3.4996386507531767, 2.080344739828304), (-3.2235541084787016, 2.2028467687704123),
108+
(-2.964914653637088, 2.358862224493221), (-2.7250981071969633, 2.54259163466473),
109+
(-2.5056280830880766, 2.750194254789547), (-2.3083951214334135, 2.9790617856123007),
110+
(-2.133405063488162, 3.225349727544979), (-1.9826476315042143, 3.4871737393476523),
111+
(-1.8429171184083586, 3.7550182971097983), (-1.6624635795137053, 3.9969223174192465),
112+
(-1.4374768177053099, 4.197912159834103), (-1.1762738863011961, 4.34893781271954),
113+
(-0.8899665215989707, 4.444275799665646), (-0.5906981566926603, 4.482390585813717),
114+
(-0.2889054214587574, 4.468883219633297), (0.01213588919433306, 4.444428268346981),
115+
(0.31243565287383745, 4.409727278623776), (0.6122367938974733, 4.368135634336666),
116+
(0.9121378919103975, 4.327924075994686), (1.212166931293332, 4.289475146208004),
117+
(1.5123234054067964, 4.2527887257673305), (1.8126078506925936, 4.217865649137692),
118+
(2.1130199691274996, 4.184704724226193), (2.413537885806882, 4.153008285436825),
119+
(2.7140474578359957, 4.121209326658444), (3.014532472751462, 4.089081111822323),
120+
(3.314992930553281, 4.056624236974911), (3.6154289504507418, 4.023838344488339),
121+
(3.9158393403509493, 3.9907230767347373), (4.216226961276853, 3.957296076688961),
122+
(4.516606952808225, 3.92379862395306), (4.816985275409543, 3.8903092774488486),
123+
(5.117361929080808, 3.8568267258741415), (5.41773643698486, 3.823351684484676),
124+
(5.718109275958859, 3.789883795652584), (6.018480684421384, 3.7564252051450766),
125+
(6.318872596881711, 3.7231403025724448), (6.619300033710324, 3.690140667829708)]

src/prototype_ui/main.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
from configuration.config_manager import ConfigManager
77
from prototype_ui.actions import Actions
88
from prototype_ui.menubar import MenuBarManager
9-
from prototype_ui.open_file_dialog import OpenFileDialog
109
from prototype_ui.please_wait import PleaseWait
1110
from prototype_ui.toolbar import ToolBarManager
1211
from prototype_ui.track_analysis_canvas import TrackAnalysisCanvas, FilledCircle, TrackArea, Line
1312
from prototype_ui.tracks_v4 import get_all_tracks
13+
from prototype_ui.open_file_dialog import OpenFileDialog
14+
1415

1516

1617
class MainWindow(QMainWindow):
@@ -51,7 +52,7 @@ def __init__(self):
5152
# Initialise tracks & draw here temporarily to prove everything works or not
5253

5354
self._tracks = get_all_tracks()
54-
self._current_track = self._tracks["reinvent_base"]
55+
self._current_track = self._tracks["arctic_pro_cw"]
5556
self._current_track.configure_track_canvas(self.canvas)
5657
# self.canvas.set_track_area(TrackArea(0, 0, 10, 10))
5758
self._current_track.draw_track_edges(self.canvas, Qt.GlobalColor.red)

0 commit comments

Comments
 (0)