Added timeweighting infinite for real time processing

This commit is contained in:
Anne de Jong 2020-02-29 18:07:46 +01:00
parent 92ca0aa795
commit 82e077ec3a

View File

@ -82,12 +82,14 @@ class TimeWeighting:
fast = (0.125, 'Fast (0.125 s)') fast = (0.125, 'Fast (0.125 s)')
slow = (1.0, 'Slow (1.0 s)') slow = (1.0, 'Slow (1.0 s)')
tens = (10., '10 s') tens = (10., '10 s')
infinite = (0, 'Infinite')
types = (none, uufast, ufast, fast, slow, tens) types = (none, uufast, ufast, fast, slow, tens)
types_all = (none, uufast, ufast, fast, slow, tens, infinite)
default = fast default = fast
default_index = 3 default_index = 3
@staticmethod @staticmethod
def fillComboBox(cb): def fillComboBox(cb, all_=False):
""" """
Fill TimeWeightings to a combobox Fill TimeWeightings to a combobox
@ -95,13 +97,17 @@ class TimeWeighting:
cb: QComboBox to fill cb: QComboBox to fill
""" """
cb.clear() cb.clear()
for tw in TimeWeighting.types: if all_:
types = TimeWeighting.types_all
else:
types = TimeWeighting.types
for tw in types:
cb.addItem(tw[1], tw) cb.addItem(tw[1], tw)
cb.setCurrentIndex(TimeWeighting.default_index) cb.setCurrentIndex(TimeWeighting.default_index)
@staticmethod @staticmethod
def getCurrent(cb): def getCurrent(cb):
return TimeWeighting.types[cb.currentIndex()] return TimeWeighting.types_all[cb.currentIndex()]
class FreqWeighting: class FreqWeighting:
""" """