winIDEA SDK
Loading...
Searching...
No Matches
test_area.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
winidea_id = ''
def test_area():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
covCtrl = ic.CCoverageController2(connMgr, r'sdk_example.trd', "a")
covCtrl.waitUntilLoaded(5000, isThrow=True)
triggerIndex = covCtrl.getActiveTriggerIndex()
AREA = ic.CCoverageController2.EAreaFunction
covCtrl.setScope(triggerIndex, AREA)
covCtrl.addArea(triggerIndex, AREA, "myArea")
covCtrl.addArea(triggerIndex, AREA, "myArea2")
areaName = covCtrl.areaType2Str(AREA)
print(f"Areas with names 'myArea' and 'myArea2' ware added, type: '{areaName}'.")
areas = ic.StrVector()
covCtrl.getAreas(triggerIndex, AREA, areas)
print(f"These areas are currently available: {', '.join(areas)}")
isRemoved = covCtrl.removeArea(triggerIndex, AREA, "myArea")
print(f"Area 'myArea' was removed: {isRemoved == 1}")
covCtrl.removeAllAreas(triggerIndex)
print(f"All areas were removed.")
covCtrl.close()
if __name__ == "__main__":
test_area()