Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
02bwilson committed Aug 13, 2023
1 parent 960e14d commit 7fb18e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Managers/DataManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def __init__(self):

def setIIRAlpha(self, alpha):
self._IIR_ALPHA = alpha

def setSpeed(self, speed):
self._TIME_SCALE_FACTOR = speed

Expand Down Expand Up @@ -123,7 +124,7 @@ def gatherData(self):
# If the window size has been decreased we need to resize the time data
elif len(self.dataDict['time']) > self._WINDOW_SIZE * self._SAMPLE_RATE:
spliceSpot = (len(self.dataDict['time']) - (self._WINDOW_SIZE * self._SAMPLE_RATE))
self.dataDict['time'] = self.dataDict['time'][int(spliceSpot)+1:]
self.dataDict['time'] = self.dataDict['time'][int(spliceSpot) + 1:]
# Add the current value
self.dataDict['time'] += [curVal]
self.timeList += [now]
Expand Down Expand Up @@ -172,10 +173,11 @@ def addSignal(self, data):
# Operator: the operator that will be applied to the curValue
# Lambda t: A lambda expression representing the signal
self.functions[data["name"]] = [data["operator"],
lambda t: eval(str(data["alpha"]) + "*" + self._FUNCTION_MAP[data["function"]] \
lambda t: eval(str(data["alpha"]) + "*" + self._FUNCTION_MAP[data["function"]]
+ "(" + str(data["beta"]) + "*" + str(t) + "+" + str(
data["gamma"]) + ")"), [data["alpha"], data["beta"], data["gamma"],
data["function"], self._FUNCTION_MAP[data["function"]]]]
data["function"],
self._FUNCTION_MAP[data["function"]]]]

def removeSignal(self, signalName):
"""
Expand Down

0 comments on commit 7fb18e7

Please sign in to comment.