winIDEA SDK
Loading...
Searching...
No Matches
invoke.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
7
8def main():
9 winidea_id = ''
10 print('isystem.connect version: ' + ic.getModuleVersion())
11
12 cmgr = ic.ConnectionMgr()
13 cmgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 ideCtrl = ic.CIDEController(cmgr)
16
17 inParams = {}
18 inParams['Dividend'] = '10'
19 inParams['Divisor'] = '2'
20
21 result = ideCtrl.invoke("/IDE/Divide", inParams)
22
23 print('Result as mapping: ', result)
24
25 print('Quotient = ', result['Quotient'])
26 print('Remainder = ', result['Remainder'])
27 if 'ResultB' in result:
28 print('Result = ', result['ResultB'])
29
30 # use 'int' or 'float' built-in functions to get numeric values.
31 if int(result['Remainder']) == 0:
32 print('There is no remainder!')
33
34
35if __name__ == "__main__":
36 main()