Swap a module from cargo to fitting window
(self, x, y, cargoItemID)
| 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""" |
no test coverage detected