本文整理汇总了Python中gui.fitCommands.helpers.InternalCommandHistory类的典型用法代码示例。如果您正苦于以下问题:Python InternalCommandHistory类的具体用法?Python InternalCommandHistory怎么用?Python InternalCommandHistory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InternalCommandHistory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GuiAddProjectedFitCommand
class GuiAddProjectedFitCommand(wx.Command):
def __init__(self, fitID, projectedFitID, amount):
wx.Command.__init__(self, True, 'Add Projected Fit')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.projectedFitID = projectedFitID
self.amount = amount
def Do(self):
cmd = CalcAddProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, amount=self.amount)
success = self.internalHistory.submit(cmd)
sFit = Fit.getInstance()
eos.db.flush()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
sFit = Fit.getInstance()
eos.db.flush()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例2: GuiToggleCommandFitStatesCommand
class GuiToggleCommandFitStatesCommand(wx.Command):
def __init__(self, fitID, mainCommandFitID, commandFitIDs):
wx.Command.__init__(self, True, 'Toggle Command Fit States')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.mainCommandFitID = mainCommandFitID
self.commandFitIDs = commandFitIDs
def Do(self):
cmd = CalcToggleCommandFitStatesCommand(
fitID=self.fitID,
mainCommandFitID=self.mainCommandFitID,
commandFitIDs=self.commandFitIDs)
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例3: GuiRemoveCommandFitsCommand
class GuiRemoveCommandFitsCommand(wx.Command):
def __init__(self, fitID, commandFitIDs):
wx.Command.__init__(self, True, 'Remove Command Fits')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.commandFitIDs = commandFitIDs
def Do(self):
results = []
for commandFitID in self.commandFitIDs:
cmd = CalcRemoveCommandFitCommand(fitID=self.fitID, commandFitID=commandFitID)
results.append(self.internalHistory.submit(cmd))
success = any(results)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例4: GuiToggleBoosterSideEffectStateCommand
class GuiToggleBoosterSideEffectStateCommand(wx.Command):
def __init__(self, fitID, position, effectID):
wx.Command.__init__(self, True, 'Toggle Booster Side Effect State')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.position = position
self.effectID = effectID
def Do(self):
cmd = CalcToggleBoosterSideEffectStateCommand(fitID=self.fitID, position=self.position, effectID=self.effectID)
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例5: GuiChangeLocalModuleSpoolCommand
class GuiChangeLocalModuleSpoolCommand(wx.Command):
def __init__(self, fitID, position, spoolType, spoolAmount):
wx.Command.__init__(self, True, 'Change Local Module Spool')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.position = position
self.spoolType = spoolType
self.spoolAmount = spoolAmount
def Do(self):
cmd = CalcChangeModuleSpoolCommand(
fitID=self.fitID,
projected=False,
position=self.position,
spoolType=self.spoolType,
spoolAmount=self.spoolAmount)
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例6: GuiChangeLocalFighterAmountCommand
class GuiChangeLocalFighterAmountCommand(wx.Command):
def __init__(self, fitID, position, amount):
wx.Command.__init__(self, True, 'Change Local Fighter Amount')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.position = position
self.amount = amount
def Do(self):
if self.amount > 0:
cmd = CalcChangeFighterAmountCommand(fitID=self.fitID, projected=False, position=self.position, amount=self.amount)
else:
cmd = CalcRemoveLocalFighterCommand(fitID=self.fitID, position=self.position)
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例7: GuiChangeProjectedDroneAmountCommand
class GuiChangeProjectedDroneAmountCommand(wx.Command):
def __init__(self, fitID, itemID, amount):
wx.Command.__init__(self, True, 'Change Projected Drone Amount')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.itemID = itemID
self.amount = amount
def Do(self):
if self.amount > 0:
cmd = CalcChangeProjectedDroneAmountCommand(fitID=self.fitID, itemID=self.itemID, amount=self.amount)
else:
cmd = CalcRemoveProjectedDroneCommand(fitID=self.fitID, itemID=self.itemID, amount=math.inf)
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例8: GuiChangeShipModeCommand
class GuiChangeShipModeCommand(wx.Command):
def __init__(self, fitID, itemID):
wx.Command.__init__(self, True, 'Change Ship Mode')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.itemID = itemID
def Do(self):
cmd = CalcChangeShipModeCommand(fitID=self.fitID, itemID=self.itemID)
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例9: GuiChangeLocalModuleMutationCommand
class GuiChangeLocalModuleMutationCommand(wx.Command):
def __init__(self, fitID, position, mutation, oldMutation=None):
wx.Command.__init__(self, True, 'Change Local Module Mutation')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.position = position
self.mutation = mutation
self.oldMutation = oldMutation
def Do(self):
cmd = CalcChangeLocalModuleMutationCommand(
fitID=self.fitID,
position=self.position,
mutation=self.mutation,
oldMutation=self.oldMutation)
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例10: GuiRemoveCargosCommand
class GuiRemoveCargosCommand(wx.Command):
def __init__(self, fitID, itemIDs):
wx.Command.__init__(self, True, 'Remove Cargos')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.itemIDs = itemIDs
def Do(self):
results = []
for itemID in self.itemIDs:
cmd = CalcRemoveCargoCommand(
fitID=self.fitID,
cargoInfo=CargoInfo(itemID=itemID, amount=math.inf))
results.append(self.internalHistory.submit(cmd))
success = any(results)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例11: GuiChangeLocalModuleChargesCommand
class GuiChangeLocalModuleChargesCommand(wx.Command):
def __init__(self, fitID, positions, chargeItemID):
wx.Command.__init__(self, True, 'Change Local Module Charges')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.positions = positions
self.chargeItemID = chargeItemID
def Do(self):
cmd = CalcChangeModuleChargesCommand(fitID=self.fitID, projected=False, chargeMap={p: self.chargeItemID for p in self.positions})
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例12: GuiAddProjectedDroneCommand
class GuiAddProjectedDroneCommand(wx.Command):
def __init__(self, fitID, itemID):
wx.Command.__init__(self, True, 'Add Projected Drone')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.itemID = itemID
def Do(self):
cmd = CalcAddProjectedDroneCommand(fitID=self.fitID, droneInfo=DroneInfo(itemID=self.itemID, amount=1, amountActive=1))
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例13: GuiAddImplantSetCommand
class GuiAddImplantSetCommand(wx.Command):
def __init__(self, fitID, itemIDs):
wx.Command.__init__(self, True, 'Add Implant Set')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.itemIDs = itemIDs
def Do(self):
results = []
for itemID in self.itemIDs:
cmd = CalcAddImplantCommand(fitID=self.fitID, implantInfo=ImplantInfo(itemID=itemID))
results.append(self.internalHistory.submit(cmd))
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
# Some might fail, as we already might have these implants
return any(results)
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例14: GuiRemoveBoostersCommand
class GuiRemoveBoostersCommand(wx.Command):
def __init__(self, fitID, positions):
wx.Command.__init__(self, True, 'Remove Boosters')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.positions = positions
def Do(self):
results = []
for position in sorted(self.positions, reverse=True):
cmd = CalcRemoveBoosterCommand(fitID=self.fitID, position=position)
results.append(self.internalHistory.submit(cmd))
success = any(results)
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
示例15: GuiChangeBoosterMetaCommand
class GuiChangeBoosterMetaCommand(wx.Command):
def __init__(self, fitID, position, newItemID):
wx.Command.__init__(self, True, 'Change Booster Meta')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.position = position
self.newItemID = newItemID
def Do(self):
sFit = Fit.getInstance()
fit = sFit.getFit(self.fitID)
booster = fit.boosters[self.position]
if booster.itemID == self.newItemID:
return False
info = BoosterInfo.fromBooster(booster)
info.itemID = self.newItemID
cmd = CalcAddBoosterCommand(fitID=self.fitID, boosterInfo=info)
success = self.internalHistory.submit(cmd)
eos.db.flush()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
eos.db.flush()
sFit = Fit.getInstance()
sFit.recalc(self.fitID)
sFit.fill(self.fitID)
eos.db.commit()
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success