Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ynsta/steamcontroller.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Chrétien <chretien.b@gmail.com>2016-05-11 15:54:40 +0300
committerBenjamin Chrétien <chretien.b@gmail.com>2016-05-11 15:57:09 +0300
commitf01ea3fbb99b49c0f52aa410cb5e7c1d6ab3deef (patch)
treef4459ca5acdc8f2a893648b140cb9a5326ba915a
parent71cb09c9dd4e0d6dfd61a109562f24e5aea58517 (diff)
sc-gyro-plot.py: fix size mismatch
-rwxr-xr-xscripts/sc-gyro-plot.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/sc-gyro-plot.py b/scripts/sc-gyro-plot.py
index c1648d5..47ad06f 100755
--- a/scripts/sc-gyro-plot.py
+++ b/scripts/sc-gyro-plot.py
@@ -102,7 +102,12 @@ def _main():
for name in imu.keys():
imu[name].append(sci._asdict()[name])
- imu[name] = imu[name][-len(times):]
+ nt = len(times)
+ ni = len(imu[name])
+ if nt < ni:
+ imu[name] = imu[name][-nt:]
+ elif nt > ni:
+ times = times[nt-ni:]
curves[name].setData(times, imu[name])
app.processEvents()