Implement point getter for time functions
This commit is contained in:
@@ -41,7 +41,7 @@ class YDpsMixin:
|
|||||||
def _getDamagePerKey(self, fit, time):
|
def _getDamagePerKey(self, fit, time):
|
||||||
# Use data from time cache if time was not specified
|
# Use data from time cache if time was not specified
|
||||||
if time is not None:
|
if time is not None:
|
||||||
return self.graph._timeCache.getDpsDataPoint(fit, time)
|
return self._getTimeCacheDataPoint(fit=fit, time=time)
|
||||||
# Compose map ourselves using current fit settings if time is not specified
|
# Compose map ourselves using current fit settings if time is not specified
|
||||||
dpsMap = {}
|
dpsMap = {}
|
||||||
defaultSpoolValue = eos.config.settings['globalDefaultSpoolupPercentage']
|
defaultSpoolValue = eos.config.settings['globalDefaultSpoolupPercentage']
|
||||||
@@ -64,7 +64,10 @@ class YDpsMixin:
|
|||||||
self.graph._timeCache.prepareDpsData(fit=fit, maxTime=maxTime)
|
self.graph._timeCache.prepareDpsData(fit=fit, maxTime=maxTime)
|
||||||
|
|
||||||
def _getTimeCacheData(self, fit):
|
def _getTimeCacheData(self, fit):
|
||||||
return self.graph._timeCache.getDpsData(fit)
|
return self.graph._timeCache.getDpsData(fit=fit)
|
||||||
|
|
||||||
|
def _getTimeCacheDataPoint(self, fit, time):
|
||||||
|
return self.graph._timeCache.getDpsDataPoint(fit=fit, time=time)
|
||||||
|
|
||||||
|
|
||||||
class YVolleyMixin:
|
class YVolleyMixin:
|
||||||
@@ -72,7 +75,7 @@ class YVolleyMixin:
|
|||||||
def _getDamagePerKey(self, fit, time):
|
def _getDamagePerKey(self, fit, time):
|
||||||
# Use data from time cache if time was not specified
|
# Use data from time cache if time was not specified
|
||||||
if time is not None:
|
if time is not None:
|
||||||
return self.graph._timeCache.getVolleyDataPoint(fit, time)
|
return self._getTimeCacheDataPoint(fit=fit, time=time)
|
||||||
# Compose map ourselves using current fit settings if time is not specified
|
# Compose map ourselves using current fit settings if time is not specified
|
||||||
volleyMap = {}
|
volleyMap = {}
|
||||||
defaultSpoolValue = eos.config.settings['globalDefaultSpoolupPercentage']
|
defaultSpoolValue = eos.config.settings['globalDefaultSpoolupPercentage']
|
||||||
@@ -95,7 +98,10 @@ class YVolleyMixin:
|
|||||||
self.graph._timeCache.prepareVolleyData(fit=fit, maxTime=maxTime)
|
self.graph._timeCache.prepareVolleyData(fit=fit, maxTime=maxTime)
|
||||||
|
|
||||||
def _getTimeCacheData(self, fit):
|
def _getTimeCacheData(self, fit):
|
||||||
return self.graph._timeCache.getVolleyData(fit)
|
return self.graph._timeCache.getVolleyData(fit=fit)
|
||||||
|
|
||||||
|
def _getTimeCacheDataPoint(self, fit, time):
|
||||||
|
return self.graph._timeCache.getVolleyDataPoint(fit=fit, time=time)
|
||||||
|
|
||||||
|
|
||||||
class YInflictedDamageMixin:
|
class YInflictedDamageMixin:
|
||||||
@@ -104,13 +110,16 @@ class YInflictedDamageMixin:
|
|||||||
# Damage inflicted makes no sense without time specified
|
# Damage inflicted makes no sense without time specified
|
||||||
if time is None:
|
if time is None:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
return self.graph._timeCache.getDmgDataPoint(fit, time)
|
return self._getTimeCacheDataPoint(fit=fit, time=time)
|
||||||
|
|
||||||
def _prepareTimeCache(self, fit, maxTime):
|
def _prepareTimeCache(self, fit, maxTime):
|
||||||
self.graph._timeCache.prepareDmgData(fit=fit, maxTime=maxTime)
|
self.graph._timeCache.prepareDmgData(fit=fit, maxTime=maxTime)
|
||||||
|
|
||||||
def _getTimeCacheData(self, fit):
|
def _getTimeCacheData(self, fit):
|
||||||
return self.graph._timeCache.getDmgData(fit)
|
return self.graph._timeCache.getDmgData(fit=fit)
|
||||||
|
|
||||||
|
def _getTimeCacheDataPoint(self, fit, time):
|
||||||
|
return self.graph._timeCache.getDmgDataPoint(fit=fit, time=time)
|
||||||
|
|
||||||
|
|
||||||
# X mixins
|
# X mixins
|
||||||
@@ -166,7 +175,7 @@ class XDistanceMixin(SmoothPointGetter):
|
|||||||
|
|
||||||
class XTimeMixin(PointGetter):
|
class XTimeMixin(PointGetter):
|
||||||
|
|
||||||
def _prepareData(self, time, miscParams, fit, tgt):
|
def _prepareApplicationMap(self, miscParams, fit, tgt):
|
||||||
# Process params into more convenient form
|
# Process params into more convenient form
|
||||||
miscParamMap = dict(miscParams)
|
miscParamMap = dict(miscParams)
|
||||||
tgtSpeed = miscParamMap['tgtSpeed']
|
tgtSpeed = miscParamMap['tgtSpeed']
|
||||||
@@ -201,16 +210,16 @@ class XTimeMixin(PointGetter):
|
|||||||
tgtSpeed=tgtSpeed,
|
tgtSpeed=tgtSpeed,
|
||||||
tgtAngle=miscParamMap['tgtAngle'],
|
tgtAngle=miscParamMap['tgtAngle'],
|
||||||
tgtSigRadius=tgtSigRadius)
|
tgtSigRadius=tgtSigRadius)
|
||||||
self._prepareTimeCache(fit=fit, maxTime=time)
|
return applicationMap
|
||||||
timeCache = self._getTimeCacheData(fit)
|
|
||||||
return tgtSpeed, tgtSigRadius, applicationMap, timeCache
|
|
||||||
|
|
||||||
def getRange(self, mainParamRange, miscParams, fit, tgt):
|
def getRange(self, mainParamRange, miscParams, fit, tgt):
|
||||||
xs = []
|
xs = []
|
||||||
ys = []
|
ys = []
|
||||||
minTime, maxTime = mainParamRange[1]
|
minTime, maxTime = mainParamRange[1]
|
||||||
tgtSpeed, tgtSigRadius, applicationMap, timeCache = self._prepareData(
|
# Prepare time cache and various shared data
|
||||||
time=maxTime, miscParams=miscParams, fit=fit, tgt=tgt)
|
self._prepareTimeCache(fit=fit, maxTime=maxTime)
|
||||||
|
timeCache = self._getTimeCacheData(fit=fit)
|
||||||
|
applicationMap = self._prepareApplicationMap(miscParams=miscParams, fit=fit, tgt=tgt)
|
||||||
# Custom iteration for time graph to show all data points
|
# Custom iteration for time graph to show all data points
|
||||||
currentDmg = None
|
currentDmg = None
|
||||||
currentTime = None
|
currentTime = None
|
||||||
@@ -258,7 +267,13 @@ class XTimeMixin(PointGetter):
|
|||||||
return xs, ys
|
return xs, ys
|
||||||
|
|
||||||
def getPoint(self, mainParam, miscParams, fit, tgt):
|
def getPoint(self, mainParam, miscParams, fit, tgt):
|
||||||
pass
|
x = mainParam[1]
|
||||||
|
# Prepare time cache and various data
|
||||||
|
self._prepareTimeCache(fit=fit, maxTime=x)
|
||||||
|
dmgData = self._getTimeCacheDataPoint(fit=fit, time=x)
|
||||||
|
applicationMap = self._prepareApplicationMap(miscParams=miscParams, fit=fit, tgt=tgt)
|
||||||
|
y = applyDamage(dmgMap=dmgData, applicationMap=applicationMap).total
|
||||||
|
return x, y
|
||||||
|
|
||||||
|
|
||||||
class XTgtSpeedMixin(SmoothPointGetter):
|
class XTgtSpeedMixin(SmoothPointGetter):
|
||||||
|
|||||||
Reference in New Issue
Block a user