Implement fax cap booster limit
This commit is contained in:
@@ -40,9 +40,6 @@ class CalcAddLocalModuleCommand(wx.Command):
|
||||
position=fit.modules.index(oldMod),
|
||||
newModInfo=self.newModInfo)
|
||||
return self.subsystemCmd.Do()
|
||||
if not newMod.fits(fit):
|
||||
pyfalog.warning('Module does not fit')
|
||||
return False
|
||||
fit.modules.append(newMod)
|
||||
if newMod not in fit.modules:
|
||||
pyfalog.warning('Failed to append to list')
|
||||
@@ -52,6 +49,15 @@ class CalcAddLocalModuleCommand(wx.Command):
|
||||
# relationship via .owner attribute, which is handled by SQLAlchemy
|
||||
eos.db.flush()
|
||||
sFit.recalc(fit)
|
||||
# fits() sometimes relies on recalculated on-item attributes, such as fax cap
|
||||
# booster limitation, so we have to check it after recalculating and remove the
|
||||
# module if the check has failed
|
||||
if not newMod.fits(fit):
|
||||
pyfalog.warning('Module does not fit')
|
||||
from .localRemove import CalcRemoveLocalModulesCommand
|
||||
cmd = CalcRemoveLocalModulesCommand(fitID=self.fitID, positions=[self.savedPosition], recalc=False)
|
||||
cmd.Do()
|
||||
return False
|
||||
self.savedStateCheckChanges = sFit.checkStates(fit, newMod)
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user