Important: These forums are for discussions between SkyDemon users. They are not routinely monitored by SkyDemon staff so any urgent issues should be sent directly to our Customer Support.

Exporting a Flight Plan to FSM


Author
Message
philippecmartin
philippecmartin
Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)
Group: Forum Members
Posts: 23, Visits: 29
Hi,
I was delighted to find out that SkyDemon connected to X-Plane after purchasing it.
I noticed though that none of the export formats were fsm.

I wrote a small script that converts GPX to FSM (not perfect but working) and my question is.

I chose GPX since it is a documented format and I assume I can legally do that; is there a SkyDemon policy that says otherwise ?

Also: would it make more sense to use one of the other formats as input instead.

Note that I would be glad to share that script once stable.

Regards,
Philippe


Tim Dawson
Tim Dawson
SkyDemon Team (678K reputation)SkyDemon Team (678K reputation)SkyDemon Team (678K reputation)SkyDemon Team (678K reputation)SkyDemon Team (678K reputation)SkyDemon Team (678K reputation)SkyDemon Team (678K reputation)SkyDemon Team (678K reputation)SkyDemon Team (678K reputation)
Group: Forum Members
Posts: 8.1K, Visits: 9.3K
Once SkyDemon has outputted a route in GPX format you're free to do whatever you like with it, it's just a file.
philippecmartin
philippecmartin
Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)
Group: Forum Members
Posts: 23, Visits: 29
Great, thanks.
Regards,
Philippe


Edited 3/17/2016 10:55:15 PM by philippecmartin
philippecmartin
philippecmartin
Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)Too Much Forum (3.2K reputation)
Group: Forum Members
Posts: 23, Visits: 29
Here is the script if interested - needs python 2.7 installed

DEST = '{PATH TO XPLANE HERE}/Output/FMS plans/'
SOURCE = '{PATH TO SKYDEMON GPX HERE}/SkyDemon/Routes/*.gpx'


import xml.etree.ElementTree as ET
import os
#ref GPX: http://www.topografix.com/GPX/1/1/
import glob


ELEVATION = 'ele'
LATITUDE = 'lat'
LONGITUDE = 'lon'
SYM = 'sym'
#*******************************************************************************
#*******************************************************************************
#*******************************************************************************
class GPX2FSM:
    #***************************************************************************
    #***************************************************************************
    #***************************************************************************
    def __init__ (self):
        pass
    #***************************************************************************
    #***************************************************************************
    #***************************************************************************
    def Convert(self, fn):
        tree = ET.parse(fn)
        root = tree.getroot()
       
        fms = []
        route = root.getchildren()[0]
        fms.append('I')
        fms.append('3 version')
        fms.append('1')
        fms.append('1')
        index = 0
        for wp in route:
            d =  wp.attrib
            if LATITUDE in d and LONGITUDE in d:
                lat = d[LATITUDE]
                lon = d[LONGITUDE]
                ele = '3000'
                waypoint = 'WP%d' % index
                wp_found = False
                for c in wp.getchildren():
                    if -1 != c.tag.find(ELEVATION):
                        ele = c.text
                    if -1 != c.tag.find(SYM):
                        wp_found = True
                        waypoint = c.text
               
               
               
               
                #fms.append('1 %s%d 3000 %s %s' % (WAYPOINT, index, lat, lon))
                fms.append('1 %s %s %s %s' % (waypoint, ele, lat, lon))
                if not wp_found:
                    index += 1
           
        return fms
#*******************************************************************************
#*******************************************************************************
#*******************************************************************************
if __name__ == "__main__":
    o = GPX2FSM()
    files = glob.glob(SOURCE)
    for src in files:
        fms = o.Convert(src)
       
        dst = DEST + 'conv-'  + os.path.basename(src).split('.')[0] + '.fms'
        print 'writing ' + dst
        f = open (dst,'w')
        for i in fms:
            f.write(i + '\n')
        f.close()
   
   
   

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Login

Explore
Messages
Mentions
Search