From a8684ef1b97846c4496c6a8cf0c2b5deff31b240 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Sun, 14 Apr 2019 13:30:14 +0300 Subject: [PATCH] Merge several local/projected commands into universal commands --- gui/fitCommands/calc/booster/add.py | 12 +++--- gui/fitCommands/calc/booster/remove.py | 6 +-- .../calc/booster/sideEffectToggleState.py | 4 +- gui/fitCommands/calc/booster/toggleState.py | 4 +- gui/fitCommands/calc/cargo/add.py | 6 +-- gui/fitCommands/calc/cargo/changeAmount.py | 4 +- gui/fitCommands/calc/cargo/remove.py | 6 +-- gui/fitCommands/calc/commandFit/add.py | 6 +-- gui/fitCommands/calc/commandFit/remove.py | 6 +-- .../calc/commandFit/toggleState.py | 4 +- gui/fitCommands/calc/drone/localAdd.py | 10 ++--- .../calc/drone/localChangeAmount.py | 6 +-- gui/fitCommands/calc/drone/localRemove.py | 6 +-- .../calc/drone/localToggleState.py | 8 ++-- gui/fitCommands/calc/drone/projectedAdd.py | 6 +-- .../calc/drone/projectedChangeAmount.py | 2 +- gui/fitCommands/calc/drone/projectedRemove.py | 6 +-- .../calc/drone/projectedToggleState.py | 4 +- ...abilityToggle.py => abilityToggleState.py} | 10 ++--- .../{localChangeAmount.py => changeAmount.py} | 10 +++-- gui/fitCommands/calc/fighter/localAdd.py | 6 +-- gui/fitCommands/calc/fighter/localRemove.py | 6 +-- gui/fitCommands/calc/fighter/projectedAdd.py | 6 +-- .../calc/fighter/projectedChangeAmount.py | 39 ------------------- .../calc/fighter/projectedRemove.py | 6 +-- .../calc/fighter/projectedToggleState.py | 32 --------------- .../{localToggleState.py => toggleState.py} | 10 +++-- gui/fitCommands/calc/fitRename.py | 4 +- gui/fitCommands/calc/implant/add.py | 12 +++--- .../calc/implant/changeLocation.py | 4 +- gui/fitCommands/calc/implant/remove.py | 6 +-- gui/fitCommands/calc/implant/toggleState.py | 4 +- gui/fitCommands/calc/itemRebase.py | 4 +- gui/fitCommands/calc/module/changeCharges.py | 4 +- gui/fitCommands/calc/module/changeSpool.py | 4 +- gui/fitCommands/calc/module/localAdd.py | 14 +++---- .../calc/module/localChangeStates.py | 6 +-- gui/fitCommands/calc/module/localClone.py | 10 ++--- gui/fitCommands/calc/module/localRemove.py | 10 ++--- gui/fitCommands/calc/module/localReplace.py | 10 ++--- gui/fitCommands/calc/module/localSwap.py | 2 +- gui/fitCommands/calc/module/projectedAdd.py | 8 ++-- .../calc/module/projectedChangeState.py | 2 +- .../calc/module/projectedRemove.py | 6 +-- gui/fitCommands/calc/projectedFit/add.py | 6 +-- .../calc/projectedFit/changeAmount.py | 4 +- gui/fitCommands/calc/projectedFit/remove.py | 6 +-- .../calc/projectedFit/toggleState.py | 4 +- gui/fitCommands/calc/shipModeChange.py | 4 +- gui/fitCommands/guiAddBooster.py | 4 +- gui/fitCommands/guiAddCargo.py | 4 +- gui/fitCommands/guiAddCharge.py | 4 +- gui/fitCommands/guiAddCommand.py | 4 +- gui/fitCommands/guiAddDrone.py | 4 +- gui/fitCommands/guiAddFighter.py | 4 +- gui/fitCommands/guiAddImplant.py | 8 ++-- gui/fitCommands/guiAddModule.py | 12 +++--- gui/fitCommands/guiAddProjected.py | 16 ++++---- gui/fitCommands/guiCargoToModule.py | 18 ++++----- gui/fitCommands/guiChangeCargoQty.py | 4 +- gui/fitCommands/guiChangeDroneQty.py | 4 +- gui/fitCommands/guiChangeFighterQty.py | 4 +- gui/fitCommands/guiChangeImplantLocation.py | 4 +- gui/fitCommands/guiChangeProjectedDroneQty.py | 4 +- .../guiChangeProjectedFighterAmount.py | 4 +- gui/fitCommands/guiChangeProjectedFitQty.py | 4 +- gui/fitCommands/guiFillWithModule.py | 4 +- gui/fitCommands/guiFitRename.py | 4 +- gui/fitCommands/guiImportMutatedModule.py | 4 +- gui/fitCommands/guiMetaSwap.py | 30 +++++++------- gui/fitCommands/guiModuleToCargo.py | 22 +++++------ gui/fitCommands/guiMutaConvert.py | 4 +- gui/fitCommands/guiMutaRevert.py | 4 +- gui/fitCommands/guiRebaseItems.py | 18 ++++----- gui/fitCommands/guiRemoveBooster.py | 4 +- gui/fitCommands/guiRemoveCargo.py | 4 +- gui/fitCommands/guiRemoveCommand.py | 4 +- gui/fitCommands/guiRemoveDrone.py | 4 +- gui/fitCommands/guiRemoveFighter.py | 4 +- gui/fitCommands/guiRemoveImplant.py | 4 +- gui/fitCommands/guiRemoveModule.py | 4 +- gui/fitCommands/guiRemoveProjected.py | 16 ++++---- gui/fitCommands/guiSetMode.py | 4 +- gui/fitCommands/guiSetSpoolup.py | 4 +- gui/fitCommands/guiSwapCloneModule.py | 8 ++-- gui/fitCommands/guiToggleBooster.py | 4 +- gui/fitCommands/guiToggleBoosterSideEffect.py | 4 +- gui/fitCommands/guiToggleCommand.py | 4 +- gui/fitCommands/guiToggleDrone.py | 4 +- gui/fitCommands/guiToggleFighter.py | 4 +- gui/fitCommands/guiToggleFighterAbility.py | 4 +- gui/fitCommands/guiToggleImplant.py | 4 +- gui/fitCommands/guiToggleModuleState.py | 4 +- gui/fitCommands/guiToggleProjected.py | 18 ++++----- service/port/efs.py | 8 ++-- 95 files changed, 306 insertions(+), 373 deletions(-) rename gui/fitCommands/calc/fighter/{abilityToggle.py => abilityToggleState.py} (89%) rename gui/fitCommands/calc/fighter/{localChangeAmount.py => changeAmount.py} (73%) delete mode 100644 gui/fitCommands/calc/fighter/projectedChangeAmount.py delete mode 100644 gui/fitCommands/calc/fighter/projectedToggleState.py rename gui/fitCommands/calc/fighter/{localToggleState.py => toggleState.py} (66%) diff --git a/gui/fitCommands/calc/booster/add.py b/gui/fitCommands/calc/booster/add.py index b4a458f40..434cf408e 100644 --- a/gui/fitCommands/calc/booster/add.py +++ b/gui/fitCommands/calc/booster/add.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddBoosterCommand(wx.Command): +class CalcAddBoosterCommand(wx.Command): def __init__(self, fitID, boosterInfo, position=None): wx.Command.__init__(self, True, 'Add Booster') @@ -38,7 +38,7 @@ class FitAddBoosterCommand(wx.Command): fit.boosters.insert(self.newPosition, newBooster) except HandledListActionError: pyfalog.warning('Failed to insert to list') - cmd = FitAddBoosterCommand(fitID=self.fitID, boosterInfo=self.oldBoosterInfo, position=self.oldPosition) + cmd = CalcAddBoosterCommand(fitID=self.fitID, boosterInfo=self.oldBoosterInfo, position=self.oldPosition) cmd.Do() return False else: @@ -46,7 +46,7 @@ class FitAddBoosterCommand(wx.Command): fit.boosters.append(newBooster) except HandledListActionError: pyfalog.warning('Failed to append to list') - cmd = FitAddBoosterCommand(fitID=self.fitID, boosterInfo=self.oldBoosterInfo, position=self.oldPosition) + cmd = CalcAddBoosterCommand(fitID=self.fitID, boosterInfo=self.oldBoosterInfo, position=self.oldPosition) cmd.Do() return False self.newPosition = fit.boosters.index(newBooster) @@ -57,8 +57,8 @@ class FitAddBoosterCommand(wx.Command): def Undo(self): pyfalog.debug('Undo addition of booster {} to fit {}'.format(self.newBoosterInfo, self.fitID)) if self.oldBoosterInfo and self.oldPosition: - cmd = FitAddBoosterCommand(fitID=self.fitID, boosterInfo=self.oldBoosterInfo, position=self.oldPosition) + cmd = CalcAddBoosterCommand(fitID=self.fitID, boosterInfo=self.oldBoosterInfo, position=self.oldPosition) return cmd.Do() - from .remove import FitRemoveBoosterCommand - cmd = FitRemoveBoosterCommand(fitID=self.fitID, position=self.newPosition) + from .remove import CalcRemoveBoosterCommand + cmd = CalcRemoveBoosterCommand(fitID=self.fitID, position=self.newPosition) return cmd.Do() diff --git a/gui/fitCommands/calc/booster/remove.py b/gui/fitCommands/calc/booster/remove.py index 1485b270a..49ce8c149 100644 --- a/gui/fitCommands/calc/booster/remove.py +++ b/gui/fitCommands/calc/booster/remove.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveBoosterCommand(wx.Command): +class CalcRemoveBoosterCommand(wx.Command): def __init__(self, fitID, position): wx.Command.__init__(self, True, 'Remove Booster') @@ -28,6 +28,6 @@ class FitRemoveBoosterCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing removal of booster {} on fit {}'.format(self.savedBoosterInfo, self.fitID)) - from .add import FitAddBoosterCommand - cmd = FitAddBoosterCommand(fitID=self.fitID, boosterInfo=self.savedBoosterInfo, position=self.position) + from .add import CalcAddBoosterCommand + cmd = CalcAddBoosterCommand(fitID=self.fitID, boosterInfo=self.savedBoosterInfo, position=self.position) return cmd.Do() diff --git a/gui/fitCommands/calc/booster/sideEffectToggleState.py b/gui/fitCommands/calc/booster/sideEffectToggleState.py index ea3695c04..29be8441d 100644 --- a/gui/fitCommands/calc/booster/sideEffectToggleState.py +++ b/gui/fitCommands/calc/booster/sideEffectToggleState.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleBoosterSideEffectStateCommand(wx.Command): +class CalcToggleBoosterSideEffectStateCommand(wx.Command): def __init__(self, fitID, position, effectID, forceState=None): wx.Command.__init__(self, True, 'Toggle Booster Side Effect State') @@ -33,5 +33,5 @@ class FitToggleBoosterSideEffectStateCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing toggling of booster side effect {} state at position {} for fit {}'.format(self.effectID, self.position, self.fitID)) - cmd = FitToggleBoosterSideEffectStateCommand(fitID=self.fitID, position=self.position, effectID=self.effectID, forceState=self.savedState) + cmd = CalcToggleBoosterSideEffectStateCommand(fitID=self.fitID, position=self.position, effectID=self.effectID, forceState=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/booster/toggleState.py b/gui/fitCommands/calc/booster/toggleState.py index 88b56a2cf..3091caf5d 100644 --- a/gui/fitCommands/calc/booster/toggleState.py +++ b/gui/fitCommands/calc/booster/toggleState.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleBoosterStateCommand(wx.Command): +class CalcToggleBoosterStateCommand(wx.Command): def __init__(self, fitID, position, forceState=None): wx.Command.__init__(self, True, 'Toggle Booster State') @@ -28,5 +28,5 @@ class FitToggleBoosterStateCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing toggling of booster state at position {} for fit {}'.format(self.position, self.fitID)) - cmd = FitToggleBoosterStateCommand(fitID=self.fitID, position=self.position, forceState=self.savedState) + cmd = CalcToggleBoosterStateCommand(fitID=self.fitID, position=self.position, forceState=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/cargo/add.py b/gui/fitCommands/calc/cargo/add.py index 71a973ad0..03e2e9b07 100644 --- a/gui/fitCommands/calc/cargo/add.py +++ b/gui/fitCommands/calc/cargo/add.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddCargoCommand(wx.Command): +class CalcAddCargoCommand(wx.Command): def __init__(self, fitID, cargoInfo): wx.Command.__init__(self, True, 'Add Cargo') @@ -35,6 +35,6 @@ class FitAddCargoCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing addition of cargo {} to fit {}'.format(self.cargoInfo, self.fitID)) - from .remove import FitRemoveCargoCommand - cmd = FitRemoveCargoCommand(fitID=self.fitID, cargoInfo=self.cargoInfo) + from .remove import CalcRemoveCargoCommand + cmd = CalcRemoveCargoCommand(fitID=self.fitID, cargoInfo=self.cargoInfo) return cmd.Do() diff --git a/gui/fitCommands/calc/cargo/changeAmount.py b/gui/fitCommands/calc/cargo/changeAmount.py index 7437da90b..7caa00f86 100644 --- a/gui/fitCommands/calc/cargo/changeAmount.py +++ b/gui/fitCommands/calc/cargo/changeAmount.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeCargoAmountCommand(wx.Command): +class CalcChangeCargoAmountCommand(wx.Command): def __init__(self, fitID, cargoInfo): wx.Command.__init__(self, True, 'Change Cargo Amount') @@ -33,5 +33,5 @@ class FitChangeCargoAmountCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing change of cargo {} for fit {}'.format(self.cargoInfo, self.fitID)) - cmd = FitChangeCargoAmountCommand(fitID=self.fitID, cargoInfo=self.savedCargoInfo) + cmd = CalcChangeCargoAmountCommand(fitID=self.fitID, cargoInfo=self.savedCargoInfo) return cmd.Do() diff --git a/gui/fitCommands/calc/cargo/remove.py b/gui/fitCommands/calc/cargo/remove.py index d457f6fda..4bc5a677a 100644 --- a/gui/fitCommands/calc/cargo/remove.py +++ b/gui/fitCommands/calc/cargo/remove.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveCargoCommand(wx.Command): +class CalcRemoveCargoCommand(wx.Command): def __init__(self, fitID, cargoInfo): wx.Command.__init__(self, True, 'Remove Cargo') @@ -32,6 +32,6 @@ class FitRemoveCargoCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing removal of cargo {} to fit {}'.format(self.cargoInfo, self.fitID)) - from .add import FitAddCargoCommand - cmd = FitAddCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=self.cargoInfo.itemID, amount=self.savedRemovedAmount)) + from .add import CalcAddCargoCommand + cmd = CalcAddCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=self.cargoInfo.itemID, amount=self.savedRemovedAmount)) return cmd.Do() diff --git a/gui/fitCommands/calc/commandFit/add.py b/gui/fitCommands/calc/commandFit/add.py index 2388f2e18..70d9e29aa 100644 --- a/gui/fitCommands/calc/commandFit/add.py +++ b/gui/fitCommands/calc/commandFit/add.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddCommandCommand(wx.Command): +class CalcAddCommandCommand(wx.Command): def __init__(self, fitID, commandFitID, state=None): wx.Command.__init__(self, True, 'Add Command Fit') @@ -54,6 +54,6 @@ class FitAddCommandCommand(wx.Command): commandFit = Fit.getInstance().getFit(self.commandFitID) if commandFit is None: return True - from .remove import FitRemoveCommandCommand - cmd = FitRemoveCommandCommand(fitID=self.fitID, commandFitID=self.commandFitID) + from .remove import CalcRemoveCommandCommand + cmd = CalcRemoveCommandCommand(fitID=self.fitID, commandFitID=self.commandFitID) return cmd.Do() diff --git a/gui/fitCommands/calc/commandFit/remove.py b/gui/fitCommands/calc/commandFit/remove.py index 1d45c11de..b3500a380 100644 --- a/gui/fitCommands/calc/commandFit/remove.py +++ b/gui/fitCommands/calc/commandFit/remove.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveCommandCommand(wx.Command): +class CalcRemoveCommandCommand(wx.Command): def __init__(self, fitID, commandFitID): wx.Command.__init__(self, True, 'Remove Command Fit') @@ -38,6 +38,6 @@ class FitRemoveCommandCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing removal of command fit {} for fit {}'.format(self.commandFitID, self.fitID)) - from .add import FitAddCommandCommand - cmd = FitAddCommandCommand(fitID=self.fitID, commandFitID=self.commandFitID, state=self.savedState) + from .add import CalcAddCommandCommand + cmd = CalcAddCommandCommand(fitID=self.fitID, commandFitID=self.commandFitID, state=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/commandFit/toggleState.py b/gui/fitCommands/calc/commandFit/toggleState.py index 05e74e73c..5d20e0f1b 100644 --- a/gui/fitCommands/calc/commandFit/toggleState.py +++ b/gui/fitCommands/calc/commandFit/toggleState.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleCommandFitStateCommand(wx.Command): +class CalcToggleCommandFitStateCommand(wx.Command): def __init__(self, fitID, commandFitID, forceState=None): wx.Command.__init__(self, True, 'Toggle Command Fit State') @@ -35,5 +35,5 @@ class FitToggleCommandFitStateCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing toggling of command fit {} state for fit {}'.format(self.commandFitID, self.fitID)) - cmd = FitToggleCommandFitStateCommand(fitID=self.fitID, commandFitID=self.commandFitID, forceState=self.savedState) + cmd = CalcToggleCommandFitStateCommand(fitID=self.fitID, commandFitID=self.commandFitID, forceState=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/drone/localAdd.py b/gui/fitCommands/calc/drone/localAdd.py index 76201ca4d..4b7ba3df1 100644 --- a/gui/fitCommands/calc/drone/localAdd.py +++ b/gui/fitCommands/calc/drone/localAdd.py @@ -11,7 +11,7 @@ from service.market import Market pyfalog = Logger(__name__) -class FitAddDroneCommand(wx.Command): +class CalcAddLocalDroneCommand(wx.Command): def __init__(self, fitID, droneInfo): wx.Command.__init__(self, True, 'Add Drone') @@ -21,7 +21,7 @@ class FitAddDroneCommand(wx.Command): self.savedPosition = None def Do(self): - pyfalog.debug('Doing addition of drone {} to fit {}'.format(self.droneInfo, self.fitID)) + pyfalog.debug('Doing addition of local drone {} to fit {}'.format(self.droneInfo, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) item = Market.getInstance().getItem(self.droneInfo.itemID, eager=("attributes", "group.category")) # If we're not adding any active drones, check if there's an inactive stack @@ -55,13 +55,13 @@ class FitAddDroneCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing addition of drone {} to fit {}'.format(self.droneInfo, self.fitID)) + pyfalog.debug('Undoing addition of local drone {} to fit {}'.format(self.droneInfo, self.fitID)) if self.savedDroneInfo is not None: fit = Fit.getInstance().getFit(self.fitID) drone = fit.drones[self.savedPosition] drone.amount = self.savedDroneInfo.amount drone.amountActive = self.savedDroneInfo.amountActive return True - from .localRemove import FitRemoveDroneCommand - cmd = FitRemoveDroneCommand(fitID=self.fitID, position=self.savedPosition, amount=self.droneInfo.amount) + from .localRemove import CalcRemoveLocalDroneCommand + cmd = CalcRemoveLocalDroneCommand(fitID=self.fitID, position=self.savedPosition, amount=self.droneInfo.amount) return cmd.Do() diff --git a/gui/fitCommands/calc/drone/localChangeAmount.py b/gui/fitCommands/calc/drone/localChangeAmount.py index 8fa953c4a..471c68b12 100644 --- a/gui/fitCommands/calc/drone/localChangeAmount.py +++ b/gui/fitCommands/calc/drone/localChangeAmount.py @@ -11,7 +11,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeDroneAmountCommand(wx.Command): +class CalcChangeLocalDroneAmountCommand(wx.Command): def __init__(self, fitID, position, amount): wx.Command.__init__(self, True, 'Change Drone Amount') @@ -21,7 +21,7 @@ class FitChangeDroneAmountCommand(wx.Command): self.savedDroneInfo = None def Do(self): - pyfalog.debug('Doing change of drone amount to {} at position {} on fit {}'.format(self.amount, self.position, self.fitID)) + pyfalog.debug('Doing change of local drone amount to {} at position {} on fit {}'.format(self.amount, self.position, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) drone = fit.drones[self.position] self.savedDroneInfo = DroneInfo.fromDrone(drone) @@ -36,7 +36,7 @@ class FitChangeDroneAmountCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing change of drone quantity to {} at position {} on fit {}'.format(self.amount, self.position, self.fitID)) + pyfalog.debug('Undoing change of local drone quantity to {} at position {} on fit {}'.format(self.amount, self.position, self.fitID)) if self.savedDroneInfo is not None: fit = Fit.getInstance().getFit(self.fitID) drone = fit.drones[self.position] diff --git a/gui/fitCommands/calc/drone/localRemove.py b/gui/fitCommands/calc/drone/localRemove.py index 72973c65a..ed3a13572 100644 --- a/gui/fitCommands/calc/drone/localRemove.py +++ b/gui/fitCommands/calc/drone/localRemove.py @@ -10,7 +10,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveDroneCommand(wx.Command): +class CalcRemoveLocalDroneCommand(wx.Command): def __init__(self, fitID, position, amount): wx.Command.__init__(self, True, 'Remove Drone') @@ -21,7 +21,7 @@ class FitRemoveDroneCommand(wx.Command): self.removedStack = None def Do(self): - pyfalog.debug('Doing removal of {} drones at position {} from fit {}'.format(self.amountToRemove, self.position, self.fitID)) + pyfalog.debug('Doing removal of {} local drones at position {} from fit {}'.format(self.amountToRemove, self.position, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) drone = fit.drones[self.position] self.savedDroneInfo = DroneInfo.fromDrone(drone) @@ -40,7 +40,7 @@ class FitRemoveDroneCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing removal of {} drones at position {} from fit {}'.format(self.amountToRemove, self.position, self.fitID)) + pyfalog.debug('Undoing removal of {} local drones at position {} from fit {}'.format(self.amountToRemove, self.position, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) if self.removedStack: drone = self.savedDroneInfo.toDrone() diff --git a/gui/fitCommands/calc/drone/localToggleState.py b/gui/fitCommands/calc/drone/localToggleState.py index f681b9c76..557a44ff9 100644 --- a/gui/fitCommands/calc/drone/localToggleState.py +++ b/gui/fitCommands/calc/drone/localToggleState.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleDroneStateCommand(wx.Command): +class CalcToggleLocalDroneStateCommand(wx.Command): def __init__(self, fitID, position, forceAmountActive=None): wx.Command.__init__(self, True, 'Toggle Drone State') @@ -18,7 +18,7 @@ class FitToggleDroneStateCommand(wx.Command): self.savedAmountActive = None def Do(self): - pyfalog.debug('Doing toggling of drone state at position {} for fit {}'.format(self.position, self.fitID)) + pyfalog.debug('Doing toggling of local drone state at position {} for fit {}'.format(self.position, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) drone = fit.drones[self.position] self.savedAmountActive = drone.amountActive @@ -32,6 +32,6 @@ class FitToggleDroneStateCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing toggling of drone state at position {} for fit {}'.format(self.position, self.fitID)) - cmd = FitToggleDroneStateCommand(fitID=self.fitID, position=self.position, forceAmountActive=self.savedAmountActive) + pyfalog.debug('Undoing toggling of local drone state at position {} for fit {}'.format(self.position, self.fitID)) + cmd = CalcToggleLocalDroneStateCommand(fitID=self.fitID, position=self.position, forceAmountActive=self.savedAmountActive) return cmd.Do() diff --git a/gui/fitCommands/calc/drone/projectedAdd.py b/gui/fitCommands/calc/drone/projectedAdd.py index abd45a107..e1be7f2c1 100644 --- a/gui/fitCommands/calc/drone/projectedAdd.py +++ b/gui/fitCommands/calc/drone/projectedAdd.py @@ -10,7 +10,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddProjectedDroneCommand(wx.Command): +class CalcAddProjectedDroneCommand(wx.Command): def __init__(self, fitID, droneInfo): wx.Command.__init__(self, True, 'Add Projected Drone') @@ -61,6 +61,6 @@ class FitAddProjectedDroneCommand(wx.Command): drone.amountActive = self.savedDroneInfo.amountActive return True # Removing new stack - from .projectedRemove import FitRemoveProjectedDroneCommand - cmd = FitRemoveProjectedDroneCommand(fitID=self.fitID, droneInfo=self.droneInfo) + from .projectedRemove import CalcRemoveProjectedDroneCommand + cmd = CalcRemoveProjectedDroneCommand(fitID=self.fitID, droneInfo=self.droneInfo) return cmd.Do() diff --git a/gui/fitCommands/calc/drone/projectedChangeAmount.py b/gui/fitCommands/calc/drone/projectedChangeAmount.py index 2d87d8bf5..b7b24506d 100644 --- a/gui/fitCommands/calc/drone/projectedChangeAmount.py +++ b/gui/fitCommands/calc/drone/projectedChangeAmount.py @@ -11,7 +11,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeProjectedDroneAmountCommand(wx.Command): +class CalcChangeProjectedDroneAmountCommand(wx.Command): def __init__(self, fitID, itemID, amount): wx.Command.__init__(self, True, 'Change Projected Drone Amount') diff --git a/gui/fitCommands/calc/drone/projectedRemove.py b/gui/fitCommands/calc/drone/projectedRemove.py index 020f25284..39f753035 100644 --- a/gui/fitCommands/calc/drone/projectedRemove.py +++ b/gui/fitCommands/calc/drone/projectedRemove.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveProjectedDroneCommand(wx.Command): +class CalcRemoveProjectedDroneCommand(wx.Command): def __init__(self, fitID, droneInfo): wx.Command.__init__(self, True, 'Remove Projected Drone') @@ -45,6 +45,6 @@ class FitRemoveProjectedDroneCommand(wx.Command): drone.amountActive = self.savedDroneInfo.amountActive return True # Make new stack - from .projectedAdd import FitAddProjectedDroneCommand - cmd = FitAddProjectedDroneCommand(fitID=self.fitID, droneInfo=self.savedDroneInfo) + from .projectedAdd import CalcAddProjectedDroneCommand + cmd = CalcAddProjectedDroneCommand(fitID=self.fitID, droneInfo=self.savedDroneInfo) return cmd.Do() diff --git a/gui/fitCommands/calc/drone/projectedToggleState.py b/gui/fitCommands/calc/drone/projectedToggleState.py index fb942e8d5..f5d492c06 100644 --- a/gui/fitCommands/calc/drone/projectedToggleState.py +++ b/gui/fitCommands/calc/drone/projectedToggleState.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleProjectedDroneStateCommand(wx.Command): +class CalcToggleProjectedDroneStateCommand(wx.Command): def __init__(self, fitID, itemID, forceAmountActive=None): wx.Command.__init__(self, True, 'Toggle Projected Drone State') @@ -42,5 +42,5 @@ class FitToggleProjectedDroneStateCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing toggling of projected drone {} state for fit {}'.format(self.itemID, self.fitID)) - cmd = FitToggleProjectedDroneStateCommand(fitID=self.fitID, itemID=self.itemID, forceAmountActive=self.savedAmountActive) + cmd = CalcToggleProjectedDroneStateCommand(fitID=self.fitID, itemID=self.itemID, forceAmountActive=self.savedAmountActive) return cmd.Do() diff --git a/gui/fitCommands/calc/fighter/abilityToggle.py b/gui/fitCommands/calc/fighter/abilityToggleState.py similarity index 89% rename from gui/fitCommands/calc/fighter/abilityToggle.py rename to gui/fitCommands/calc/fighter/abilityToggleState.py index 54da94a6b..f95949163 100644 --- a/gui/fitCommands/calc/fighter/abilityToggle.py +++ b/gui/fitCommands/calc/fighter/abilityToggleState.py @@ -8,14 +8,14 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleFighterAbilityStateCommand(wx.Command): +class CalcToggleFighterAbilityStateCommand(wx.Command): - def __init__(self, fitID, position, effectID, projected, forceState=None): + def __init__(self, fitID, projected, position, effectID, forceState=None): wx.Command.__init__(self, True, 'Toggle Fighter Ability State') self.fitID = fitID + self.projected = projected self.position = position self.effectID = effectID - self.projected = projected self.forceState = forceState self.savedState = None @@ -35,10 +35,10 @@ class FitToggleFighterAbilityStateCommand(wx.Command): def Undo(self): pyfalog.debug('Unoing toggling of fighter ability {} state at position {} for fit {}'.format(self.effectID, self.position, self.fitID)) - cmd = FitToggleFighterAbilityStateCommand( + cmd = CalcToggleFighterAbilityStateCommand( fitID=self.fitID, + projected=self.projected, position=self.position, effectID=self.effectID, - projected=self.projected, forceState=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/fighter/localChangeAmount.py b/gui/fitCommands/calc/fighter/changeAmount.py similarity index 73% rename from gui/fitCommands/calc/fighter/localChangeAmount.py rename to gui/fitCommands/calc/fighter/changeAmount.py index 3961d6eb6..59047e654 100644 --- a/gui/fitCommands/calc/fighter/localChangeAmount.py +++ b/gui/fitCommands/calc/fighter/changeAmount.py @@ -8,11 +8,12 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeFighterAmountCommand(wx.Command): +class CalcChangeFighterAmountCommand(wx.Command): - def __init__(self, fitID, position, amount): + def __init__(self, fitID, projected, position, amount): wx.Command.__init__(self, True, 'Change Fighter Amount') self.fitID = fitID + self.projected = projected self.position = position self.amount = amount self.savedAmount = None @@ -20,7 +21,8 @@ class FitChangeFighterAmountCommand(wx.Command): def Do(self): pyfalog.debug('Doing change of fighter amount to {} at position {} on fit {}'.format(self.amount, self.position, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) - fighter = fit.fighters[self.position] + container = fit.projectedFighters if self.projected else fit.fighters + fighter = container[self.position] if self.amount == fighter.amount or self.amount == fighter.amountActive: return False self.savedAmount = fighter.amount @@ -35,5 +37,5 @@ class FitChangeFighterAmountCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing change of fighter amount to {} at position {} on fit {}'.format(self.amount, self.position, self.fitID)) - cmd = FitChangeFighterAmountCommand(fitID=self.fitID, position=self.position, amount=self.savedAmount) + cmd = CalcChangeFighterAmountCommand(fitID=self.fitID, projected=self.projected, position=self.position, amount=self.savedAmount) return cmd.Do() diff --git a/gui/fitCommands/calc/fighter/localAdd.py b/gui/fitCommands/calc/fighter/localAdd.py index 759646c6b..98940a9dc 100644 --- a/gui/fitCommands/calc/fighter/localAdd.py +++ b/gui/fitCommands/calc/fighter/localAdd.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddFighterCommand(wx.Command): +class CalcAddLocalFighterCommand(wx.Command): def __init__(self, fitID, fighterInfo, position=None): wx.Command.__init__(self, True, 'Add Fighter') @@ -58,7 +58,7 @@ class FitAddFighterCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing addition of fighter {} to fit {}'.format(self.fighterInfo, self.fitID)) - from .localRemove import FitRemoveFighterCommand - cmd = FitRemoveFighterCommand(fitID=self.fitID, position=self.position) + from .localRemove import CalcRemoveLocalFighterCommand + cmd = CalcRemoveLocalFighterCommand(fitID=self.fitID, position=self.position) cmd.Do() return True diff --git a/gui/fitCommands/calc/fighter/localRemove.py b/gui/fitCommands/calc/fighter/localRemove.py index 5aae65939..e4baae280 100644 --- a/gui/fitCommands/calc/fighter/localRemove.py +++ b/gui/fitCommands/calc/fighter/localRemove.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveFighterCommand(wx.Command): +class CalcRemoveLocalFighterCommand(wx.Command): def __init__(self, fitID, position): wx.Command.__init__(self, True, 'Remove Fighter') @@ -28,6 +28,6 @@ class FitRemoveFighterCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing removal of fighter at position {} from fit {}'.format(self.position, self.fitID)) - from .localAdd import FitAddFighterCommand - cmd = FitAddFighterCommand(fitID=self.fitID, fighterInfo=self.savedFighterInfo, position=self.position) + from .localAdd import CalcAddLocalFighterCommand + cmd = CalcAddLocalFighterCommand(fitID=self.fitID, fighterInfo=self.savedFighterInfo, position=self.position) return cmd.Do() diff --git a/gui/fitCommands/calc/fighter/projectedAdd.py b/gui/fitCommands/calc/fighter/projectedAdd.py index 2596615be..4e5a0d5f8 100644 --- a/gui/fitCommands/calc/fighter/projectedAdd.py +++ b/gui/fitCommands/calc/fighter/projectedAdd.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddProjectedFighterCommand(wx.Command): +class CalcAddProjectedFighterCommand(wx.Command): def __init__(self, fitID, fighterInfo, position=None): wx.Command.__init__(self, True, 'Add Projected Fighter') @@ -41,6 +41,6 @@ class FitAddProjectedFighterCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing addition of projected fighter {} onto: {}'.format(self.fighterInfo, self.fitID)) - from .projectedRemove import FitRemoveProjectedFighterCommand - cmd = FitRemoveProjectedFighterCommand(fitID=self.fitID, position=self.position) + from .projectedRemove import CalcRemoveProjectedFighterCommand + cmd = CalcRemoveProjectedFighterCommand(fitID=self.fitID, position=self.position) return cmd.Do() diff --git a/gui/fitCommands/calc/fighter/projectedChangeAmount.py b/gui/fitCommands/calc/fighter/projectedChangeAmount.py deleted file mode 100644 index 2215ac60a..000000000 --- a/gui/fitCommands/calc/fighter/projectedChangeAmount.py +++ /dev/null @@ -1,39 +0,0 @@ -import wx -from logbook import Logger - -import eos.db -from service.fit import Fit - - -pyfalog = Logger(__name__) - - -class FitChangeProjectedFighterAmountCommand(wx.Command): - - def __init__(self, fitID, position, amount): - wx.Command.__init__(self, True, 'Change Projected Fighter Amount') - self.fitID = fitID - self.position = position - self.amount = amount - self.savedAmount = None - - def Do(self): - pyfalog.debug('Doing change of projected fighter amount to {} at position {} on fit {}'.format(self.amount, self.position, self.fitID)) - fit = Fit.getInstance().getFit(self.fitID) - fighter = fit.projectedFighters[self.position] - if self.amount == fighter.amount or self.amount == fighter.amountActive: - return False - self.savedAmount = fighter.amount - if self.amount == -1: - fighter.amount = self.amount - eos.db.commit() - return True - else: - fighter.amount = max(min(self.amount, fighter.fighterSquadronMaxSize), 0) - eos.db.commit() - return True - - def Undo(self): - pyfalog.debug('Undoing change of projected fighter amount to {} at position {} on fit {}'.format(self.amount, self.position, self.fitID)) - cmd = FitChangeProjectedFighterAmountCommand(fitID=self.fitID, position=self.position, amount=self.savedAmount) - return cmd.Do() diff --git a/gui/fitCommands/calc/fighter/projectedRemove.py b/gui/fitCommands/calc/fighter/projectedRemove.py index 07950d051..195bffe85 100644 --- a/gui/fitCommands/calc/fighter/projectedRemove.py +++ b/gui/fitCommands/calc/fighter/projectedRemove.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveProjectedFighterCommand(wx.Command): +class CalcRemoveProjectedFighterCommand(wx.Command): def __init__(self, fitID, position): wx.Command.__init__(self, True, 'Add Projected Fighter') @@ -28,6 +28,6 @@ class FitRemoveProjectedFighterCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing removal of projected fighter at position {} from fit {}'.format(self.position, self.fitID)) - from .projectedAdd import FitAddProjectedFighterCommand - cmd = FitAddProjectedFighterCommand(fitID=self.fitID, fighterInfo=self.savedFighterInfo) + from .projectedAdd import CalcAddProjectedFighterCommand + cmd = CalcAddProjectedFighterCommand(fitID=self.fitID, fighterInfo=self.savedFighterInfo) return cmd.Do() diff --git a/gui/fitCommands/calc/fighter/projectedToggleState.py b/gui/fitCommands/calc/fighter/projectedToggleState.py deleted file mode 100644 index 5e8e605e6..000000000 --- a/gui/fitCommands/calc/fighter/projectedToggleState.py +++ /dev/null @@ -1,32 +0,0 @@ -import wx -from logbook import Logger - -import eos.db -from service.fit import Fit - - -pyfalog = Logger(__name__) - - -class FitToggleProjectedFighterStateCommand(wx.Command): - - def __init__(self, fitID, position, forceState=None): - wx.Command.__init__(self, True, 'Toggle Projected Fighter State') - self.fitID = fitID - self.position = position - self.forceState = forceState - self.savedState = None - - def Do(self): - pyfalog.debug('Doing toggling of projected fighter state at position {} for fit {}'.format(self.position, self.fitID)) - fit = Fit.getInstance().getFit(self.fitID) - fighter = fit.projectedFighters[self.position] - self.savedState = fighter.active - fighter.active = not fighter.active if self.forceState is None else self.forceState - eos.db.commit() - return True - - def Undo(self): - pyfalog.debug('Undoing toggling of projected fighter state at position {} for fit {}'.format(self.position, self.fitID)) - cmd = FitToggleProjectedFighterStateCommand(fitID=self.fitID, position=self.position, forceState=self.savedState) - return cmd.Do() diff --git a/gui/fitCommands/calc/fighter/localToggleState.py b/gui/fitCommands/calc/fighter/toggleState.py similarity index 66% rename from gui/fitCommands/calc/fighter/localToggleState.py rename to gui/fitCommands/calc/fighter/toggleState.py index fc1724bed..94b605794 100644 --- a/gui/fitCommands/calc/fighter/localToggleState.py +++ b/gui/fitCommands/calc/fighter/toggleState.py @@ -8,11 +8,12 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleFighterStateCommand(wx.Command): +class CalcToggleFighterStateCommand(wx.Command): - def __init__(self, fitID, position, forceState=None): + def __init__(self, fitID, projected, position, forceState=None): wx.Command.__init__(self, True, 'Toggle Fighter State') self.fitID = fitID + self.projected = projected self.position = position self.forceState = forceState self.savedState = None @@ -20,7 +21,8 @@ class FitToggleFighterStateCommand(wx.Command): def Do(self): pyfalog.debug('Doing toggling of fighter state at position {} for fit {}'.format(self.position, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) - fighter = fit.fighters[self.position] + container = fit.projectedFighters if self.projected else fit.fighters + fighter = container[self.position] self.savedState = fighter.active fighter.active = not fighter.active if self.forceState is None else self.forceState eos.db.commit() @@ -28,5 +30,5 @@ class FitToggleFighterStateCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing toggling of fighter state at position {} for fit {}'.format(self.position, self.fitID)) - cmd = FitToggleFighterStateCommand(fitID=self.fitID, position=self.position, forceState=self.savedState) + cmd = CalcToggleFighterStateCommand(fitID=self.fitID, projected=self.projected, position=self.position, forceState=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/fitRename.py b/gui/fitCommands/calc/fitRename.py index bebc22901..d472bc8b6 100644 --- a/gui/fitCommands/calc/fitRename.py +++ b/gui/fitCommands/calc/fitRename.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitFitRenameCommand(wx.Command): +class CalcFitRenameCommand(wx.Command): def __init__(self, fitID, name): wx.Command.__init__(self, True, 'Rename Fit') @@ -28,5 +28,5 @@ class FitFitRenameCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing renaming of fit {} to {}'.format(self.fitID, self.name)) - cmd = FitFitRenameCommand(fitID=self.fitID, name=self.savedName) + cmd = CalcFitRenameCommand(fitID=self.fitID, name=self.savedName) return cmd.Do() diff --git a/gui/fitCommands/calc/implant/add.py b/gui/fitCommands/calc/implant/add.py index 49b7483a2..d07c66a69 100644 --- a/gui/fitCommands/calc/implant/add.py +++ b/gui/fitCommands/calc/implant/add.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddImplantCommand(wx.Command): +class CalcAddImplantCommand(wx.Command): def __init__(self, fitID, implantInfo, position=None): wx.Command.__init__(self, True, 'Add Implant') @@ -38,7 +38,7 @@ class FitAddImplantCommand(wx.Command): fit.implants.insert(self.newPosition, newImplant) except HandledListActionError: pyfalog.warning('Failed to insert to list') - cmd = FitAddImplantCommand(fitID=self.fitID, implantInfo=self.oldImplantInfo, position=self.oldPosition) + cmd = CalcAddImplantCommand(fitID=self.fitID, implantInfo=self.oldImplantInfo, position=self.oldPosition) cmd.Do() return False else: @@ -46,7 +46,7 @@ class FitAddImplantCommand(wx.Command): fit.implants.append(newImplant) except HandledListActionError: pyfalog.warning('Failed to append to list') - cmd = FitAddImplantCommand(fitID=self.fitID, implantInfo=self.oldImplantInfo, position=self.oldPosition) + cmd = CalcAddImplantCommand(fitID=self.fitID, implantInfo=self.oldImplantInfo, position=self.oldPosition) cmd.Do() return False self.newPosition = fit.implants.index(newImplant) @@ -56,8 +56,8 @@ class FitAddImplantCommand(wx.Command): def Undo(self): pyfalog.debug('Undo addition of implant {} to fit {}'.format(self.newImplantInfo, self.fitID)) if self.oldImplantInfo and self.oldPosition: - cmd = FitAddImplantCommand(fitID=self.fitID, implantInfo=self.oldImplantInfo, position=self.oldPosition) + cmd = CalcAddImplantCommand(fitID=self.fitID, implantInfo=self.oldImplantInfo, position=self.oldPosition) return cmd.Do() - from .remove import FitRemoveImplantCommand - cmd = FitRemoveImplantCommand(fitID=self.fitID, position=self.newPosition) + from .remove import CalcRemoveImplantCommand + cmd = CalcRemoveImplantCommand(fitID=self.fitID, position=self.newPosition) return cmd.Do() diff --git a/gui/fitCommands/calc/implant/changeLocation.py b/gui/fitCommands/calc/implant/changeLocation.py index 8b6595192..1a3ffe2a4 100644 --- a/gui/fitCommands/calc/implant/changeLocation.py +++ b/gui/fitCommands/calc/implant/changeLocation.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeImplantLocationCommand(wx.Command): +class CalcChangeImplantLocationCommand(wx.Command): def __init__(self, fitID, source): wx.Command.__init__(self, True, 'Change Implant Location') @@ -25,5 +25,5 @@ class FitChangeImplantLocationCommand(wx.Command): return True def Undo(self): - cmd = FitChangeImplantLocationCommand(fitID=self.fitID, source=self.savedSource) + cmd = CalcChangeImplantLocationCommand(fitID=self.fitID, source=self.savedSource) return cmd.Do() diff --git a/gui/fitCommands/calc/implant/remove.py b/gui/fitCommands/calc/implant/remove.py index eba5e651a..953d9f3af 100644 --- a/gui/fitCommands/calc/implant/remove.py +++ b/gui/fitCommands/calc/implant/remove.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveImplantCommand(wx.Command): +class CalcRemoveImplantCommand(wx.Command): def __init__(self, fitID, position): wx.Command.__init__(self, True, 'Remove Implant') @@ -28,6 +28,6 @@ class FitRemoveImplantCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing removal of implant {} on fit {}'.format(self.savedImplantInfo, self.fitID)) - from .add import FitAddImplantCommand - cmd = FitAddImplantCommand(fitID=self.fitID, implantInfo=self.savedImplantInfo, position=self.position) + from .add import CalcAddImplantCommand + cmd = CalcAddImplantCommand(fitID=self.fitID, implantInfo=self.savedImplantInfo, position=self.position) return cmd.Do() diff --git a/gui/fitCommands/calc/implant/toggleState.py b/gui/fitCommands/calc/implant/toggleState.py index d75c79994..34fe62a7a 100644 --- a/gui/fitCommands/calc/implant/toggleState.py +++ b/gui/fitCommands/calc/implant/toggleState.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleImplantStateCommand(wx.Command): +class CalcToggleImplantStateCommand(wx.Command): def __init__(self, fitID, position, forceState=None): wx.Command.__init__(self, True, 'Toggle Implant State') @@ -28,5 +28,5 @@ class FitToggleImplantStateCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing toggling of implant state at position {} for fit {}'.format(self.position, self.fitID)) - cmd = FitToggleImplantStateCommand(fitID=self.fitID, position=self.position, forceState=self.savedState) + cmd = CalcToggleImplantStateCommand(fitID=self.fitID, position=self.position, forceState=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/itemRebase.py b/gui/fitCommands/calc/itemRebase.py index f4734c0c0..c9b178a04 100644 --- a/gui/fitCommands/calc/itemRebase.py +++ b/gui/fitCommands/calc/itemRebase.py @@ -9,7 +9,7 @@ from service.market import Market pyfalog = Logger(__name__) -class FitRebaseItemCommand(wx.Command): +class CalcRebaseItemCommand(wx.Command): def __init__(self, fitID, containerName, position, itemID, commit=True): wx.Command.__init__(self, True, 'Rebase Item') @@ -39,5 +39,5 @@ class FitRebaseItemCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing rebase of item in {} at position {} to {}'.format(self.containerName, self.position, self.itemID)) - cmd = FitRebaseItemCommand(fitID=self.fitID, containerName=self.containerName, position=self.position, itemID=self.savedItemID) + cmd = CalcRebaseItemCommand(fitID=self.fitID, containerName=self.containerName, position=self.position, itemID=self.savedItemID) return cmd.Do() diff --git a/gui/fitCommands/calc/module/changeCharges.py b/gui/fitCommands/calc/module/changeCharges.py index 4bee92ba4..78660c581 100644 --- a/gui/fitCommands/calc/module/changeCharges.py +++ b/gui/fitCommands/calc/module/changeCharges.py @@ -9,7 +9,7 @@ from service.market import Market pyfalog = Logger(__name__) -class FitChangeModuleChargesCommand(wx.Command): +class CalcChangeModuleChargesCommand(wx.Command): def __init__(self, fitID, chargeMap, projected=False): wx.Command.__init__(self, True, 'Change Module Charges') @@ -50,5 +50,5 @@ class FitChangeModuleChargesCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing change of module charges according to map {} on fit {}'.format(self.chargeMap, self.fitID)) - cmd = FitChangeModuleChargesCommand(fitID=self.fitID, chargeMap=self.savedChargeMap, projected=self.projected) + cmd = CalcChangeModuleChargesCommand(fitID=self.fitID, chargeMap=self.savedChargeMap, projected=self.projected) return cmd.Do() diff --git a/gui/fitCommands/calc/module/changeSpool.py b/gui/fitCommands/calc/module/changeSpool.py index 33d8757fa..d2fcf4307 100644 --- a/gui/fitCommands/calc/module/changeSpool.py +++ b/gui/fitCommands/calc/module/changeSpool.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeModuleSpoolCommand(wx.Command): +class CalcChangeModuleSpoolCommand(wx.Command): def __init__(self, fitID, position, spoolType, spoolAmount, projected=False): wx.Command.__init__(self, True, 'Change Module Spool') @@ -39,7 +39,7 @@ class FitChangeModuleSpoolCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing change of module spoolup at position {} to {} type {} amount on fit {}'.format(self.position, self.spoolType, self.spoolAmount, self.fitID)) - cmd = FitChangeModuleSpoolCommand( + cmd = CalcChangeModuleSpoolCommand( fitID=self.fitID, position=self.position, spoolType=self.savedSpoolType, diff --git a/gui/fitCommands/calc/module/localAdd.py b/gui/fitCommands/calc/module/localAdd.py index ee103aa5b..2d515e93d 100644 --- a/gui/fitCommands/calc/module/localAdd.py +++ b/gui/fitCommands/calc/module/localAdd.py @@ -10,7 +10,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddModuleCommand(wx.Command): +class CalcAddLocalModuleCommand(wx.Command): def __init__(self, fitID, newModInfo): wx.Command.__init__(self, True, 'Add Module') @@ -20,7 +20,7 @@ class FitAddModuleCommand(wx.Command): self.subsystemCmd = None def Do(self): - pyfalog.debug('Doing addition of module {} to fit {}'.format(self.newModInfo, self.fitID)) + pyfalog.debug('Doing addition of local module {} to fit {}'.format(self.newModInfo, self.fitID)) sFit = Fit.getInstance() fit = sFit.getFit(self.fitID) @@ -32,8 +32,8 @@ class FitAddModuleCommand(wx.Command): if newMod.item.category.name == 'Subsystem': for oldMod in fit.modules: if oldMod.getModifiedItemAttr('subSystemSlot') == newMod.getModifiedItemAttr('subSystemSlot') and newMod.slot == oldMod.slot: - from .localReplace import FitReplaceModuleCommand - self.subsystemCmd = FitReplaceModuleCommand(fitID=self.fitID, position=oldMod.modPosition, newModInfo=self.newModInfo) + from .localReplace import CalcReplaceLocalModuleCommand + self.subsystemCmd = CalcReplaceLocalModuleCommand(fitID=self.fitID, position=oldMod.modPosition, newModInfo=self.newModInfo) return self.subsystemCmd.Do() if not newMod.fits(fit): @@ -53,12 +53,12 @@ class FitAddModuleCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing addition of module {} to fit {}'.format(self.newModInfo, self.fitID)) + pyfalog.debug('Undoing addition of local module {} to fit {}'.format(self.newModInfo, self.fitID)) # We added a subsystem module, which actually ran the replace command. Run the undo for that guy instead if self.subsystemCmd is not None: return self.subsystemCmd.Undo() - from .localRemove import FitRemoveModuleCommand + from .localRemove import CalcRemoveLocalModuleCommand if self.savedPosition is None: return False - cmd = FitRemoveModuleCommand(fitID=self.fitID, positions=[self.savedPosition]) + cmd = CalcRemoveLocalModuleCommand(fitID=self.fitID, positions=[self.savedPosition]) return cmd.Do() diff --git a/gui/fitCommands/calc/module/localChangeStates.py b/gui/fitCommands/calc/module/localChangeStates.py index 4941d388f..834060d5a 100644 --- a/gui/fitCommands/calc/module/localChangeStates.py +++ b/gui/fitCommands/calc/module/localChangeStates.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeModuleStatesCommand(wx.Command): +class CalcChangeLocalModuleStatesCommand(wx.Command): def __init__(self, fitID, mainPosition, positions, click): wx.Command.__init__(self, True, 'Change Module States') @@ -20,7 +20,7 @@ class FitChangeModuleStatesCommand(wx.Command): self.savedStates = {} def Do(self): - pyfalog.debug('Doing change of module states at position {}/{} to click {} on fit {}'.format(self.mainPosition, self.positions, self.click, self.fitID)) + pyfalog.debug('Doing change of local module states at position {}/{} to click {} on fit {}'.format(self.mainPosition, self.positions, self.click, self.fitID)) sFit = Fit.getInstance() fit = sFit.getFit(self.fitID) mainMod = fit.modules[self.mainPosition] @@ -49,7 +49,7 @@ class FitChangeModuleStatesCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing change of module states at position {}/{} to click {} on fit {}'.format(self.mainPosition, self.positions, self.click, self.fitID)) + pyfalog.debug('Undoing change of local module states at position {}/{} to click {} on fit {}'.format(self.mainPosition, self.positions, self.click, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) for position, state in self.savedStates.items(): mod = fit.modules[position] diff --git a/gui/fitCommands/calc/module/localClone.py b/gui/fitCommands/calc/module/localClone.py index 0261671e5..ae3a9a889 100644 --- a/gui/fitCommands/calc/module/localClone.py +++ b/gui/fitCommands/calc/module/localClone.py @@ -11,7 +11,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitCloneModuleCommand(wx.Command): +class CalcCloneLocalModuleCommand(wx.Command): def __init__(self, fitID, srcPosition, dstPosition): wx.Command.__init__(self, True, 'Clone Module') @@ -21,7 +21,7 @@ class FitCloneModuleCommand(wx.Command): self.dstModInfo = None def Do(self): - pyfalog.debug('Doing cloning from position {} to position {} for fit ID {}'.format(self.srcPosition, self.dstPosition, self.fitID)) + pyfalog.debug('Doing cloning of local module from position {} to position {} for fit ID {}'.format(self.srcPosition, self.dstPosition, self.fitID)) sFit = Fit.getInstance() fit = sFit.getFit(self.fitID) srcMod = fit.modules[self.srcPosition] @@ -42,7 +42,7 @@ class FitCloneModuleCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing cloning from position {} to position {} for fit ID {}'.format(self.srcPosition, self.dstPosition, self.fitID)) - from .localRemove import FitRemoveModuleCommand - cmd = FitRemoveModuleCommand(fitID=self.fitID, positions=[self.dstPosition]) + pyfalog.debug('Undoing cloning of local module from position {} to position {} for fit ID {}'.format(self.srcPosition, self.dstPosition, self.fitID)) + from .localRemove import CalcRemoveLocalModuleCommand + cmd = CalcRemoveLocalModuleCommand(fitID=self.fitID, positions=[self.dstPosition]) return cmd.Do() diff --git a/gui/fitCommands/calc/module/localRemove.py b/gui/fitCommands/calc/module/localRemove.py index 6ce2e2918..3d3a140a4 100644 --- a/gui/fitCommands/calc/module/localRemove.py +++ b/gui/fitCommands/calc/module/localRemove.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveModuleCommand(wx.Command): +class CalcRemoveLocalModuleCommand(wx.Command): def __init__(self, fitID, positions): wx.Command.__init__(self, True, 'Remove Module') @@ -18,7 +18,7 @@ class FitRemoveModuleCommand(wx.Command): self.savedModInfos = {} def Do(self): - pyfalog.debug('Doing removal of modules from positions {} on fit {}'.format(self.positions, self.fitID)) + pyfalog.debug('Doing removal of local modules from positions {} on fit {}'.format(self.positions, self.fitID)) fit = Fit.getInstance().getFit(self.fitID) for position in self.positions: @@ -35,10 +35,10 @@ class FitRemoveModuleCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing removal of modules {} on fit {}'.format(self.savedModInfos, self.fitID)) + pyfalog.debug('Undoing removal of local modules {} on fit {}'.format(self.savedModInfos, self.fitID)) results = [] - from .localReplace import FitReplaceModuleCommand + from .localReplace import CalcReplaceLocalModuleCommand for position, modInfo in self.savedModInfos.items(): - cmd = FitReplaceModuleCommand(fitID=self.fitID, position=position, newModInfo=modInfo) + cmd = CalcReplaceLocalModuleCommand(fitID=self.fitID, position=position, newModInfo=modInfo) results.append(cmd.Do()) return any(results) diff --git a/gui/fitCommands/calc/module/localReplace.py b/gui/fitCommands/calc/module/localReplace.py index c71bad116..b4efffc1b 100644 --- a/gui/fitCommands/calc/module/localReplace.py +++ b/gui/fitCommands/calc/module/localReplace.py @@ -10,7 +10,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitReplaceModuleCommand(wx.Command): +class CalcReplaceLocalModuleCommand(wx.Command): def __init__(self, fitID, position, newModInfo): wx.Command.__init__(self, True, 'Replace Module') @@ -20,7 +20,7 @@ class FitReplaceModuleCommand(wx.Command): self.oldModInfo = None def Do(self): - pyfalog.debug('Doing replacement of module at position {} to {} on fit {}'.format(self.newModInfo, self.position, self.fitID)) + pyfalog.debug('Doing replacement of local module at position {} to {} on fit {}'.format(self.newModInfo, self.position, self.fitID)) sFit = Fit.getInstance() fit = sFit.getFit(self.fitID) oldMod = fit.modules[self.position] @@ -49,11 +49,11 @@ class FitReplaceModuleCommand(wx.Command): return True def Undo(self): - pyfalog.debug('Undoing replacement of module at position {} to {} on fit {}'.format(self.newModInfo, self.position, self.fitID)) + pyfalog.debug('Undoing replacement of local module at position {} to {} on fit {}'.format(self.newModInfo, self.position, self.fitID)) # Remove if there was no module if self.oldModInfo is None: - from .localRemove import FitRemoveModuleCommand - cmd = FitRemoveModuleCommand(fitID=self.fitID, positions=[self.position]) + from .localRemove import CalcRemoveLocalModuleCommand + cmd = CalcRemoveLocalModuleCommand(fitID=self.fitID, positions=[self.position]) return cmd.Do() # Replace if there was sFit = Fit.getInstance() diff --git a/gui/fitCommands/calc/module/localSwap.py b/gui/fitCommands/calc/module/localSwap.py index 1e3524437..35c44df93 100644 --- a/gui/fitCommands/calc/module/localSwap.py +++ b/gui/fitCommands/calc/module/localSwap.py @@ -9,7 +9,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitSwapModuleCommand(wx.Command): +class CalcSwapLocalModuleCommand(wx.Command): def __init__(self, fitID, position1, position2): wx.Command.__init__(self, True, 'Swap Modules') diff --git a/gui/fitCommands/calc/module/projectedAdd.py b/gui/fitCommands/calc/module/projectedAdd.py index 93c2a4f95..6a21a0a03 100644 --- a/gui/fitCommands/calc/module/projectedAdd.py +++ b/gui/fitCommands/calc/module/projectedAdd.py @@ -10,7 +10,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddProjectedModuleCommand(wx.Command): +class CalcAddProjectedModuleCommand(wx.Command): def __init__(self, fitID, modInfo, position=None): wx.Command.__init__(self, True) @@ -52,8 +52,8 @@ class FitAddProjectedModuleCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing addition of projected module {} onto: {}'.format(self.newModInfo, self.fitID)) if self.oldPosition is not None and self.oldModInfo is not None: - cmd = FitAddProjectedModuleCommand(fitID=self.fitID, modInfo=self.oldModInfo, position=self.oldPosition) + cmd = CalcAddProjectedModuleCommand(fitID=self.fitID, modInfo=self.oldModInfo, position=self.oldPosition) return cmd.Do() - from .projectedRemove import FitRemoveProjectedModuleCommand - cmd = FitRemoveProjectedModuleCommand(self.fitID, self.newPosition) + from .projectedRemove import CalcRemoveProjectedModuleCommand + cmd = CalcRemoveProjectedModuleCommand(self.fitID, self.newPosition) return cmd.Do() diff --git a/gui/fitCommands/calc/module/projectedChangeState.py b/gui/fitCommands/calc/module/projectedChangeState.py index 83ced4b3f..a2431e3d8 100644 --- a/gui/fitCommands/calc/module/projectedChangeState.py +++ b/gui/fitCommands/calc/module/projectedChangeState.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeProjectedModuleStateCommand(wx.Command): +class CalcChangeProjectedModuleStateCommand(wx.Command): def __init__(self, fitID, position, click): wx.Command.__init__(self, True, 'Change Projected Module State') diff --git a/gui/fitCommands/calc/module/projectedRemove.py b/gui/fitCommands/calc/module/projectedRemove.py index b31543228..21a77682a 100644 --- a/gui/fitCommands/calc/module/projectedRemove.py +++ b/gui/fitCommands/calc/module/projectedRemove.py @@ -9,7 +9,7 @@ from gui.fitCommands.helpers import ModuleInfo pyfalog = Logger(__name__) -class FitRemoveProjectedModuleCommand(wx.Command): +class CalcRemoveProjectedModuleCommand(wx.Command): def __init__(self, fitID, position): wx.Command.__init__(self, True) @@ -28,6 +28,6 @@ class FitRemoveProjectedModuleCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing removal of projected module {} on fit {}'.format(self.savedModInfo, self.fitID)) - from .projectedAdd import FitAddProjectedModuleCommand - cmd = FitAddProjectedModuleCommand(fitID=self.fitID, modInfo=self.savedModInfo, position=self.position) + from .projectedAdd import CalcAddProjectedModuleCommand + cmd = CalcAddProjectedModuleCommand(fitID=self.fitID, modInfo=self.savedModInfo, position=self.position) return cmd.Do() diff --git a/gui/fitCommands/calc/projectedFit/add.py b/gui/fitCommands/calc/projectedFit/add.py index 0595f45bc..80c602fb9 100644 --- a/gui/fitCommands/calc/projectedFit/add.py +++ b/gui/fitCommands/calc/projectedFit/add.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitAddProjectedFitCommand(wx.Command): +class CalcAddProjectedFitCommand(wx.Command): def __init__(self, fitID, projectedFitID, state): wx.Command.__init__(self, True, 'Add Projected Fit') @@ -54,6 +54,6 @@ class FitAddProjectedFitCommand(wx.Command): projectedFit = Fit.getInstance().getFit(self.projectedFitID) if projectedFit is None: return True - from .remove import FitRemoveProjectedFitCommand - cmd = FitRemoveProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID) + from .remove import CalcRemoveProjectedFitCommand + cmd = CalcRemoveProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID) return cmd.Do() diff --git a/gui/fitCommands/calc/projectedFit/changeAmount.py b/gui/fitCommands/calc/projectedFit/changeAmount.py index 49e3b23cb..9f18451b0 100644 --- a/gui/fitCommands/calc/projectedFit/changeAmount.py +++ b/gui/fitCommands/calc/projectedFit/changeAmount.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitChangeProjectedFitAmountCommand(wx.Command): +class CalcChangeProjectedFitAmountCommand(wx.Command): def __init__(self, fitID, projectedFitID, amount): wx.Command.__init__(self, True, 'Change Projected Fit Amount') @@ -39,5 +39,5 @@ class FitChangeProjectedFitAmountCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing change of projected fit {} amount to {} for fit {}'.format(self.projectedFitID, self.amount, self.fitID)) - cmd = FitChangeProjectedFitAmountCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, amount=self.savedAmount) + cmd = CalcChangeProjectedFitAmountCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, amount=self.savedAmount) return cmd.Do() diff --git a/gui/fitCommands/calc/projectedFit/remove.py b/gui/fitCommands/calc/projectedFit/remove.py index 63d89a502..ea4c6d5c9 100644 --- a/gui/fitCommands/calc/projectedFit/remove.py +++ b/gui/fitCommands/calc/projectedFit/remove.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitRemoveProjectedFitCommand(wx.Command): +class CalcRemoveProjectedFitCommand(wx.Command): def __init__(self, fitID, projectedFitID): wx.Command.__init__(self, True, 'Add Projected Fit') @@ -38,6 +38,6 @@ class FitRemoveProjectedFitCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing removal of projected fit {} for fit {}'.format(self.projectedFitID, self.fitID)) - from .add import FitAddProjectedFitCommand - cmd = FitAddProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, state=self.savedState) + from .add import CalcAddProjectedFitCommand + cmd = CalcAddProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, state=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/projectedFit/toggleState.py b/gui/fitCommands/calc/projectedFit/toggleState.py index 35a90922c..3736cec2a 100644 --- a/gui/fitCommands/calc/projectedFit/toggleState.py +++ b/gui/fitCommands/calc/projectedFit/toggleState.py @@ -8,7 +8,7 @@ from service.fit import Fit pyfalog = Logger(__name__) -class FitToggleProjectedFitCommand(wx.Command): +class CalcToggleProjectedFitCommand(wx.Command): def __init__(self, fitID, projectedFitID, forceState=None): wx.Command.__init__(self, True, 'Toggle Projected Fit State') @@ -35,5 +35,5 @@ class FitToggleProjectedFitCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing toggling of projected fit {} state for fit {}'.format(self.projectedFitID, self.fitID)) - cmd = FitToggleProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, forceState=self.savedState) + cmd = CalcToggleProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, forceState=self.savedState) return cmd.Do() diff --git a/gui/fitCommands/calc/shipModeChange.py b/gui/fitCommands/calc/shipModeChange.py index 0cf009416..d332af647 100644 --- a/gui/fitCommands/calc/shipModeChange.py +++ b/gui/fitCommands/calc/shipModeChange.py @@ -10,7 +10,7 @@ from service.market import Market pyfalog = Logger(__name__) -class FitChangeShipModeCommand(wx.Command): +class CalcChangeShipModeCommand(wx.Command): def __init__(self, fitID, itemID): wx.Command.__init__(self, True, 'Set Mode') @@ -30,5 +30,5 @@ class FitChangeShipModeCommand(wx.Command): def Undo(self): pyfalog.debug('Undoing changing mode to {} for fit {}'.format(self.itemID, self.fitID)) - cmd = FitChangeShipModeCommand(self.fitID, self.savedItemID) + cmd = CalcChangeShipModeCommand(self.fitID, self.savedItemID) return cmd.Do() diff --git a/gui/fitCommands/guiAddBooster.py b/gui/fitCommands/guiAddBooster.py index 6c0c4ad09..1aab8dd98 100644 --- a/gui/fitCommands/guiAddBooster.py +++ b/gui/fitCommands/guiAddBooster.py @@ -4,7 +4,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import BoosterInfo -from .calc.booster.add import FitAddBoosterCommand +from .calc.booster.add import CalcAddBoosterCommand class GuiAddBoosterCommand(wx.Command): @@ -18,7 +18,7 @@ class GuiAddBoosterCommand(wx.Command): self.itemID = itemID def Do(self): - if self.internal_history.Submit(FitAddBoosterCommand(fitID=self.fitID, boosterInfo=BoosterInfo(itemID=self.itemID))): + if self.internal_history.Submit(CalcAddBoosterCommand(fitID=self.fitID, boosterInfo=BoosterInfo(itemID=self.itemID))): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiAddCargo.py b/gui/fitCommands/guiAddCargo.py index 042d256ab..70df1bd46 100644 --- a/gui/fitCommands/guiAddCargo.py +++ b/gui/fitCommands/guiAddCargo.py @@ -4,7 +4,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import CargoInfo -from .calc.cargo.add import FitAddCargoCommand +from .calc.cargo.add import CalcAddCargoCommand class GuiAddCargoCommand(wx.Command): @@ -19,7 +19,7 @@ class GuiAddCargoCommand(wx.Command): self.amount = amount def Do(self): - if self.internal_history.Submit(FitAddCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=self.itemID, amount=self.amount))): + if self.internal_history.Submit(CalcAddCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=self.itemID, amount=self.amount))): wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True return False diff --git a/gui/fitCommands/guiAddCharge.py b/gui/fitCommands/guiAddCharge.py index 850b79aae..3cf529ec0 100644 --- a/gui/fitCommands/guiAddCharge.py +++ b/gui/fitCommands/guiAddCharge.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.module.changeCharges import FitChangeModuleChargesCommand +from .calc.module.changeCharges import CalcChangeModuleChargesCommand class GuiModuleAddChargeCommand(wx.Command): @@ -18,7 +18,7 @@ class GuiModuleAddChargeCommand(wx.Command): self.projected = modules[0].isProjected def Do(self): - if self.internal_history.Submit(FitChangeModuleChargesCommand(self.fitID, {p: self.itemID for p in self.positions}, self.projected)): + if self.internal_history.Submit(CalcChangeModuleChargesCommand(self.fitID, {p: self.itemID for p in self.positions}, self.projected)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiAddCommand.py b/gui/fitCommands/guiAddCommand.py index 73bb2eabe..906821e59 100644 --- a/gui/fitCommands/guiAddCommand.py +++ b/gui/fitCommands/guiAddCommand.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.commandFit.add import FitAddCommandCommand +from .calc.commandFit.add import CalcAddCommandCommand class GuiAddCommandCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiAddCommandCommand(wx.Command): self.commandFitID = commandFitID def Do(self): - if self.internal_history.Submit(FitAddCommandCommand(self.fitID, self.commandFitID, None)): + if self.internal_history.Submit(CalcAddCommandCommand(self.fitID, self.commandFitID, None)): wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) self.sFit.recalc(self.fitID) return True diff --git a/gui/fitCommands/guiAddDrone.py b/gui/fitCommands/guiAddDrone.py index 48ae4d7ec..663472e24 100644 --- a/gui/fitCommands/guiAddDrone.py +++ b/gui/fitCommands/guiAddDrone.py @@ -4,7 +4,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import DroneInfo -from .calc.drone.localAdd import FitAddDroneCommand +from .calc.drone.localAdd import CalcAddLocalDroneCommand class GuiAddDroneCommand(wx.Command): @@ -17,7 +17,7 @@ class GuiAddDroneCommand(wx.Command): self.itemID = itemID def Do(self): - cmd = FitAddDroneCommand(fitID=self.fitID, droneInfo=DroneInfo(itemID=self.itemID, amount=1, amountActive=0)) + cmd = CalcAddLocalDroneCommand(fitID=self.fitID, droneInfo=DroneInfo(itemID=self.itemID, amount=1, amountActive=0)) if self.internal_history.Submit(cmd): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiAddFighter.py b/gui/fitCommands/guiAddFighter.py index 6991ddfee..0317930fd 100644 --- a/gui/fitCommands/guiAddFighter.py +++ b/gui/fitCommands/guiAddFighter.py @@ -4,7 +4,7 @@ import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import FighterInfo from service.fit import Fit -from .calc.fighter.localAdd import FitAddFighterCommand +from .calc.fighter.localAdd import CalcAddLocalFighterCommand class GuiAddFighterCommand(wx.Command): @@ -15,7 +15,7 @@ class GuiAddFighterCommand(wx.Command): self.itemID = itemID def Do(self): - if self.internal_history.Submit(FitAddFighterCommand(fitID=self.fitID, fighterInfo=FighterInfo(itemID=self.itemID))): + if self.internal_history.Submit(CalcAddLocalFighterCommand(fitID=self.fitID, fighterInfo=FighterInfo(itemID=self.itemID))): Fit.getInstance().recalc(self.fitID) wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiAddImplant.py b/gui/fitCommands/guiAddImplant.py index 191f247e4..b452e46e4 100644 --- a/gui/fitCommands/guiAddImplant.py +++ b/gui/fitCommands/guiAddImplant.py @@ -5,8 +5,8 @@ import gui.mainFrame from eos.const import ImplantLocation from gui import globalEvents as GE from gui.fitCommands.helpers import ImplantInfo -from .calc.implant.add import FitAddImplantCommand -from .calc.implant.changeLocation import FitChangeImplantLocationCommand +from .calc.implant.add import CalcAddImplantCommand +from .calc.implant.changeLocation import CalcChangeImplantLocationCommand class GuiAddImplantCommand(wx.Command): @@ -20,8 +20,8 @@ class GuiAddImplantCommand(wx.Command): def Do(self): if ( - self.internal_history.Submit(FitAddImplantCommand(fitID=self.fitID, implantInfo=ImplantInfo(itemID=self.itemID))) and - self.internal_history.Submit(FitChangeImplantLocationCommand(self.fitID, ImplantLocation.FIT)) + self.internal_history.Submit(CalcAddImplantCommand(fitID=self.fitID, implantInfo=ImplantInfo(itemID=self.itemID))) and + self.internal_history.Submit(CalcChangeImplantLocationCommand(self.fitID, ImplantLocation.FIT)) ): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiAddModule.py b/gui/fitCommands/guiAddModule.py index ff4fb0906..47a42a2a9 100644 --- a/gui/fitCommands/guiAddModule.py +++ b/gui/fitCommands/guiAddModule.py @@ -6,9 +6,9 @@ from service.market import Market from service.fit import Fit from gui import globalEvents as GE from gui.fitCommands.helpers import ModuleInfo -from .calc.module.localAdd import FitAddModuleCommand -from .calc.module.localReplace import FitReplaceModuleCommand -from .calc.module.changeCharges import FitChangeModuleChargesCommand +from .calc.module.localAdd import CalcAddLocalModuleCommand +from .calc.module.localReplace import CalcReplaceLocalModuleCommand +from .calc.module.changeCharges import CalcChangeModuleChargesCommand pyfalog = Logger(__name__) @@ -38,14 +38,14 @@ class GuiModuleAddCommand(wx.Command): # Charge if item.isCharge and self.position is not None: pyfalog.debug("Trying to add a charge") - success = self.internalHistory.Submit(FitChangeModuleChargesCommand(self.fitID, {self.position: self.itemID})) + success = self.internalHistory.Submit(CalcChangeModuleChargesCommand(self.fitID, {self.position: self.itemID})) if not success: pyfalog.debug(" Failed") return False # if it's a charge item and this failed, nothing more we can try. # Module to position elif self.position is not None: pyfalog.debug("Trying to add a module to a specific position") - success = self.internalHistory.Submit(FitReplaceModuleCommand( + success = self.internalHistory.Submit(CalcReplaceLocalModuleCommand( fitID=self.fitID, position=self.position, newModInfo=ModuleInfo(itemID=self.itemID))) @@ -56,7 +56,7 @@ class GuiModuleAddCommand(wx.Command): # Module without position if self.position is None: pyfalog.debug("Trying to append a module") - success = self.internalHistory.Submit(FitAddModuleCommand( + success = self.internalHistory.Submit(CalcAddLocalModuleCommand( fitID=self.fitID, newModInfo=ModuleInfo(itemID=self.itemID))) diff --git a/gui/fitCommands/guiAddProjected.py b/gui/fitCommands/guiAddProjected.py index f41978be4..cf6151e22 100644 --- a/gui/fitCommands/guiAddProjected.py +++ b/gui/fitCommands/guiAddProjected.py @@ -4,10 +4,10 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import ModuleInfo, DroneInfo, FighterInfo -from .calc.module.projectedAdd import FitAddProjectedModuleCommand -from .calc.projectedFit.add import FitAddProjectedFitCommand -from .calc.fighter.projectedAdd import FitAddProjectedFighterCommand -from .calc.drone.projectedAdd import FitAddProjectedDroneCommand +from .calc.module.projectedAdd import CalcAddProjectedModuleCommand +from .calc.projectedFit.add import CalcAddProjectedFitCommand +from .calc.fighter.projectedAdd import CalcAddProjectedFighterCommand +from .calc.drone.projectedAdd import CalcAddProjectedDroneCommand from logbook import Logger import eos.db pyfalog = Logger(__name__) @@ -31,17 +31,17 @@ class GuiAddProjectedCommand(wx.Command): item = eos.db.getItem(self.id, eager=("attributes", "group.category")) if item.category.name == "Drone": - result = self.internal_history.Submit(FitAddProjectedDroneCommand( + result = self.internal_history.Submit(CalcAddProjectedDroneCommand( fitID=self.fitID, droneInfo=DroneInfo(itemID=self.id, amount=1, amountActive=1))) elif item.category.name == "Fighter": - result = self.internal_history.Submit(FitAddProjectedFighterCommand(self.fitID, fighterInfo=FighterInfo(itemID=self.id))) + result = self.internal_history.Submit(CalcAddProjectedFighterCommand(self.fitID, fighterInfo=FighterInfo(itemID=self.id))) else: - result = self.internal_history.Submit(FitAddProjectedModuleCommand( + result = self.internal_history.Submit(CalcAddProjectedModuleCommand( fitID=self.fitID, modInfo=ModuleInfo(itemID=self.id))) elif self.type == 'fit': - result = self.internal_history.Submit(FitAddProjectedFitCommand(self.fitID, self.id, None)) + result = self.internal_history.Submit(CalcAddProjectedFitCommand(self.fitID, self.id, None)) if result: self.sFit.recalc(self.fitID) diff --git a/gui/fitCommands/guiCargoToModule.py b/gui/fitCommands/guiCargoToModule.py index ed131b5eb..5ce7fac94 100644 --- a/gui/fitCommands/guiCargoToModule.py +++ b/gui/fitCommands/guiCargoToModule.py @@ -3,11 +3,11 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from gui.fitCommands.calc.module.changeCharges import FitChangeModuleChargesCommand -from gui.fitCommands.calc.module.localReplace import FitReplaceModuleCommand -from gui.fitCommands.calc.cargo.remove import FitRemoveCargoCommand +from gui.fitCommands.calc.module.changeCharges import CalcChangeModuleChargesCommand +from gui.fitCommands.calc.module.localReplace import CalcReplaceLocalModuleCommand +from gui.fitCommands.calc.cargo.remove import CalcRemoveCargoCommand from gui.fitCommands.helpers import ModuleInfo -from .calc.cargo.add import FitAddCargoCommand +from .calc.cargo.add import CalcAddCargoCommand from logbook import Logger pyfalog = Logger(__name__) @@ -40,12 +40,12 @@ class GuiCargoToModuleCommand(wx.Command): # We're trying to move a charge from cargo to a slot. Use SetCharge command (don't respect move vs copy) if sFit.isAmmo(cargo.itemID): - result = self.internal_history.Submit(FitChangeModuleChargesCommand(self.fitID, {module.modPosition: cargo.itemID})) + result = self.internal_history.Submit(CalcChangeModuleChargesCommand(self.fitID, {module.modPosition: cargo.itemID})) else: pyfalog.debug("Moving cargo item to module for fit ID: {0}", self.fitID) - self.addCmd = FitReplaceModuleCommand( + self.addCmd = CalcReplaceLocalModuleCommand( fitID=self.fitID, position=module.modPosition, newModInfo=ModuleInfo(itemID=cargo.itemID)) @@ -58,14 +58,14 @@ class GuiCargoToModuleCommand(wx.Command): if self.addCmd.old_module is not None: # we're swapping with an existing module, so remove cargo and add module - self.removeCmd = FitRemoveCargoCommand(self.fitID, cargo.itemID) + self.removeCmd = CalcRemoveCargoCommand(self.fitID, cargo.itemID) result = self.internal_history.Submit(self.removeCmd) - self.addCargoCmd = FitAddCargoCommand(self.fitID, self.addCmd.old_module.itemID) + self.addCargoCmd = CalcAddCargoCommand(self.fitID, self.addCmd.old_module.itemID) result = self.internal_history.Submit(self.addCargoCmd) elif not self.copy: # move, not copying, so remove cargo - self.removeCmd = FitRemoveCargoCommand(self.fitID, cargo.itemID) + self.removeCmd = CalcRemoveCargoCommand(self.fitID, cargo.itemID) result = self.internal_history.Submit(self.removeCmd) if result: diff --git a/gui/fitCommands/guiChangeCargoQty.py b/gui/fitCommands/guiChangeCargoQty.py index 4955df7a4..e48f99602 100644 --- a/gui/fitCommands/guiChangeCargoQty.py +++ b/gui/fitCommands/guiChangeCargoQty.py @@ -1,7 +1,7 @@ import wx import gui.mainFrame from gui import globalEvents as GE -from .calc.cargo.changeAmount import FitChangeCargoAmountCommand +from .calc.cargo.changeAmount import CalcChangeCargoAmountCommand from service.fit import Fit from gui.fitCommands.helpers import CargoInfo from logbook import Logger @@ -20,7 +20,7 @@ class GuiChangeCargoQty(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - cmd = FitChangeCargoAmountCommand(self.fitID, CargoInfo(itemID=self.itemID, amount=self.amount)) + cmd = CalcChangeCargoAmountCommand(self.fitID, CargoInfo(itemID=self.itemID, amount=self.amount)) if self.internal_history.Submit(cmd): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiChangeDroneQty.py b/gui/fitCommands/guiChangeDroneQty.py index 2e603b012..eec919171 100644 --- a/gui/fitCommands/guiChangeDroneQty.py +++ b/gui/fitCommands/guiChangeDroneQty.py @@ -1,7 +1,7 @@ import wx import gui.mainFrame from gui import globalEvents as GE -from .calc.drone.localChangeAmount import FitChangeDroneAmountCommand +from .calc.drone.localChangeAmount import CalcChangeLocalDroneAmountCommand from service.fit import Fit from logbook import Logger pyfalog = Logger(__name__) @@ -18,7 +18,7 @@ class GuiChangeDroneQty(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - cmd = FitChangeDroneAmountCommand(self.fitID, self.position, self.amount) + cmd = CalcChangeLocalDroneAmountCommand(self.fitID, self.position, self.amount) if self.internal_history.Submit(cmd): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiChangeFighterQty.py b/gui/fitCommands/guiChangeFighterQty.py index bbcfca07c..d11ac7a13 100644 --- a/gui/fitCommands/guiChangeFighterQty.py +++ b/gui/fitCommands/guiChangeFighterQty.py @@ -1,7 +1,7 @@ import wx import gui.mainFrame from gui import globalEvents as GE -from .calc.fighter.localChangeAmount import FitChangeFighterAmountCommand +from .calc.fighter.changeAmount import CalcChangeFighterAmountCommand from service.fit import Fit from logbook import Logger pyfalog = Logger(__name__) @@ -18,7 +18,7 @@ class GuiChangeFighterQty(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - cmd = FitChangeFighterAmountCommand(self.fitID, self.position, self.amount) + cmd = CalcChangeFighterAmountCommand(self.fitID, False, self.position, self.amount) if self.internal_history.Submit(cmd): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiChangeImplantLocation.py b/gui/fitCommands/guiChangeImplantLocation.py index 9d5d21ab4..3083f9701 100644 --- a/gui/fitCommands/guiChangeImplantLocation.py +++ b/gui/fitCommands/guiChangeImplantLocation.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.implant.changeLocation import FitChangeImplantLocationCommand +from .calc.implant.changeLocation import CalcChangeImplantLocationCommand class GuiChangeImplantLocation(wx.Command): @@ -16,7 +16,7 @@ class GuiChangeImplantLocation(wx.Command): self.source = source def Do(self): - if self.internal_history.Submit(FitChangeImplantLocationCommand(self.fitID, self.source)): + if self.internal_history.Submit(CalcChangeImplantLocationCommand(self.fitID, self.source)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiChangeProjectedDroneQty.py b/gui/fitCommands/guiChangeProjectedDroneQty.py index 5b53f46e5..6ea0a49dc 100644 --- a/gui/fitCommands/guiChangeProjectedDroneQty.py +++ b/gui/fitCommands/guiChangeProjectedDroneQty.py @@ -1,7 +1,7 @@ import wx import gui.mainFrame from gui import globalEvents as GE -from .calc.drone.projectedChangeAmount import FitChangeProjectedDroneAmountCommand +from .calc.drone.projectedChangeAmount import CalcChangeProjectedDroneAmountCommand from service.fit import Fit from logbook import Logger pyfalog = Logger(__name__) @@ -18,7 +18,7 @@ class GuiChangeProjectedDroneQty(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - cmd = FitChangeProjectedDroneAmountCommand(self.fitID, self.itemID, self.amount) + cmd = CalcChangeProjectedDroneAmountCommand(self.fitID, self.itemID, self.amount) if self.internal_history.Submit(cmd): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiChangeProjectedFighterAmount.py b/gui/fitCommands/guiChangeProjectedFighterAmount.py index 1ed66731e..bd48d3780 100644 --- a/gui/fitCommands/guiChangeProjectedFighterAmount.py +++ b/gui/fitCommands/guiChangeProjectedFighterAmount.py @@ -1,7 +1,7 @@ import wx import gui.mainFrame from gui import globalEvents as GE -from .calc.fighter.projectedChangeAmount import FitChangeProjectedFighterAmountCommand +from .calc.fighter.changeAmount import CalcChangeFighterAmountCommand from service.fit import Fit from logbook import Logger pyfalog = Logger(__name__) @@ -19,7 +19,7 @@ class GuiChangeProjectedFighterAmount(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - cmd = FitChangeProjectedFighterAmountCommand(self.fitID, self.position, self.amount) + cmd = CalcChangeFighterAmountCommand(self.fitID, True, self.position, self.amount) if self.internal_history.Submit(cmd): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiChangeProjectedFitQty.py b/gui/fitCommands/guiChangeProjectedFitQty.py index b21361028..02efd4cc8 100644 --- a/gui/fitCommands/guiChangeProjectedFitQty.py +++ b/gui/fitCommands/guiChangeProjectedFitQty.py @@ -1,7 +1,7 @@ import wx import gui.mainFrame from gui import globalEvents as GE -from .calc.projectedFit.changeAmount import FitChangeProjectedFitAmountCommand +from .calc.projectedFit.changeAmount import CalcChangeProjectedFitAmountCommand from service.fit import Fit from logbook import Logger pyfalog = Logger(__name__) @@ -18,7 +18,7 @@ class GuiChangeProjectedFitQty(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - cmd = FitChangeProjectedFitAmountCommand(self.fitID, self.pfitID, self.amount) + cmd = CalcChangeProjectedFitAmountCommand(self.fitID, self.pfitID, self.amount) if self.internal_history.Submit(cmd): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiFillWithModule.py b/gui/fitCommands/guiFillWithModule.py index 20f61718c..300eb3e39 100644 --- a/gui/fitCommands/guiFillWithModule.py +++ b/gui/fitCommands/guiFillWithModule.py @@ -5,7 +5,7 @@ import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import ModuleInfo from service.fit import Fit -from .calc.module.localAdd import FitAddModuleCommand +from .calc.module.localAdd import CalcAddLocalModuleCommand pyfalog = Logger(__name__) @@ -34,7 +34,7 @@ class GuiFillWithModuleCommand(wx.Command): pyfalog.debug("{} Do()".format(self)) pyfalog.debug("Trying to append a module") added_modules = 0 - while self.internal_history.Submit(FitAddModuleCommand(fitID=self.fitID, newModInfo=ModuleInfo(itemID=self.itemID))): + while self.internal_history.Submit(CalcAddLocalModuleCommand(fitID=self.fitID, newModInfo=ModuleInfo(itemID=self.itemID))): added_modules += 1 if added_modules > 0: diff --git a/gui/fitCommands/guiFitRename.py b/gui/fitCommands/guiFitRename.py index b34018fd1..b5a750c69 100644 --- a/gui/fitCommands/guiFitRename.py +++ b/gui/fitCommands/guiFitRename.py @@ -1,6 +1,6 @@ import wx import gui.mainFrame -from .calc.fitRename import FitFitRenameCommand +from .calc.fitRename import CalcFitRenameCommand from service.fit import Fit from logbook import Logger from gui.builtinShipBrowser.events import FitRenamed @@ -17,7 +17,7 @@ class GuiFitRenameCommand(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - if self.internal_history.Submit(FitFitRenameCommand(self.fitID, self.newName)): + if self.internal_history.Submit(CalcFitRenameCommand(self.fitID, self.newName)): wx.PostEvent(self.mainFrame, FitRenamed(fitID=self.fitID)) return True return False diff --git a/gui/fitCommands/guiImportMutatedModule.py b/gui/fitCommands/guiImportMutatedModule.py index babdc56e8..b789f4d22 100644 --- a/gui/fitCommands/guiImportMutatedModule.py +++ b/gui/fitCommands/guiImportMutatedModule.py @@ -5,7 +5,7 @@ import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import ModuleInfo from service.fit import Fit -from .calc.module.localAdd import FitAddModuleCommand +from .calc.module.localAdd import CalcAddLocalModuleCommand pyfalog = Logger(__name__) @@ -26,7 +26,7 @@ class GuiImportMutatedModuleCommand(wx.Command): def Do(self): pyfalog.debug("{} Do()".format(self)) - if self.internalHistory.Submit(FitAddModuleCommand(fitID=self.fitID, newModInfo=self.newModInfo)): + if self.internalHistory.Submit(CalcAddLocalModuleCommand(fitID=self.fitID, newModInfo=self.newModInfo)): Fit.getInstance().recalc(self.fitID) wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID, action="modadd")) return True diff --git a/gui/fitCommands/guiMetaSwap.py b/gui/fitCommands/guiMetaSwap.py index 57487a43f..f9c9d1293 100644 --- a/gui/fitCommands/guiMetaSwap.py +++ b/gui/fitCommands/guiMetaSwap.py @@ -4,15 +4,15 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import ModuleInfo, FighterInfo, BoosterInfo -from .calc.implant.remove import FitRemoveImplantCommand -from .calc.implant.add import FitAddImplantCommand -from .calc.booster.add import FitAddBoosterCommand -from .calc.cargo.remove import FitRemoveCargoCommand -from .calc.cargo.add import FitAddCargoCommand -from .calc.module.localReplace import FitReplaceModuleCommand -from .calc.fighter.localAdd import FitAddFighterCommand -from .calc.fighter.localRemove import FitRemoveFighterCommand -from .calc.itemRebase import FitRebaseItemCommand +from .calc.implant.remove import CalcRemoveImplantCommand +from .calc.implant.add import CalcAddImplantCommand +from .calc.booster.add import CalcAddBoosterCommand +from .calc.cargo.remove import CalcRemoveCargoCommand +from .calc.cargo.add import CalcAddCargoCommand +from .calc.module.localReplace import CalcReplaceLocalModuleCommand +from .calc.fighter.localAdd import CalcAddLocalFighterCommand +from .calc.fighter.localRemove import CalcRemoveLocalFighterCommand +from .calc.itemRebase import CalcRebaseItemCommand class GuiMetaSwapCommand(wx.Command): @@ -30,28 +30,28 @@ class GuiMetaSwapCommand(wx.Command): if context == 'fittingModule': for x in selection: position = fit.modules.index(x) - self.data.append(((FitReplaceModuleCommand, fitID, position, ModuleInfo( + self.data.append(((CalcReplaceLocalModuleCommand, fitID, position, ModuleInfo( itemID=itemID, chargeID=x.chargeID, state=x.state, spoolType=x.spoolType, spoolAmount=x.spoolAmount)),)) elif context == 'implantItem': for x in selection: idx = fit.implants.index(x) state = x.active - self.data.append(((FitRemoveImplantCommand, fitID, idx), (FitAddImplantCommand, fitID, itemID, state))) + self.data.append(((CalcRemoveImplantCommand, fitID, idx), (CalcAddImplantCommand, fitID, itemID, state))) elif context == 'boosterItem': for x in selection: - self.data.append(((FitAddBoosterCommand, fitID, BoosterInfo( + self.data.append(((CalcAddBoosterCommand, fitID, BoosterInfo( itemID=itemID, state=x.active, sideEffects={se.effectID: se.active for se in x.sideEffects})),)) elif context == 'cargoItem': for x in selection: - self.data.append(((FitRemoveCargoCommand, fitID, x.itemID, 1, True), (FitAddCargoCommand, fitID, itemID, x.amount))) + self.data.append(((CalcRemoveCargoCommand, fitID, x.itemID, 1, True), (CalcAddCargoCommand, fitID, itemID, x.amount))) elif context == 'fighterItem': for x in selection: fighterInfo = FighterInfo.fromFighter(x) fighterInfo.itemID = itemID - self.data.append(((FitRemoveFighterCommand, fitID, fit.fighters.index(x)), (FitAddFighterCommand, fitID, fighterInfo))) + self.data.append(((CalcRemoveLocalFighterCommand, fitID, fit.fighters.index(x)), (CalcAddLocalFighterCommand, fitID, fighterInfo))) elif context == 'droneItem': for x in selection: - self.data.append(((FitRebaseItemCommand, fitID, 'drones', fit.drones.index(x), itemID),),) + self.data.append(((CalcRebaseItemCommand, fitID, 'drones', fit.drones.index(x), itemID),), ) def Do(self): for cmds in self.data: diff --git a/gui/fitCommands/guiModuleToCargo.py b/gui/fitCommands/guiModuleToCargo.py index 5587c0c2a..484ef782a 100644 --- a/gui/fitCommands/guiModuleToCargo.py +++ b/gui/fitCommands/guiModuleToCargo.py @@ -3,12 +3,12 @@ from logbook import Logger import gui.mainFrame from gui import globalEvents as GE -from gui.fitCommands.calc.cargo.remove import FitRemoveCargoCommand -from gui.fitCommands.calc.module.localRemove import FitRemoveModuleCommand -from gui.fitCommands.calc.module.localReplace import FitReplaceModuleCommand +from gui.fitCommands.calc.cargo.remove import CalcRemoveCargoCommand +from gui.fitCommands.calc.module.localRemove import CalcRemoveLocalModuleCommand +from gui.fitCommands.calc.module.localReplace import CalcReplaceLocalModuleCommand from gui.fitCommands.helpers import ModuleInfo from service.fit import Fit -from .calc.cargo.add import FitAddCargoCommand +from .calc.cargo.add import CalcAddCargoCommand pyfalog = Logger(__name__) @@ -33,12 +33,12 @@ class GuiModuleToCargoCommand(wx.Command): if self.cargoIdx: # we're swapping with cargo if self.copy: # if copying, simply add item to cargo - result = self.internal_history.Submit(FitAddCargoCommand( + result = self.internal_history.Submit(CalcAddCargoCommand( self.mainFrame.getActiveFit(), module.item.ID if not module.item.isAbyssal else module.baseItemID)) else: # otherwise, try to swap by replacing module with cargo item. If successful, remove old cargo and add new cargo cargo = fit.cargo[self.cargoIdx] - self.modReplaceCmd = FitReplaceModuleCommand( + self.modReplaceCmd = CalcReplaceLocalModuleCommand( fitID=self.fitID, position=module.modPosition, newModInfo=ModuleInfo(itemID=cargo.itemID)) @@ -51,18 +51,18 @@ class GuiModuleToCargoCommand(wx.Command): if self.modReplaceCmd.old_module is not None: # we're swapping with an existing module, so remove cargo and add module - self.removeCmd = FitRemoveCargoCommand(self.fitID, cargo.itemID) + self.removeCmd = CalcRemoveCargoCommand(self.fitID, cargo.itemID) result = self.internal_history.Submit(self.removeCmd) - self.addCargoCmd = FitAddCargoCommand(self.fitID, self.modReplaceCmd.old_module.itemID) + self.addCargoCmd = CalcAddCargoCommand(self.fitID, self.modReplaceCmd.old_module.itemID) result = self.internal_history.Submit(self.addCargoCmd) else: # dragging to blank spot, append - result = self.internal_history.Submit(FitAddCargoCommand(self.mainFrame.getActiveFit(), - module.item.ID if not module.item.isAbyssal else module.baseItemID)) + result = self.internal_history.Submit(CalcAddCargoCommand(self.mainFrame.getActiveFit(), + module.item.ID if not module.item.isAbyssal else module.baseItemID)) if not self.copy: # if not copying, remove module - self.internal_history.Submit(FitRemoveModuleCommand(self.mainFrame.getActiveFit(), [self.moduleIdx])) + self.internal_history.Submit(CalcRemoveLocalModuleCommand(self.mainFrame.getActiveFit(), [self.moduleIdx])) if result: sFit.recalc(self.fitID) diff --git a/gui/fitCommands/guiMutaConvert.py b/gui/fitCommands/guiMutaConvert.py index 709befb75..33b141975 100644 --- a/gui/fitCommands/guiMutaConvert.py +++ b/gui/fitCommands/guiMutaConvert.py @@ -4,7 +4,7 @@ import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import ModuleInfo from service.fit import Fit -from .calc.module.localReplace import FitReplaceModuleCommand +from .calc.module.localReplace import CalcReplaceLocalModuleCommand class GuiMutaConvertCommand(wx.Command): @@ -26,7 +26,7 @@ class GuiMutaConvertCommand(wx.Command): if oldMod.isMutated: return False - success = self.internal_history.Submit(FitReplaceModuleCommand( + success = self.internal_history.Submit(CalcReplaceLocalModuleCommand( fitID=self.fitID, position=self.position, newModInfo=ModuleInfo( diff --git a/gui/fitCommands/guiMutaRevert.py b/gui/fitCommands/guiMutaRevert.py index 02571175d..e38f5af45 100644 --- a/gui/fitCommands/guiMutaRevert.py +++ b/gui/fitCommands/guiMutaRevert.py @@ -4,7 +4,7 @@ import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import ModuleInfo from service.fit import Fit -from .calc.module.localReplace import FitReplaceModuleCommand +from .calc.module.localReplace import CalcReplaceLocalModuleCommand class GuiMutaRevertCommand(wx.Command): @@ -25,7 +25,7 @@ class GuiMutaRevertCommand(wx.Command): if not oldMod.isMutated: return False - success = self.internal_history.Submit(FitReplaceModuleCommand( + success = self.internal_history.Submit(CalcReplaceLocalModuleCommand( fitID=self.fitID, position=self.position, newModInfo=ModuleInfo( diff --git a/gui/fitCommands/guiRebaseItems.py b/gui/fitCommands/guiRebaseItems.py index 4d792de5a..e12738e5f 100644 --- a/gui/fitCommands/guiRebaseItems.py +++ b/gui/fitCommands/guiRebaseItems.py @@ -5,10 +5,10 @@ import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import CargoInfo from service.fit import Fit -from .calc.itemRebase import FitRebaseItemCommand -from .calc.module.changeCharges import FitChangeModuleChargesCommand -from .calc.cargo.add import FitAddCargoCommand -from .calc.cargo.remove import FitRemoveCargoCommand +from .calc.itemRebase import CalcRebaseItemCommand +from .calc.module.changeCharges import CalcChangeModuleChargesCommand +from .calc.cargo.add import CalcAddCargoCommand +from .calc.cargo.remove import CalcRemoveCargoCommand @@ -25,21 +25,21 @@ class GuiRebaseItemsCommand(wx.Command): fit = eos.db.getFit(self.fitID) for mod in fit.modules: if mod.itemID in self.rebaseMap: - self.internal_history.Submit(FitRebaseItemCommand(fitID=self.fitID, containerName="modules", position=mod.modPosition, itemID=self.rebaseMap[mod.itemID], commit=False)) + self.internal_history.Submit(CalcRebaseItemCommand(fitID=self.fitID, containerName="modules", position=mod.modPosition, itemID=self.rebaseMap[mod.itemID], commit=False)) if mod.chargeID in self.rebaseMap: - self.internal_history.Submit(FitChangeModuleChargesCommand(fitID=self.fitID, chargeMap={mod.modPosition: self.rebaseMap[mod.chargeID]})) + self.internal_history.Submit(CalcChangeModuleChargesCommand(fitID=self.fitID, chargeMap={mod.modPosition: self.rebaseMap[mod.chargeID]})) for containerName in ("drones", "fighters", "implants", "boosters"): container = getattr(fit, containerName) for obj in container: if obj.itemID in self.rebaseMap: - self.internal_history.Submit(FitRebaseItemCommand(fitID=self.fitID, containerName=containerName, position=container.index(obj), itemID=self.rebaseMap[obj.itemID], commit=False)) + self.internal_history.Submit(CalcRebaseItemCommand(fitID=self.fitID, containerName=containerName, position=container.index(obj), itemID=self.rebaseMap[obj.itemID], commit=False)) # Need to process cargo separately as we want to merge items when needed, # e.g. FN iron and CN iron into single stack of CN iron for cargo in fit.cargo: if cargo.itemID in self.rebaseMap: amount = cargo.amount - self.internal_history.Submit(FitRemoveCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=cargo.itemID, amount=amount))) - self.internal_history.Submit(FitAddCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=self.rebaseMap[cargo.itemID], amount=amount))) + self.internal_history.Submit(CalcRemoveCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=cargo.itemID, amount=amount))) + self.internal_history.Submit(CalcAddCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=self.rebaseMap[cargo.itemID], amount=amount))) if self.internal_history.Commands: eos.db.commit() Fit.getInstance().recalc(self.fitID) diff --git a/gui/fitCommands/guiRemoveBooster.py b/gui/fitCommands/guiRemoveBooster.py index 8a5bf8e76..abd47890c 100644 --- a/gui/fitCommands/guiRemoveBooster.py +++ b/gui/fitCommands/guiRemoveBooster.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.booster.remove import FitRemoveBoosterCommand +from .calc.booster.remove import CalcRemoveBoosterCommand class GuiRemoveBoosterCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiRemoveBoosterCommand(wx.Command): self.position = position def Do(self): - if self.internal_history.Submit(FitRemoveBoosterCommand(self.fitID, self.position)): + if self.internal_history.Submit(CalcRemoveBoosterCommand(self.fitID, self.position)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiRemoveCargo.py b/gui/fitCommands/guiRemoveCargo.py index 65104e72c..e1d3e0149 100644 --- a/gui/fitCommands/guiRemoveCargo.py +++ b/gui/fitCommands/guiRemoveCargo.py @@ -6,7 +6,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import CargoInfo -from .calc.cargo.remove import FitRemoveCargoCommand +from .calc.cargo.remove import CalcRemoveCargoCommand class GuiRemoveCargoCommand(wx.Command): @@ -19,7 +19,7 @@ class GuiRemoveCargoCommand(wx.Command): self.itemID = itemID def Do(self): - if self.internal_history.Submit(FitRemoveCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=self.itemID, amount=math.inf))): + if self.internal_history.Submit(CalcRemoveCargoCommand(fitID=self.fitID, cargoInfo=CargoInfo(itemID=self.itemID, amount=math.inf))): wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True return False diff --git a/gui/fitCommands/guiRemoveCommand.py b/gui/fitCommands/guiRemoveCommand.py index a856cff52..a4002408e 100644 --- a/gui/fitCommands/guiRemoveCommand.py +++ b/gui/fitCommands/guiRemoveCommand.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.commandFit.remove import FitRemoveCommandCommand +from .calc.commandFit.remove import CalcRemoveCommandCommand class GuiRemoveCommandCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiRemoveCommandCommand(wx.Command): self.commandFitID = commandFitID def Do(self): - if self.internal_history.Submit(FitRemoveCommandCommand(self.fitID, self.commandFitID)): + if self.internal_history.Submit(CalcRemoveCommandCommand(self.fitID, self.commandFitID)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiRemoveDrone.py b/gui/fitCommands/guiRemoveDrone.py index 01bf6ac43..42dcac5cd 100644 --- a/gui/fitCommands/guiRemoveDrone.py +++ b/gui/fitCommands/guiRemoveDrone.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.drone.localRemove import FitRemoveDroneCommand +from .calc.drone.localRemove import CalcRemoveLocalDroneCommand class GuiRemoveDroneCommand(wx.Command): @@ -17,7 +17,7 @@ class GuiRemoveDroneCommand(wx.Command): self.amount = amount def Do(self): - cmd = FitRemoveDroneCommand(self.fitID, self.position, self.amount) + cmd = CalcRemoveLocalDroneCommand(self.fitID, self.position, self.amount) if self.internal_history.Submit(cmd): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiRemoveFighter.py b/gui/fitCommands/guiRemoveFighter.py index 75f8568be..eeea0a87d 100644 --- a/gui/fitCommands/guiRemoveFighter.py +++ b/gui/fitCommands/guiRemoveFighter.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.fighter.localRemove import FitRemoveFighterCommand +from .calc.fighter.localRemove import CalcRemoveLocalFighterCommand class GuiRemoveFighterCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiRemoveFighterCommand(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - success = self.internal_history.Submit(FitRemoveFighterCommand(self.fitID, self.position)) + success = self.internal_history.Submit(CalcRemoveLocalFighterCommand(self.fitID, self.position)) if success: self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) diff --git a/gui/fitCommands/guiRemoveImplant.py b/gui/fitCommands/guiRemoveImplant.py index 0e7133991..0677b998f 100644 --- a/gui/fitCommands/guiRemoveImplant.py +++ b/gui/fitCommands/guiRemoveImplant.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.implant.remove import FitRemoveImplantCommand +from .calc.implant.remove import CalcRemoveImplantCommand class GuiRemoveImplantCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiRemoveImplantCommand(wx.Command): self.position = position def Do(self): - if self.internal_history.Submit(FitRemoveImplantCommand(self.fitID, self.position)): + if self.internal_history.Submit(CalcRemoveImplantCommand(self.fitID, self.position)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiRemoveModule.py b/gui/fitCommands/guiRemoveModule.py index 976b45ad2..de0d29906 100644 --- a/gui/fitCommands/guiRemoveModule.py +++ b/gui/fitCommands/guiRemoveModule.py @@ -4,7 +4,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE from .helpers import ModuleInfo -from .calc.module.localRemove import FitRemoveModuleCommand +from .calc.module.localRemove import CalcRemoveLocalModuleCommand class GuiModuleRemoveCommand(wx.Command): @@ -23,7 +23,7 @@ class GuiModuleRemoveCommand(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - success = self.internal_history.Submit(FitRemoveModuleCommand(self.fitID, [pos for pos in self.modCache])) + success = self.internal_history.Submit(CalcRemoveLocalModuleCommand(self.fitID, [pos for pos in self.modCache])) if success: self.sFit.recalc(self.fitID) diff --git a/gui/fitCommands/guiRemoveProjected.py b/gui/fitCommands/guiRemoveProjected.py index e1a0b6126..873da7fbe 100644 --- a/gui/fitCommands/guiRemoveProjected.py +++ b/gui/fitCommands/guiRemoveProjected.py @@ -3,11 +3,11 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.module.projectedRemove import FitRemoveProjectedModuleCommand -from .calc.projectedFit.remove import FitRemoveProjectedFitCommand -from .calc.fighter.projectedRemove import FitRemoveProjectedFighterCommand +from .calc.module.projectedRemove import CalcRemoveProjectedModuleCommand +from .calc.projectedFit.remove import CalcRemoveProjectedFitCommand +from .calc.fighter.projectedRemove import CalcRemoveProjectedFighterCommand from logbook import Logger -from .calc.drone.projectedRemove import FitRemoveProjectedDroneCommand +from .calc.drone.projectedRemove import CalcRemoveProjectedDroneCommand from gui.fitCommands.helpers import DroneInfo from eos.saveddata.drone import Drone @@ -19,10 +19,10 @@ pyfalog = Logger(__name__) class GuiRemoveProjectedCommand(wx.Command): mapping = { - 'fit': FitRemoveProjectedFitCommand, - 'module': FitRemoveProjectedModuleCommand, - 'fighter': FitRemoveProjectedFighterCommand, - 'drone': FitRemoveProjectedDroneCommand + 'fit': CalcRemoveProjectedFitCommand, + 'module': CalcRemoveProjectedModuleCommand, + 'fighter': CalcRemoveProjectedFighterCommand, + 'drone': CalcRemoveProjectedDroneCommand } def __init__(self, fitID, thing): diff --git a/gui/fitCommands/guiSetMode.py b/gui/fitCommands/guiSetMode.py index 37bec815c..2c572c714 100644 --- a/gui/fitCommands/guiSetMode.py +++ b/gui/fitCommands/guiSetMode.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.shipModeChange import FitChangeShipModeCommand +from .calc.shipModeChange import CalcChangeShipModeCommand class GuiSetModeCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiSetModeCommand(wx.Command): self.itemID = itemID def Do(self): - if self.internal_history.Submit(FitChangeShipModeCommand(self.fitID, self.itemID)): + if self.internal_history.Submit(CalcChangeShipModeCommand(self.fitID, self.itemID)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiSetSpoolup.py b/gui/fitCommands/guiSetSpoolup.py index cf61c05ec..588af0a86 100644 --- a/gui/fitCommands/guiSetSpoolup.py +++ b/gui/fitCommands/guiSetSpoolup.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.module.changeSpool import FitChangeModuleSpoolCommand +from .calc.module.changeSpool import CalcChangeModuleSpoolCommand class GuiSetSpoolup(wx.Command): @@ -20,7 +20,7 @@ class GuiSetSpoolup(wx.Command): self.context = context def Do(self): - if self.internal_history.Submit(FitChangeModuleSpoolCommand( + if self.internal_history.Submit(CalcChangeModuleSpoolCommand( fitID=self.fitID, position=self.position, spoolType=self.spoolType, diff --git a/gui/fitCommands/guiSwapCloneModule.py b/gui/fitCommands/guiSwapCloneModule.py index f4bd5a2be..4251094f1 100644 --- a/gui/fitCommands/guiSwapCloneModule.py +++ b/gui/fitCommands/guiSwapCloneModule.py @@ -3,8 +3,8 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from gui.fitCommands.calc.module.localSwap import FitSwapModuleCommand -from .calc.module.localClone import FitCloneModuleCommand +from gui.fitCommands.calc.module.localSwap import CalcSwapLocalModuleCommand +from .calc.module.localClone import CalcCloneLocalModuleCommand from logbook import Logger pyfalog = Logger(__name__) @@ -26,13 +26,13 @@ class GuiModuleSwapOrCloneCommand(wx.Command): if self.clone: pyfalog.debug("Trying to clone module") - if self.internal_history.Submit(FitCloneModuleCommand(self.fitID, self.srcPosition, self.dstPosition)): + if self.internal_history.Submit(CalcCloneLocalModuleCommand(self.fitID, self.srcPosition, self.dstPosition)): self.sFit.recalc(self.fitID) # clone needs a recalc wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True else: pyfalog.debug("Trying to Swap module") - if self.internal_history.Submit(FitSwapModuleCommand(self.fitID, self.srcPosition, self.dstPosition)): + if self.internal_history.Submit(CalcSwapLocalModuleCommand(self.fitID, self.srcPosition, self.dstPosition)): wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleBooster.py b/gui/fitCommands/guiToggleBooster.py index 88d8af1cd..644a0d1a7 100644 --- a/gui/fitCommands/guiToggleBooster.py +++ b/gui/fitCommands/guiToggleBooster.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.booster.toggleState import FitToggleBoosterStateCommand +from .calc.booster.toggleState import CalcToggleBoosterStateCommand class GuiToggleBoosterCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiToggleBoosterCommand(wx.Command): self.position = position def Do(self): - if self.internal_history.Submit(FitToggleBoosterStateCommand(self.fitID, self.position)): + if self.internal_history.Submit(CalcToggleBoosterStateCommand(self.fitID, self.position)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleBoosterSideEffect.py b/gui/fitCommands/guiToggleBoosterSideEffect.py index 9ca51d4ee..eb91dc184 100644 --- a/gui/fitCommands/guiToggleBoosterSideEffect.py +++ b/gui/fitCommands/guiToggleBoosterSideEffect.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.booster.sideEffectToggleState import FitToggleBoosterSideEffectStateCommand +from .calc.booster.sideEffectToggleState import CalcToggleBoosterSideEffectStateCommand class GuiToggleBoosterSideEffectCommand(wx.Command): @@ -17,7 +17,7 @@ class GuiToggleBoosterSideEffectCommand(wx.Command): self.effectID = effectID def Do(self): - if self.internal_history.Submit(FitToggleBoosterSideEffectStateCommand(self.fitID, self.position, self.effectID)): + if self.internal_history.Submit(CalcToggleBoosterSideEffectStateCommand(self.fitID, self.position, self.effectID)): Fit.getInstance().recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleCommand.py b/gui/fitCommands/guiToggleCommand.py index 11c5956ef..7066200d3 100644 --- a/gui/fitCommands/guiToggleCommand.py +++ b/gui/fitCommands/guiToggleCommand.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.commandFit.toggleState import FitToggleCommandFitStateCommand +from .calc.commandFit.toggleState import CalcToggleCommandFitStateCommand class GuiToggleCommandCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiToggleCommandCommand(wx.Command): self.commandFitID = commandFitID def Do(self): - if self.internal_history.Submit(FitToggleCommandFitStateCommand(self.fitID, self.commandFitID)): + if self.internal_history.Submit(CalcToggleCommandFitStateCommand(self.fitID, self.commandFitID)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleDrone.py b/gui/fitCommands/guiToggleDrone.py index e020bcd50..a016a497c 100644 --- a/gui/fitCommands/guiToggleDrone.py +++ b/gui/fitCommands/guiToggleDrone.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.drone.localToggleState import FitToggleDroneStateCommand +from .calc.drone.localToggleState import CalcToggleLocalDroneStateCommand class GuiToggleDroneCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiToggleDroneCommand(wx.Command): self.position = position def Do(self): - if self.internal_history.Submit(FitToggleDroneStateCommand(self.fitID, self.position)): + if self.internal_history.Submit(CalcToggleLocalDroneStateCommand(self.fitID, self.position)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleFighter.py b/gui/fitCommands/guiToggleFighter.py index e6a1b7f2b..e0f86f450 100644 --- a/gui/fitCommands/guiToggleFighter.py +++ b/gui/fitCommands/guiToggleFighter.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.fighter.localToggleState import FitToggleFighterStateCommand +from .calc.fighter.toggleState import CalcToggleFighterStateCommand class GuiToggleFighterCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiToggleFighterCommand(wx.Command): self.position = position def Do(self): - if self.internal_history.Submit(FitToggleFighterStateCommand(self.fitID, self.position)): + if self.internal_history.Submit(CalcToggleFighterStateCommand(self.fitID, False, self.position)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleFighterAbility.py b/gui/fitCommands/guiToggleFighterAbility.py index 96201a9b1..31796b9a0 100644 --- a/gui/fitCommands/guiToggleFighterAbility.py +++ b/gui/fitCommands/guiToggleFighterAbility.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.fighter.abilityToggle import FitToggleFighterAbilityStateCommand +from .calc.fighter.abilityToggleState import CalcToggleFighterAbilityStateCommand class GuiToggleFighterAbilityCommand(wx.Command): @@ -18,7 +18,7 @@ class GuiToggleFighterAbilityCommand(wx.Command): self.isProjected = isProjected def Do(self): - if self.internal_history.Submit(FitToggleFighterAbilityStateCommand(self.fitID, self.position, self.effectID, self.isProjected)): + if self.internal_history.Submit(CalcToggleFighterAbilityStateCommand(self.fitID, self.isProjected, self.position, self.effectID)): Fit.getInstance().recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleImplant.py b/gui/fitCommands/guiToggleImplant.py index 7eb45d6d2..89e0c5cb0 100644 --- a/gui/fitCommands/guiToggleImplant.py +++ b/gui/fitCommands/guiToggleImplant.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.implant.toggleState import FitToggleImplantStateCommand +from .calc.implant.toggleState import CalcToggleImplantStateCommand class GuiToggleImplantCommand(wx.Command): @@ -16,7 +16,7 @@ class GuiToggleImplantCommand(wx.Command): self.position = position def Do(self): - if self.internal_history.Submit(FitToggleImplantStateCommand(self.fitID, self.position)): + if self.internal_history.Submit(CalcToggleImplantStateCommand(self.fitID, self.position)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleModuleState.py b/gui/fitCommands/guiToggleModuleState.py index 6c745f2bd..11c5d6ef7 100644 --- a/gui/fitCommands/guiToggleModuleState.py +++ b/gui/fitCommands/guiToggleModuleState.py @@ -3,7 +3,7 @@ from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE -from .calc.module.localChangeStates import FitChangeModuleStatesCommand +from .calc.module.localChangeStates import CalcChangeLocalModuleStatesCommand class GuiModuleStateChangeCommand(wx.Command): @@ -19,7 +19,7 @@ class GuiModuleStateChangeCommand(wx.Command): self.internal_history = wx.CommandProcessor() def Do(self): - if self.internal_history.Submit(FitChangeModuleStatesCommand(self.fitID, self.baseMod, self.modules, self.click)): + if self.internal_history.Submit(CalcChangeLocalModuleStatesCommand(self.fitID, self.baseMod, self.modules, self.click)): self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return True diff --git a/gui/fitCommands/guiToggleProjected.py b/gui/fitCommands/guiToggleProjected.py index 7f090e75c..9e42b487b 100644 --- a/gui/fitCommands/guiToggleProjected.py +++ b/gui/fitCommands/guiToggleProjected.py @@ -7,10 +7,10 @@ from eos.saveddata.fit import Fit as FitType from eos.saveddata.module import Module as ModuleType from gui import globalEvents as GE from service.fit import Fit -from .calc.drone.projectedToggleState import FitToggleProjectedDroneStateCommand -from .calc.fighter.projectedToggleState import FitToggleProjectedFighterStateCommand -from .calc.projectedFit.toggleState import FitToggleProjectedFitCommand -from .calc.module.projectedChangeState import FitChangeProjectedModuleStateCommand +from .calc.drone.projectedToggleState import CalcToggleProjectedDroneStateCommand +from .calc.fighter.toggleState import CalcToggleFighterStateCommand +from .calc.projectedFit.toggleState import CalcToggleProjectedFitCommand +from .calc.module.projectedChangeState import CalcChangeProjectedModuleStateCommand class GuiToggleProjectedCommand(wx.Command): @@ -22,19 +22,19 @@ class GuiToggleProjectedCommand(wx.Command): self.fitID = fitID fit = Fit.getInstance().getFit(self.fitID) if isinstance(thing, FitType): - self.commandType = FitToggleProjectedFitCommand + self.commandType = CalcToggleProjectedFitCommand self.args = (self.fitID, thing.ID) elif isinstance(thing, ModuleType): position = fit.projectedModules.index(thing) - self.commandType = FitChangeProjectedModuleStateCommand + self.commandType = CalcChangeProjectedModuleStateCommand self.args = (self.fitID, position, click) elif isinstance(thing, DroneType): - self.commandType = FitToggleProjectedDroneStateCommand + self.commandType = CalcToggleProjectedDroneStateCommand self.args = (self.fitID, thing.itemID) elif isinstance(thing, FighterType): position = fit.projectedFighters.index(thing) - self.commandType = FitToggleProjectedFighterStateCommand - self.args = (self.fitID, position) + self.commandType = CalcToggleFighterStateCommand + self.args = (self.fitID, True, position) else: self.commandType = None self.args = () diff --git a/service/port/efs.py b/service/port/efs.py index 45a920cee..3aa22d35b 100755 --- a/service/port/efs.py +++ b/service/port/efs.py @@ -16,8 +16,8 @@ from eos.effectHandlerHelpers import HandledList from eos.db import gamedata_session, getCategory, getAttributeInfo, getGroup from eos.gamedata import Attribute, Effect, Group, Item, ItemEffect from eos.utils.spoolSupport import SpoolType, SpoolOptions -from gui.fitCommands.calc.module.localAdd import FitAddModuleCommand -from gui.fitCommands.calc.module.localRemove import FitRemoveModuleCommand +from gui.fitCommands.calc.module.localAdd import CalcAddLocalModuleCommand +from gui.fitCommands.calc.module.localRemove import CalcRemoveLocalModuleCommand from gui.fitCommands.helpers import ModuleInfo @@ -66,12 +66,12 @@ class EfsPort: if propID is None: return None - FitAddModuleCommand(fitID, ModuleInfo(itemID=propID)).Do() + CalcAddLocalModuleCommand(fitID, ModuleInfo(itemID=propID)).Do() sFit.recalc(fit) fit = eos.db.getFit(fitID) mwdPropSpeed = fit.maxSpeed mwdPosition = list(filter(lambda mod: mod.item and mod.item.ID == propID, fit.modules))[0].position - FitRemoveModuleCommand(fitID, [mwdPosition]).Do() + CalcRemoveLocalModuleCommand(fitID, [mwdPosition]).Do() sFit.recalc(fit) fit = eos.db.getFit(fitID) return mwdPropSpeed