Add scanres vs locktime on active fit graph as experimental feature

This commit is contained in:
DarkPhoenix
2019-10-24 13:52:34 +03:00
parent 536eb1efa5
commit d1be0bb680
15 changed files with 242 additions and 44 deletions

View File

@@ -18,6 +18,9 @@
# =============================================================================
import config as _config
from . import fitDamageStats
from . import fitEwarStats
from . import fitRemoteReps
@@ -25,4 +28,7 @@ from . import fitShieldRegen
from . import fitCapacitor
from . import fitMobility
from . import fitWarpTime
from . import fitLockTime
from . import fitLockTimeOutgoing
if _config.experimentalFeatures:
from . import fitLockTimeIncoming

View File

@@ -20,8 +20,8 @@
import math
from eos.calc import calculateRangeFactor
from graphs.calc import calculateMultiplier, checkLockRange, checkDroneControlRange
from eos.calc import calculateMultiplier, calculateRangeFactor
from graphs.calc import checkLockRange, checkDroneControlRange
from graphs.data.base import SmoothPointGetter

View File

@@ -18,7 +18,7 @@
# =============================================================================
from .graph import FitLockTimeGraph
from .graph import FitLockTimeIncomingGraph
FitLockTimeGraph.register()
FitLockTimeIncomingGraph.register()

View File

@@ -0,0 +1,39 @@
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyfa is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
# =============================================================================
from eos.calc import calculateLockTime
from graphs.data.base import SmoothPointGetter
class ScanRes2LockTimeGetter(SmoothPointGetter):
def _getCommonData(self, miscParams, src, tgt):
if miscParams['applyDamps']:
scanResMult = src.item.getDampMultScanRes()
else:
scanResMult = 1
return {'scanResMult': scanResMult}
def _calculatePoint(self, x, miscParams, src, tgt, commonData):
scanRes = x
time = calculateLockTime(
srcScanRes=scanRes * commonData['scanResMult'],
tgtSigRadius=src.item.ship.getModifiedItemAttr('signatureRadius'))
return time

View File

@@ -0,0 +1,40 @@
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyfa is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
# =============================================================================
import math
from graphs.data.base import FitGraph, XDef, YDef, Input, InputCheckbox
from .getter import ScanRes2LockTimeGetter
class FitLockTimeIncomingGraph(FitGraph):
# UI stuff
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')]
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}

View File

@@ -0,0 +1,24 @@
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyfa is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
# =============================================================================
from .graph import FitLockTimeOutgoingGraph
FitLockTimeOutgoingGraph.register()

View File

@@ -20,14 +20,14 @@
import math
from graphs.data.base import FitGraph, Input, XDef, YDef
from graphs.data.base import FitGraph, XDef, YDef, Input
from .getter import TgtSigRadius2LockTimeGetter
class FitLockTimeGraph(FitGraph):
class FitLockTimeOutgoingGraph(FitGraph):
# UI stuff
internalName = 'lockTimeGraph'
internalName = 'lockTimeOutgoingGraph'
name = 'Lock Time'
xDefs = [XDef(handle='tgtSigRad', unit='m', label='Target signature radius', mainInput=('tgtSigRad', 'm'))]
yDefs = [YDef(handle='time', unit='s', label='Lock time')]