Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[testudo] Adjust contrast default

Allow manual input adjustment of contrast default for test stage1

Fix some error checking of python modules - so test will
failure message is clear if GPIB driver failed to load

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
commit f6102af8c71596fd3c78d0d7ad5c88851eb174d3 1 parent bb02c81
@hxw hxw authored
View
6 testudo/src/Agilent.py
@@ -5,11 +5,7 @@
# DESCRIPTION: Classes for Aglient GPIB instruments
# AUTHOR: Christopher Hall <hsw@openmoko.com>
-try:
- from Gpib import *
-except:
- print 'error: Missing python module: linux-gpib'
- exit(1)
+from Gpib import *
from time import sleep
View
6 testudo/src/Keithley.py
@@ -5,11 +5,7 @@
# DESCRIPTION: Classes for Keithley GPIB instruments
# AUTHOR: Christopher Hall <hsw@openmoko.com>
-try:
- from Gpib import *
-except:
- print 'error: Missing python module: linux-gpib'
- exit(1)
+from Gpib import *
from time import sleep
View
2  testudo/src/RelayBoard.py
@@ -11,7 +11,7 @@
except:
print 'error: Missing python module: python-serial'
print ' sudo apt-get install python-serial'
- exit(1)
+ raise ImportError('Missing python module: python-serial')
from time import sleep
View
2  testudo/src/communication.py
@@ -11,7 +11,7 @@
except:
print 'error: Missing python module: python-serial'
print ' sudo apt-get install python-serial'
- exit(1)
+ raise ImportError('Missing python module: python-serial')
import sys
import time
View
51 testudo/src/ui.py
@@ -21,6 +21,11 @@
import sequencer
+
+InitialContrastVoltage = 21.0
+MinimumContrastVoltage = InitialContrastVoltage - 4
+MaximumContrastVoltage = InitialContrastVoltage + 4
+
OpenFilesFolder = 'testudo/tests'
SaveFilesFolder = '/log/files/stage1'
@@ -97,6 +102,12 @@ def stopCallback(self, widget, data = None):
self.testStop = True
self.status.set_text('.....Stopping at end of this test cycle.....')
+ def resetContrastCallback(self, widget, data = None):
+ """reset contrast to default value"""
+ global InitialContrastVoltage
+ if not self.testRunning:
+ self.contrast.set_value(InitialContrastVoltage)
+
@threaded
def runTest(self, count):
"""main test routine"""
@@ -123,7 +134,9 @@ def runTest(self, count):
(cycle, count, serial_number))
t = time.time()
- sequencer.runOneTest(self, self.fileName, 0, serial_number = serial_number)
+ sequencer.runOneTest(self, self.fileName, 0,
+ serial_number = serial_number,
+ contrast_voltage = self.contrast.get_value())
t = time.time() - t
self.write('\n*** End of Test %d of %d [%7.3f seconds] ***\n' % (cycle, count, t))
@@ -406,6 +419,7 @@ def __init__(self):
vbox1.pack_end(button_box, expand = False, fill = False, padding = 0)
+ # Auto repeat
hbox = gtk.HBox(homogeneous = False, spacing = 5)
label = gtk.Label('Auto-Repeat')
@@ -419,6 +433,7 @@ def __init__(self):
hbox.pack_start(self.repeat, expand = False, fill = True, padding = 0)
+ # auto save
self.autoSave = gtk.CheckButton("Auto-save")
self.autoSave.set_active(True)
hbox.pack_start(self.autoSave, expand = False, fill = True, padding = 0)
@@ -430,17 +445,49 @@ def __init__(self):
self.serialNumber.set_max_length(32)
hbox.pack_start(self.serialNumber, expand = True, fill = True, padding = 0)
+ # end of row
hbox.show_all()
+ vbox1.pack_start(hbox, expand = False, fill = False, padding = 0)
+
+ # contrast
+ global InitialContrastVoltage
+ global MinimumContrastVoltage
+ global MaximumContrastVoltage
+
+ hbox = gtk.HBox(homogeneous = False, spacing = 5)
+ label = gtk.Label('Contrast Calibration')
+ hbox.pack_start(label, expand = False, fill = True, padding = 0)
+ adj = gtk.Adjustment(value = InitialContrastVoltage,
+ lower = MinimumContrastVoltage,
+ upper = MaximumContrastVoltage,
+ step_incr = 0.1, page_incr = 1.0, page_size = 0)
+ self.contrast = gtk.SpinButton(adjustment = adj, climb_rate = 0.0, digits = 1)
+ self.contrast.set_wrap(False)
+ self.contrast.set_numeric(True)
+
+ hbox.pack_start(self.contrast, expand = False, fill = True, padding = 0)
+
+ label = gtk.Label('Volts')
+ hbox.pack_start(label, expand = False, fill = True, padding = 0)
+
+ buttonD = gtk.Button('Reset to {0:.1f}V'.format(InitialContrastVoltage))
+ buttonD.connect('clicked', self.resetContrastCallback, None)
+ buttonD.show()
+ hbox.pack_start(buttonD, expand = False, fill = True, padding = 0)
+
+ # end of row
+ hbox.show_all()
vbox1.pack_start(hbox, expand = False, fill = False, padding = 0)
+ # status line
self.status = gtk.Label('No test Loaded')
self.status.set_alignment(0, 0)
vbox1.pack_start(self.status, expand = False, fill = False, padding = 0)
self.status.show()
+ # add all rows and display them
self.window.add(vbox1)
-
self.window.show()
self.serialNumber.grab_focus()
View
13 testudo/tests/test_SAMO_01.py
@@ -49,6 +49,13 @@
LCD_V0 = 21.0
LCD_V0_DELTA = 0.1
+# contrast calibration voltage (if not set use LCD_V0)
+if 'contrast_voltage' in global_args:
+ contrast_voltage = float(global_args['contrast_voltage'])
+else:
+ contrast_voltage = LCD_V0
+
+
# power supply (volts, amps)
SUPPLY_STANDARD_VOLTAGE = 3.0
SUPPLY_CURRENT_LIMIT = 0.35
@@ -278,6 +285,8 @@ def test008_internal():
Check software power off"""
global debug, psu, dvm, relay
+ global contrast_voltage
+
p = communication.SerialPort(port = CPU_SERIAL)
relay.on(RELAY_RESET)
@@ -350,8 +359,8 @@ def test008_internal():
relay_increase = RELAY_SEARCH_KEY
relay_set = RELAY_HISTORY_KEY
- v0_max = LCD_V0 + LCD_V0_DELTA
- v0_min = LCD_V0 - LCD_V0_DELTA
+ v0_max = contrast_voltage + LCD_V0_DELTA
+ v0_min = contrast_voltage - LCD_V0_DELTA
actual = 0
for i in range(20):
time.sleep(VOLTAGE_SAMPLE_TIME)
Please sign in to comment.
Something went wrong with that request. Please try again.