(self, fit)
| 149 | view.refreshPanel(fit) |
| 150 | |
| 151 | def refreshPanel(self, fit): |
| 152 | # If we did anything intresting, we'd update our labels to reflect the new fit's stats here |
| 153 | if fit is not None and fit.targetProfile is not None: |
| 154 | self.stEff.Show() |
| 155 | else: |
| 156 | self.stEff.Hide() |
| 157 | |
| 158 | def hasSpoolUp(preSpool, fullSpool): |
| 159 | if preSpool is None or fullSpool is None: |
| 160 | return False |
| 161 | return roundToPrec(preSpool.total, prec) != roundToPrec(fullSpool.total, prec) |
| 162 | |
| 163 | def dpsToolTip(normal, preSpool, fullSpool, prec, lowest, highest): |
| 164 | if normal is None or preSpool is None or fullSpool is None: |
| 165 | return "" |
| 166 | hasSpool = hasSpoolUp(preSpool, fullSpool) |
| 167 | lines = [] |
| 168 | if hasSpool: |
| 169 | lines.append(_t("Spool up") + ": {}-{}".format( |
| 170 | formatAmount(preSpool.total, prec, lowest, highest), |
| 171 | formatAmount(fullSpool.total, prec, lowest, highest))) |
| 172 | if getattr(normal, 'total', None): |
| 173 | if hasSpool: |
| 174 | lines.append("") |
| 175 | lines.append(_t("Current") + ": {}".format(formatAmount(normal.total, prec, lowest, highest))) |
| 176 | for dmgType in normal.names(includePure=True): |
| 177 | val = getattr(normal, dmgType, None) |
| 178 | if val: |
| 179 | lines.append("{}{}: {}%".format( |
| 180 | " " if hasSpool else "", |
| 181 | _t(dmgType).capitalize(), |
| 182 | formatAmount(val / normal.total * 100, 3, 0, 0))) |
| 183 | return "\n".join(lines) |
| 184 | |
| 185 | defaultSpoolValue = eos.config.settings['globalDefaultSpoolupPercentage'] |
| 186 | stats = ( |
| 187 | ( |
| 188 | "labelFullDpsWeapon", |
| 189 | lambda: fit.getWeaponDps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, defaultSpoolValue, False)), |
| 190 | lambda: fit.getWeaponDps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)), |
| 191 | lambda: fit.getWeaponDps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)), |
| 192 | 3, 0, 0, "{}{} DPS"), |
| 193 | ( |
| 194 | "labelFullDpsDrone", |
| 195 | lambda: fit.getDroneDps(), |
| 196 | lambda: fit.getDroneDps(), |
| 197 | lambda: fit.getDroneDps(), |
| 198 | 3, 0, 0, "{}{} DPS"), |
| 199 | ( |
| 200 | "labelFullVolleyTotal", |
| 201 | lambda: fit.getTotalVolley(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, defaultSpoolValue, False)), |
| 202 | lambda: fit.getTotalVolley(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)), |
| 203 | lambda: fit.getTotalVolley(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)), |
| 204 | 3, 0, 0, "{}{}"), |
| 205 | ( |
| 206 | "labelFullDpsTotal", |
| 207 | lambda: fit.getTotalDps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, defaultSpoolValue, False)), |
| 208 | lambda: fit.getTotalDps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)), |
no test coverage detected