guage: respect animation setting (#1434)
This commit is contained in:
@@ -18,6 +18,7 @@ import wx
|
|||||||
|
|
||||||
from gui.utils import color as color_utils
|
from gui.utils import color as color_utils
|
||||||
from gui.utils import draw, anim_effects
|
from gui.utils import draw, anim_effects
|
||||||
|
from service.fit import Fit
|
||||||
|
|
||||||
|
|
||||||
class PyGauge(wx.Window):
|
class PyGauge(wx.Window):
|
||||||
@@ -129,11 +130,16 @@ class PyGauge(wx.Window):
|
|||||||
return self._max_range
|
return self._max_range
|
||||||
|
|
||||||
def Animate(self):
|
def Animate(self):
|
||||||
if not self._timer:
|
sFit = Fit.getInstance()
|
||||||
self._timer = wx.Timer(self, self._timer_id)
|
if sFit.serviceFittingOptions["enableGaugeAnimation"]:
|
||||||
|
if not self._timer:
|
||||||
|
self._timer = wx.Timer(self, self._timer_id)
|
||||||
|
|
||||||
self._anim_step = 0
|
self._anim_step = 0
|
||||||
self._timer.Start(self._period)
|
self._timer.Start(self._period)
|
||||||
|
else:
|
||||||
|
self._anim_value = self._percentage
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
def SetRange(self, range, reinit=False, animate=True):
|
def SetRange(self, range, reinit=False, animate=True):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user