예제 #1
0
def quick_stg_line(path_to_scenery, ac_fname, position, elevation, heading, show=True):
    """debug."""
    stg_path = calc_tile.construct_path_to_stg(path_to_scenery, position)
    stg_fname = calc_tile.construct_stg_file_name(position)
    stg_line = "OBJECT_STATIC %s %1.7f %1.7f %1.2f %g\n" % (ac_fname, position.lon, position.lat, elevation, heading)
    if show == 1 or show == 3:
        print stg_path + stg_fname
    if show == 2 or show == 3:
        print stg_line
    #        print "%s\n%s" % (stg_path + stg_fname, stg_line)
    return stg_path, stg_fname, stg_line
예제 #2
0
def quick_stg_line(path_to_scenery,
                   ac_fname,
                   position,
                   elevation,
                   heading,
                   show=True):
    """debug."""
    stg_path = calc_tile.construct_path_to_stg(path_to_scenery, position)
    stg_fname = calc_tile.construct_stg_file_name(position)
    stg_line = "OBJECT_STATIC %s %1.7f %1.7f %1.2f %g\n" % (
        ac_fname, position.lon, position.lat, elevation, heading)
    if show == 1 or show == 3:
        print(stg_path + stg_fname)
    if show == 2 or show == 3:
        print(stg_line)


#        print ("%s\n%s" % (stg_path + stg_fname, stg_line))
    return stg_path, stg_fname, stg_line
예제 #3
0
stg_manager = stg_io2.STG_Manager(path_to_fg_out, OUR_MAGIC, overwrite=True)

logging.info("probing elevation")
ac_file_list = []
ac_object_list = []
for o in objects:
    if o.msl == None:
        if not args.no_elev: 
            o.msl = elev_prober(o.pos)
        else:
            o.msl = 0.1
        #logging.debug("object %s: elev probed %s" % (o.file, str(o.msl)))
    else:
        logging.debug("object %s: using provided MSL=%g" % (o.file, o.msl))

    stg_file_name = calc_tile.construct_stg_file_name(o.pos)
    stg_path = calc_tile.construct_path_to_stg(path_to_fg_out, o.pos)
    #print stg_file_name, stg_path
    # -- build list of objects to be converted
    full_path = get_source_path(o)
    full_path = "/tmp"
    if full_path != False:
        path_to_stg = stg_manager.add_object_shared(o.prefix + o.file + ".ac", o.pos, o.msl, 90-o.hdg)
        mk_dirs(path_to_stg + o.prefix)
        o.path_to_ac = path_to_stg + o.prefix + o.file + '.ac'
        if o.path_to_ac not in ac_file_list:
            ac_file_list.append(o.path_to_ac)
            ac_object_list.append(o)
            if os.path.exists(o.path_to_ac):
                print "EX ", o
            else:
예제 #4
0
stg_manager = stg_io2.STG_Manager(path_to_fg_out, OUR_MAGIC, overwrite=True)

logging.info("probing elevation")
ac_file_list = []
ac_object_list = []
for o in objects:
    if o.msl == None:
        if not args.no_elev:
            o.msl = elev_prober(o.pos)
        else:
            o.msl = 0.1
        #logging.debug("object %s: elev probed %s" % (o.file, str(o.msl)))
    else:
        logging.debug("object %s: using provided MSL=%g" % (o.file, o.msl))

    stg_file_name = calc_tile.construct_stg_file_name(o.pos)
    stg_path = calc_tile.construct_path_to_stg(path_to_fg_out, o.pos)
    #print stg_file_name, stg_path
    # -- build list of objects to be converted
    full_path = get_source_path(o)
    full_path = "/tmp"
    if full_path != False:
        path_to_stg = stg_manager.add_object_shared(o.prefix + o.file + ".ac",
                                                    o.pos, o.msl, 90 - o.hdg)
        mk_dirs(path_to_stg + o.prefix)
        o.path_to_ac = path_to_stg + o.prefix + o.file + '.ac'
        if o.path_to_ac not in ac_file_list:
            ac_file_list.append(o.path_to_ac)
            ac_object_list.append(o)
            if os.path.exists(o.path_to_ac):
                print "EX ", o