def UpdatePower(self): powerLoadInfo = self.controller.GetPowerLoad() powerOutputInfo = self.controller.GetPowerOutput() powerLoadText = FmtAmt(powerOutputInfo.value - powerLoadInfo.value, showFraction=1) coloredPowerLoadText = GetColoredText( isBetter=powerLoadInfo.isBetterThanBefore, text=powerLoadText) powerOutputText = FmtAmt(powerOutputInfo.value, showFraction=1) coloredPowerOutputText = GetColoredText( isBetter=powerOutputInfo.isBetterThanBefore, text=powerOutputText) self.power_statustext.text = '%s/%s' % (coloredPowerLoadText, coloredPowerOutputText)
def UpdateCPU(self): cpuLoadInfo = self.controller.GetCPULoad() cpuOutputInfo = self.controller.GetCPUOutput() cpuLoadText = FmtAmt(cpuOutputInfo.value - cpuLoadInfo.value, showFraction=1) coloredCpuLoadText = GetColoredText( isBetter=cpuLoadInfo.isBetterThanBefore, text=cpuLoadText) cpuOutputText = FmtAmt(cpuOutputInfo.value, showFraction=1) coloredCpuOutputText = GetColoredText( isBetter=cpuOutputInfo.isBetterThanBefore, text=cpuOutputText) self.cpu_statustext.text = '%s/%s' % (coloredCpuLoadText, coloredCpuOutputText)
def SetFuelUsageText(self): fuelPerDay = self.controller.GetFuelUsage() text = GetByLabel('UI/Fitting/FittingWindow/FuelPerDay', unitsPerDay=fuelPerDay.value) coloredText = GetColoredText(isBetter=fuelPerDay.isBetterThanBefore, text=text) self.SetLabel(self.fuelInfo[0], coloredText)
def UpdateCalibration(self): calibrationLoadInfo = self.controller.GetCalibrationLoad() calibrationOutputInfo = self.controller.GetCalibrationOutput() calibrationLoadText = FmtAmt(calibrationOutputInfo.value - calibrationLoadInfo.value, showFraction=1) coloredCalibrationLoadText = GetColoredText( isBetter=calibrationLoadInfo.isBetterThanBefore, text=calibrationLoadText) calibrationOutputText = FmtAmt(calibrationOutputInfo.value, showFraction=1) coloredCalibrationOutputText = GetColoredText( isBetter=calibrationOutputInfo.isBetterThanBefore, text=calibrationOutputText) self.calibration_statustext.text = '%s/%s' % ( coloredCalibrationLoadText, coloredCalibrationOutputText)
def SetDeltaText(self, deltaInfo, deltaPercentageInfo): deltaText = GetByLabel('UI/Fitting/FittingWindow/CapacitorDelta', delta=deltaInfo.value, percentage=deltaPercentageInfo.value) deltaText = GetColoredText(isBetter=deltaInfo.isBetterThanBefore, text=deltaText) self.delteLabel.text = deltaText
def SetScanResolutionText(self): scanResolutionInfo = self.controller.GetScanResolution() text = GetByLabel('UI/Fitting/FittingWindow/ScanResolution', resolution=int(scanResolutionInfo.value)) coloredText = GetColoredText( isBetter=scanResolutionInfo.isBetterThanBefore, text=text) self.SetLabel(scanResolutionInfo.attributeID, coloredText)
def SetAlignTimeText(self): alignTime = self.controller.GetAlignTime() text = GetByLabel('UI/Fitting/FittingWindow/AlignTime', value=alignTime.value) coloredText = GetColoredText(isBetter=alignTime.isBetterThanBefore, text=text) self.SetLabel(self.alignTimeInfo[0], coloredText)
def SetMaxVelocityText(self): maxVelocityInfo = self.controller.GetMaxVelocity() text = GetByLabel('UI/Fitting/FittingWindow/ColoredMaxVelocity', maxVelocity=maxVelocityInfo.value) coloredText = GetColoredText( isBetter=maxVelocityInfo.isBetterThanBefore, text=text) self.SetStatusText(coloredText)
def SetAgilityText(self): agilityInfo = self.controller.GetAgility() text = GetByLabel('UI/Fitting/FittingWindow/InertiaModifier', value=agilityInfo.value) coloredText = GetColoredText(isBetter=agilityInfo.isBetterThanBefore, text=text) self.SetLabel(dogmaConst.attributeAgility, coloredText)
def SetSignatureText(self): signatureRadiusInfo = self.controller.GetSignatureRadius() text = GetByLabel('UI/Fitting/FittingWindow/TargetingRange', range=signatureRadiusInfo.value) coloredText = GetColoredText( isBetter=signatureRadiusInfo.isBetterThanBefore, text=text) self.SetLabel(signatureRadiusInfo.attributeID, coloredText)
def SetMaxTargetsText(self): maxTargetingInfo = self.controller.GetMaxTargets() text = GetByLabel('UI/Fitting/FittingWindow/MaxLockedTargets', maxTargets=int(maxTargetingInfo.value)) coloredText = GetColoredText( isBetter=maxTargetingInfo.isBetterThanBefore, text=text) self.SetLabel(maxTargetingInfo.attributeID, coloredText)
def SetWarpSpeedText(self): baseWarpSpeedInfo = self.controller.GetBaseWarpSpeed() warpSpeedMultiplierInfo = self.controller.GetWarpSpeedMultiplier() distValue = baseWarpSpeedInfo.value * warpSpeedMultiplierInfo.value * appConst.AU text = GetByLabel('UI/Fitting/FittingWindow/WarpSpeed', distText=FmtDist(distValue, 2)) coloredText = GetColoredText( isBetter=warpSpeedMultiplierInfo.isBetterThanBefore, text=text) self.SetLabel(dogmaConst.attributeBaseWarpSpeed, coloredText)
def SetTargetingHeader(self): maxTargetRangeInfo = self.controller.GetMaxTargetRange() maxRange = maxTargetRangeInfo.value / 1000.0 text = GetByLabel('UI/Fitting/FittingWindow/TargetingHeader', maxRange=maxRange) coloredText = GetColoredText( isBetter=maxTargetRangeInfo.isBetterThanBefore, text=text) headerHint = GetByLabel('UI/Fitting/FittingWindow/TargetingHeaderHint') self.SetStatusText(coloredText, headerHint)
def SetRechargeText(self): maxCapInfo = self.controller.GetCapacitorCapacity() maxCapFormattedValue = GetFormatAndValue(self.capCapacityAttribute, int(maxCapInfo.value)) maxCapText = GetColoredText(isBetter=maxCapInfo.isBetterThanBefore, text=maxCapFormattedValue) rechargeRate = self.controller.GetCapRechargeRate() rechargeFormattedValue = GetFormatAndValue(self.rechargeRateAttribute, int(rechargeRate.value)) rechargeRateText = GetColoredText( isBetter=rechargeRate.isBetterThanBefore, text=rechargeFormattedValue) capText = GetByLabel( 'UI/Fitting/FittingWindow/CapacitorCapAndRechargeTime', capacitorCapacity=maxCapText, capacitorRechargeTime=rechargeRateText, startColorTag1='', startColorTag2='', endColorTag='') self.capAndRechargeLabel.text = capText
def SetMassText(self): massInfo = self.controller.GetMass() if massInfo.value > 10000.0: value = massInfo.value / 1000.0 massText = GetByLabel('UI/Fitting/FittingWindow/MassTonnes', mass=value) else: massText = GetByLabel('UI/Fitting/FittingWindow/MassKg', mass=massInfo.value) coloredText = GetColoredText(isBetter=massInfo.isBetterThanBefore, text=massText) self.SetLabel(dogmaConst.attributeMass, coloredText)
def _Update(self): cap = self.GetCapacity() if not cap: return if not self or self.destroyed: return capacityInfo = self.GetCapacityInfo() cap2 = capacityInfo.value used = util.FmtAmt(cap.used, showFraction=1) cap2 = util.FmtAmt(cap2, showFraction=1) coloredText = GetColoredText(isBetter=capacityInfo.isBetterThanBefore, text=cap2) self.SetStatusText(used, coloredText, '')
def SetSensorStrengthElements(self): sensorStrenghtInfos = { dogmaConst.attributeScanRadarStrength: self.controller.GetScanRadarStrength(), dogmaConst.attributeScanMagnetometricStrength: self.controller.GetScanMagnetometricStrength(), dogmaConst.attributeScanGravimetricStrength: self.controller.GetScanGravimetricStrength(), dogmaConst.attributeScanLadarStrength: self.controller.GetScanLadarStrength() } maxSensorStrenghtAttributeID, maxSensorStrengthInfo = (None, None) for attributeID, strengthInfo in sensorStrenghtInfos.iteritems(): if maxSensorStrengthInfo is None or strengthInfo.value > maxSensorStrengthInfo.value: maxSensorStrengthInfo = strengthInfo maxSensorStrenghtAttributeID = attributeID text = GetByLabel('UI/Fitting/FittingWindow/SensorStrength', points=maxSensorStrengthInfo.value) coloredText = GetColoredText( isBetter=maxSensorStrengthInfo.isBetterThanBefore, text=text) self.SetLabel('sensorStrength', coloredText) attributeInfo = cfg.dgmattribs.Get(maxSensorStrenghtAttributeID) self.LoadIcon('sensorStrength', attributeInfo.iconID)