r4635 - in developers/werner/ahrt/host/tmc: demo lib
werner at docs.openmoko.org
werner at docs.openmoko.org
Mon Sep 8 12:22:54 CEST 2008
Author: werner
Date: 2008-09-08 12:22:54 +0200 (Mon, 08 Sep 2008)
New Revision: 4635
Added:
developers/werner/ahrt/host/tmc/demo/rigoldump.py
Modified:
developers/werner/ahrt/host/tmc/demo/screen.py
developers/werner/ahrt/host/tmc/lib/scope.py
Log:
Cleanup to make downloads work.
- demo/screen.py: don't import popen2
- lib/scope.py (rigol_ds1000c.wave): fixed various silly bugs preventing it
from running at all
- demo/rigoldump.py: example for a full dump of all channels
Added: developers/werner/ahrt/host/tmc/demo/rigoldump.py
===================================================================
--- developers/werner/ahrt/host/tmc/demo/rigoldump.py (rev 0)
+++ developers/werner/ahrt/host/tmc/demo/rigoldump.py 2008-09-08 10:22:54 UTC (rev 4635)
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+#
+# rigoldump.py - Extract all captured data from a Rigol DS1000 and write it to
+# a file
+#
+
+import tmc.scope
+from sys import argv
+
+
+# Open the Rigol DS1000
+
+s = tmc.scope.rigol_ds1000c()
+
+# Retrieve all waves (assuming a DS1000CD with digital channels)
+# Note that this retrieves all samples and can therefore take a while.
+# The use of the "step" argument is recommended.
+
+analog = [s.ch[0], s.ch[1]]
+digital = map(lambda i: s.d[i], range(0, 16))
+w = s.wave(analog+digital)
+
+# Save the waves in the specified file, one sample per line
+
+w.save(argv[1])
Property changes on: developers/werner/ahrt/host/tmc/demo/rigoldump.py
___________________________________________________________________
Name: svn:executable
+ *
Modified: developers/werner/ahrt/host/tmc/demo/screen.py
===================================================================
--- developers/werner/ahrt/host/tmc/demo/screen.py 2008-09-08 10:01:43 UTC (rev 4634)
+++ developers/werner/ahrt/host/tmc/demo/screen.py 2008-09-08 10:22:54 UTC (rev 4635)
@@ -5,7 +5,6 @@
#
import tmc.scope
-from popen2 import popen2
from os import popen
from sys import argv
Modified: developers/werner/ahrt/host/tmc/lib/scope.py
===================================================================
--- developers/werner/ahrt/host/tmc/lib/scope.py 2008-09-08 10:01:43 UTC (rev 4634)
+++ developers/werner/ahrt/host/tmc/lib/scope.py 2008-09-08 10:22:54 UTC (rev 4635)
@@ -29,7 +29,7 @@
import time
from tmc.instrument import settings, setting, settable, instrument
-from tmc.wave import analog, digital
+from tmc.wave import analog, digital, waves
from tmc.trigger import trigger
@@ -352,13 +352,13 @@
return rigol_to_ppm(self.query(":LCD:DATA?"))
def wave(self, channels, start = None, end = None, step = None):
- if not isinstance(channels, array):
+ if not isinstance(channels, list):
return self.download([channels], start, end, step)[0]
la = None
- res = []
+ res = waves()
for ch in channels:
if isinstance(ch, channel):
- res.append(download_wave, start, end, step)
+ res.append(self.download_wave(ch, start, end, step))
else:
if la is None:
la = self.download_la(start, end, step)
More information about the commitlog
mailing list