MCPcopy Create free account
hub / github.com/ARM-software/AVH / __getWindow

Method __getWindow

interface/sensor/python/vsi_sensor.py:102–124  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

100 # Read data file until current and last timestamp are at least WINDOW_SIZE apart
101 # or end of file is reached
102 def __getWindow(self):
103 window = 0
104 old_timestamp_num = 0
105 logger.info("Get Time window")
106 while True:
107 if len(self.timestamp) == 0:
108 self.__getRecord()
109
110 if len(self.timestamp) == old_timestamp_num:
111 break
112 else:
113 old_timestamp_num = len(self.timestamp)
114
115 t0 = self.timestamp[self.cnt]
116 t1 = self.timestamp[-1]
117 window = t1 - t0
118 if window >= self.WINDOW_SIZE:
119 break
120 else:
121 self.__getRecord()
122
123 self.window = window
124 logger.debug(f"Window size: {self.window} ms")
125
126 # Calculate average interval based on number of samples/blocks in current time window
127 def __getInterval(self):

Callers 1

updateTimerMethod · 0.95

Calls 1

__getRecordMethod · 0.95

Tested by

no test coverage detected