def GetSolarSystemsInRange_thread(self, solarSystemID):
        shipID = util.GetActiveShip()
        if not shipID:
            return
        self.sr.scroll.Load(
            contentList=[],
            noContentHint=localization.GetByLabel('UI/Common/GettingData'))
        jumpDriveRange, consumptionType, consumptionAmount = self.GetJumpDriveInfo(
            shipID)
        inRange = set()
        soldict = self.soldict.get(solarSystemID, None)
        for solID, solData in cfg.mapSystemCache.iteritems():
            if session.solarsystemid2 != solID and solData.securityStatus <= const.securityClassLowSec:
                distance = uix.GetLightYearDistance(solarSystemID, solID,
                                                    False)
                if distance is not None and distance <= jumpDriveRange:
                    inRange.add(solID)
            self.soldict[solarSystemID] = inRange
        else:
            inRange = soldict

        scrolllist = []
        if inRange:
            for solarSystemID in inRange:
                blue.pyos.BeNice()
                if not self or self.destroyed:
                    return
                requiredQty, requiredType = self.GetFuelConsumptionForMyShip(
                    session.solarsystemid2, solarSystemID, consumptionType,
                    consumptionAmount)
                entry = self.GetSolarSystemBeaconEntry(solarSystemID,
                                                       requiredQty,
                                                       requiredType,
                                                       jumpDriveRange)
                if entry:
                    scrolllist.append(entry)

        if not len(scrolllist):
            self.sr.scroll.ShowHint(
                localization.GetByLabel('UI/Common/NothingFound'))
        if self.sr.scroll and scrolllist and self.sr.Get('showing',
                                                         None) == 'inrange':
            self.sr.scroll.ShowHint('')
            self.sr.scroll.Load(
                contentList=scrolllist,
                headers=[
                    localization.GetByLabel(
                        'UI/Common/LocationTypes/SolarSystem'),
                    localization.GetByLabel(
                        'UI/CapitalNavigation/CapitalNavigationWindow/SecurityColumnHeader'
                    ),
                    localization.GetByLabel(
                        'UI/CapitalNavigation/CapitalNavigationWindow/FuelColumnHeader'
                    ),
                    localization.GetByLabel('UI/Common/Volume'),
                    localization.GetByLabel('UI/Common/Distance'),
                    localization.GetByLabel(
                        'UI/CapitalNavigation/CapitalNavigationWindow/JumpTo')
                ])
 def GetFuelConsumptionForMyShip(self, fromSystem, toSystem,
                                 consumptionType, consumptionAmount):
     if not util.GetActiveShip():
         return
     myDist = uix.GetLightYearDistance(fromSystem, toSystem, False)
     if myDist is None:
         return
     consumptionAmount = myDist * consumptionAmount
     return (int(consumptionAmount), consumptionType)
 def GetSolarSystemBeaconEntry(self,
                               solarSystemID,
                               requiredQty,
                               requiredType,
                               jumpDriveRange,
                               structureID=None,
                               isBridge=False):
     if solarSystemID is None or requiredQty is None or requiredType is None or jumpDriveRange is None:
         return
     invType = cfg.invtypes.Get(requiredType)
     lightYearDistance = uix.GetLightYearDistance(session.solarsystemid2,
                                                  solarSystemID, False)
     s_typename = invType.name
     solarSystemName = localization.GetByLabel(
         'UI/CapitalNavigation/CapitalNavigationWindow/SolarSystemName',
         solarSystem=solarSystemID)
     securityStatus = sm.GetService('map').GetSecurityStatus(solarSystemID)
     requiredVolume = invType.volume * requiredQty
     rangeString = ''
     if jumpDriveRange > lightYearDistance:
         rangeString = 'UI/CapitalNavigation/CapitalNavigationWindow/WithinRange'
     else:
         rangeString = 'UI/CapitalNavigation/CapitalNavigationWindow/NotInRange'
     label = '%s<t>%s<t>%s<t>%s<t>%s<t>%s' % (
         solarSystemName,
         localization.GetByLabel(
             'UI/CapitalNavigation/CapitalNavigationWindow/SecurityStatus',
             securityStatus=securityStatus),
         localization.GetByLabel(
             'UI/CapitalNavigation/CapitalNavigationWindow/FuelTypeRequired',
             fuelType=requiredType,
             requiredQty=requiredQty),
         localization.GetByLabel(
             'UI/CapitalNavigation/CapitalNavigationWindow/FuelVolumeRequired',
             requiredVolume=requiredVolume),
         localization.GetByLabel(
             'UI/CapitalNavigation/CapitalNavigationWindow/DistanceToSystem',
             lightYearDistance=lightYearDistance),
         localization.GetByLabel(rangeString))
     data = util.KeyVal()
     data.label = label
     data.showinfo = 1
     data.typeID = const.typeSolarSystem
     data.itemID = solarSystemID
     if structureID:
         data.beaconID = structureID
         if isBridge:
             data.GetMenu = self.BridgeTo
         else:
             data.GetMenu = self.JumpTo
     data.Set('sort_%s' % localization.GetByLabel('UI/Common/Distance'),
              lightYearDistance)
     data.Set(
         'sort_%s' % localization.GetByLabel(
             'UI/CapitalNavigation/CapitalNavigationWindow/FuelColumnHeader'
         ), requiredQty)
     data.Set('sort_%s' % localization.GetByLabel('UI/Common/Destination'),
              solarSystemName)
     data.Set(
         'sort_%s' % localization.GetByLabel(
             'UI/CapitalNavigation/CapitalNavigationWindow/SecurityColumnHeader'
         ), securityStatus)
     data.Set('sort_%s' % localization.GetByLabel('UI/Common/Volume'),
              requiredVolume)
     return listentry.Get('Generic', data=data)