diff --git a/graphs/data/__init__.py b/graphs/data/__init__.py index 8bd2b8fbe..6453ee583 100644 --- a/graphs/data/__init__.py +++ b/graphs/data/__init__.py @@ -18,9 +18,6 @@ # ============================================================================= -import config as _config - - from . import fitDamageStats from . import fitEwarStats from . import fitRemoteReps @@ -29,6 +26,5 @@ from . import fitCapacitor from . import fitMobility from . import fitWarpTime from . import fitLockTime - -if _config.experimentalFeatures: - from . import fitEcmBurstScanresDamps +# Hidden graphs, available via ctrl-alt-g +from . import fitEcmBurstScanresDamps diff --git a/graphs/data/base/graph.py b/graphs/data/base/graph.py index 999e4d6b2..860329658 100644 --- a/graphs/data/base/graph.py +++ b/graphs/data/base/graph.py @@ -29,6 +29,7 @@ from service.const import GraphCacheCleanupReason class FitGraph(metaclass=ABCMeta): # UI stuff + hidden = False views = [] viewMap = {} diff --git a/graphs/data/fitEcmBurstScanresDamps/graph.py b/graphs/data/fitEcmBurstScanresDamps/graph.py index 0f99a7fa4..964d6dd38 100644 --- a/graphs/data/fitEcmBurstScanresDamps/graph.py +++ b/graphs/data/fitEcmBurstScanresDamps/graph.py @@ -36,15 +36,16 @@ from .getter import ( class FitEcmBurstScanresDampsGraph(FitGraph): # UI stuff + hidden = True internalName = 'ecmBurstScanresDamps' name = 'ECM Burst + Scanres Damps' xDefs = [ - XDef(handle='tgtScanRes', unit='mm', label='Enemy scanres', mainInput=('tgtScanRes', 'mm')), - XDef(handle='tgtDps', unit=None, label='Enemy DPS', mainInput=('tgtDps', None))] + XDef(handle='tgtDps', unit=None, label='Enemy DPS', mainInput=('tgtDps', None)), + XDef(handle='tgtScanRes', unit='mm', label='Enemy scanres', mainInput=('tgtScanRes', 'mm'))] yDefs = [ + YDef(handle='srcDmg', unit=None, label='Damage inflicted'), YDef(handle='tgtLockTime', unit='s', label='Lock time'), - YDef(handle='tgtLockUptime', unit='s', label='Lock uptime'), - YDef(handle='srcDmg', unit=None, label='Damage done')] + YDef(handle='tgtLockUptime', unit='s', label='Lock uptime')] inputs = [ Input(handle='tgtScanRes', unit='mm', label='Enemy scanres', iconID=74, defaultValue=700, defaultRange=(100, 1000)), Input(handle='tgtDps', unit=None, label='Enemy DPS', iconID=1432, defaultValue=200, defaultRange=(100, 600)), diff --git a/graphs/gui/frame.py b/graphs/gui/frame.py index 47261c292..f56c08d48 100644 --- a/graphs/gui/frame.py +++ b/graphs/gui/frame.py @@ -43,7 +43,7 @@ REDRAW_DELAY = 500 class GraphFrame(AuxiliaryFrame): - def __init__(self, parent): + def __init__(self, parent, includeHidden=False): if not canvasPanel.graphFrame_enabled: pyfalog.warning('Matplotlib is not enabled. Skipping initialization.') return @@ -74,6 +74,8 @@ class GraphFrame(AuxiliaryFrame): # Setup - graph selector for view in FitGraph.views: + if view.hidden and not includeHidden: + continue self.graphSelection.Append(view.name, view()) self.graphSelection.SetSelection(0) self.ctrlPanel.updateControls(layout=False) @@ -101,9 +103,9 @@ class GraphFrame(AuxiliaryFrame): self.draw() @classmethod - def openOne(cls, parent): + def openOne(cls, parent, *args, **kwargs): if canvasPanel.graphFrame_enabled: - super().openOne(parent) + super().openOne(parent, *args, **kwargs) def UpdateWindowSize(self): curW, curH = self.GetSize() diff --git a/gui/auxFrame.py b/gui/auxFrame.py index a751737be..90ef09564 100644 --- a/gui/auxFrame.py +++ b/gui/auxFrame.py @@ -53,10 +53,10 @@ class AuxiliaryFrame(wx.Frame): self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)) @classmethod - def openOne(cls, parent): + def openOne(cls, parent, *args, **kwargs): """If window is open and alive - raise it, open otherwise""" if not cls._instance: - frame = cls(parent) + frame = cls(parent, *args, **kwargs) cls._instance = frame frame.Show() else: diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 896d24091..05744a504 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -204,6 +204,7 @@ class MainFrame(wx.Frame): self.addPageId = wx.NewId() self.closePageId = wx.NewId() self.closeAllPagesId = wx.NewId() + self.hiddenGraphsId = wx.NewId() self.widgetInspectMenuID = wx.NewId() self.SetMenuBar(MainMenuBar(self)) @@ -423,6 +424,9 @@ class MainFrame(wx.Frame): def OnShowGraphFrame(self, event): GraphFrame.openOne(self) + def OnShowGraphFrameHidden(self, event): + GraphFrame.openOne(self, includeHidden=True) + def OnShowDevTools(self, event): DevTools.openOne(parent=self) @@ -551,6 +555,7 @@ class MainFrame(wx.Frame): # Graphs self.Bind(wx.EVT_MENU, self.OnShowGraphFrame, id=menuBar.graphFrameId) + self.Bind(wx.EVT_MENU, self.OnShowGraphFrameHidden, id=self.hiddenGraphsId) toggleSearchBoxId = wx.NewId() toggleShipMarketId = wx.NewId() @@ -576,6 +581,9 @@ class MainFrame(wx.Frame): (wx.ACCEL_CTRL, wx.WXK_F4, self.closePageId), (wx.ACCEL_CMD, ord("W"), self.closePageId), + (wx.ACCEL_CTRL | wx.ACCEL_ALT, ord("G"), self.hiddenGraphsId), + (wx.ACCEL_CMD | wx.ACCEL_ALT, ord("G"), self.hiddenGraphsId), + (wx.ACCEL_CTRL | wx.ACCEL_ALT, ord("W"), self.closeAllPagesId), (wx.ACCEL_CTRL | wx.ACCEL_ALT, wx.WXK_F4, self.closeAllPagesId), (wx.ACCEL_CMD | wx.ACCEL_ALT, ord("W"), self.closeAllPagesId),