Initialize graph with ideal target profile, and plug it into UI's columns

This commit is contained in:
DarkPhoenix
2019-07-25 19:45:20 +03:00
parent 365a3798c2
commit 6f1321aa13
7 changed files with 105 additions and 15 deletions

View File

@@ -23,6 +23,7 @@ import wx
import gui.display
import gui.globalEvents as GE
from eos.saveddata.targetProfile import TargetProfile
from gui.builtinShipBrowser.events import EVT_FIT_RENAMED
from service.const import GraphCacheCleanupReason
from service.fit import Fit
@@ -107,7 +108,10 @@ class BaseList(gui.display.Display):
self.removeColumn(col)
for colSpec in extraColSpecs:
self.appendColumnBySpec(colSpec)
self.refresh(self.fits)
self.refreshView()
def refreshView(self):
raise NotImplementedError
def OnFitRenamed(self, event):
event.Skip()
@@ -191,9 +195,19 @@ class FitList(BaseList):
self.fits.append(fit)
self.update(self.fits)
def refreshView(self):
self.refresh(self.fits)
class TargetList(BaseList):
def __init__(self, graphFrame, parent):
super().__init__(graphFrame, parent)
self.update(self.fits)
self.profiles = []
self.profiles.append(TargetProfile.getIdeal())
stuff = self.fits + self.profiles
self.update(stuff)
def refreshView(self):
stuff = self.fits + self.profiles
self.refresh(stuff)