Move shield regen graph to new infrastructure
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
import math
|
||||
from logbook import Logger
|
||||
|
||||
from .base import SmoothGraph
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitShieldAmountVsTimeGraph(SmoothGraph):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
import gui.mainFrame
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
def getYForX(self, fit, extraData, time):
|
||||
if time < 0:
|
||||
return 0
|
||||
maxShield = fit.ship.getModifiedItemAttr('shieldCapacity')
|
||||
regenTime = fit.ship.getModifiedItemAttr('shieldRechargeRate') / 1000
|
||||
# https://wiki.eveuniversity.org/Capacitor#Capacitor_recharge_rate (shield is similar to cap)
|
||||
shield = maxShield * (1 + math.exp(5 * -time / regenTime) * -1) ** 2
|
||||
useEhp = self.mainFrame.statsPane.nameViewMap["resistancesViewFull"].showEffective
|
||||
if fit.damagePattern is not None and useEhp:
|
||||
shield = fit.damagePattern.effectivify(fit, shield, 'shield')
|
||||
return shield
|
||||
@@ -1,22 +0,0 @@
|
||||
import math
|
||||
|
||||
from .base import SmoothGraph
|
||||
|
||||
|
||||
class FitShieldRegenVsShieldPercGraph(SmoothGraph):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
import gui.mainFrame
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
def getYForX(self, fit, extraData, perc):
|
||||
maxShield = fit.ship.getModifiedItemAttr('shieldCapacity')
|
||||
regenTime = fit.ship.getModifiedItemAttr('shieldRechargeRate') / 1000
|
||||
currentShield = maxShield * perc / 100
|
||||
# https://wiki.eveuniversity.org/Capacitor#Capacitor_recharge_rate (shield is similar to cap)
|
||||
regen = 10 * maxShield / regenTime * (math.sqrt(currentShield / maxShield) - currentShield / maxShield)
|
||||
useEhp = self.mainFrame.statsPane.nameViewMap["resistancesViewFull"].showEffective
|
||||
if fit.damagePattern is not None and useEhp:
|
||||
regen = fit.damagePattern.effectivify(fit, regen, 'shield')
|
||||
return regen
|
||||
Reference in New Issue
Block a user