From d5c8ec3b16e2562481a90282a59c641ef1953875 Mon Sep 17 00:00:00 2001 From: Jonathan Hogg Date: Fri, 18 May 2018 17:41:57 +0100 Subject: [PATCH] Small trigger tweaks and logging changes --- scope.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/scope.py b/scope.py index 18f430e..69eecaf 100755 --- a/scope.py +++ b/scope.py @@ -170,14 +170,23 @@ class Scope(vm.VirtualMachine): spock_option |= vm.SpockOption.TriggerSourceB trigger_logic = 0x40 trigger_mask = 0xff ^ trigger_logic - else: + elif isinstance(trigger, dict): trigger_logic = 0 trigger_mask = 0xff for channel, value in trigger.items(): + if isinstance(channel, str): + if channel.startswith('L'): + channel = int(channel[1:]) + else: + raise TypeError("Unrecognised trigger value") + if channel < 0 or channel > 7: + raise TypeError("Unrecognised trigger value") mask = 1<