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