From 4cf07c4b764cde67f67edaa27a39037431287bf0 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Fri, 21 Jun 2019 09:10:55 +0300 Subject: [PATCH] Slap shit together and commit --- gui/builtinGraphs/__init__.py | 16 ++++----- gui/builtinGraphs/base.py | 34 +++++++++++-------- .../{fitDpsVsRange.py => fitDamageStats.py} | 21 +++++++----- 3 files changed, 39 insertions(+), 32 deletions(-) rename gui/builtinGraphs/{fitDpsVsRange.py => fitDamageStats.py} (60%) diff --git a/gui/builtinGraphs/__init__.py b/gui/builtinGraphs/__init__.py index d943dcf04..de2446088 100644 --- a/gui/builtinGraphs/__init__.py +++ b/gui/builtinGraphs/__init__.py @@ -1,11 +1,11 @@ # noinspection PyUnresolvedReferences from gui.builtinGraphs import ( # noqa: E402,F401 - fitDpsVsRange, - fitDmgVsTime, - fitShieldRegenVsShieldPerc, - fitShieldAmountVsTime, - fitCapRegenVsCapPerc, - fitCapAmountVsTime, - fitMobilityVsTime, - fitWarpTimeVsDistance + fitDamageStats, + # fitDmgVsTime, + # fitShieldRegenVsShieldPerc, + # fitShieldAmountVsTime, + # fitCapRegenVsCapPerc, + # fitCapAmountVsTime, + # fitMobilityVsTime, + # fitWarpTimeVsDistance ) diff --git a/gui/builtinGraphs/base.py b/gui/builtinGraphs/base.py index 9129bf334..4ebc8616d 100644 --- a/gui/builtinGraphs/base.py +++ b/gui/builtinGraphs/base.py @@ -40,26 +40,30 @@ class Graph(metaclass=ABCMeta): def name(self): raise NotImplementedError - @property - @abstractmethod - def xDef(self): - raise NotImplementedError - - @property - def extraInputs(self): - return {} - @property @abstractmethod def yDefs(self): raise NotImplementedError @property - def hasTargets(self): - return False + @abstractmethod + def xDefs(self): + raise NotImplementedError @property - def hasVectors(self): + def inputs(self): + raise NotImplementedError + + @property + def srcVectorHandles(self): + return None, None + + @property + def tgtVectorHandles(self): + return None, None + + @property + def hasTargets(self): return False @property @@ -98,9 +102,9 @@ class Graph(metaclass=ABCMeta): getattr(self, yDef.eosGraph).clearCache(key=key) -XDef = namedtuple('XDef', ('inputDefault', 'inputLabel', 'inputIconID', 'axisLabel')) -YDef = namedtuple('YDef', ('switchLabel', 'axisLabel', 'eosGraph')) -ExtraInput = namedtuple('ExtraInput', ('inputDefault', 'inputLabel', 'inputIconID')) +XDef = namedtuple('XDef', ('handle', 'label', 'unit', 'mainInputHandle')) +YDef = namedtuple('YDef', ('handle', 'label', 'unit', 'eosGraph')) +Input = namedtuple('Input', ('handle', 'label', 'unit', 'iconID', 'defaultValue', 'defaultRange')) # noinspection PyUnresolvedReferences diff --git a/gui/builtinGraphs/fitDpsVsRange.py b/gui/builtinGraphs/fitDamageStats.py similarity index 60% rename from gui/builtinGraphs/fitDpsVsRange.py rename to gui/builtinGraphs/fitDamageStats.py index 3a2e7326c..121af4aaa 100644 --- a/gui/builtinGraphs/fitDpsVsRange.py +++ b/gui/builtinGraphs/fitDamageStats.py @@ -21,19 +21,19 @@ from collections import OrderedDict from eos.graph.fitDpsVsRange import FitDpsVsRangeGraph as EosGraph -from .base import Graph, XDef, YDef, ExtraInput +from .base import Graph, XDef, YDef, Input -class FitDpsVsRangeGraph(Graph): +class FitDamageStatsGraph(Graph): - name = 'DPS vs Range' + name = 'Damage Stats' def __init__(self): super().__init__() self.eosGraph = EosGraph() @property - def xDef(self): + def xDefs(self): return XDef(inputDefault='0-100', inputLabel='Distance to target (km)', inputIconID=1391, axisLabel='Distance to target, km') @property @@ -41,11 +41,14 @@ class FitDpsVsRangeGraph(Graph): return OrderedDict([('dps', YDef(switchLabel='DPS', axisLabel='DPS', eosGraph='eosGraph'))]) @property - def extraInputs(self): + def inputs(self): return OrderedDict([ - ('speed', ExtraInput(inputDefault=0, inputLabel='Target speed (m/s)', inputIconID=1389)), - ('signatureRadius', ExtraInput(inputDefault=None, inputLabel='Target signature radius (m)', inputIconID=1390)), - ('angle', ExtraInput(inputDefault=0, inputLabel='Target angle (degrees)', inputIconID=1389))]) + ('time', Input(handle='time', label='Time', unit='s', iconID=1392, defaultValue=None, defaultRange=(0, 80))), + ('atkSpeed', Input(handle='atkSpeed', label=None, unit=None, iconID=None, defaultValue=None, defaultRange=None)), + ('atkAngle', Input(handle='atkAngle', label=None, unit=None, iconID=None, defaultValue=None, defaultRange=None)), + ('tgtSpeed', Input(handle='tgtSpeed', label='Target speed', unit='%', iconID=1389, defaultValue=100, defaultRange=(0, 100))), + ('tgtAngle', Input(handle='tgtAngle', label=None, unit=None, iconID=None, defaultValue=None, defaultRange=None)), + ('tgtSigRad', Input(handle='tgtSigRad', label='Target signature radius', unit='%', iconID=1390, defaultValue=100, defaultRange=(100, 200)))]) @property def hasTargets(self): @@ -56,4 +59,4 @@ class FitDpsVsRangeGraph(Graph): return True -FitDpsVsRangeGraph.register() +FitDamageStatsGraph.register()