kasli_tester: cleanup/fix test skipping

This commit is contained in:
Sebastien Bourdeauducq 2019-06-21 16:00:10 +08:00
parent b8b9fa51bd
commit f6edceb23d

View File

@ -323,15 +323,14 @@ class KasliTester(EnvExperiment):
zotino.load() zotino.load()
def test_zotinos(self): def test_zotinos(self):
if self.zotinos: print("*** Testing Zotino DACs.")
print("*** Testing Zotino DACs.") print("Voltages:")
print("Voltages:") for card_n, (card_name, card_dev) in enumerate(self.zotinos):
for card_n, (card_name, card_dev) in enumerate(self.zotinos): voltages = [2*card_n + (-1)**i*0.1*(i//2+1) for i in range(32)]
voltages = [2*card_n + (-1)**i*0.1*(i//2+1) for i in range(32)] print(card_name, " ".join(["{:.1f}".format(x) for x in voltages]))
print(card_name, " ".join(["{:.1f}".format(x) for x in voltages])) self.set_zotino_voltages(card_dev, voltages)
self.set_zotino_voltages(card_dev, voltages) print("Press ENTER when done.")
print("Press ENTER when done.") input()
input()
@kernel @kernel
def grabber_capture(self, card_dev, rois): def grabber_capture(self, card_dev, rois):
@ -354,28 +353,34 @@ class KasliTester(EnvExperiment):
print("ROI sums:", n) print("ROI sums:", n)
def test_grabbers(self): def test_grabbers(self):
if self.grabbers: print("*** Testing Grabber Frame Grabbers.")
print("*** Testing Grabber Frame Grabbers.") print("Activate the camera's frame grabber output, type 'g', press "
print("Activate the camera's frame grabber output, type 'g', press " "ENTER, and trigger the camera.")
"ENTER, and trigger the camera.") print("Just press ENTER to skip the test.")
print("Just press ENTER to skip the test.") if input().strip().lower() != "g":
if input().strip().lower() != "g": print("skipping...")
print("skipping...") return
return rois = [[0, 0, 0, 2, 2], [1, 0, 0, 2048, 2048]]
rois = [[0, 0, 0, 2, 2], [1, 0, 0, 2048, 2048]] print("ROIs:", rois)
print("ROIs:", rois) for card_n, (card_name, card_dev) in enumerate(self.grabbers):
for card_n, (card_name, card_dev) in enumerate(self.grabbers): print(card_name)
print(card_name) self.grabber_capture(card_dev, rois)
self.grabber_capture(card_dev, rois)
def run(self): def run(self):
print("****** Kasli system tester ******") print("****** Kasli system tester ******")
print("") print("")
self.core.reset() self.core.reset()
self.test_leds() if self.leds:
self.test_ttl_outs() self.test_leds()
self.test_ttl_ins() if self.ttl_outs:
self.test_urukuls() self.test_ttl_outs()
self.test_samplers() if self.ttl_ins:
self.test_zotinos() self.test_ttl_ins()
self.test_grabbers() if self.urukuls:
self.test_urukuls()
if self.samplers:
self.test_samplers()
if self.zotinos:
self.test_zotinos()
if self.grabbers:
self.test_grabbers()