コード例 #1
0
ファイル: hud2dtf.py プロジェクト: raviyer/warbirds
def dtf_connect_points(points):
    d = ""
    total_distance = 0
    last_dist = 0
    for i,s in enumerate(points[:-1]):
        e = points[i+1]
        total_distance += distance(s, e)
        if (total_distance - last_dist) > feet(40):
            offset = e.offset_miles(1,0)
            d += dtf.dtf_text(offset,
                             "T+%02d %.2f miles, %s, %dmph. tas" %
                             (int(e.tm/60), miles(total_distance),
                              alt_text(e.alt), int(e.tas)))
            d += dtf.dtf_circle(e, feet(1))
            last_dist = total_distance
            m = midpoint(s,e)
            a1,a2 = arrow(s,m)
            d += dtf.dtf_line(m,a1)
            d += dtf.dtf_line(m,a2)
            d += dtf.dtf_line(a1,a2)
        d += dtf.dtf_line(s,e)
    return d
コード例 #2
0
ファイル: grid.py プロジェクト: raviyer/warbirds
def draw_grid_labels(t):
    labels = generate_grid_numbers(t)
    s = ""
    for (l,p) in labels:
        s += dtf.dtf_text(p, l)
    return s