MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / getText

Method getText

gui/builtinViewColumns/heat.py:148–167  ·  view source on GitHub ↗
(self, mod)

Source from the content-addressed store, hash-verified

146 self.mask = wx.LIST_MASK_IMAGE
147
148 def getText(self, mod):
149 if not isinstance(mod, Module) or mod.state != FittingModuleState.OVERHEATED:
150 return ""
151
152 thermo = Thermodynamics(Fit.getInstance().getFit(self.mainFrame.getActiveFit()))
153 burnCycles = thermo.calcBurnCycles(mod)
154 duration = mod.getModifiedItemAttr("duration") / 1000
155 speed = mod.getModifiedItemAttr("speed") / 1000
156 cycleTime = duration or speed
157
158 t = burnCycles * cycleTime
159 s = t % 60
160 m = (t / 60) % 60
161 h = (t / 3600) % 24
162 out = [f"{int(m):02d}", f"{int(s):02d}"]
163
164 if int(h) > 0: # hours is rarely relevant, only show if it is
165 out.insert(0, f"{int(h):02d}")
166
167 return ":".join(out) # display as 00:00:00 to vertically align across slot cols consistently
168
169 def getToolTip(self, mod):
170 if isinstance(mod, Module) and mod.state == FittingModuleState.OVERHEATED:

Callers

nothing calls this directly

Calls 7

calcBurnCyclesMethod · 0.95
ThermodynamicsClass · 0.85
getFitMethod · 0.80
getInstanceMethod · 0.45
getActiveFitMethod · 0.45
getModifiedItemAttrMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected