diff --git a/gui/fitCommands/calc/fitAddModule.py b/gui/fitCommands/calc/fitAddModule.py index f0d421baf..cd96b6d4f 100644 --- a/gui/fitCommands/calc/fitAddModule.py +++ b/gui/fitCommands/calc/fitAddModule.py @@ -2,6 +2,7 @@ import wx from eos.saveddata.module import Module, State import eos.db from logbook import Logger +from service.fit import Fit pyfalog = Logger(__name__) @@ -23,6 +24,7 @@ class FitAddModuleCommand(wx.Command): self.replace_cmd = None def Do(self): + sFit = Fit.getInstance() fitID = self.fitID itemID = self.itemID fit = eos.db.getFit(fitID) @@ -57,7 +59,7 @@ class FitAddModuleCommand(wx.Command): # As some items may affect state-limiting attributes of the ship, calculate new attributes first # self.recalc(fit) # Then, check states of all modules and change where needed. This will recalc if needed - # self.checkStates(fit, m) + sFit.checkStates(fit, self.module) # fit.fill() eos.db.commit() diff --git a/gui/fitCommands/calc/fitChangeState.py b/gui/fitCommands/calc/fitChangeState.py index 4354f6c32..0b901e640 100644 --- a/gui/fitCommands/calc/fitChangeState.py +++ b/gui/fitCommands/calc/fitChangeState.py @@ -30,7 +30,7 @@ class FitChangeStatesCommand(wx.Command): def Do(self): fit = eos.db.getFit(self.fitID) - + sFit = Fit.getInstance() baseMod = fit.modules[self.baseModPos] # make sure positions only include non-empty positions @@ -61,6 +61,7 @@ class FitChangeStatesCommand(wx.Command): # As some items may affect state-limiting attributes of the ship, calculate new attributes first # self.recalc(fit) # # Then, check states of all modules and change where needed. This will recalc if needed + sFit.checkStates(fit, baseMod) # self.checkStates(fit, base) return True return False diff --git a/service/fit.py b/service/fit.py index d830dda3e..122b1c9ee 100644 --- a/service/fit.py +++ b/service/fit.py @@ -559,8 +559,8 @@ class Fit(FitDeprecated): changed = True # If any state was changed, recalculate attributes again - if changed: - self.recalc(fit) + # if changed: + # self.recalc(fit) def refreshFit(self, fitID): pyfalog.debug("Refresh fit for fit ID: {0}", fitID)