Add checkbox to UI which will control if RAAR/RASB will reload or not

This commit is contained in:
DarkPhoenix
2019-08-19 01:28:12 +03:00
parent 9b15f1942d
commit d0a56e3ee8
5 changed files with 40 additions and 16 deletions

View File

@@ -18,6 +18,6 @@
# =============================================================================
from .cache import FitDataCache
from .defs import XDef, YDef, VectorDef, Input
from .defs import XDef, YDef, VectorDef, Input, InputCheckbox
from .getter import PointGetter, SmoothPointGetter
from .graph import FitGraph

View File

@@ -22,6 +22,7 @@ from collections import namedtuple
VectorDef = namedtuple('VectorDef', ('lengthHandle', 'lengthUnit', 'angleHandle', 'angleUnit', 'label'))
InputCheckbox = namedtuple('InputCheckbox', ('handle', 'label', 'defaultValue'))
class YDef:

View File

@@ -79,17 +79,17 @@ class FitGraph(metaclass=ABCMeta):
def inputMap(self):
return OrderedDict(((i.handle, i.unit), i) for i in self.inputs)
@property
def srcExtraCols(self):
return ()
checkboxes = ()
@property
def tgtExtraCols(self):
return ()
def checkboxesMap(self):
return OrderedDict((ec.handle, ec) for ec in self.checkboxes)
hasTargets = False
srcVectorDef = None
tgtVectorDef = None
hasTargets = False
srcExtraCols = ()
tgtExtraCols = ()
usesHpEffectivity = False
def getPlotPoints(self, mainInput, miscInputs, xSpec, ySpec, src, tgt=None):

View File

@@ -18,7 +18,7 @@
# =============================================================================
from graphs.data.base import FitGraph, XDef, YDef, Input
from graphs.data.base import FitGraph, XDef, YDef, Input, InputCheckbox
from service.const import GraphCacheCleanupReason
from .cache import TimeCache
from .getter import Distance2RpsGetter, Distance2RepAmountGetter, Time2RpsGetter, Time2RepAmountGetter
@@ -52,6 +52,7 @@ class FitRemoteRepsGraph(FitGraph):
Input(handle='time', unit='s', label='Time', iconID=1392, defaultValue=None, defaultRange=(0, 80), secondaryTooltip='When set, uses repairing ship\'s exact RR stats at a given time\nWhen not set, uses repairing ship\'s RR stats as shown in stats panel of main window'),
Input(handle='distance', unit='km', label='Distance', iconID=1391, defaultValue=None, defaultRange=(0, 100), mainTooltip='Distance between the repairing ship and the target, as seen in overview (surface-to-surface)', secondaryTooltip='Distance between the repairing ship and the target, as seen in overview (surface-to-surface)')]
srcExtraCols = ('ShieldRR', 'ArmorRR', 'HullRR')
checkboxes = [InputCheckbox(handle='ancReload', label='Reload ancillary reps', defaultValue=True)]
# Calculation stuff
_normalizers = {('distance', 'km'): lambda v, src, tgt: None if v is None else v * 1000}