py_canoe 3.0.3__py3-none-any.whl → 26.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. py_canoe/__init__.py +2 -1
  2. py_canoe/canoe.py +910 -0
  3. py_canoe/core/__init__.py +0 -0
  4. py_canoe/core/application.py +170 -0
  5. py_canoe/core/bus.py +301 -0
  6. py_canoe/core/capl.py +59 -0
  7. py_canoe/core/child_elements/__init__.py +0 -0
  8. py_canoe/core/child_elements/application_model.py +24 -0
  9. py_canoe/core/child_elements/application_model_file.py +21 -0
  10. py_canoe/core/child_elements/application_model_files.py +22 -0
  11. py_canoe/core/child_elements/application_model_setup.py +15 -0
  12. py_canoe/core/child_elements/application_models.py +22 -0
  13. py_canoe/core/child_elements/application_socket.py +11 -0
  14. py_canoe/core/child_elements/application_specific_module.py +24 -0
  15. py_canoe/core/child_elements/application_specific_modules.py +16 -0
  16. py_canoe/core/child_elements/audio_interface.py +28 -0
  17. py_canoe/core/child_elements/available_modules.py +22 -0
  18. py_canoe/core/child_elements/basic_module.py +19 -0
  19. py_canoe/core/child_elements/basic_modules.py +16 -0
  20. py_canoe/core/child_elements/c_libraries.py +28 -0
  21. py_canoe/core/child_elements/c_library.py +33 -0
  22. py_canoe/core/child_elements/can_controller.py +74 -0
  23. py_canoe/core/child_elements/capl_function.py +17 -0
  24. py_canoe/core/child_elements/ccp_setup.py +15 -0
  25. py_canoe/core/child_elements/channel.py +20 -0
  26. py_canoe/core/child_elements/channels.py +19 -0
  27. py_canoe/core/child_elements/communication_setup.py +23 -0
  28. py_canoe/core/child_elements/compile_result.py +22 -0
  29. py_canoe/core/child_elements/configured_channel.py +48 -0
  30. py_canoe/core/child_elements/configured_channels.py +21 -0
  31. py_canoe/core/child_elements/configured_module.py +82 -0
  32. py_canoe/core/child_elements/configured_modules.py +61 -0
  33. py_canoe/core/child_elements/connected_modules.py +14 -0
  34. py_canoe/core/child_elements/data_source.py +42 -0
  35. py_canoe/core/child_elements/data_source_file.py +21 -0
  36. py_canoe/core/child_elements/data_source_files.py +22 -0
  37. py_canoe/core/child_elements/data_source_issue.py +22 -0
  38. py_canoe/core/child_elements/data_source_issues.py +16 -0
  39. py_canoe/core/child_elements/data_source_setup.py +17 -0
  40. py_canoe/core/child_elements/data_sources.py +27 -0
  41. py_canoe/core/child_elements/database_setup.py +62 -0
  42. py_canoe/core/child_elements/device.py +34 -0
  43. py_canoe/core/child_elements/devices.py +13 -0
  44. py_canoe/core/child_elements/diagnostic.py +22 -0
  45. py_canoe/core/child_elements/diagnostic_request.py +59 -0
  46. py_canoe/core/child_elements/diagnostic_response.py +34 -0
  47. py_canoe/core/child_elements/diagnostic_responses.py +13 -0
  48. py_canoe/core/child_elements/diagnostics_setup.py +254 -0
  49. py_canoe/core/child_elements/distributed_mode.py +74 -0
  50. py_canoe/core/child_elements/encoding.py +27 -0
  51. py_canoe/core/child_elements/encodings.py +13 -0
  52. py_canoe/core/child_elements/environment_array.py +13 -0
  53. py_canoe/core/child_elements/environment_group.py +22 -0
  54. py_canoe/core/child_elements/environment_info.py +14 -0
  55. py_canoe/core/child_elements/environment_variable.py +55 -0
  56. py_canoe/core/child_elements/fdx_files.py +50 -0
  57. py_canoe/core/child_elements/file_group_data_source.py +17 -0
  58. py_canoe/core/child_elements/general_setup.py +66 -0
  59. py_canoe/core/child_elements/macros_setup.py +52 -0
  60. py_canoe/core/child_elements/mc_ecus.py +428 -0
  61. py_canoe/core/child_elements/measurement_setup.py +269 -0
  62. py_canoe/core/child_elements/modules.py +87 -0
  63. py_canoe/core/child_elements/most_disassembler.py +21 -0
  64. py_canoe/core/child_elements/most_network_interface.py +4 -0
  65. py_canoe/core/child_elements/namespace.py +21 -0
  66. py_canoe/core/child_elements/namespaces.py +19 -0
  67. py_canoe/core/child_elements/network.py +18 -0
  68. py_canoe/core/child_elements/network_adapters.py +13 -0
  69. py_canoe/core/child_elements/nodes.py +119 -0
  70. py_canoe/core/child_elements/open_configuration_result.py +0 -0
  71. py_canoe/core/child_elements/panel_setup.py +97 -0
  72. py_canoe/core/child_elements/participant.py +17 -0
  73. py_canoe/core/child_elements/participants.py +22 -0
  74. py_canoe/core/child_elements/ports.py +81 -0
  75. py_canoe/core/child_elements/replay_collection.py +56 -0
  76. py_canoe/core/child_elements/security_configuration.py +20 -0
  77. py_canoe/core/child_elements/security_setup.py +31 -0
  78. py_canoe/core/child_elements/signals.py +39 -0
  79. py_canoe/core/child_elements/simulation_setup.py +0 -0
  80. py_canoe/core/child_elements/single_file_data_source.py +13 -0
  81. py_canoe/core/child_elements/snippet_setup.py +68 -0
  82. py_canoe/core/child_elements/standalone_mode.py +0 -0
  83. py_canoe/core/child_elements/start_value_list.py +0 -0
  84. py_canoe/core/child_elements/symbol_mappings.py +0 -0
  85. py_canoe/core/child_elements/tcp_ip_stack_setting.py +0 -0
  86. py_canoe/core/child_elements/test_configurations.py +0 -0
  87. py_canoe/core/child_elements/test_environment.py +64 -0
  88. py_canoe/core/child_elements/test_environments.py +26 -0
  89. py_canoe/core/child_elements/test_module.py +213 -0
  90. py_canoe/core/child_elements/test_modules.py +23 -0
  91. py_canoe/core/child_elements/test_setup.py +16 -0
  92. py_canoe/core/child_elements/test_setup_folder_ext.py +36 -0
  93. py_canoe/core/child_elements/test_setup_folders.py +25 -0
  94. py_canoe/core/child_elements/user_files.py +0 -0
  95. py_canoe/core/child_elements/variable.py +144 -0
  96. py_canoe/core/child_elements/variable_events.py +14 -0
  97. py_canoe/core/child_elements/variables.py +29 -0
  98. py_canoe/core/child_elements/variables_file.py +15 -0
  99. py_canoe/core/child_elements/variables_files.py +19 -0
  100. py_canoe/core/child_elements/visual_sequence_setup.py +46 -0
  101. py_canoe/core/child_elements/vt_system.py +83 -0
  102. py_canoe/core/child_elements/vtt_sut_import_result.py +21 -0
  103. py_canoe/core/child_elements/write.py +71 -0
  104. py_canoe/core/child_elements/xcp_setup.py +12 -0
  105. py_canoe/core/configuration.py +509 -0
  106. py_canoe/core/environment.py +59 -0
  107. py_canoe/core/measurement.py +149 -0
  108. py_canoe/core/networks.py +103 -0
  109. py_canoe/core/performance.py +21 -0
  110. py_canoe/core/simulation.py +53 -0
  111. py_canoe/core/system.py +164 -0
  112. py_canoe/core/ui.py +53 -0
  113. py_canoe/core/version.py +54 -0
  114. py_canoe/helpers/__init__.py +0 -0
  115. py_canoe/helpers/common.py +78 -0
  116. {py_canoe-3.0.3.dist-info → py_canoe-26.0.0.dist-info}/METADATA +331 -327
  117. py_canoe-26.0.0.dist-info/RECORD +118 -0
  118. py_canoe-26.0.0.dist-info/WHEEL +4 -0
  119. py_canoe/logging_collection.py +0 -345
  120. py_canoe/py_canoe.py +0 -2586
  121. py_canoe/py_canoe_logger.py +0 -29
  122. py_canoe-3.0.3.dist-info/LICENSE +0 -21
  123. py_canoe-3.0.3.dist-info/RECORD +0 -8
  124. py_canoe-3.0.3.dist-info/WHEEL +0 -4
@@ -1,336 +1,340 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: py_canoe
3
- Version: 3.0.3
4
- Summary: Python CANoe Package
5
- License: LICENSE
6
- Keywords: Vector,CANoe,py_canoe
3
+ Version: 26.0.0
4
+ Summary: Python 🐍 Package for accessing Vector CANoe 🛶 Tool
5
+ Keywords: Vector,CANoe,Python,Test,Automation
7
6
  Author: chaitu-ycr
8
- Author-email: chaitu.ycr@gmail.com
9
- Requires-Python: >=3.9,<4.0
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: License :: Other/Proprietary License
12
- Classifier: Operating System :: Microsoft :: Windows
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.9
7
+ Author-email: chaitu-ycr <chaitu.ycr@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025 chaitu-ycr
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
15
29
  Classifier: Programming Language :: Python :: 3.10
16
30
  Classifier: Programming Language :: Python :: 3.11
17
31
  Classifier: Programming Language :: Python :: 3.12
18
32
  Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Topic :: Software Development :: Embedded Systems
20
- Requires-Dist: pywin32 (>=306,<=308)
21
- Project-URL: Documentation, https://chaitu-ycr.github.io/py_canoe/
22
- Project-URL: Homepage, https://github.com/chaitu-ycr/py_canoe
23
- Project-URL: Repository, https://github.com/chaitu-ycr/py_canoe
33
+ Classifier: Programming Language :: Python :: 3.14
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Operating System :: Microsoft :: Windows
36
+ Requires-Dist: pywin32
37
+ Requires-Python: >=3.10, <=3.14
38
+ Project-URL: documentation, https://chaitu-ycr.github.io/py_canoe/
39
+ Project-URL: homepage, https://github.com/chaitu-ycr/py_canoe
40
+ Project-URL: repository, https://github.com/chaitu-ycr/py_canoe
24
41
  Description-Content-Type: text/markdown
25
42
 
26
- # [py_canoe](https://github.com/chaitu-ycr/py_canoe)
27
-
28
- ## about package
29
-
30
- Python 🐍 Package for controlling Vector CANoe 🛶 Tool
31
-
32
- ## important links
33
-
34
- - py_canoe github documentation [🔗 link](https://chaitu-ycr.github.io/py_canoe/)
35
- - pypi package [🔗 link](https://pypi.org/project/py_canoe/)
36
- - github releases [🔗 link](https://github.com/chaitu-ycr/py_canoe/releases)
37
- - for ideas💡/sugessions please create new discussion [here](https://github.com/chaitu-ycr/py_canoe/discussions)
38
- - create issue or request feature [here](https://github.com/chaitu-ycr/py_canoe/issues/new/choose)
39
- - fork [py_canoe](https://github.com/chaitu-ycr/py_canoe/fork) repo and create pull request to contribute back to this project.
40
-
41
- ## prerequisites
42
-
43
- - [Python(>=3.9)](https://www.python.org/downloads/)
44
- - [Vector CANoe software(>=v11)](https://www.vector.com/int/en/support-downloads/download-center/)
45
- - [visual studio code](https://code.visualstudio.com/Download)
46
- - Windows PC(recommended win 10 os along with 16GB RAM)
47
-
48
- ## setup and installation
49
-
50
- create python virtual environment
51
-
52
- ```bat
53
- python -m venv .venv
54
- ```
55
-
56
- activate virtual environment
57
-
58
- ```bat
59
- .venv\Scripts\activate
60
- ```
61
-
62
- upgrade pip (optional)
63
-
64
- ```bat
65
- python -m pip install pip --upgrade
66
- ```
67
-
68
- Install [py_canoe](https://pypi.org/project/py_canoe/) package
69
-
70
- ```bat
71
- pip install py_canoe --upgrade
72
- ```
73
-
74
- ---
75
-
76
- ## example use cases
77
-
78
- ### import CANoe module and create CANoe object instance
79
-
80
- ```python
81
- from py_canoe import CANoe, wait
82
-
83
- canoe_inst = CANoe()
84
- ```
85
-
86
- ### open CANoe, start measurement, get version info, stop measurement and close canoe configuration
87
-
88
- ```python
89
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo.cfg')
90
- canoe_inst.start_measurement()
91
- canoe_version_info = canoe_inst.get_canoe_version_info()
92
- canoe_inst.stop_measurement()
93
- canoe_inst.quit()
94
- ```
95
-
96
- ### restart/reset running measurement
97
-
98
- ```python
99
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo.cfg')
100
- canoe_inst.start_measurement()
101
- canoe_inst.reset_measurement()
102
- canoe_inst.stop_ex_measurement()
103
- ```
104
-
105
- ### open CANoe offline config and start/break/step/reset/stop measurement in offline mode
106
-
107
- ```python
108
- canoe_inst.open(r'tests\demo_cfg\demo_offline.cfg')
109
- canoe_inst.add_offline_source_log_file(r'tests\demo_cfg\Logs\demo_log.blf')
110
- canoe_inst.start_measurement_in_animation_mode(animation_delay=200)
111
- wait(1)
112
- canoe_inst.break_measurement_in_offline_mode()
113
- wait(1)
114
- canoe_inst.step_measurement_event_in_single_step()
115
- wait(1)
116
- canoe_inst.reset_measurement_in_offline_mode()
117
- wait(1)
118
- canoe_inst.stop_measurement()
119
- wait(1)
120
- ```
121
-
122
- ### get/set CANoe measurement index
123
-
124
- ```python
125
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
126
- meas_index_value = canoe_inst.get_measurement_index()
127
- canoe_inst.start_measurement()
128
- canoe_inst.stop_measurement()
129
- meas_index_value = canoe_inst.get_measurement_index()
130
- canoe_inst.set_measurement_index(meas_index_value + 1)
131
- meas_index_new = canoe_inst.get_measurement_index()
132
- canoe_inst.reset_measurement()
133
- canoe_inst.stop_measurement()
134
- ```
135
-
136
- ### save CANoe config to a different version with different name
137
-
138
- ```python
139
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
140
- canoe_inst.save_configuration_as(path=r'tests\demo_cfg\demo_v10.cfg', major=10, minor=0, create_dir=True)
141
- ```
142
-
143
- ### get CAN bus statistics of CAN channel 1
144
-
145
- ```python
146
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
147
- canoe_inst.start_measurement()
148
- wait(2)
149
- canoe_inst.get_can_bus_statistics(channel=1)
150
- canoe_inst.stop_measurement()
151
- ```
152
-
153
- ### get/set bus signal value, check signal state and get signal full name
154
-
155
- ```python
156
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
157
- canoe_inst.start_measurement()
158
- wait(1)
159
- sig_full_name = canoe_inst.get_signal_full_name(bus='CAN', channel=1, message='LightState', signal='FlashLight')
160
- sig_value = canoe_inst.get_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', raw_value=False)
161
- canoe_inst.set_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', value=1, raw_value=False)
162
- wait(1)
163
- sig_online_state = canoe_inst.check_signal_online(bus='CAN', channel=1, message='LightState', signal='FlashLight')
164
- sig_state = canoe_inst.check_signal_state(bus='CAN', channel=1, message='LightState', signal='FlashLight')
165
- sig_val = canoe_inst.get_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', raw_value=True)
166
- canoe_inst.stop_measurement()
167
- ```
168
-
169
- ### clear write window / read text from write window / control write window output file
170
-
171
- ```python
172
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
173
- canoe_inst.enable_write_window_output_file(r'tests\demo_cfg\Logs\write_win.txt')
174
- wait(1)
175
- canoe_inst.start_measurement()
176
- canoe_inst.clear_write_window_content()
177
- wait(1)
178
- canoe_inst.write_text_in_write_window("hello from py_canoe!")
179
- wait(1)
180
- text = canoe_inst.read_text_from_write_window()
181
- canoe_inst.stop_measurement()
182
- canoe_inst.disable_write_window_output_file()
183
- wait(1)
184
- ```
185
-
186
- ### switch between CANoe desktops
187
-
188
- ```python
189
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
190
- canoe_inst.ui_activate_desktop('Configuration')
191
- ```
192
-
193
- ### get/set system variable or define system variable
194
-
195
- ```python
196
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
197
- canoe_inst.start_measurement()
198
- wait(1)
199
- canoe_inst.set_system_variable_value('demo::level_two_1::sys_var2', 20)
200
- canoe_inst.set_system_variable_value('demo::string_var', 'hey hello this is string variable')
201
- canoe_inst.set_system_variable_value('demo::data_var', 'hey hello this is data variable')
202
- canoe_inst.set_system_variable_array_values('demo::int_array_var', (00, 11, 22, 33, 44, 55, 66, 77, 88, 99))
203
- wait(0.1)
204
- sys_var_val = canoe_inst.get_system_variable_value('demo::level_two_1::sys_var2')
205
- sys_var_val = canoe_inst.get_system_variable_value('demo::data_var')
206
- canoe_inst.stop_measurement()
207
- # define system variable and use it in measurement
208
- canoe_inst.define_system_variable('sys_demo::demo', 1)
209
- canoe_inst.save_configuration()
210
- canoe_inst.start_measurement()
211
- wait(1)
212
- sys_var_val = canoe_inst.get_system_variable_value('sys_demo::demo')
213
- canoe_inst.stop_measurement()
214
- ```
215
-
216
- ### send diagnostic request, control tester present
217
-
218
- ```python
219
- canoe_inst.open(r'tests\demo_cfg\demo_diag.cfg')
220
- canoe_inst.start_measurement()
221
- wait(1)
222
- resp = canoe_inst.send_diag_request('Door', 'DefaultSession_Start', False)
223
- canoe_inst.control_tester_present('Door', False)
224
- wait(2)
225
- canoe_inst.control_tester_present('Door', True)
226
- wait(5)
227
- resp = canoe_inst.send_diag_request('Door', '10 02')
228
- canoe_inst.control_tester_present('Door', False)
229
- wait(2)
230
- resp = canoe_inst.send_diag_request('Door', '10 03', return_sender_name=True)
231
- canoe_inst.stop_measurement()
232
- ```
233
-
234
- ### set replay block source file / control replay block start stop
235
-
236
- ```python
237
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
238
- canoe_inst.start_measurement()
239
- wait(1)
240
- canoe_inst.set_replay_block_file(block_name='DemoReplayBlock', recording_file_path=r'tests\demo_cfg\Logs\demo_log.blf')
241
- wait(1)
242
- canoe_inst.control_replay_block(block_name='DemoReplayBlock', start_stop=True)
243
- wait(2)
244
- canoe_inst.control_replay_block(block_name='DemoReplayBlock', start_stop=False)
245
- wait(1)
246
- canoe_inst.stop_measurement()
247
- ```
248
-
249
- ### compile CAPL nodes and call capl function
250
-
251
- ```python
252
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
253
- canoe_inst.compile_all_capl_nodes()
254
- canoe_inst.start_measurement()
255
- wait(1)
256
- canoe_inst.call_capl_function('addition_function', 100, 200)
257
- canoe_inst.call_capl_function('hello_world')
258
- canoe_inst.stop_measurement()
259
- ```
260
-
261
- ### execute test setup test module / test environment
262
-
263
- ```python
264
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
265
- canoe_inst.start_measurement()
266
- wait(1)
267
- canoe_inst.execute_all_test_modules_in_test_env(demo_test_environment)
268
- canoe_inst.execute_test_module('demo_test_node_002')
269
- wait(1)
270
- canoe_inst.stop_measurement()
271
- ```
272
-
273
- ### get/set environment variable value
274
-
275
- ```python
276
- canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
277
- canoe_inst.start_measurement()
278
- wait(1)
279
- canoe_inst.set_environment_variable_value('int_var', 123.12)
280
- canoe_inst.set_environment_variable_value('float_var', 111.123)
281
- canoe_inst.set_environment_variable_value('string_var', 'this is string variable')
282
- canoe_inst.set_environment_variable_value('data_var', (1, 2, 3, 4, 5, 6, 7))
283
- var_value = canoe_inst.get_environment_variable_value('int_var')
284
- var_value = canoe_inst.get_environment_variable_value('float_var')
285
- var_value = canoe_inst.get_environment_variable_value('string_var')
286
- var_value = canoe_inst.get_environment_variable_value('data_var')
287
- wait(1)
288
- canoe_inst.stop_measurement()
289
- ```
290
-
291
- ### add/remove database
292
-
293
- ```python
294
- self.canoe_inst.open(canoe_cfg=self.canoe_cfg_gen_db_setup, visible=True, auto_save=True, prompt_user=False, auto_stop=True)
295
- self.canoe_inst.start_measurement()
296
- wait(1)
297
- # add database
298
- self.canoe_inst.add_database(fr"{self.file_path}\demo_cfg\DBs\sample_databases\XCP.dbc", 'CAN1', 1)
299
- # remove database
300
- self.canoe_inst.remove_database(fr"{self.file_path}\demo_cfg\DBs\sample_databases\XCP.dbc", 1)
301
- ```
302
-
303
- ### start/stop online measurement setup logging block
304
-
305
- ```python
306
- self.canoe_inst.open(canoe_cfg=self.canoe_cfg_online_setup)
307
- self.canoe_inst.start_measurement()
308
- wait(1)
309
- # stop logging block
310
- self.canoe_inst.start_stop_online_measurement_setup_logging_block(fr'{self.demo_cfg_dir}\Logs\demo_online_setup_log.blf', start=False)
311
- wait(2)
312
- # start logging block
313
- self.canoe_inst.start_stop_online_measurement_setup_logging_block(fr'{self.demo_cfg_dir}\Logs\demo_online_setup_log.blf', start=True)
314
- ```
315
-
316
- ### working with logging blocks
317
-
318
- ```python
319
- # remove current logging blocks
320
- for i in range(canoe_inst.logging_collection.count):
321
- canoe_inst.remove_logging_block(1) # iteration start from 1 and shifts after each delete
322
-
323
- # add a new block
324
- # define dest path with file format as asc, blf or other
325
- # may include field functions like {IncMeasurement}
326
- full_path = "C:/sample_log_{IncMeasurement}.blf"
327
- canoe_inst.add_logging_block(full_path)
328
- canoe_inst.start_measurement()
329
- # ...
330
- canoe_inst.stop_measurement()
331
- # log should be fully generated at this point for you to analyze
332
- canoe_inst.set_configuration_modified(False) # to avoid popup asking to save changes
333
- canoe_inst.quit()
334
- ```
335
-
336
-
43
+ # [py_canoe](https://github.com/chaitu-ycr/py_canoe)
44
+
45
+ ## about package
46
+
47
+ Python 🐍 Package for accessing Vector CANoe 🛶 Tool
48
+
49
+ ## important links
50
+
51
+ - [🔗 github documentation](https://chaitu-ycr.github.io/py_canoe/)
52
+ - [🔗 pypi package](https://pypi.org/project/py_canoe/)
53
+ - [🔗 github releases](https://github.com/chaitu-ycr/py_canoe/releases)
54
+ - [🔗 for ideas💡/sugessions please create new discussion **here**](https://github.com/chaitu-ycr/py_canoe/discussions)
55
+ - [🔗 create issue or request feature **here**](https://github.com/chaitu-ycr/py_canoe/issues/new/choose)
56
+ - [🔗 fork repo](https://github.com/chaitu-ycr/py_canoe/fork) and create pull request to contribute back to this project.
57
+
58
+ ## prerequisites
59
+
60
+ - [Python(>=3.10)](https://www.python.org/downloads/)
61
+ - [Vector CANoe software(>=v11)](https://www.vector.com/int/en/support-downloads/download-center/)
62
+ - Vector CANoe license. Also works with Demo version of CANoe with limited functionalities.
63
+ - [visual studio code](https://code.visualstudio.com/Download)
64
+ - Windows PC(recommended windows 11 OS along with 16GB RAM)
65
+
66
+ ## setup and installation
67
+
68
+ create python virtual environment
69
+
70
+ ```
71
+ python -m venv .venv
72
+ ```
73
+
74
+ activate virtual environment
75
+
76
+ ```
77
+ .venv\Scripts\activate
78
+ ```
79
+
80
+ upgrade pip (optional)
81
+
82
+ ```
83
+ python -m pip install pip --upgrade
84
+ ```
85
+
86
+ Install [**py_canoe**](https://pypi.org/project/py_canoe/) package
87
+
88
+ ```
89
+ pip install py_canoe --upgrade
90
+ ```
91
+
92
+ ---
93
+
94
+ ## example use cases
95
+
96
+ ### import CANoe module and create CANoe object instance
97
+
98
+ ```python
99
+ from py_canoe import CANoe, wait
100
+
101
+ canoe_inst = CANoe()
102
+ ```
103
+
104
+ ### open CANoe, start measurement, get version info, stop measurement and close canoe configuration
105
+
106
+ ```python
107
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo.cfg')
108
+
109
+ canoe_inst.start_measurement()
110
+ canoe_version_info = canoe_inst.get_canoe_version_info()
111
+ canoe_inst.stop_measurement()
112
+ canoe_inst.quit()
113
+ ```
114
+
115
+ ### restart/reset running measurement
116
+
117
+ ```python
118
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo.cfg')
119
+
120
+ canoe_inst.start_measurement()
121
+ canoe_inst.reset_measurement()
122
+ canoe_inst.stop_ex_measurement()
123
+ ```
124
+
125
+ ### open CANoe offline config and start/break/step/reset/stop measurement in offline mode
126
+
127
+ ```python
128
+ canoe_inst.open(r'tests\demo_cfg\demo_offline.cfg')
129
+
130
+ canoe_inst.add_offline_source_log_file(r'tests\demo_cfg\Logs\demo_log.blf')
131
+ canoe_inst.start_measurement_in_animation_mode(animation_delay=200)
132
+ canoe_inst.break_measurement_in_offline_mode()
133
+ canoe_inst.step_measurement_event_in_single_step()
134
+ canoe_inst.reset_measurement_in_offline_mode()
135
+ canoe_inst.stop_measurement()
136
+ ```
137
+
138
+ ### get/set CANoe measurement index
139
+
140
+ ```python
141
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
142
+
143
+ meas_index_value = canoe_inst.get_measurement_index()
144
+ canoe_inst.start_measurement()
145
+ canoe_inst.stop_measurement()
146
+ meas_index_value = canoe_inst.get_measurement_index()
147
+ canoe_inst.set_measurement_index(meas_index_value + 1)
148
+ meas_index_new = canoe_inst.get_measurement_index()
149
+ canoe_inst.reset_measurement()
150
+ canoe_inst.stop_measurement()
151
+ ```
152
+
153
+ ### save CANoe config to a different version with different name
154
+
155
+ ```python
156
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
157
+
158
+ canoe_inst.save_configuration_as(path=r'tests\demo_cfg\demo_v10.cfg', major=10, minor=0, create_dir=True)
159
+ ```
160
+
161
+ ### get CAN bus statistics of CAN channel 1
162
+
163
+ ```python
164
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
165
+
166
+ canoe_inst.start_measurement()
167
+ canoe_inst.get_can_bus_statistics(channel=1)
168
+ canoe_inst.stop_measurement()
169
+ ```
170
+
171
+ ### get/set bus signal value, check signal state and get signal full name
172
+
173
+ ```python
174
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
175
+
176
+ canoe_inst.start_measurement()
177
+ sig_full_name = canoe_inst.get_signal_full_name(bus='CAN', channel=1, message='LightState', signal='FlashLight')
178
+ sig_value = canoe_inst.get_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', raw_value=False)
179
+ canoe_inst.set_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', value=1, raw_value=False)
180
+ sig_online_state = canoe_inst.check_signal_online(bus='CAN', channel=1, message='LightState', signal='FlashLight')
181
+ sig_state = canoe_inst.check_signal_state(bus='CAN', channel=1, message='LightState', signal='FlashLight')
182
+ sig_val = canoe_inst.get_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', raw_value=True)
183
+ canoe_inst.stop_measurement()
184
+ ```
185
+
186
+ ### clear write window / read text from write window / control write window output file
187
+
188
+ ```python
189
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
190
+
191
+ canoe_inst.enable_write_window_output_file(r'tests\demo_cfg\Logs\write_win.txt')
192
+ canoe_inst.start_measurement()
193
+ canoe_inst.clear_write_window_content()
194
+ canoe_inst.write_text_in_write_window("hello from py_canoe!")
195
+ text = canoe_inst.read_text_from_write_window()
196
+ canoe_inst.stop_measurement()
197
+ canoe_inst.disable_write_window_output_file()
198
+ ```
199
+
200
+ ### switch between CANoe desktops
201
+
202
+ ```python
203
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
204
+ canoe_inst.ui_activate_desktop('Configuration')
205
+ ```
206
+
207
+ ### get/set system variable or define system variable
208
+
209
+ ```python
210
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
211
+
212
+ canoe_inst.start_measurement()
213
+ canoe_inst.set_system_variable_value('demo::level_two_1::sys_var2', 20)
214
+ canoe_inst.set_system_variable_value('demo::string_var', 'hey hello this is string variable')
215
+ canoe_inst.set_system_variable_value('demo::data_var', 'hey hello this is data variable')
216
+ canoe_inst.set_system_variable_array_values('demo::int_array_var', (00, 11, 22, 33, 44, 55, 66, 77, 88, 99))
217
+ sys_var_val = canoe_inst.get_system_variable_value('demo::level_two_1::sys_var2')
218
+ sys_var_val = canoe_inst.get_system_variable_value('demo::data_var')
219
+ canoe_inst.stop_measurement()
220
+ canoe_inst.define_system_variable('sys_demo::demo', 1)
221
+ canoe_inst.save_configuration()
222
+ canoe_inst.start_measurement()
223
+ sys_var_val = canoe_inst.get_system_variable_value('sys_demo::demo')
224
+ canoe_inst.stop_measurement()
225
+ ```
226
+
227
+ ### send diagnostic request, control tester present
228
+
229
+ ```python
230
+ canoe_inst.open(r'tests\demo_cfg\demo_diag.cfg')
231
+
232
+ canoe_inst.start_measurement()
233
+ resp = canoe_inst.send_diag_request('Door', 'DefaultSession_Start', False)
234
+ canoe_inst.control_tester_present('Door', False)
235
+ wait(2)
236
+ canoe_inst.control_tester_present('Door', True)
237
+ wait(5)
238
+ resp = canoe_inst.send_diag_request('Door', '10 02')
239
+ canoe_inst.control_tester_present('Door', False)
240
+ wait(2)
241
+ resp = canoe_inst.send_diag_request('Door', '10 03', return_sender_name=True)
242
+ canoe_inst.stop_measurement()
243
+ ```
244
+
245
+ ### set replay block source file / control replay block start stop
246
+
247
+ ```python
248
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
249
+
250
+ canoe_inst.start_measurement()
251
+ canoe_inst.set_replay_block_file(block_name='DemoReplayBlock', recording_file_path=r'tests\demo_cfg\Logs\demo_log.blf')
252
+ canoe_inst.control_replay_block(block_name='DemoReplayBlock', start_stop=True)
253
+ wait(2)
254
+ canoe_inst.control_replay_block(block_name='DemoReplayBlock', start_stop=False)
255
+ canoe_inst.stop_measurement()
256
+ ```
257
+
258
+ ### compile CAPL nodes and call capl function
259
+
260
+ ```python
261
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
262
+
263
+ canoe_inst.compile_all_capl_nodes()
264
+ canoe_inst.start_measurement()
265
+ canoe_inst.call_capl_function('addition_function', 100, 200)
266
+ canoe_inst.call_capl_function('hello_world')
267
+ canoe_inst.stop_measurement()
268
+ ```
269
+
270
+ ### execute test setup test module / test environment
271
+
272
+ ```python
273
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
274
+
275
+ canoe_inst.start_measurement()
276
+ canoe_inst.execute_all_test_modules_in_test_env(demo_test_environment)
277
+ canoe_inst.execute_test_module('demo_test_node_002')
278
+ canoe_inst.stop_measurement()
279
+ ```
280
+
281
+ ### get/set environment variable value
282
+
283
+ ```python
284
+ canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
285
+
286
+ canoe_inst.start_measurement()
287
+ canoe_inst.set_environment_variable_value('int_var', 123.12)
288
+ canoe_inst.set_environment_variable_value('float_var', 111.123)
289
+ canoe_inst.set_environment_variable_value('string_var', 'this is string variable')
290
+ canoe_inst.set_environment_variable_value('data_var', (1, 2, 3, 4, 5, 6, 7))
291
+ var_value = canoe_inst.get_environment_variable_value('int_var')
292
+ var_value = canoe_inst.get_environment_variable_value('float_var')
293
+ var_value = canoe_inst.get_environment_variable_value('string_var')
294
+ var_value = canoe_inst.get_environment_variable_value('data_var')
295
+ canoe_inst.stop_measurement()
296
+ ```
297
+
298
+ ### add/remove database
299
+
300
+ ```python
301
+ canoe_inst.open(canoe_cfg=r"tests\demo_cfg\demo_conf_gen_db_setup.cfg")
302
+
303
+ canoe_inst.start_measurement()
304
+ # add database
305
+ canoe_inst.add_database(fr"{file_path}\demo_cfg\DBs\sample_databases\XCP.dbc", 'CAN1', 1)
306
+ # remove database
307
+ canoe_inst.remove_database(fr"{file_path}\demo_cfg\DBs\sample_databases\XCP.dbc", 1)
308
+ ```
309
+
310
+ ### start/stop online logging block
311
+
312
+ ```python
313
+ canoe_inst.open(canoe_cfg=r"tests\demo_cfg\demo_online_setup.cfg")
314
+
315
+ canoe_inst.start_measurement()
316
+ # stop logging block
317
+ canoe_inst.start_stop_online_logging_block(fr'{demo_cfg_dir}\Logs\demo_online_setup_log.blf', start_stop=False)
318
+ wait(2)
319
+ # start logging block
320
+ canoe_inst.start_stop_online_logging_block(fr'{demo_cfg_dir}\Logs\demo_online_setup_log.blf', start_stop=True)
321
+ ```
322
+
323
+ ### working with logging blocks
324
+
325
+ ```python
326
+ # remove current logging blocks
327
+ for i in range(canoe_inst.logging_collection.count):
328
+ canoe_inst.remove_logging_block(1) # iteration start from 1 and shifts after each delete
329
+ # add a new block
330
+ # define dest path with file format as asc, blf or other
331
+ # may include field functions like {IncMeasurement}
332
+ full_path = "C:/sample_log_{IncMeasurement}.blf"
333
+ canoe_inst.add_logging_block(full_path)
334
+ canoe_inst.start_measurement()
335
+ # ...
336
+ canoe_inst.stop_measurement()
337
+ # log should be fully generated at this point for you to analyze
338
+ canoe_inst.set_configuration_modified(False) # to avoid popup asking to save changes
339
+ canoe_inst.quit()
340
+ ```