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

Method refreshPanel

gui/builtinStatsViews/outgoingViewFull.py:95–122  ·  view source on GitHub ↗
(self, fit)

Source from the content-addressed store, hash-verified

93 sizerOutgoing.Add(baseBox, 1, wx.ALIGN_LEFT)
94
95 def refreshPanel(self, fit):
96
97 def formatTooltip(text, preSpool, fullSpool, prec, lowest, highest):
98 if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
99 return False, text
100 else:
101 return True, "{}\nSpool up: {}-{}".format(
102 text,
103 formatAmount(preSpool, prec, lowest, highest),
104 formatAmount(fullSpool, prec, lowest, highest))
105
106 defaultSpoolValue = eos.config.settings['globalDefaultSpoolupPercentage']
107 counter = 0
108 for labelName, labelDesc, valueFormat, image, tooltip, val, preSpoolVal, fullSpoolVal, prec, lowest, highest in stats:
109 label = getattr(self, labelName)
110 val = val(fit, defaultSpoolValue) if fit is not None else 0
111 preSpoolVal = preSpoolVal(fit) if fit is not None else 0
112 fullSpoolVal = fullSpoolVal(fit) if fit is not None else 0
113 if self._cachedValues[counter] != val:
114 hasSpool, tooltipText = formatTooltip(tooltip, preSpoolVal, fullSpoolVal, prec, lowest, highest)
115 label.SetLabel(valueFormat.format(
116 formatAmount(val, prec, lowest, highest),
117 "\u02e2" if hasSpool else ""))
118 label.SetToolTip(wx.ToolTip(tooltipText))
119 self._cachedValues[counter] = val
120 counter += 1
121 self.panel.Layout()
122 self.headerPanel.Layout()
123
124
125OutgoingViewFull.register()

Callers

nothing calls this directly

Calls 2

formatAmountFunction · 0.90
SetLabelMethod · 0.80

Tested by

no test coverage detected