Initial work on caching command fits unless needing to update. FitChanged event can now carry an action and typeID, only used in the CommandFit context menu (for now, can use this elsewhere). If the module being added or removed, we update the cached list.

This commit is contained in:
blitzman
2017-03-22 23:00:20 -04:00
parent 6c1d949cef
commit 4065022866
5 changed files with 59 additions and 15 deletions

View File

@@ -23,10 +23,11 @@ import gui.display as d
import gui.globalEvents as GE
import gui.droneView
import gui.marketBrowser as marketBrowser
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
from gui.builtinContextMenus.commandFits import CommandFits
from service.fit import Fit
from service.market import Market
from eos.saveddata.drone import Drone as es_Drone
@@ -64,15 +65,7 @@ class CommandView(d.Display):
self.lastFitId = None
# Get list of items that define a command fit
sMkt = Market.getInstance()
grp = sMkt.getGroup(1770) # Command burst group
self.commandTypeIDs = [item.ID for item in grp.items]
sFit = Fit.getInstance()
commandFits = sFit.getFitsWithModules(self.commandTypeIDs)
print (commandFits)
self.mainFrame.Bind(GE.FIT_CHANGED, CommandFits.populateFits)
self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
self.Bind(wx.EVT_LEFT_DOWN, self.click)
self.Bind(wx.EVT_RIGHT_DOWN, self.click)