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.
- py_canoe/__init__.py +2 -1
- py_canoe/canoe.py +910 -0
- py_canoe/core/__init__.py +0 -0
- py_canoe/core/application.py +170 -0
- py_canoe/core/bus.py +301 -0
- py_canoe/core/capl.py +59 -0
- py_canoe/core/child_elements/__init__.py +0 -0
- py_canoe/core/child_elements/application_model.py +24 -0
- py_canoe/core/child_elements/application_model_file.py +21 -0
- py_canoe/core/child_elements/application_model_files.py +22 -0
- py_canoe/core/child_elements/application_model_setup.py +15 -0
- py_canoe/core/child_elements/application_models.py +22 -0
- py_canoe/core/child_elements/application_socket.py +11 -0
- py_canoe/core/child_elements/application_specific_module.py +24 -0
- py_canoe/core/child_elements/application_specific_modules.py +16 -0
- py_canoe/core/child_elements/audio_interface.py +28 -0
- py_canoe/core/child_elements/available_modules.py +22 -0
- py_canoe/core/child_elements/basic_module.py +19 -0
- py_canoe/core/child_elements/basic_modules.py +16 -0
- py_canoe/core/child_elements/c_libraries.py +28 -0
- py_canoe/core/child_elements/c_library.py +33 -0
- py_canoe/core/child_elements/can_controller.py +74 -0
- py_canoe/core/child_elements/capl_function.py +17 -0
- py_canoe/core/child_elements/ccp_setup.py +15 -0
- py_canoe/core/child_elements/channel.py +20 -0
- py_canoe/core/child_elements/channels.py +19 -0
- py_canoe/core/child_elements/communication_setup.py +23 -0
- py_canoe/core/child_elements/compile_result.py +22 -0
- py_canoe/core/child_elements/configured_channel.py +48 -0
- py_canoe/core/child_elements/configured_channels.py +21 -0
- py_canoe/core/child_elements/configured_module.py +82 -0
- py_canoe/core/child_elements/configured_modules.py +61 -0
- py_canoe/core/child_elements/connected_modules.py +14 -0
- py_canoe/core/child_elements/data_source.py +42 -0
- py_canoe/core/child_elements/data_source_file.py +21 -0
- py_canoe/core/child_elements/data_source_files.py +22 -0
- py_canoe/core/child_elements/data_source_issue.py +22 -0
- py_canoe/core/child_elements/data_source_issues.py +16 -0
- py_canoe/core/child_elements/data_source_setup.py +17 -0
- py_canoe/core/child_elements/data_sources.py +27 -0
- py_canoe/core/child_elements/database_setup.py +62 -0
- py_canoe/core/child_elements/device.py +34 -0
- py_canoe/core/child_elements/devices.py +13 -0
- py_canoe/core/child_elements/diagnostic.py +22 -0
- py_canoe/core/child_elements/diagnostic_request.py +59 -0
- py_canoe/core/child_elements/diagnostic_response.py +34 -0
- py_canoe/core/child_elements/diagnostic_responses.py +13 -0
- py_canoe/core/child_elements/diagnostics_setup.py +254 -0
- py_canoe/core/child_elements/distributed_mode.py +74 -0
- py_canoe/core/child_elements/encoding.py +27 -0
- py_canoe/core/child_elements/encodings.py +13 -0
- py_canoe/core/child_elements/environment_array.py +13 -0
- py_canoe/core/child_elements/environment_group.py +22 -0
- py_canoe/core/child_elements/environment_info.py +14 -0
- py_canoe/core/child_elements/environment_variable.py +55 -0
- py_canoe/core/child_elements/fdx_files.py +50 -0
- py_canoe/core/child_elements/file_group_data_source.py +17 -0
- py_canoe/core/child_elements/general_setup.py +66 -0
- py_canoe/core/child_elements/macros_setup.py +52 -0
- py_canoe/core/child_elements/mc_ecus.py +428 -0
- py_canoe/core/child_elements/measurement_setup.py +269 -0
- py_canoe/core/child_elements/modules.py +87 -0
- py_canoe/core/child_elements/most_disassembler.py +21 -0
- py_canoe/core/child_elements/most_network_interface.py +4 -0
- py_canoe/core/child_elements/namespace.py +21 -0
- py_canoe/core/child_elements/namespaces.py +19 -0
- py_canoe/core/child_elements/network.py +18 -0
- py_canoe/core/child_elements/network_adapters.py +13 -0
- py_canoe/core/child_elements/nodes.py +119 -0
- py_canoe/core/child_elements/open_configuration_result.py +0 -0
- py_canoe/core/child_elements/panel_setup.py +97 -0
- py_canoe/core/child_elements/participant.py +17 -0
- py_canoe/core/child_elements/participants.py +22 -0
- py_canoe/core/child_elements/ports.py +81 -0
- py_canoe/core/child_elements/replay_collection.py +56 -0
- py_canoe/core/child_elements/security_configuration.py +20 -0
- py_canoe/core/child_elements/security_setup.py +31 -0
- py_canoe/core/child_elements/signals.py +39 -0
- py_canoe/core/child_elements/simulation_setup.py +0 -0
- py_canoe/core/child_elements/single_file_data_source.py +13 -0
- py_canoe/core/child_elements/snippet_setup.py +68 -0
- py_canoe/core/child_elements/standalone_mode.py +0 -0
- py_canoe/core/child_elements/start_value_list.py +0 -0
- py_canoe/core/child_elements/symbol_mappings.py +0 -0
- py_canoe/core/child_elements/tcp_ip_stack_setting.py +0 -0
- py_canoe/core/child_elements/test_configurations.py +0 -0
- py_canoe/core/child_elements/test_environment.py +64 -0
- py_canoe/core/child_elements/test_environments.py +26 -0
- py_canoe/core/child_elements/test_module.py +213 -0
- py_canoe/core/child_elements/test_modules.py +23 -0
- py_canoe/core/child_elements/test_setup.py +16 -0
- py_canoe/core/child_elements/test_setup_folder_ext.py +36 -0
- py_canoe/core/child_elements/test_setup_folders.py +25 -0
- py_canoe/core/child_elements/user_files.py +0 -0
- py_canoe/core/child_elements/variable.py +144 -0
- py_canoe/core/child_elements/variable_events.py +14 -0
- py_canoe/core/child_elements/variables.py +29 -0
- py_canoe/core/child_elements/variables_file.py +15 -0
- py_canoe/core/child_elements/variables_files.py +19 -0
- py_canoe/core/child_elements/visual_sequence_setup.py +46 -0
- py_canoe/core/child_elements/vt_system.py +83 -0
- py_canoe/core/child_elements/vtt_sut_import_result.py +21 -0
- py_canoe/core/child_elements/write.py +71 -0
- py_canoe/core/child_elements/xcp_setup.py +12 -0
- py_canoe/core/configuration.py +509 -0
- py_canoe/core/environment.py +59 -0
- py_canoe/core/measurement.py +149 -0
- py_canoe/core/networks.py +103 -0
- py_canoe/core/performance.py +21 -0
- py_canoe/core/simulation.py +53 -0
- py_canoe/core/system.py +164 -0
- py_canoe/core/ui.py +53 -0
- py_canoe/core/version.py +54 -0
- py_canoe/helpers/__init__.py +0 -0
- py_canoe/helpers/common.py +78 -0
- {py_canoe-3.0.3.dist-info → py_canoe-26.0.0.dist-info}/METADATA +331 -327
- py_canoe-26.0.0.dist-info/RECORD +118 -0
- py_canoe-26.0.0.dist-info/WHEEL +4 -0
- py_canoe/logging_collection.py +0 -345
- py_canoe/py_canoe.py +0 -2586
- py_canoe/py_canoe_logger.py +0 -29
- py_canoe-3.0.3.dist-info/LICENSE +0 -21
- py_canoe-3.0.3.dist-info/RECORD +0 -8
- 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:
|
|
4
|
-
Summary: Python CANoe
|
|
5
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
31
|
-
|
|
32
|
-
## important links
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
- pypi package
|
|
36
|
-
- github releases
|
|
37
|
-
- for ideas💡/sugessions please create new discussion
|
|
38
|
-
- create issue or request feature
|
|
39
|
-
- fork
|
|
40
|
-
|
|
41
|
-
## prerequisites
|
|
42
|
-
|
|
43
|
-
- [Python(>=3.
|
|
44
|
-
- [Vector CANoe software(>=v11)](https://www.vector.com/int/en/support-downloads/download-center/)
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
canoe_inst.
|
|
91
|
-
|
|
92
|
-
canoe_inst.
|
|
93
|
-
canoe_inst.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
canoe_inst.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
canoe_inst.
|
|
115
|
-
|
|
116
|
-
canoe_inst.
|
|
117
|
-
|
|
118
|
-
canoe_inst.stop_measurement()
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
canoe_inst.
|
|
148
|
-
|
|
149
|
-
canoe_inst.
|
|
150
|
-
canoe_inst.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
canoe_inst.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
canoe_inst.
|
|
162
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
canoe_inst.start_measurement()
|
|
176
|
-
canoe_inst.clear_write_window_content()
|
|
177
|
-
|
|
178
|
-
canoe_inst.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
canoe_inst.
|
|
197
|
-
canoe_inst.
|
|
198
|
-
|
|
199
|
-
canoe_inst.
|
|
200
|
-
canoe_inst.
|
|
201
|
-
canoe_inst.
|
|
202
|
-
canoe_inst.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
canoe_inst.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
canoe_inst.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
canoe_inst.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
canoe_inst.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
canoe_inst.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
canoe_inst.
|
|
238
|
-
canoe_inst.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
canoe_inst.
|
|
245
|
-
|
|
246
|
-
canoe_inst.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
canoe_inst.
|
|
257
|
-
|
|
258
|
-
canoe_inst.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
canoe_inst.
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
canoe_inst.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
canoe_inst.
|
|
277
|
-
canoe_inst.
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
canoe_inst.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
#
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
#
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
#
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
for
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
+
```
|