def handleAmmoSwitch(self, event): if len(self.modules) != 1: event.Skip() return charge = self.chargeIds.get(event.Id, False) if charge is False: event.Skip() return sFit = Fit.getInstance() fitID = self.mainFrame.getActiveFit() fit = db_getFit(fitID) selectedModule = self.modules[0] allModules = [] for mod in fit.modules: if mod.itemID is None: continue if mod.itemID == selectedModule.itemID: allModules.append(mod) sFit.setAmmo(fitID, charge.ID if charge is not None else None, allModules) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
def handleAmmoSwitch(self, event): if len(self.modules) != 1: event.Skip() return charge = self.chargeIds.get(event.Id, False) if charge is False: event.Skip() return fitID = self.mainFrame.getActiveFit() fit = db_getFit(fitID) selectedModule = self.modules[0] allModules = [] for mod in fit.modules: if mod.itemID is None: continue if mod.itemID == selectedModule.itemID: allModules.append(mod) self.mainFrame.command.Submit(cmd.GuiModuleAddChargeCommand(fitID, charge.ID if charge is not None else None, allModules))
def handleAmmoSwitch(self, event): if len(self.modules) != 1: event.Skip() return charge = self.chargeIds.get(event.Id, False) if charge is False: event.Skip() return fitID = self.mainFrame.getActiveFit() fit = db_getFit(fitID) selectedModule = self.modules[0] source = fit.modules if not selectedModule.isProjected else fit.projectedModules allModules = [] for mod in source: if mod.itemID is None: continue if mod.itemID == selectedModule.itemID: allModules.append(mod) self.mainFrame.command.Submit(cmd.GuiModuleAddChargeCommand(fitID, charge.ID if charge is not None else None, allModules))
def clipboardEftImps(self): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportEftImps(fit))
def clipboardEsi(self): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportESI(fit))
def clipboardEfs(self): fit = db_getFit(self.getActiveFit()) toClipboard(EfsPort.exportEfs(fit, 0))
def clipboardEfs(self, options): fit = db_getFit(self.getActiveFit()) toClipboard(EfsPort.exportEfs(fit, 0))
def clipboardXml(self): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportXml(None, fit))
def clipboardEsi(self, options): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportESI(fit))
def clipboardDna(self, options): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportDna(fit))
def clipboardEft(self, options): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportEft(fit, options))
def clipboardCrest(self): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportCrest(fit))
def clipboardDna(self): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportDna(fit))
def clipboardXml(self, options): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportXml(None, fit))
def clipboardMultiBuy(self): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportMultiBuy(fit))
def clipboardMultiBuy(self, options): fit = db_getFit(self.getActiveFit()) toClipboard(Port.exportMultiBuy(fit))