Adjust ECM burst + damp graph
This commit is contained in:
@@ -22,7 +22,7 @@ from eos.calc import calculateLockTime
|
||||
from graphs.data.base import SmoothPointGetter
|
||||
|
||||
|
||||
class ScanRes2LockTimeGetter(SmoothPointGetter):
|
||||
class ScanRes2LockingTimeGetter(SmoothPointGetter):
|
||||
|
||||
def _getCommonData(self, miscParams, src, tgt):
|
||||
if miscParams['applyDamps']:
|
||||
@@ -37,3 +37,13 @@ class ScanRes2LockTimeGetter(SmoothPointGetter):
|
||||
srcScanRes=scanRes * commonData['scanResMult'],
|
||||
tgtSigRadius=src.item.ship.getModifiedItemAttr('signatureRadius'))
|
||||
return time
|
||||
|
||||
|
||||
class ScanRes2LockedTimeGetter(ScanRes2LockingTimeGetter):
|
||||
|
||||
def _calculatePoint(self, *args, **kwargs):
|
||||
# Assuming you ECM burst every 30 seconds, find out how long you
|
||||
# will be locked before you burst another time
|
||||
lockTime = super()._calculatePoint(*args, **kwargs)
|
||||
lockedTime = max(0, 30 - lockTime)
|
||||
return lockedTime
|
||||
|
||||
@@ -18,10 +18,17 @@
|
||||
# =============================================================================
|
||||
|
||||
|
||||
"""
|
||||
Disclaimer by kadesh: this graph was made to analyze my ECM burst + damp frig
|
||||
concept. I do not think it is useful for regular player, so it is disabled.
|
||||
Enable by setting config.experimentalFeatures = True.
|
||||
"""
|
||||
|
||||
|
||||
import math
|
||||
|
||||
from graphs.data.base import FitGraph, XDef, YDef, Input, InputCheckbox
|
||||
from .getter import ScanRes2LockTimeGetter
|
||||
from .getter import ScanRes2LockingTimeGetter, ScanRes2LockedTimeGetter
|
||||
|
||||
|
||||
class FitLockTimeIncomingGraph(FitGraph):
|
||||
@@ -30,11 +37,15 @@ class FitLockTimeIncomingGraph(FitGraph):
|
||||
internalName = 'lockTimeIncomingGraph'
|
||||
name = 'Lock Time (Incoming)'
|
||||
xDefs = [XDef(handle='scanRes', unit='mm', label='Scan resolution', mainInput=('scanRes', 'mm'))]
|
||||
yDefs = [YDef(handle='time', unit='s', label='Lock time')]
|
||||
yDefs = [
|
||||
YDef(handle='lockingTime', unit='s', label='Locking time'),
|
||||
YDef(handle='lockedTime', unit='s', label='Locked time')]
|
||||
inputs = [Input(handle='scanRes', unit='mm', label='Scan resolution', iconID=74, defaultValue=None, defaultRange=(100, 1000))]
|
||||
checkboxes = [InputCheckbox(handle='applyDamps', label='Apply sensor dampeners', defaultValue=True)]
|
||||
srcExtraCols = ('SigRadius', 'Damp ScanRes')
|
||||
|
||||
# Calculation stuff
|
||||
_limiters = {'scanRes': lambda src, tgt: (1, math.inf)}
|
||||
_getters = {('scanRes', 'time'): ScanRes2LockTimeGetter}
|
||||
_getters = {
|
||||
('scanRes', 'lockingTime'): ScanRes2LockingTimeGetter,
|
||||
('scanRes', 'lockedTime'): ScanRes2LockedTimeGetter}
|
||||
|
||||
Reference in New Issue
Block a user