r5694 - developers/werner/ahrt/host/tmc/lib
werner at docs.openmoko.org
werner at docs.openmoko.org
Sun Oct 18 00:40:49 CEST 2009
Author: werner
Date: 2009-10-18 00:40:48 +0200 (Sun, 18 Oct 2009)
New Revision: 5694
Modified:
developers/werner/ahrt/host/tmc/lib/meter.py
developers/werner/ahrt/host/tmc/lib/power.py
Log:
Various corrections to the M3500A and mPP3040D drivers.
- lib/meter.py: Picotest now have a 20 port scanner card, so raise the number
of channels
- lib/meter.py: the response to ROUT:CLOS? is a comma-separated list, so we
have to count only the commas
- lib/meter.py: we had two meter.avg variables: done to set statistics mode and
one to retrieve the average value. Renamed the former to meter.stat.
- lib/power.py (leaptronix_mpp3040d.query): don't print the query text
- lib/power.py: report current values through functions, not (cached) variables
Modified: developers/werner/ahrt/host/tmc/lib/meter.py
===================================================================
--- developers/werner/ahrt/host/tmc/lib/meter.py 2009-10-16 04:07:21 UTC (rev 5693)
+++ developers/werner/ahrt/host/tmc/lib/meter.py 2009-10-17 22:40:48 UTC (rev 5694)
@@ -34,7 +34,7 @@
# Warning: "meter" doesn't lock itself !
instrument.__init__(self, *args)
- self.avg = setting(self, "CALC:FUNC AVER;:CALC:STAT",
+ self.stat = setting(self, "CALC:FUNC AVER;:CALC:STAT",
lambda x: x == 1,
lambda x: ("OFF", "ON")[x != 0])
self.min = setting(self, "CALC:AVER:MIN",
@@ -116,7 +116,8 @@
if self.curr is not None:
raise hell
self.curr = n
- n += 1
+ if ch == ",":
+ n += 1
else:
self.curr = 1
return self.curr
@@ -128,7 +129,7 @@
if value != 0:
raise hell
else:
- if value < 1 or value > 10:
+ if value < 1 or value > 20:
raise hell
if self.has_scanner():
self.instr.send("ROUT:OPEN")
@@ -144,5 +145,6 @@
def __init__(self):
meter.__init__(self, "usbtmc", "timeout=2", "retry", "vendor=0x164e",
"product=0x0dad")
+ self.send("*RST")
self.chan = m3005a_chan(self)
self.lock_attr()
Modified: developers/werner/ahrt/host/tmc/lib/power.py
===================================================================
--- developers/werner/ahrt/host/tmc/lib/power.py 2009-10-16 04:07:21 UTC (rev 5693)
+++ developers/werner/ahrt/host/tmc/lib/power.py 2009-10-17 22:40:48 UTC (rev 5694)
@@ -58,19 +58,25 @@
lambda i: float(i.rstrip("A")),
args = "#1 ")
- self.v = setting(self, ":VOUT",
- lambda v: float_or_none(v.rstrip("V")),
- args = "#1 ")
+# self.v = setting(self, ":VOUT",
+# lambda v: float_or_none(v.rstrip("V")),
+# args = "#1 ")
- self.i = setting(self, ":IOUT",
- lambda i: float_or_none(i.rstrip("A")),
- args = "#1 ")
+# self.i = setting(self, ":IOUT",
+# lambda i: float_or_none(i.rstrip("A")),
+# args = "#1 ")
self.mode = setting(self, ":SYS:STATUS",
lambda s: self.mode_map.get(s, None))
self.lock_attr()
+ def v(self):
+ return float_or_none(self.query(":VOUT? #1").rstrip("V"))
+
+ def i(self):
+ return float_or_none(self.query(":IOUT? #1").rstrip("A"))
+
def send(self, s):
power.send(self, s)
last_read = power.read(self)
@@ -79,6 +85,5 @@
return self.last_read
def query(self, s):
- print "query ", s
power.send(self, s)
return power.read(self)
More information about the commitlog
mailing list