Changeset 2009


Ignore:
Timestamp:
04/28/10 20:49:11 (2 years ago)
Author:
tolteque
Message:

o LoPlug?

  • Adaptation to new airport management


NOTE: Dont know why, but airportManager always returns "noname" for the airport name !!!

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/loplug.py

    r1977 r2009  
    2525sys.path.append( os.path.join( sys.path[0], 'common', 'drawobjects')) 
    2626sys.path.append( os.path.join( sys.path[0], 'common', 'lodb')) 
     27sys.path.append( os.path.join( sys.path[0], 'common', 'mesh')) 
    2728sys.path.append( os.path.join( sys.path[0], 'lotatc_server')) 
    2829sys.path.append( os.path.join( sys.path[0], 'lotatc_client')) 
  • trunk/loplug/plugins/lockon/llf.py

    r1944 r2009  
    2323from pgservice                import PGService 
    2424from lotatc_positionConverter import * 
    25 from srtm30                   import Srtm30 
     25from meshselecter             import getMeshServer 
    2626 
    2727# ======================================================================================================== 
     
    5757    self.plugItemRequests     = {}                             #- Dictionnary for all the requests 
    5858    self.posConverter         = PositionConverter()            #- Used to convert (latitude, longitude) to (x,y) 
    59     self.srtm                 = Srtm30()                       #- Used to get target altitude 
    6059     
    6160    self.samplingPeriod       = Llf.LUA_SAMPLING_PERIOD        #- Default sampling period 
     
    153152    self.__computeVerticalVelocityInfo__() 
    154153 
     154    # Get meshServer (Used to get target altitude) according to the FC version used 
     155    fcVersion = self.parentPlug.getFcVersion() 
     156    self.mesh = getMeshServer() 
     157     
     158     
    155159#---------------------------------------------------------------- 
    156160  # To save the settings 
  • trunk/loplug/plugins/lockon/rtb.py

    r1993 r2009  
    2828from lodbselecter             import getDbParser 
    2929from lotatc_positionConverter import * 
     30from airportdatamanager       import * 
    3031 
    3132 
     
    6566    self.dbParser                 = None                      #- FC db parser 
    6667    self.fcVersion                = None                      #- Flamming cliff version 
     68    self.airport_mng              = AirportDataManager("") 
    6769         
    6870# ======================================================================================================== 
     
    138140      range = 100 
    139141      if self.dbParser: 
     142        for airportClsId, airportInfo in self.airport_mng.items(): 
     143          airportName = airportInfo[CST_AIRPORT_NAME] 
     144          print airportClsId, airportName 
     145          self.airportsData[airportName] = {} 
     146          self.airportsData[airportName]["clsId"] = airportClsId 
     147          self.airportsData[airportName]["range"] = range 
     148          range -= 1 
     149        return 
     150       
    140151        for clsId in cst_airportDict.keys(): 
    141152          airportName = self.dbParser.getAirportById(clsId) 
     
    176187    self.widgets["ukraineAirports"].setLayout( ukraineAirports_vBox) 
    177188     
    178     # Process RUSSIAN airports 
     189    # Process airports 
    179190    self.widgets["russiaAirports"] = QGroupBox( self.tr("Russia")) 
    180191    russiaAirports_vBox = QVBoxLayout() 
    181192    self.widgets["russiaAirports"].setLayout( russiaAirports_vBox) 
    182193 
    183     for clsId in cst_airportDict.keys(): 
    184       airportName = cst_airportDict[clsId][CST_AIRPORT_NAME] 
    185       self.widgets[clsId] = QCheckBox( QString( airportName)) 
    186       if cst_airportDict[clsId][CST_AIRPORT_SIDE] == "Ukraine": 
    187         ukraineAirports_vBox.addWidget( self.widgets[clsId]) 
     194    for airportClsId, airportInfo in self.airport_mng.items(): 
     195      self.widgets[airportClsId] = QCheckBox( QString( airportInfo[CST_AIRPORT_NAME])) 
     196      if airportInfo[CST_AIRPORT_SIDE] == "Ukraine": 
     197        ukraineAirports_vBox.addWidget( self.widgets[airportClsId]) 
    188198      else: 
    189         russiaAirports_vBox.addWidget( self.widgets[clsId]) 
    190          
     199        russiaAirports_vBox.addWidget( self.widgets[airportClsId]) 
     200     
     201     
    191202    # Build complete UI 
    192203    hBox = QHBoxLayout() 
     
    209220  def _deinit_ui( self ): 
    210221    self.preselectedAirportClsIds = [] 
    211     for clsId in cst_airportDict.keys(): 
    212       if self.widgets[clsId].isChecked(): 
    213         self.preselectedAirportClsIds.append( clsId) 
     222    for airportClsId, airportInfo in self.airport_mng.items(): 
     223      if self.widgets[airportClsId].isChecked(): 
     224        self.preselectedAirportClsIds.append( airportClsId)    
     225         
     226#    for clsId in cst_airportDict.keys(): 
     227#      if self.widgets[clsId].isChecked(): 
     228#        self.preselectedAirportClsIds.append( clsId) 
    214229#---------------------------------------------------------------- 
    215230  # Method invoked by the PGPluginClient parent on restart() 
Note: See TracChangeset for help on using the changeset viewer.