Skip to content

Commit caccc93

Browse files
committed
added metar
1 parent 8bf5982 commit caccc93

File tree

4 files changed

+3239
-6
lines changed

4 files changed

+3239
-6
lines changed

app/static/css/style.css

+22-6
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ center column
122122

123123
#timeline-container {
124124
width: 100%;
125-
height: 120px;
125+
height: 140px;
126126
align-self: end;
127127
display: grid;
128128
position: relative;
129-
grid-template-rows: auto 32px;
129+
grid-template-rows: auto 12px 30px;
130130
overflow-x: scroll;
131131
overflow-y: hidden;
132132
}
@@ -140,7 +140,7 @@ center column
140140
width: 2px;
141141
margin: 0px 0px;
142142
padding: 0px;
143-
z-index: 3;
143+
z-index: 4;
144144
}
145145

146146
#timeline-cursor-text {
@@ -150,7 +150,7 @@ center column
150150
padding: 1px 2px;
151151
border: 2px solid #000000;
152152
background-color: #ffffff;
153-
z-index: 4;
153+
z-index: 5;
154154
font-size: 9pt;
155155
}
156156

@@ -179,12 +179,27 @@ center column
179179
}
180180

181181
.hour-tick-line {
182-
border-left: 1px solid #303030;
183-
height: 10px;
182+
border-left: 1px solid #505050;
183+
height: 12px;
184184
margin: 0px 4px;
185185
padding: 0px;
186186
}
187187

188+
.metar {
189+
position: absolute;
190+
height: 12px;
191+
width: 16px;
192+
font-size: x-small;
193+
text-align: center;
194+
z-index: 1;
195+
}
196+
197+
.metar:hover {
198+
color: #4693c7;
199+
font-weight: 900;
200+
}
201+
202+
188203
.marker {
189204
position: absolute;
190205
border-radius: 3px;
@@ -194,6 +209,7 @@ center column
194209
border: 1px solid rgba(114, 167, 202, 0.66);
195210
top: 6px;
196211
height: 10px;
212+
z-index: 2;
197213
}
198214

199215
.marker-selected {

app/templates/index.html

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
</div>
5656
{% endfor %}
5757
</div>
58+
<div class="timeline-item">
59+
<div style="font-size: x-small; left:0%; position: absolute;">Metar</div>
60+
{% for metar in data.metar %}
61+
<div class="metar" style="left:{{ (metar[0]-(4.5*3600)) / (16*36) }}%;" title="{{ metar[1] }}">M</div>
62+
{% endfor %}
63+
</div>
5864
<div class="timeline-item scale-item-bar">
5965
{% for i in range(5, 21) %}
6066
<div class="scale-item-item">

app/views.py

+24
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@
77
from .track import main_index, read_day, read_track
88

99

10+
METARFILE = 'metars.txt'
11+
metar = []
12+
13+
def read_metar():
14+
with open(METARFILE) as f:
15+
for l in f:
16+
metar.append(l.strip())
17+
18+
19+
def get_metar(date):
20+
ret = []
21+
for l in metar:
22+
if l.startswith(date.strftime('%Y%m%d')):
23+
hour = int(l[8:10])
24+
min = int(l[10:12])
25+
ret.append((hour*3600+min*60, l[13:]))
26+
27+
return ret
28+
29+
30+
read_metar()
31+
32+
1033
def calendar_data(year : int):
1134
months = []
1235
names = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
@@ -71,6 +94,7 @@ def index(datestr, adr):
7194
'day_tracks': day_tracks,
7295
'selected_track': selected_track,
7396
'selected_filename': selected_filename,
97+
'metar': get_metar(date),
7498
'svg': svg }
7599

76100
return render_template('index.html', data=data)

0 commit comments

Comments
 (0)