def definition (self, donnees) : """ # The data arrives in this form: # /CODED_ROUTE/ # # Couche (NAME) # | Plafond # | | # --V--|--V-- # # The separation will therefore be using the separator "|" """ donnees = donnees.strip(None) tabDonnees = donnees.split("|") for x in xrange(len(tabDonnees)) : tabDonnees[x] = tabDonnees[x].strip(None) # Assigning variables self.name = str(tabDonnees[0]) newLevel = str(int(Convertion.convertLevel(float(tabDonnees[1][1:])))) self.level = { 'min' : Layer.lastLevel, 'max' : newLevel} Layer.lastLevel = newLevel
def definition (self, donnees): """ Disperssion des données # The data arrives in this form: # /SID/ # Convention is as follows: # 1st & 2nd character for the SID point # 3rd & 4th character for the SID number # 5th & 6th character for runway number: 5L=05L, 5R=05R, # 3L=23L, 3R=23R # NAME # | COUCHE # | | POINTS # | | | # V V V # ------|---------|---------------------- # # La dispertion va donc de faire à l'aide du séparateur "|" """ donnees = donnees.strip(None) tabDonnees = donnees.split("|") for x in xrange(len(tabDonnees)) : tabDonnees[x] = tabDonnees[x].strip(None) # Assignation des variables self.name = str(tabDonnees[0]) tabLevel = tabDonnees[1].split('-') altMin = Convertion.convertLevel(str(tabLevel[0][1:].strip(None))) altMax = Convertion.convertLevel(str(tabLevel[1][1:].strip(None))) #print altMin #print altMax self.altitude['min'] = altMin self.altitude['max'] = altMax i = len(self.points) tabPoints = tabDonnees[2].split(' ') for x in tabPoints: if x != '' : self.points[i] = self.defPoints[x] i += 1