(self, fit=None)
| 92 | self.panel.Layout() |
| 93 | |
| 94 | def refreshPanelPrices(self, fit=None): |
| 95 | |
| 96 | ship_price = 0 |
| 97 | module_price = 0 |
| 98 | drone_price = 0 |
| 99 | fighter_price = 0 |
| 100 | cargo_price = 0 |
| 101 | booster_price = 0 |
| 102 | implant_price = 0 |
| 103 | |
| 104 | if fit: |
| 105 | ship_price = fit.ship.item.price.price |
| 106 | |
| 107 | if fit.modules: |
| 108 | for module in fit.modules: |
| 109 | if not module.isEmpty: |
| 110 | module_price += module.item.price.price |
| 111 | |
| 112 | if fit.drones: |
| 113 | for drone in fit.drones: |
| 114 | drone_price += drone.item.price.price * drone.amount |
| 115 | |
| 116 | if fit.fighters: |
| 117 | for fighter in fit.fighters: |
| 118 | fighter_price += fighter.item.price.price * fighter.amount |
| 119 | |
| 120 | if fit.cargo: |
| 121 | for cargo in fit.cargo: |
| 122 | cargo_price += cargo.item.price.price * cargo.amount |
| 123 | |
| 124 | if fit.boosters: |
| 125 | for booster in fit.boosters: |
| 126 | booster_price += booster.item.price.price |
| 127 | |
| 128 | if fit.appliedImplants: |
| 129 | for implant in fit.appliedImplants: |
| 130 | implant_price += implant.item.price.price |
| 131 | |
| 132 | total_price = 0 |
| 133 | total_price += ship_price |
| 134 | total_price += module_price |
| 135 | if self.settings.get("drones"): |
| 136 | total_price += drone_price + fighter_price |
| 137 | if self.settings.get("cargo"): |
| 138 | total_price += cargo_price |
| 139 | if self.settings.get("character"): |
| 140 | total_price += booster_price + implant_price |
| 141 | |
| 142 | self.labelPriceShip.SetLabel("%s ISK" % formatAmount(ship_price, 3, 3, 9, currency=True)) |
| 143 | self.labelPriceShip.SetToolTip(wx.ToolTip('{:,.2f} ISK'.format(ship_price))) |
| 144 | |
| 145 | self.labelPriceFittings.SetLabel("%s ISK" % formatAmount(module_price, 3, 3, 9, currency=True)) |
| 146 | self.labelPriceFittings.SetToolTip(wx.ToolTip('{:,.2f} ISK'.format(module_price))) |
| 147 | |
| 148 | self.labelPriceDrones.SetLabel("%s ISK" % formatAmount(drone_price + fighter_price, 3, 3, 9, currency=True)) |
| 149 | self.labelPriceDrones.SetToolTip(wx.ToolTip('{:,.2f} ISK'.format(drone_price + fighter_price))) |
| 150 | |
| 151 | self.labelPriceCargobay.SetLabel("%s ISK" % formatAmount(cargo_price, 3, 3, 9, currency=True)) |
no test coverage detected