winIDEA SDK
Loading...
Searching...
No Matches
sequence_diagram.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
5"""
6This script processes data recorded by profiler and creates two types
7of diagrams - UML sequence diagrams and call graphs.
8
9
10Requirements for custom Python installations
11============================================
12
13Python, which is bundled with winIDEA, already has all dependencies
14configured.
15
161. - For sequence diagrams module 'seqdiag' has to be installed.
17 First download setuptools from:
18 https://pypi.python.org/pypi/setuptools#files
19 and install.
20 - Install 'seqdiag' (use correct path for your Python installation):
21
22 pip install seqdiag
23
24 Alternatively (if the above steps failed) you can download seqdiag from:
25 https://pypi.python.org/pypi/seqdiag/
26 Uncompress it (7-zip can be used) and run:
27
28 python setup.py
29
302. Install graphviz. Windows installer can be downloaded from:
31 http://www.graphviz.org/Download_windows.php
32 The console or IDE where the scripts will be ran should be restarted
33 after the graphviz has been installed.
34
35See also help text in function _parse_cmd_line_options().
36"""
37
38import sys
39import traceback
40import isystem.seqAndCallDiag as scdiag
41
42
43def main():
44
45 profilerExportFile = '../../targetProjects/profilerSample-1.xml'
46 callGraphImageFName = '../../targetProjects/profilerSample-1.call'
47 seqDiagImageFName = '../../targetProjects/profilerSample-1.svg'
48 functionName = ''
49 isCreateSeqDiag = True
50 isCreateCallGraph = False
51 seqDiagCompactLevel = 4
52 isCreateSeqDiagImage = True
53 isCreateCallGraphImage = False
54 isOpenSeqDiagImage = True
55 isOpenCallGraphImage = False
56 variableName = ''
57 is_binary_timeline = False # set to True, if your profiler export has binary timeline
58
59 try:
60 scdiag.generateDiagrams('',
61 profilerExportFile,
62 callGraphImageFName,
63 seqDiagImageFName,
64 '',
65 isCreateSeqDiag, isCreateCallGraph,
66 4,
67 isCreateSeqDiagImage, isCreateCallGraphImage,
68 isOpenSeqDiagImage, isOpenCallGraphImage,
69 variableName, is_binary_timeline)
70 except Exception as ex:
71 print(str(ex), file=sys.stderr)
72 traceback.print_exc()
73
74
75if __name__ == "__main__":
76 main()