winIDEA SDK
test_disconnect.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2# (c) TASKING Germany GmbH, 2023
3
4import isystem.connect as ic
5
6
7winidea_id = ''
8
9
10def test_disconnect():
11 print("Connecting to most recently used winIDEA...")
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14 print(f"\tIs connected: {connMgr.isConnected()}.")
15
16 print("Disconnecting...")
17 connMgr.disconnect_keep()
18 print(f"\tIs connected: {connMgr.isConnected()}")
19
20 # to specify whether state should be saved or not:
21 # connMgr.disconnect_close(bSaveAll=False)
22
23
24if __name__ == "__main__":
25 test_disconnect()