MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / refreshPanel

Method refreshPanel

gui/builtinStatsViews/rechargeViewFull.py:112–161  ·  view source on GitHub ↗
(self, fit)

Source from the content-addressed store, hash-verified

110 contentPanel.Layout()
111
112 def refreshPanel(self, fit):
113 # If we did anything interesting, we'd update our labels to reflect the new fit's stats here
114 unit = " EHP/s" if self.effective else " HP/s"
115
116 for stability in ("reinforced", "sustained"):
117 if stability == "reinforced" and fit is not None:
118 tank = fit.effectiveTank if self.effective else fit.tank
119 elif stability == "sustained" and fit is not None:
120 tank = fit.effectiveSustainableTank if self.effective else fit.sustainableTank
121 else:
122 tank = None
123
124 for name in ("shield", "armor", "hull"):
125 lbl = getattr(self, "labelTank%s%sActive" % (stability.capitalize(), name.capitalize()))
126 unitlbl = getattr(self, "unitLabelTank%s%sActive" % (stability.capitalize(), name.capitalize()))
127 unitlbl.SetLabel(unit)
128 if tank is not None:
129 amount = tank["{}Repair".format(name)]
130 else:
131 amount = 0
132
133 if tank is not None and name == "armor":
134 preSpoolAmount = tank["armorRepairPreSpool"]
135 fullSpoolAmount = tank["armorRepairFullSpool"]
136 if round(preSpoolAmount, 1) != round(fullSpoolAmount, 1):
137 ttText = "Spool up: {:.1f}-{:.1f}".format(preSpoolAmount, fullSpoolAmount)
138 else:
139 ttText = ""
140 else:
141 ttText = ""
142
143 lbl.SetLabel("{:.1f}{}".format(amount, "\u02e2" if ttText else ""))
144 lbl.SetToolTip(wx.ToolTip(ttText))
145 unitlbl.SetToolTip(wx.ToolTip(ttText))
146
147 if fit is not None:
148 label = getattr(self, "labelTankSustainedShieldPassive")
149 value = fit.effectiveTank["passiveShield"] if self.effective else fit.tank["passiveShield"]
150 label.SetLabel(formatAmount(value, 3, 0, 9))
151 unitlbl = getattr(self, "unitLabelTankSustainedShieldPassive")
152 unitlbl.SetLabel(unit)
153
154 else:
155 value = 0
156 label = getattr(self, "labelTankSustainedShieldPassive")
157 label.SetLabel("0")
158
159 label.SetToolTip(wx.ToolTip("%.3f" % value))
160 self.panel.Layout()
161 self.headerPanel.Layout()
162
163
164RechargeViewFull.register()

Callers 1

toggleEffectiveMethod · 0.95

Calls 2

formatAmountFunction · 0.90
SetLabelMethod · 0.80

Tested by

no test coverage detected