import isystem.connect as ic
winidea_id = ''
def test_removeItems():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
profCtrl = ic.CProfilerController2(connMgr, "sdk_example.trd", "w")
profCtrl.addFunction(0, 'main')
profCtrl.addFunction(0, 'target_init')
print("Removing function 'main' of trigger with index 0...")
a = profCtrl.removeFunction(0, "main")
if a == 0:
print("\tOK.")
else:
print("\tOK, already removed or not present.")
a = profCtrl.removeFunction(0, "target_init")
if a == 0:
print("\tOK.")
else:
print("\tOK, already removed or not present.")
print("Removing functions of trigger with index 0...")
profCtrl.removeAllFunctions(0)
print("Removing variable 'main_loop_counter' of trigger with index 0...")
if profCtrl.removeVariable(0, "main_loop_counter") == 0:
print("\tOK.")
else:
print("\tOK, already removed or not present.")
print("Removing all variables of trigger with index 0...")
profCtrl.removeAllVariables(0)
profCtrl.closeDiscard()
if __name__ == "__main__":
test_removeItems()