winIDEA SDK
Loading...
Searching...
No Matches
test_trace_get_timeline_iterator.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
#
# (c) TASKING Germany GmbH, 2023
import isystem.connect as ic
import export_trace_data # see docs section Examples for link to source
winidea_id = ''
def test_getTimelineIterator():
conn_mgr = ic.ConnectionMgr()
conn_mgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
xml_file_path, _ = export_trace_data.export_data(conn_mgr)
trace_data = ic.CTraceData.createInstance(xml_file_path)
print("Iterating first 10 timeline events...")
count = 0
itr = trace_data.getTimelineIterator()
while itr.hasNext():
event = itr.nextAsSPtr()
print(f"Sample index: {event.getSampleIndex()}")
print(f"\t{event.toString()}\n")
# ... explore other methods of 'ic.CTraceTimeEvent'
count = count + 1
if count == 10:
break
trace_data.closeParser()
if __name__ == "__main__":
test_getTimelineIterator()