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

Method OnInputTimer

gui/patternEditor.py:212–224  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

210 self.inputTimer.Start(Fit.getInstance().serviceFittingOptions['marketSearchDelay'], True)
211
212 def OnInputTimer(self, event):
213 event.Skip()
214 if self.block:
215 return
216 p = self.entityEditor.getActiveEntity()
217 total = sum([(getattr(self, "%sEdit" % attr).GetValueFloat() or 0) for attr in self.DAMAGE_TYPES])
218 for type_ in self.DAMAGE_TYPES:
219 editBox = getattr(self, "%sEdit" % type_)
220 percLabel = getattr(self, "%sPerc" % type_)
221 setattr(p, "%sAmount" % type_, editBox.GetValueFloat() or 0)
222 percLabel.SetLabel("%.1f%%" % ((editBox.GetValueFloat() or 0) * 100 / total if total > 0 else 0))
223 self.totSizer.Layout()
224 DamagePattern.getInstance().saveChanges(p)
225
226 def restrict(self):
227 for type_ in self.DAMAGE_TYPES:

Callers

nothing calls this directly

Calls 5

getActiveEntityMethod · 0.80
GetValueFloatMethod · 0.80
SetLabelMethod · 0.80
saveChangesMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected