winIDEA SDK
service_call.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import time
6import isystem.connect as ic
7
8print('isystem.connect version: ' + ic.getModuleVersion())
9
10cmgr = ic.ConnectionMgr()
11cfg = ic.CConnectionConfig()\
12 .workspace('../../../targetProjects/SampleSTM32.xjrf').start_if_required()
13cmgr.connect(cfg)
14
15ideCtrl = ic.CIDEController(cmgr)
16
17# example with mappings
18inParams = ic.StrStrMap()
19inParams['Dividend'] = '10'
20inParams['Divisor'] = '2'
21
22outParams = ideCtrl.invoke("/IDE/Divide", inParams)
23
24print('Result as string: ', outParams)
25
26print('Quotient = ', outParams['Quotient'])
27print('Remainder = ', outParams['Remainder'])
28outParams_d = dict(outParams)
29print(outParams_d)
30if outParams['ResultB']:
31 print('Result = ', outParams['ResultB'])
32
33# use 'int' or 'float' built-in functions to get numeric values.
34if int(outParams['Remainder']) == 0:
35 print('There is no remainder!')