forked from opentap/PSLab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFetchDataStep.py
More file actions
25 lines (18 loc) · 825 Bytes
/
Copy pathFetchDataStep.py
File metadata and controls
25 lines (18 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from OpenTap import Display, Verdict
from opentap import *
from .LogicAnalyzer import *
@attribute(
Display("Fetch Data", "Publishes the captured logic events", Groups=["PSLab", "Logic Analyzer"]))
class FetchDataStep(TestStep):
# Properties
LogicAnalyzer = property(LogicAnalyzer, None) \
.add_attribute(Display("Logic Analyzer", "", "Resources", 0))
def __init__(self):
super(FetchDataStep, self).__init__()
def Run(self):
super().Run() # 3.0: Required for debugging to work.
data = self.LogicAnalyzer.fetch_data()
channels = [str(i + 1) for i in range(len(data))]
for i in range(len(data[0])):
self.PublishResult("Captured Data", channels, [data[channel][i] for channel in range(len(data))])
self.UpgradeVerdict(Verdict.Pass)