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