MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / swapCargo

Method swapCargo

gui/builtinViews/fittingView.py:487–505  ·  view source on GitHub ↗

Swap a module from cargo to fitting window

(self, x, y, cargoItemID)

Source from the content-addressed store, hash-verified

485
486
487 def swapCargo(self, x, y, cargoItemID):
488 """Swap a module from cargo to fitting window"""
489
490 dstRow, _ = self.HitTest((x, y))
491 if dstRow != -1 and dstRow not in self.blanks:
492 mod = self.mods[dstRow]
493
494 if not isinstance(mod, Module):
495 return
496
497 fitID = self.mainFrame.getActiveFit()
498 fit = Fit.getInstance().getFit(fitID)
499 if mod in fit.modules:
500 position = fit.modules.index(mod)
501 self.mainFrame.command.Submit(cmd.GuiCargoToLocalModuleCommand(
502 fitID=fitID,
503 cargoItemID=cargoItemID,
504 modPosition=position,
505 copy=wx.GetMouseState().GetModifiers() == wx.MOD_CONTROL))
506
507 def swapItems(self, x, y, srcIdx):
508 """Swap two modules in fitting window"""

Callers 1

handleListDragMethod · 0.95

Calls 4

getFitMethod · 0.80
HitTestMethod · 0.45
getActiveFitMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected