def __handleImplant(self, callingWindow, mainItem, selection): fitID = self.mainFrame.getActiveFit() fit = Fit.getInstance().getFit(fitID) positions = [] for implant in selection: if implant in fit.implants: positions.append(fit.implants.index(implant)) self.mainFrame.command.Submit( cmd.GuiRemoveImplantsCommand(fitID=fitID, positions=positions))
def removeImplants(self, implants): fitID = self.mainFrame.getActiveFit() fit = Fit.getInstance().getFit(fitID) if fit.implantLocation != ImplantLocation.FIT: return positions = [] for implant in implants: if implant in self.original: positions.append(self.original.index(implant)) self.mainFrame.command.Submit(cmd.GuiRemoveImplantsCommand(fitID=fitID, positions=positions))