import os
import isystem.connect as ic
winidea_id = ''
def test_save():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
wksCtrl = ic.CWorkspaceController(connMgr)
wksFolderPath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_DIR)
print(f"Saving currently opened workspace (overwriting original file)...")
wksCtrl.save()
print(f"Saving currently opened workspace as a copy...")
wksCtrl.saveAs("wksCopy.xjrf")
filePath = os.path.join(wksFolderPath, "wksCopy.xjrf")
print(f"\tDone: {filePath}")
print("Reopening original workspace...")
wksFilePath = os.path.join(wksFolderPath, "SampleSTM32.xjrf")
wksCtrl.open(wksFilePath)
if __name__ == "__main__":
test_save()