Skip modules which are not active

This commit is contained in:
DarkPhoenix
2019-07-08 07:22:21 +03:00
parent 04a74e278b
commit eda869fe0d
6 changed files with 8 additions and 4 deletions

View File

@@ -104,7 +104,7 @@ class FitGraph(metaclass=ABCMeta):
def clearCache(self, reason, extraData=None):
# If only one fit changed - clear plots which concern this fit
if reason == GraphCacheCleanupReason.fitChanged:
if reason in (GraphCacheCleanupReason.fitChanged, GraphCacheCleanupReason.fitRemoved):
# Clear plot cache
plotKeysToClear = set()
for cacheKey in self._plotCache:

View File

@@ -46,7 +46,7 @@ class FitDamageStatsGraph(FitGraph):
# time input, and it regenerates once time goes beyond cached value
# - Option changes are irrelevant as cache contains "raw" damage
# values which do not rely on any graph options
if reason == GraphCacheCleanupReason.fitChanged:
if reason in (GraphCacheCleanupReason.fitChanged, GraphCacheCleanupReason.fitRemoved):
self._timeCache.clearForFit(extraData)
self._projectedCache.clearForFit(extraData)
elif reason == GraphCacheCleanupReason.graphSwitched:

View File

@@ -19,6 +19,7 @@
from gui.builtinGraphs.base import FitDataCache
from eos.const import FittingModuleState
class ProjectedDataCache(FitDataCache):
@@ -32,6 +33,8 @@ class ProjectedDataCache(FitDataCache):
tpMods = []
projectedData = self._data.setdefault(fit.ID, {})['modules'] = (webMods, tpMods)
for mod in fit.modules:
if mod.state <= FittingModuleState.ONLINE:
continue
if 'remoteWebifierFalloff' in mod.item.effects or 'structureModuleEffectStasisWebifier' in mod.item.effects:
webMods.append((mod.getModifiedItemAttr('speedFactor'), mod.maxRange or 0, mod.falloff or 0, 'default'))
if 'remoteTargetPaintFalloff' in mod.item.effects or 'structureModuleEffectTargetPainter' in mod.item.effects:

View File

@@ -35,7 +35,7 @@ class FitWarpTimeGraph(FitGraph):
self._subspeedCache = SubwarpSpeedCache()
def _clearInternalCache(self, reason, extraData):
if reason == GraphCacheCleanupReason.fitChanged:
if reason in (GraphCacheCleanupReason.fitChanged, GraphCacheCleanupReason.fitRemoved):
self._subspeedCache.clearForFit(extraData)
elif reason == GraphCacheCleanupReason.graphSwitched:
self._subspeedCache.clearAll()

View File

@@ -136,7 +136,7 @@ class BaseList(gui.display.Display):
self.fits.remove(fit)
self.update(self.fits)
for fit in fits:
self.graphFrame.clearCache(reason=GraphCacheCleanupReason.fitChanged, extraData=fit.ID)
self.graphFrame.clearCache(reason=GraphCacheCleanupReason.fitRemoved, extraData=fit.ID)
self.graphFrame.draw()
def unbindExternalEvents(self):

View File

@@ -122,6 +122,7 @@ class GraphDpsDroneMode(IntEnum):
@unique
class GraphCacheCleanupReason(IntEnum):
fitChanged = auto()
fitRemoved = auto()
graphSwitched = auto()
inputChanged = auto()
optionChanged = auto()