py_canoe 3.0.0__py3-none-any.whl → 3.0.2__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 +235 -173
- py_canoe-3.0.2.dist-info/METADATA +291 -0
- py_canoe-3.0.2.dist-info/RECORD +6 -0
- py_canoe-3.0.0.dist-info/METADATA +0 -84
- py_canoe-3.0.0.dist-info/RECORD +0 -6
- {py_canoe-3.0.0.dist-info → py_canoe-3.0.2.dist-info}/LICENSE +0 -0
- {py_canoe-3.0.0.dist-info → py_canoe-3.0.2.dist-info}/WHEEL +0 -0
py_canoe/__init__.py
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
# import external modules here
|
|
2
2
|
import os
|
|
3
|
-
import
|
|
3
|
+
import time
|
|
4
4
|
import logging
|
|
5
5
|
import pythoncom
|
|
6
6
|
import win32com.client
|
|
7
7
|
from typing import Union
|
|
8
8
|
from datetime import datetime
|
|
9
|
-
from time import sleep as wait
|
|
10
9
|
|
|
11
10
|
# import internal modules here
|
|
12
11
|
from .py_canoe_logger import PyCanoeLogger
|
|
13
12
|
|
|
14
13
|
|
|
14
|
+
class PyCanoeException(Exception):
|
|
15
|
+
def __init__(self, message):
|
|
16
|
+
self.message = message
|
|
17
|
+
|
|
18
|
+
def __str__(self):
|
|
19
|
+
return self.message
|
|
20
|
+
|
|
15
21
|
class CANoe:
|
|
16
22
|
"""
|
|
17
23
|
Represents a CANoe instance.
|
|
@@ -25,131 +31,87 @@ class CANoe:
|
|
|
25
31
|
CANOE_MEASUREMENT_STOPPED = False
|
|
26
32
|
|
|
27
33
|
def __init__(self, py_canoe_log_dir='', user_capl_functions=tuple()):
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
self.__user_capl_functions = user_capl_functions
|
|
37
|
-
except Exception as e:
|
|
38
|
-
self.__log.error(f'😡 Error initializing CANoe object: {str(e)}')
|
|
39
|
-
sys.exit(1)
|
|
34
|
+
self.__log = PyCanoeLogger(py_canoe_log_dir).log
|
|
35
|
+
self.application_events_enabled = True
|
|
36
|
+
self.application_open_close_timeout = 60
|
|
37
|
+
self.simulation_events_enabled = False
|
|
38
|
+
self.measurement_events_enabled = True
|
|
39
|
+
self.measurement_start_stop_timeout = 60 # default value set to 60 seconds (1 minute)
|
|
40
|
+
self.configuration_events_enabled = False
|
|
41
|
+
self.__user_capl_functions = user_capl_functions
|
|
40
42
|
|
|
41
43
|
def __init_canoe_application(self):
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
win32com.client.WithEvents(self.application_com_obj, CanoeApplicationEvents)
|
|
52
|
-
wait(0.5)
|
|
53
|
-
except Exception as e:
|
|
54
|
-
self.__log.error(f'😡 Error initializing CANoe application: {str(e)}')
|
|
55
|
-
sys.exit(1)
|
|
44
|
+
self.__log.debug('➖'*50)
|
|
45
|
+
pythoncom.CoInitialize()
|
|
46
|
+
wait(0.5)
|
|
47
|
+
self.application_com_obj = win32com.client.Dispatch('CANoe.Application')
|
|
48
|
+
self.wait_for_canoe_app_to_open = lambda: DoMeasurementEventsUntil(lambda: CANoe.CANOE_APPLICATION_OPENED, lambda: self.application_open_close_timeout)
|
|
49
|
+
self.wait_for_canoe_app_to_close = lambda: DoMeasurementEventsUntil(lambda: CANoe.CANOE_APPLICATION_CLOSED, lambda: self.application_open_close_timeout)
|
|
50
|
+
if self.application_events_enabled:
|
|
51
|
+
win32com.client.WithEvents(self.application_com_obj, CanoeApplicationEvents)
|
|
52
|
+
wait(0.5)
|
|
56
53
|
|
|
57
54
|
def __init_canoe_application_bus(self):
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
self.bus_nodes = win32com.client.Dispatch(self.bus_com_obj.Nodes)
|
|
62
|
-
except Exception as e:
|
|
63
|
-
self.__log.error(f'😡 Error initializing CANoe bus: {str(e)}')
|
|
64
|
-
sys.exit(1)
|
|
55
|
+
self.bus_com_obj = win32com.client.Dispatch(self.application_com_obj.Bus)
|
|
56
|
+
self.bus_databases = win32com.client.Dispatch(self.bus_com_obj.Databases)
|
|
57
|
+
self.bus_nodes = win32com.client.Dispatch(self.bus_com_obj.Nodes)
|
|
65
58
|
|
|
66
59
|
def __init_canoe_application_capl(self):
|
|
67
|
-
|
|
68
|
-
self.capl_obj = lambda: CanoeCapl(self.application_com_obj)
|
|
69
|
-
except Exception as e:
|
|
70
|
-
self.__log.error(f'😡 Error initializing CANoe CAPL: {str(e)}')
|
|
71
|
-
sys.exit(1)
|
|
60
|
+
self.capl_obj = lambda: CanoeCapl(self.application_com_obj)
|
|
72
61
|
|
|
73
62
|
def __init_canoe_application_configuration(self):
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
for
|
|
94
|
-
|
|
95
|
-
self.__test_modules.append({'name': tm_name, 'object': tm_inst, 'environment': te_name})
|
|
96
|
-
except Exception as e:
|
|
97
|
-
self.__log.error(f'😡 Error initializing CANoe configuration: {str(e)}')
|
|
63
|
+
self.configuration_com_obj = win32com.client.Dispatch(self.application_com_obj.Configuration)
|
|
64
|
+
if self.configuration_events_enabled:
|
|
65
|
+
win32com.client.WithEvents(self.configuration_com_obj, CanoeConfigurationEvents)
|
|
66
|
+
self.configuration_offline_setup = win32com.client.Dispatch(self.configuration_com_obj.OfflineSetup)
|
|
67
|
+
self.configuration_offline_setup_source = win32com.client.Dispatch(self.configuration_offline_setup.Source)
|
|
68
|
+
self.configuration_offline_setup_source_sources = win32com.client.Dispatch(self.configuration_offline_setup_source.Sources)
|
|
69
|
+
sources = self.configuration_offline_setup_source_sources
|
|
70
|
+
sources_count = sources.Count + 1
|
|
71
|
+
self.configuration_offline_setup_source_sources_paths = lambda: [sources.Item(index) for index in range(1, sources_count)]
|
|
72
|
+
self.configuration_online_setup = win32com.client.Dispatch(self.configuration_com_obj.OnlineSetup)
|
|
73
|
+
self.configuration_online_setup_bus_statistics = win32com.client.Dispatch(self.configuration_online_setup.BusStatistics)
|
|
74
|
+
self.configuration_online_setup_bus_statistics_bus_statistic = lambda bus_type, channel: win32com.client.Dispatch(self.configuration_online_setup_bus_statistics.BusStatistic(bus_type, channel))
|
|
75
|
+
self.configuration_general_setup = CanoeConfigurationGeneralSetup(self.configuration_com_obj)
|
|
76
|
+
self.configuration_simulation_setup = lambda: CanoeConfigurationSimulationSetup(self.configuration_com_obj)
|
|
77
|
+
self.__replay_blocks = self.configuration_simulation_setup().replay_collection.fetch_replay_blocks()
|
|
78
|
+
self.configuration_test_setup = lambda: CanoeConfigurationTestSetup(self.configuration_com_obj)
|
|
79
|
+
self.__test_setup_environments = self.configuration_test_setup().test_environments.fetch_all_test_environments()
|
|
80
|
+
self.__test_modules = list()
|
|
81
|
+
for te_name, te_inst in self.__test_setup_environments.items():
|
|
82
|
+
for tm_name, tm_inst in te_inst.get_all_test_modules().items():
|
|
83
|
+
self.__test_modules.append({'name': tm_name, 'object': tm_inst, 'environment': te_name})
|
|
98
84
|
|
|
99
85
|
def __init_canoe_application_environment(self):
|
|
100
|
-
|
|
101
|
-
self.environment_obj_inst = CanoeEnvironment(self.application_com_obj)
|
|
102
|
-
except Exception as e:
|
|
103
|
-
self.__log.error(f'😡 Error initializing CANoe environment: {str(e)}')
|
|
104
|
-
sys.exit(1)
|
|
86
|
+
self.environment_obj_inst = CanoeEnvironment(self.application_com_obj)
|
|
105
87
|
|
|
106
88
|
def __init_canoe_application_measurement(self):
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
win32com.client.WithEvents(self.measurement_com_obj, CanoeMeasurementEvents)
|
|
115
|
-
except Exception as e:
|
|
116
|
-
self.__log.error(f'😡 Error initializing CANoe measurement: {str(e)}')
|
|
117
|
-
sys.exit(1)
|
|
89
|
+
CanoeMeasurementEvents.application_com_obj = self.application_com_obj
|
|
90
|
+
CanoeMeasurementEvents.user_capl_function_names = self.__user_capl_functions
|
|
91
|
+
self.measurement_com_obj = win32com.client.Dispatch(self.application_com_obj.Measurement)
|
|
92
|
+
self.wait_for_canoe_meas_to_start = lambda: DoMeasurementEventsUntil(lambda: CANoe.CANOE_MEASUREMENT_STARTED, lambda: self.measurement_start_stop_timeout)
|
|
93
|
+
self.wait_for_canoe_meas_to_stop = lambda: DoMeasurementEventsUntil(lambda: CANoe.CANOE_MEASUREMENT_STOPPED, lambda: self.measurement_start_stop_timeout)
|
|
94
|
+
if self.measurement_events_enabled:
|
|
95
|
+
win32com.client.WithEvents(self.measurement_com_obj, CanoeMeasurementEvents)
|
|
118
96
|
|
|
119
97
|
def __init_canoe_application_networks(self):
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
self.__diag_devices = self.networks_obj().fetch_all_diag_devices()
|
|
124
|
-
except Exception as e:
|
|
125
|
-
self.__log.error(f'😡 Error initializing CANoe networks: {str(e)}')
|
|
126
|
-
sys.exit(1)
|
|
98
|
+
self.networks_com_obj = win32com.client.Dispatch(self.application_com_obj.Networks)
|
|
99
|
+
self.networks_obj = lambda: CanoeNetworks(self.networks_com_obj)
|
|
100
|
+
self.__diag_devices = self.networks_obj().fetch_all_diag_devices()
|
|
127
101
|
|
|
128
102
|
def __init_canoe_application_simulation(self):
|
|
129
103
|
pass
|
|
130
104
|
|
|
131
105
|
def __init_canoe_application_system(self):
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
self.system_obj = lambda: CanoeSystem(self.system_com_obj)
|
|
135
|
-
except Exception as e:
|
|
136
|
-
self.__log.error(f'😡 Error initializing CANoe system: {str(e)}')
|
|
137
|
-
sys.exit(1)
|
|
106
|
+
self.system_com_obj = win32com.client.Dispatch(self.application_com_obj.System)
|
|
107
|
+
self.system_obj = lambda: CanoeSystem(self.system_com_obj)
|
|
138
108
|
|
|
139
109
|
def __init_canoe_application_ui(self):
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
self.ui_write_window_com_obj = win32com.client.Dispatch(self.ui_com_obj.Write)
|
|
143
|
-
except Exception as e:
|
|
144
|
-
self.__log.error(f'😡 Error initializing CANoe UI: {str(e)}')
|
|
145
|
-
sys.exit(1)
|
|
110
|
+
self.ui_com_obj = win32com.client.Dispatch(self.application_com_obj.UI)
|
|
111
|
+
self.ui_write_window_com_obj = win32com.client.Dispatch(self.ui_com_obj.Write)
|
|
146
112
|
|
|
147
113
|
def __init_canoe_application_version(self):
|
|
148
|
-
|
|
149
|
-
self.version_com_obj = win32com.client.Dispatch(self.application_com_obj.Version)
|
|
150
|
-
except Exception as e:
|
|
151
|
-
self.__log.error(f'😡 Error initializing CANoe version: {str(e)}')
|
|
152
|
-
sys.exit(1)
|
|
114
|
+
self.version_com_obj = win32com.client.Dispatch(self.application_com_obj.Version)
|
|
153
115
|
|
|
154
116
|
def new(self, auto_save=False, prompt_user=False) -> None:
|
|
155
117
|
try:
|
|
@@ -157,33 +119,33 @@ class CANoe:
|
|
|
157
119
|
self.application_com_obj.New(auto_save, prompt_user)
|
|
158
120
|
self.__log.debug(f'📢 New CANoe configuration successfully created 🎉')
|
|
159
121
|
except Exception as e:
|
|
160
|
-
|
|
161
|
-
|
|
122
|
+
error_message = f'😡 Error creating new CANoe configuration: {str(e)}'
|
|
123
|
+
self.__log.error(error_message)
|
|
124
|
+
raise PyCanoeException(error_message)
|
|
162
125
|
|
|
163
|
-
def open(self, canoe_cfg: str, visible=True, auto_save=
|
|
126
|
+
def open(self, canoe_cfg: str, visible=True, auto_save=True, prompt_user=False, auto_stop=True) -> None:
|
|
164
127
|
"""Loads CANoe configuration.
|
|
165
128
|
|
|
166
129
|
Args:
|
|
167
130
|
canoe_cfg (str): The complete path for the CANoe configuration.
|
|
168
131
|
visible (bool): True if you want to see CANoe UI. Defaults to True.
|
|
169
|
-
auto_save (bool, optional): A boolean value that indicates whether the active configuration should be saved if it has been changed. Defaults to
|
|
132
|
+
auto_save (bool, optional): A boolean value that indicates whether the active configuration should be saved if it has been changed. Defaults to True.
|
|
170
133
|
prompt_user (bool, optional): A boolean value that indicates whether the user should intervene in error situations. Defaults to False.
|
|
171
|
-
auto_stop (bool, optional): A boolean value that indicates whether to stop the measurement before opening the configuration. Defaults to
|
|
134
|
+
auto_stop (bool, optional): A boolean value that indicates whether to stop the measurement before opening the configuration. Defaults to True.
|
|
172
135
|
"""
|
|
173
|
-
self.__init_canoe_application()
|
|
174
|
-
self.__init_canoe_application_measurement()
|
|
175
|
-
self.__init_canoe_application_simulation()
|
|
176
|
-
self.__init_canoe_application_version()
|
|
177
136
|
try:
|
|
137
|
+
self.__init_canoe_application()
|
|
138
|
+
self.__init_canoe_application_measurement()
|
|
139
|
+
self.__init_canoe_application_simulation()
|
|
140
|
+
self.__init_canoe_application_version()
|
|
178
141
|
self.application_com_obj.Visible = visible
|
|
179
142
|
if self.measurement_com_obj.Running and not auto_stop:
|
|
180
|
-
|
|
181
|
-
sys.exit(1)
|
|
143
|
+
raise PyCanoeException('Measurement is running. Stop the measurement or set argument auto_stop=True')
|
|
182
144
|
elif self.measurement_com_obj.Running and auto_stop:
|
|
183
145
|
self.__log.warning('😇 Active Measurement is running. Stopping measurement before opening your configuration')
|
|
184
146
|
self.stop_ex_measurement()
|
|
185
147
|
if os.path.isfile(canoe_cfg):
|
|
186
|
-
self.__log.debug('⏳
|
|
148
|
+
self.__log.debug('⏳ waiting for application to open')
|
|
187
149
|
self.application_com_obj.Open(canoe_cfg, auto_save, prompt_user)
|
|
188
150
|
self.wait_for_canoe_app_to_open()
|
|
189
151
|
self.__init_canoe_application_bus()
|
|
@@ -195,17 +157,17 @@ class CANoe:
|
|
|
195
157
|
self.__init_canoe_application_ui()
|
|
196
158
|
self.__log.debug(f'📢 CANoe configuration successfully opened 🎉')
|
|
197
159
|
else:
|
|
198
|
-
|
|
199
|
-
sys.exit(1)
|
|
160
|
+
raise PyCanoeException(f'CANoe configuration "{canoe_cfg}" not found')
|
|
200
161
|
except Exception as e:
|
|
201
|
-
|
|
202
|
-
|
|
162
|
+
error_message = f'😡 Error opening CANoe configuration: {str(e)}'
|
|
163
|
+
self.__log.error(error_message)
|
|
164
|
+
raise PyCanoeException(error_message)
|
|
203
165
|
|
|
204
166
|
def quit(self):
|
|
205
167
|
"""Quits CANoe without saving changes in the configuration."""
|
|
206
168
|
try:
|
|
207
169
|
wait(0.5)
|
|
208
|
-
self.__log.debug('⏳
|
|
170
|
+
self.__log.debug('⏳ waiting for application to quit')
|
|
209
171
|
self.application_com_obj.Quit()
|
|
210
172
|
self.wait_for_canoe_app_to_close()
|
|
211
173
|
wait(0.5)
|
|
@@ -213,8 +175,9 @@ class CANoe:
|
|
|
213
175
|
self.application_com_obj = None
|
|
214
176
|
self.__log.debug('📢 CANoe Application Closed')
|
|
215
177
|
except Exception as e:
|
|
216
|
-
|
|
217
|
-
|
|
178
|
+
error_message = f'😡 Error quitting CANoe application: {str(e)}'
|
|
179
|
+
self.__log.error(error_message)
|
|
180
|
+
raise PyCanoeException(error_message)
|
|
218
181
|
|
|
219
182
|
def start_measurement(self, timeout=60) -> bool:
|
|
220
183
|
"""Starts the measurement.
|
|
@@ -226,10 +189,10 @@ class CANoe:
|
|
|
226
189
|
True if measurement started. else False.
|
|
227
190
|
"""
|
|
228
191
|
try:
|
|
229
|
-
meas_run_sts = {True: "Started
|
|
192
|
+
meas_run_sts = {True: "Started 🏃♂️", False: "Not Started 🧍♂️"}
|
|
230
193
|
self.measurement_start_stop_timeout = timeout
|
|
231
194
|
if self.measurement_com_obj.Running:
|
|
232
|
-
self.__log.warning(f'⚠️ CANoe Measurement already running
|
|
195
|
+
self.__log.warning(f'⚠️ CANoe Measurement already running 🏃♂️')
|
|
233
196
|
else:
|
|
234
197
|
self.measurement_com_obj.Start()
|
|
235
198
|
if not self.measurement_com_obj.Running:
|
|
@@ -238,8 +201,9 @@ class CANoe:
|
|
|
238
201
|
self.__log.debug(f'👉 CANoe Measurement {meas_run_sts[self.measurement_com_obj.Running]}')
|
|
239
202
|
return self.measurement_com_obj.Running
|
|
240
203
|
except Exception as e:
|
|
241
|
-
|
|
242
|
-
|
|
204
|
+
error_message = f'😡 Error starting measurement: {str(e)}'
|
|
205
|
+
self.__log.error(error_message)
|
|
206
|
+
raise PyCanoeException(error_message)
|
|
243
207
|
|
|
244
208
|
def stop_measurement(self, timeout=60) -> bool:
|
|
245
209
|
"""Stops the measurement.
|
|
@@ -262,7 +226,7 @@ class CANoe:
|
|
|
262
226
|
True if measurement stopped. else False.
|
|
263
227
|
"""
|
|
264
228
|
try:
|
|
265
|
-
meas_run_sts = {True: "Not Stopped
|
|
229
|
+
meas_run_sts = {True: "Not Stopped 🏃♂️ ", False: "Stopped 🧍♂️"}
|
|
266
230
|
self.measurement_start_stop_timeout = timeout
|
|
267
231
|
if self.measurement_com_obj.Running:
|
|
268
232
|
self.measurement_com_obj.Stop()
|
|
@@ -274,8 +238,9 @@ class CANoe:
|
|
|
274
238
|
self.__log.warning(f'⚠️ CANoe Measurement already stopped 🧍♂️')
|
|
275
239
|
return not self.measurement_com_obj.Running
|
|
276
240
|
except Exception as e:
|
|
277
|
-
|
|
278
|
-
|
|
241
|
+
error_message = f'😡 Error stopping measurement: {str(e)}'
|
|
242
|
+
self.__log.error(error_message)
|
|
243
|
+
raise PyCanoeException(error_message)
|
|
279
244
|
|
|
280
245
|
def reset_measurement(self) -> bool:
|
|
281
246
|
"""reset(stop and start) the measurement.
|
|
@@ -289,8 +254,9 @@ class CANoe:
|
|
|
289
254
|
self.__log.debug(f'👉 active measurement resetted 🔁')
|
|
290
255
|
return self.measurement_com_obj.Running
|
|
291
256
|
except Exception as e:
|
|
292
|
-
|
|
293
|
-
|
|
257
|
+
error_message = f'😡 Error resetting measurement: {str(e)}'
|
|
258
|
+
self.__log.error(error_message)
|
|
259
|
+
raise PyCanoeException(error_message)
|
|
294
260
|
|
|
295
261
|
def get_measurement_running_status(self) -> bool:
|
|
296
262
|
"""Returns the running state of the measurement.
|
|
@@ -336,9 +302,9 @@ class CANoe:
|
|
|
336
302
|
try:
|
|
337
303
|
self.measurement_com_obj.AnimationDelay = animation_delay
|
|
338
304
|
self.measurement_com_obj.Animate()
|
|
339
|
-
self.__log.debug(f'⏳ waiting for measurement to start
|
|
305
|
+
self.__log.debug(f'⏳ waiting for measurement to start 🏃♂️')
|
|
340
306
|
self.wait_for_canoe_meas_to_start()
|
|
341
|
-
self.__log.debug(f"👉 started
|
|
307
|
+
self.__log.debug(f"👉 started 🏃♂️ measurement in Animation mode with animation delay ⏲️ {animation_delay}")
|
|
342
308
|
except Exception as e:
|
|
343
309
|
self.__log.error(f'😡 Error starting measurement in animation mode: {str(e)}')
|
|
344
310
|
|
|
@@ -377,7 +343,7 @@ class CANoe:
|
|
|
377
343
|
"""
|
|
378
344
|
try:
|
|
379
345
|
meas_index = self.measurement_com_obj.MeasurementIndex
|
|
380
|
-
self.__log.debug(f'👉 measurement_index value
|
|
346
|
+
self.__log.debug(f'👉 measurement_index value = {meas_index}')
|
|
381
347
|
return meas_index
|
|
382
348
|
except Exception as e:
|
|
383
349
|
self.__log.error(f'😡 Error getting measurement index: {str(e)}')
|
|
@@ -394,7 +360,7 @@ class CANoe:
|
|
|
394
360
|
"""
|
|
395
361
|
try:
|
|
396
362
|
self.measurement_com_obj.MeasurementIndex = index
|
|
397
|
-
self.__log.debug(f'👉 measurement_index value set to
|
|
363
|
+
self.__log.debug(f'👉 measurement_index value set to {index}')
|
|
398
364
|
return index
|
|
399
365
|
except Exception as e:
|
|
400
366
|
self.__log.error(f'😡 Error setting measurement index: {str(e)}')
|
|
@@ -479,7 +445,7 @@ class CANoe:
|
|
|
479
445
|
'standard_remote_total': can_bus_statistic_obj.StandardRemoteTotal,
|
|
480
446
|
'tx_error_count': can_bus_statistic_obj.TxErrorCount,
|
|
481
447
|
}
|
|
482
|
-
self.__log.debug(f'👉 CAN Bus Statistics
|
|
448
|
+
self.__log.debug(f'👉 CAN Bus Statistics info = {statistics_info}')
|
|
483
449
|
return statistics_info
|
|
484
450
|
except Exception as e:
|
|
485
451
|
self.__log.error(f'😡 Error getting CAN Bus Statistics: {str(e)}')
|
|
@@ -503,7 +469,7 @@ class CANoe:
|
|
|
503
469
|
'major': self.version_com_obj.major,
|
|
504
470
|
'minor': self.version_com_obj.minor,
|
|
505
471
|
'patch': self.version_com_obj.Patch}
|
|
506
|
-
self.__log.debug('> CANoe Application.Version
|
|
472
|
+
self.__log.debug('> CANoe Application.Version info<'.center(50, '➖'))
|
|
507
473
|
for k, v in version_info.items():
|
|
508
474
|
self.__log.debug(f'{k:<10}: {v}')
|
|
509
475
|
self.__log.debug(''.center(50, '➖'))
|
|
@@ -531,7 +497,7 @@ class CANoe:
|
|
|
531
497
|
'channel': database_obj.Channel,
|
|
532
498
|
'full_name': database_obj.FullName
|
|
533
499
|
}
|
|
534
|
-
self.__log.debug(f'👉 {bus} bus databases
|
|
500
|
+
self.__log.debug(f'👉 {bus} bus databases info = {dbcs_info}')
|
|
535
501
|
return dbcs_info
|
|
536
502
|
except Exception as e:
|
|
537
503
|
self.__log.error(f'😡 Error getting {bus} bus databases info: {str(e)}')
|
|
@@ -556,7 +522,7 @@ class CANoe:
|
|
|
556
522
|
'full_name': node_obj.FullName,
|
|
557
523
|
'active': node_obj.Active
|
|
558
524
|
}
|
|
559
|
-
self.__log.debug(f'👉 {bus} bus nodes
|
|
525
|
+
self.__log.debug(f'👉 {bus} bus nodes info = {nodes_info}')
|
|
560
526
|
return nodes_info
|
|
561
527
|
except Exception as e:
|
|
562
528
|
self.__log.error(f'😡 Error getting {bus} bus nodes info: {str(e)}')
|
|
@@ -578,7 +544,7 @@ class CANoe:
|
|
|
578
544
|
try:
|
|
579
545
|
signal_obj = self.application_com_obj.GetBus(bus).GetSignal(channel, message, signal)
|
|
580
546
|
signal_value = signal_obj.RawValue if raw_value else signal_obj.Value
|
|
581
|
-
self.__log.debug(f'👉 value of signal({bus}{channel}.{message}.{signal})
|
|
547
|
+
self.__log.debug(f'👉 value of signal({bus}{channel}.{message}.{signal}) = {signal_value}')
|
|
582
548
|
return signal_value
|
|
583
549
|
except Exception as e:
|
|
584
550
|
self.__log.error(f'😡 Error getting signal value: {str(e)}')
|
|
@@ -620,7 +586,7 @@ class CANoe:
|
|
|
620
586
|
try:
|
|
621
587
|
signal_obj = self.application_com_obj.GetBus(bus).GetSignal(channel, message, signal)
|
|
622
588
|
signal_fullname = signal_obj.FullName
|
|
623
|
-
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) full name
|
|
589
|
+
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) full name = {signal_fullname}')
|
|
624
590
|
return signal_fullname
|
|
625
591
|
except Exception as e:
|
|
626
592
|
self.__log.error(f'😡 Error getting signal full name: {str(e)}')
|
|
@@ -641,7 +607,7 @@ class CANoe:
|
|
|
641
607
|
try:
|
|
642
608
|
signal_obj = self.application_com_obj.GetBus(bus).GetSignal(channel, message, signal)
|
|
643
609
|
sig_online_status = signal_obj.IsOnline
|
|
644
|
-
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) online status
|
|
610
|
+
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) online status = {sig_online_status}')
|
|
645
611
|
return sig_online_status
|
|
646
612
|
except Exception as e:
|
|
647
613
|
self.__log.error(f'😡 Error checking signal online status: {str(e)}')
|
|
@@ -666,7 +632,7 @@ class CANoe:
|
|
|
666
632
|
try:
|
|
667
633
|
signal_obj = self.application_com_obj.GetBus(bus).GetSignal(channel, message, signal)
|
|
668
634
|
sig_state = signal_obj.State
|
|
669
|
-
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) state
|
|
635
|
+
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) state = {sig_state}')
|
|
670
636
|
return sig_state
|
|
671
637
|
except Exception as e:
|
|
672
638
|
self.__log.error(f'😡 Error checking signal state: {str(e)}')
|
|
@@ -689,7 +655,7 @@ class CANoe:
|
|
|
689
655
|
try:
|
|
690
656
|
signal_obj = self.application_com_obj.GetBus(bus).GetJ1939Signal(channel, message, signal, source_addr, dest_addr)
|
|
691
657
|
signal_value = signal_obj.RawValue if raw_value else signal_obj.Value
|
|
692
|
-
self.__log.debug(f'👉 value of signal({bus}{channel}.{message}.{signal})
|
|
658
|
+
self.__log.debug(f'👉 value of signal({bus}{channel}.{message}.{signal}) = {signal_value}')
|
|
693
659
|
return signal_value
|
|
694
660
|
except Exception as e:
|
|
695
661
|
self.__log.error(f'😡 Error getting signal value: {str(e)}')
|
|
@@ -737,7 +703,7 @@ class CANoe:
|
|
|
737
703
|
try:
|
|
738
704
|
signal_obj = self.application_com_obj.GetBus(bus).GetJ1939Signal(channel, message, signal, source_addr, dest_addr)
|
|
739
705
|
signal_fullname = signal_obj.FullName
|
|
740
|
-
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) full name
|
|
706
|
+
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) full name = {signal_fullname}')
|
|
741
707
|
return signal_fullname
|
|
742
708
|
except Exception as e:
|
|
743
709
|
self.__log.error(f'😡 Error getting signal full name: {str(e)}')
|
|
@@ -760,7 +726,7 @@ class CANoe:
|
|
|
760
726
|
try:
|
|
761
727
|
signal_obj = self.application_com_obj.GetBus(bus).GetJ1939Signal(channel, message, signal, source_addr, dest_addr)
|
|
762
728
|
sig_online_status = signal_obj.IsOnline
|
|
763
|
-
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) online status
|
|
729
|
+
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) online status = {sig_online_status}')
|
|
764
730
|
return sig_online_status
|
|
765
731
|
except Exception as e:
|
|
766
732
|
self.__log.error(f'😡 Error checking signal online status: {str(e)}')
|
|
@@ -779,7 +745,7 @@ class CANoe:
|
|
|
779
745
|
try:
|
|
780
746
|
signal_obj = self.application_com_obj.GetBus(bus).GetJ1939Signal(channel, message, signal, source_addr, dest_addr)
|
|
781
747
|
sig_state = signal_obj.State
|
|
782
|
-
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) state
|
|
748
|
+
self.__log.debug(f'👉 signal({bus}{channel}.{message}.{signal}) state = {sig_state}')
|
|
783
749
|
return sig_state
|
|
784
750
|
except Exception as e:
|
|
785
751
|
self.__log.error(f'😡 Error checking signal state: {str(e)}')
|
|
@@ -855,10 +821,10 @@ class CANoe:
|
|
|
855
821
|
try:
|
|
856
822
|
if tab_index:
|
|
857
823
|
self.ui_write_window_com_obj.EnableOutputFile(output_file, tab_index)
|
|
858
|
-
self.__log.debug(f'✔️ Enabled logging of outputs of the Write Window. output_file
|
|
824
|
+
self.__log.debug(f'✔️ Enabled logging of outputs of the Write Window. output_file={output_file} and tab_index={tab_index}')
|
|
859
825
|
else:
|
|
860
826
|
self.ui_write_window_com_obj.EnableOutputFile(output_file)
|
|
861
|
-
self.__log.debug(f'✔️ Enabled logging of outputs of the Write Window. output_file
|
|
827
|
+
self.__log.debug(f'✔️ Enabled logging of outputs of the Write Window. output_file={output_file}')
|
|
862
828
|
except Exception as e:
|
|
863
829
|
self.__log.error(f'😡 Error enabling Write Window output file: {str(e)}')
|
|
864
830
|
|
|
@@ -871,7 +837,7 @@ class CANoe:
|
|
|
871
837
|
try:
|
|
872
838
|
if tab_index:
|
|
873
839
|
self.ui_write_window_com_obj.DisableOutputFile(tab_index)
|
|
874
|
-
self.__log.debug(f'⏹️ Disabled logging of outputs of the Write Window. tab_index
|
|
840
|
+
self.__log.debug(f'⏹️ Disabled logging of outputs of the Write Window. tab_index={tab_index}')
|
|
875
841
|
else:
|
|
876
842
|
self.ui_write_window_com_obj.DisableOutputFile()
|
|
877
843
|
self.__log.debug(f'⏹️ Disabled logging of outputs of the Write Window')
|
|
@@ -920,7 +886,7 @@ class CANoe:
|
|
|
920
886
|
return_value = var_value_name
|
|
921
887
|
else:
|
|
922
888
|
return_value = var_value
|
|
923
|
-
self.__log.debug(f'👉 system variable({sys_var_name}) value
|
|
889
|
+
self.__log.debug(f'👉 system variable({sys_var_name}) value = {return_value}')
|
|
924
890
|
except Exception as e:
|
|
925
891
|
self.__log.debug(f'😡 failed to get system variable({sys_var_name}) value. {e}')
|
|
926
892
|
return return_value
|
|
@@ -991,7 +957,7 @@ class CANoe:
|
|
|
991
957
|
diag_response_including_sender_name = {}
|
|
992
958
|
try:
|
|
993
959
|
if diag_ecu_qualifier_name in self.__diag_devices.keys():
|
|
994
|
-
self.__log.debug(f'💉 {diag_ecu_qualifier_name}: Diagnostic Request
|
|
960
|
+
self.__log.debug(f'💉 {diag_ecu_qualifier_name}: Diagnostic Request = {request}')
|
|
995
961
|
if request_in_bytes:
|
|
996
962
|
diag_req = self.__diag_devices[diag_ecu_qualifier_name].create_request_from_stream(request)
|
|
997
963
|
else:
|
|
@@ -1007,9 +973,9 @@ class CANoe:
|
|
|
1007
973
|
diag_response_data = diag_res.stream
|
|
1008
974
|
diag_response_including_sender_name[diag_res.sender] = diag_response_data
|
|
1009
975
|
if diag_res.positive:
|
|
1010
|
-
self.__log.debug(f"🟢 {diag_res.sender}: ➕ Diagnostic Response
|
|
976
|
+
self.__log.debug(f"🟢 {diag_res.sender}: ➕ Diagnostic Response = {diag_response_data}")
|
|
1011
977
|
else:
|
|
1012
|
-
self.__log.debug(f"🔴 {diag_res.Sender}: ➖ Diagnostic Response
|
|
978
|
+
self.__log.debug(f"🔴 {diag_res.Sender}: ➖ Diagnostic Response = {diag_response_data}")
|
|
1013
979
|
else:
|
|
1014
980
|
self.__log.warning(f'⚠️ Diagnostic ECU qualifier({diag_ecu_qualifier_name}) not available in loaded CANoe config')
|
|
1015
981
|
except Exception as e:
|
|
@@ -1029,11 +995,11 @@ class CANoe:
|
|
|
1029
995
|
if diag_device.tester_present_status != value:
|
|
1030
996
|
if value:
|
|
1031
997
|
diag_device.start_tester_present()
|
|
1032
|
-
self.__log.debug(f'
|
|
998
|
+
self.__log.debug(f'⏱️🏃♂️ {diag_ecu_qualifier_name}: started tester present')
|
|
1033
999
|
else:
|
|
1034
1000
|
diag_device.stop_tester_present()
|
|
1035
1001
|
self.__log.debug(f'⏱️🧍♂️ {diag_ecu_qualifier_name}: stopped tester present')
|
|
1036
|
-
wait(.1)
|
|
1002
|
+
wait(0.1)
|
|
1037
1003
|
else:
|
|
1038
1004
|
self.__log.warning(f'⚠️ {diag_ecu_qualifier_name}: tester present already set to {value}')
|
|
1039
1005
|
else:
|
|
@@ -1108,7 +1074,7 @@ class CANoe:
|
|
|
1108
1074
|
try:
|
|
1109
1075
|
capl_obj = self.capl_obj()
|
|
1110
1076
|
exec_sts = capl_obj.call_capl_function(CanoeMeasurementEvents.user_capl_function_obj_dict[name], *arguments)
|
|
1111
|
-
self.__log.debug(f'🛫 triggered capl function({name}). execution status
|
|
1077
|
+
self.__log.debug(f'🛫 triggered capl function({name}). execution status = {exec_sts}')
|
|
1112
1078
|
return exec_sts
|
|
1113
1079
|
except Exception as e:
|
|
1114
1080
|
self.__log.error(f'😡 failed to call capl function({name}). {e}')
|
|
@@ -1175,9 +1141,9 @@ class CANoe:
|
|
|
1175
1141
|
else:
|
|
1176
1142
|
continue
|
|
1177
1143
|
if test_module_found and (execution_result == 1):
|
|
1178
|
-
self.__log.debug(f'✔️ test module "{test_env_name}.{test_module_name}" executed and verdict
|
|
1144
|
+
self.__log.debug(f'✔️ test module "{test_env_name}.{test_module_name}" executed and verdict = {test_verdict[execution_result]}')
|
|
1179
1145
|
elif test_module_found and (execution_result != 1):
|
|
1180
|
-
self.__log.debug(f'😵💫 test module "{test_env_name}.{test_module_name}" executed and verdict
|
|
1146
|
+
self.__log.debug(f'😵💫 test module "{test_env_name}.{test_module_name}" executed and verdict = {test_verdict[execution_result]}')
|
|
1181
1147
|
else:
|
|
1182
1148
|
self.__log.warning(f'⚠️ test module "{test_module_name}" not found. not possible to execute')
|
|
1183
1149
|
return execution_result
|
|
@@ -1240,7 +1206,7 @@ class CANoe:
|
|
|
1240
1206
|
test_environments = self.get_test_environments()
|
|
1241
1207
|
if len(test_environments) > 0:
|
|
1242
1208
|
for test_env_name in test_environments.keys():
|
|
1243
|
-
self.__log.debug(f'
|
|
1209
|
+
self.__log.debug(f'🏃♂️ started executing test environment "{test_env_name}"')
|
|
1244
1210
|
self.execute_all_test_modules_in_test_env(test_env_name)
|
|
1245
1211
|
self.__log.debug(f'✔️ completed executing test environment "{test_env_name}"')
|
|
1246
1212
|
else:
|
|
@@ -1275,7 +1241,7 @@ class CANoe:
|
|
|
1275
1241
|
try:
|
|
1276
1242
|
variable = self.environment_obj_inst.get_variable(env_var_name)
|
|
1277
1243
|
var_value = variable.value if variable.type != 3 else tuple(variable.value)
|
|
1278
|
-
self.__log.debug(f'👉 environment variable({env_var_name}) value
|
|
1244
|
+
self.__log.debug(f'👉 environment variable({env_var_name}) value = {var_value}')
|
|
1279
1245
|
except Exception as e:
|
|
1280
1246
|
self.__log.error(f'😡 failed to get environment variable({env_var_name}) value. {e}')
|
|
1281
1247
|
return var_value
|
|
@@ -1298,11 +1264,18 @@ class CANoe:
|
|
|
1298
1264
|
else:
|
|
1299
1265
|
converted_value = tuple(value)
|
|
1300
1266
|
variable.value = converted_value
|
|
1301
|
-
self.__log.debug(f'👉 environment variable({env_var_name}) value
|
|
1267
|
+
self.__log.debug(f'👉 environment variable({env_var_name}) value = {converted_value}')
|
|
1302
1268
|
except Exception as e:
|
|
1303
1269
|
self.__log.error(f'😡 failed to set system variable({env_var_name}) value. {e}')
|
|
1304
1270
|
|
|
1305
1271
|
def add_database(self, database_file: str, database_network: str, database_channel: int) -> bool:
|
|
1272
|
+
"""adds database file to a network channel
|
|
1273
|
+
|
|
1274
|
+
Args:
|
|
1275
|
+
database_file (str): database file to attach. give full file path.
|
|
1276
|
+
database_network (str): network name on which you want to add this database.
|
|
1277
|
+
database_channel (int): channel name on which you want to add this database.
|
|
1278
|
+
"""
|
|
1306
1279
|
try:
|
|
1307
1280
|
if self.get_measurement_running_status():
|
|
1308
1281
|
self.__log.warning('⚠️ measurement is running. not possible to add database')
|
|
@@ -1327,6 +1300,12 @@ class CANoe:
|
|
|
1327
1300
|
return False
|
|
1328
1301
|
|
|
1329
1302
|
def remove_database(self, database_file: str, database_channel: int) -> bool:
|
|
1303
|
+
"""remove database file from a channel
|
|
1304
|
+
|
|
1305
|
+
Args:
|
|
1306
|
+
database_file (str): database file to remove. give full file path.
|
|
1307
|
+
database_channel (int): channel name on which you want to remove database.
|
|
1308
|
+
"""
|
|
1330
1309
|
try:
|
|
1331
1310
|
if self.get_measurement_running_status():
|
|
1332
1311
|
self.__log.warning('⚠️ measurement is running. not possible to remove database')
|
|
@@ -1349,9 +1328,20 @@ class CANoe:
|
|
|
1349
1328
|
return False
|
|
1350
1329
|
|
|
1351
1330
|
|
|
1352
|
-
def
|
|
1331
|
+
def wait(timeout_seconds=0.1):
|
|
1332
|
+
"""Waits for a specified timeout, pumping Windows messages.
|
|
1333
|
+
|
|
1334
|
+
Args:
|
|
1335
|
+
timeout_seconds: The time to wait in seconds.
|
|
1336
|
+
|
|
1337
|
+
Returns:
|
|
1338
|
+
None
|
|
1339
|
+
"""
|
|
1353
1340
|
pythoncom.PumpWaitingMessages()
|
|
1354
|
-
|
|
1341
|
+
time.sleep(timeout_seconds)
|
|
1342
|
+
|
|
1343
|
+
def DoApplicationEvents() -> None:
|
|
1344
|
+
wait(0.1)
|
|
1355
1345
|
|
|
1356
1346
|
def DoApplicationEventsUntil(cond, timeout) -> None:
|
|
1357
1347
|
base_time = datetime.now()
|
|
@@ -1365,8 +1355,7 @@ def DoApplicationEventsUntil(cond, timeout) -> None:
|
|
|
1365
1355
|
break
|
|
1366
1356
|
|
|
1367
1357
|
def DoMeasurementEvents() -> None:
|
|
1368
|
-
|
|
1369
|
-
wait(.1)
|
|
1358
|
+
wait(0.1)
|
|
1370
1359
|
|
|
1371
1360
|
def DoMeasurementEventsUntil(cond, timeout) -> None:
|
|
1372
1361
|
base_time = datetime.now()
|
|
@@ -1380,16 +1369,14 @@ def DoMeasurementEventsUntil(cond, timeout) -> None:
|
|
|
1380
1369
|
break
|
|
1381
1370
|
|
|
1382
1371
|
def DoTestModuleEvents():
|
|
1383
|
-
|
|
1384
|
-
wait(.1)
|
|
1372
|
+
wait(0.1)
|
|
1385
1373
|
|
|
1386
1374
|
def DoTestModuleEventsUntil(condition):
|
|
1387
1375
|
while not condition():
|
|
1388
1376
|
DoTestModuleEvents()
|
|
1389
1377
|
|
|
1390
1378
|
def DoEnvVarEvents():
|
|
1391
|
-
|
|
1392
|
-
wait(.1)
|
|
1379
|
+
wait(0.1)
|
|
1393
1380
|
|
|
1394
1381
|
def DoEnvVarEventsUntil(condition):
|
|
1395
1382
|
while not condition():
|
|
@@ -1694,6 +1681,7 @@ class CanoeConfigurationTestSetup:
|
|
|
1694
1681
|
|
|
1695
1682
|
|
|
1696
1683
|
class CanoeConfigurationTestSetupTestEnvironments:
|
|
1684
|
+
"""The TestEnvironments object represents the test environments within CANoe's test setup."""
|
|
1697
1685
|
def __init__(self, test_setup_com_obj):
|
|
1698
1686
|
try:
|
|
1699
1687
|
self.__log = logging.getLogger('CANOE_LOG')
|
|
@@ -1725,6 +1713,9 @@ class CanoeConfigurationTestSetupTestEnvironmentsTestEnvironment:
|
|
|
1725
1713
|
def __init__(self, test_environment_com_obj):
|
|
1726
1714
|
self.com_obj = test_environment_com_obj
|
|
1727
1715
|
self.__test_modules = CanoeConfigurationTestSetupTestEnvironmentsTestEnvironmentTestModules(self.com_obj)
|
|
1716
|
+
self.__test_setup_folders = CanoeConfigurationTestSetupTestEnvironmentsTestEnvironmentTestSetupFolders(self.com_obj)
|
|
1717
|
+
self.__all_test_modules = {}
|
|
1718
|
+
self.__all_test_setup_folders = {}
|
|
1728
1719
|
|
|
1729
1720
|
@property
|
|
1730
1721
|
def enabled(self) -> bool:
|
|
@@ -1758,8 +1749,79 @@ class CanoeConfigurationTestSetupTestEnvironmentsTestEnvironment:
|
|
|
1758
1749
|
def stop_sequence(self) -> None:
|
|
1759
1750
|
self.com_obj.StopSequence()
|
|
1760
1751
|
|
|
1752
|
+
def update_all_test_setup_folders(self, tsfs_instance=None):
|
|
1753
|
+
if tsfs_instance is None:
|
|
1754
|
+
tsfs_instance = self.__test_setup_folders
|
|
1755
|
+
if tsfs_instance.count > 0:
|
|
1756
|
+
test_setup_folders = tsfs_instance.fetch_test_setup_folders()
|
|
1757
|
+
for tsf_name, tsf_inst in test_setup_folders.items():
|
|
1758
|
+
self.__all_test_setup_folders[tsf_name] = tsf_inst
|
|
1759
|
+
if tsf_inst.test_modules.count > 0:
|
|
1760
|
+
self.__all_test_modules.update(tsf_inst.test_modules.fetch_test_modules())
|
|
1761
|
+
if tsf_inst.folders.count > 0:
|
|
1762
|
+
tsfs_instance = tsf_inst.folders
|
|
1763
|
+
self.update_all_test_setup_folders(tsfs_instance)
|
|
1764
|
+
|
|
1761
1765
|
def get_all_test_modules(self):
|
|
1762
|
-
|
|
1766
|
+
self.update_all_test_setup_folders()
|
|
1767
|
+
self.__all_test_modules.update(self.__test_modules.fetch_test_modules())
|
|
1768
|
+
return self.__all_test_modules
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
class CanoeConfigurationTestSetupTestEnvironmentsTestEnvironmentTestSetupFolders:
|
|
1772
|
+
"""The TestSetupFolders object represents the folders in a test environment or in a test setup folder."""
|
|
1773
|
+
def __init__(self, test_env_com_obj) -> None:
|
|
1774
|
+
self.com_obj = test_env_com_obj.Folders
|
|
1775
|
+
|
|
1776
|
+
@property
|
|
1777
|
+
def count(self) -> int:
|
|
1778
|
+
return self.com_obj.Count
|
|
1779
|
+
|
|
1780
|
+
def add(self, full_name: str) -> object:
|
|
1781
|
+
return self.com_obj.Add(full_name)
|
|
1782
|
+
|
|
1783
|
+
def remove(self, index: int, prompt_user=False) -> None:
|
|
1784
|
+
self.com_obj.Remove(index, prompt_user)
|
|
1785
|
+
|
|
1786
|
+
def fetch_test_setup_folders(self) -> dict:
|
|
1787
|
+
test_setup_folders = dict()
|
|
1788
|
+
for index in range(1, self.count + 1):
|
|
1789
|
+
tsf_com_obj = win32com.client.Dispatch(self.com_obj.Item(index))
|
|
1790
|
+
tsf_inst = CanoeConfigurationTestSetupTestEnvironmentsTestEnvironmentTestSetupFoldersTestSetupFolderExt(tsf_com_obj)
|
|
1791
|
+
test_setup_folders[tsf_inst.name] = tsf_inst
|
|
1792
|
+
return test_setup_folders
|
|
1793
|
+
|
|
1794
|
+
|
|
1795
|
+
class CanoeConfigurationTestSetupTestEnvironmentsTestEnvironmentTestSetupFoldersTestSetupFolderExt:
|
|
1796
|
+
"""The TestSetupFolderExt object represents a directory in CANoe's test setup."""
|
|
1797
|
+
def __init__(self, test_setup_folder_ext_com_obj) -> None:
|
|
1798
|
+
self.com_obj = test_setup_folder_ext_com_obj
|
|
1799
|
+
|
|
1800
|
+
@property
|
|
1801
|
+
def enabled(self) -> bool:
|
|
1802
|
+
return self.com_obj.Enabled
|
|
1803
|
+
|
|
1804
|
+
@enabled.setter
|
|
1805
|
+
def enabled(self, enabled: bool) -> None:
|
|
1806
|
+
self.com_obj.Enabled = enabled
|
|
1807
|
+
|
|
1808
|
+
@property
|
|
1809
|
+
def name(self):
|
|
1810
|
+
return self.com_obj.Name
|
|
1811
|
+
|
|
1812
|
+
@property
|
|
1813
|
+
def folders(self):
|
|
1814
|
+
return CanoeConfigurationTestSetupTestEnvironmentsTestEnvironmentTestSetupFolders(self.com_obj)
|
|
1815
|
+
|
|
1816
|
+
@property
|
|
1817
|
+
def test_modules(self):
|
|
1818
|
+
return CanoeConfigurationTestSetupTestEnvironmentsTestEnvironmentTestModules(self.com_obj)
|
|
1819
|
+
|
|
1820
|
+
def execute_all(self):
|
|
1821
|
+
self.com_obj.ExecuteAll()
|
|
1822
|
+
|
|
1823
|
+
def stop_sequence(self):
|
|
1824
|
+
self.com_obj.StopSequence()
|
|
1763
1825
|
|
|
1764
1826
|
|
|
1765
1827
|
class CanoeConfigurationTestSetupTestEnvironmentsTestEnvironmentTestModules:
|
|
@@ -1984,7 +2046,7 @@ class CanoeEnvironmentVariable:
|
|
|
1984
2046
|
@value.setter
|
|
1985
2047
|
def value(self, value):
|
|
1986
2048
|
self.com_obj.Value = value
|
|
1987
|
-
wait(.1)
|
|
2049
|
+
wait(0.1)
|
|
1988
2050
|
|
|
1989
2051
|
|
|
1990
2052
|
class CanoeEnvironmentInfo:
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: py_canoe
|
|
3
|
+
Version: 3.0.2
|
|
4
|
+
Summary: Python CANoe Package
|
|
5
|
+
Home-page: https://github.com/chaitu-ycr/py_canoe
|
|
6
|
+
License: LICENSE
|
|
7
|
+
Keywords: Vector,CANoe,py_canoe
|
|
8
|
+
Author: chaitu-ycr
|
|
9
|
+
Author-email: chaitu.ycr@gmail.com
|
|
10
|
+
Requires-Python: >=3.9,<4.0
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: License :: Other/Proprietary License
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Embedded Systems
|
|
21
|
+
Requires-Dist: pywin32 (>=306,<=308)
|
|
22
|
+
Project-URL: Documentation, https://chaitu-ycr.github.io/py_canoe/
|
|
23
|
+
Project-URL: Repository, https://github.com/chaitu-ycr/py_canoe
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
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
|
|
82
|
+
from time import sleep as wait
|
|
83
|
+
|
|
84
|
+
canoe_inst = CANoe()
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### open CANoe, start measurement, get version info, stop measurement and close canoe configuration
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo.cfg')
|
|
91
|
+
canoe_inst.start_measurement()
|
|
92
|
+
canoe_version_info = canoe_inst.get_canoe_version_info()
|
|
93
|
+
canoe_inst.stop_measurement()
|
|
94
|
+
canoe_inst.quit()
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### restart/reset running measurement
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo.cfg')
|
|
101
|
+
canoe_inst.start_measurement()
|
|
102
|
+
canoe_inst.reset_measurement()
|
|
103
|
+
canoe_inst.stop_ex_measurement()
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### open CANoe offline config and start/break/step/reset/stop measurement in offline mode
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
canoe_inst.open(r'tests\demo_cfg\demo_offline.cfg')
|
|
110
|
+
canoe_inst.add_offline_source_log_file(r'tests\demo_cfg\Logs\demo_log.blf')
|
|
111
|
+
canoe_inst.start_measurement_in_animation_mode(animation_delay=200)
|
|
112
|
+
wait(1)
|
|
113
|
+
canoe_inst.break_measurement_in_offline_mode()
|
|
114
|
+
wait(1)
|
|
115
|
+
canoe_inst.step_measurement_event_in_single_step()
|
|
116
|
+
wait(1)
|
|
117
|
+
canoe_inst.reset_measurement_in_offline_mode()
|
|
118
|
+
wait(1)
|
|
119
|
+
canoe_inst.stop_measurement()
|
|
120
|
+
wait(1)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### get/set CANoe measurement index
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
127
|
+
meas_index_value = canoe_inst.get_measurement_index()
|
|
128
|
+
canoe_inst.start_measurement()
|
|
129
|
+
canoe_inst.stop_measurement()
|
|
130
|
+
meas_index_value = canoe_inst.get_measurement_index()
|
|
131
|
+
canoe_inst.set_measurement_index(meas_index_value + 1)
|
|
132
|
+
meas_index_new = canoe_inst.get_measurement_index()
|
|
133
|
+
canoe_inst.reset_measurement()
|
|
134
|
+
canoe_inst.stop_measurement()
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### save CANoe config to a different version with different name
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
141
|
+
canoe_inst.save_configuration_as(path=r'tests\demo_cfg\demo_v10.cfg', major=10, minor=0, create_dir=True)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### get CAN bus statistics of CAN channel 1
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
148
|
+
canoe_inst.start_measurement()
|
|
149
|
+
wait(2)
|
|
150
|
+
canoe_inst.get_can_bus_statistics(channel=1)
|
|
151
|
+
canoe_inst.stop_measurement()
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### get/set bus signal value, check signal state and get signal full name
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
158
|
+
canoe_inst.start_measurement()
|
|
159
|
+
wait(1)
|
|
160
|
+
sig_full_name = canoe_inst.get_signal_full_name(bus='CAN', channel=1, message='LightState', signal='FlashLight')
|
|
161
|
+
sig_value = canoe_inst.get_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', raw_value=False)
|
|
162
|
+
canoe_inst.set_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', value=1, raw_value=False)
|
|
163
|
+
wait(1)
|
|
164
|
+
sig_online_state = canoe_inst.check_signal_online(bus='CAN', channel=1, message='LightState', signal='FlashLight')
|
|
165
|
+
sig_state = canoe_inst.check_signal_state(bus='CAN', channel=1, message='LightState', signal='FlashLight')
|
|
166
|
+
sig_val = canoe_inst.get_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', raw_value=True)
|
|
167
|
+
canoe_inst.stop_measurement()
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### clear write window / read text from write window / control write window output file
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
174
|
+
canoe_inst.enable_write_window_output_file(r'tests\demo_cfg\Logs\write_win.txt')
|
|
175
|
+
wait(1)
|
|
176
|
+
canoe_inst.start_measurement()
|
|
177
|
+
canoe_inst.clear_write_window_content()
|
|
178
|
+
wait(1)
|
|
179
|
+
canoe_inst.write_text_in_write_window("hello from py_canoe!")
|
|
180
|
+
wait(1)
|
|
181
|
+
text = canoe_inst.read_text_from_write_window()
|
|
182
|
+
canoe_inst.stop_measurement()
|
|
183
|
+
canoe_inst.disable_write_window_output_file()
|
|
184
|
+
wait(1)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### switch between CANoe desktops
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
191
|
+
canoe_inst.ui_activate_desktop('Configuration')
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### get/set system variable or define system variable
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
198
|
+
canoe_inst.start_measurement()
|
|
199
|
+
wait(1)
|
|
200
|
+
canoe_inst.set_system_variable_value('demo::level_two_1::sys_var2', 20)
|
|
201
|
+
canoe_inst.set_system_variable_value('demo::string_var', 'hey hello this is string variable')
|
|
202
|
+
canoe_inst.set_system_variable_value('demo::data_var', 'hey hello this is data variable')
|
|
203
|
+
canoe_inst.set_system_variable_array_values('demo::int_array_var', (00, 11, 22, 33, 44, 55, 66, 77, 88, 99))
|
|
204
|
+
wait(0.1)
|
|
205
|
+
sys_var_val = canoe_inst.get_system_variable_value('demo::level_two_1::sys_var2')
|
|
206
|
+
sys_var_val = canoe_inst.get_system_variable_value('demo::data_var')
|
|
207
|
+
canoe_inst.stop_measurement()
|
|
208
|
+
# define system variable and use it in measurement
|
|
209
|
+
canoe_inst.define_system_variable('sys_demo::demo', 1)
|
|
210
|
+
canoe_inst.save_configuration()
|
|
211
|
+
canoe_inst.start_measurement()
|
|
212
|
+
wait(1)
|
|
213
|
+
sys_var_val = canoe_inst.get_system_variable_value('sys_demo::demo')
|
|
214
|
+
canoe_inst.stop_measurement()
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### send diagnostic request, control tester present
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
canoe_inst.open(r'tests\demo_cfg\demo_diag.cfg')
|
|
221
|
+
canoe_inst.start_measurement()
|
|
222
|
+
wait(1)
|
|
223
|
+
resp = canoe_inst.send_diag_request('Door', 'DefaultSession_Start', False)
|
|
224
|
+
canoe_inst.control_tester_present('Door', False)
|
|
225
|
+
wait(2)
|
|
226
|
+
canoe_inst.control_tester_present('Door', True)
|
|
227
|
+
wait(5)
|
|
228
|
+
resp = canoe_inst.send_diag_request('Door', '10 02')
|
|
229
|
+
canoe_inst.control_tester_present('Door', False)
|
|
230
|
+
wait(2)
|
|
231
|
+
resp = canoe_inst.send_diag_request('Door', '10 03', return_sender_name=True)
|
|
232
|
+
canoe_inst.stop_measurement()
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### set replay block source file / control replay block start stop
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
239
|
+
canoe_inst.start_measurement()
|
|
240
|
+
wait(1)
|
|
241
|
+
canoe_inst.set_replay_block_file(block_name='DemoReplayBlock', recording_file_path=r'tests\demo_cfg\Logs\demo_log.blf')
|
|
242
|
+
wait(1)
|
|
243
|
+
canoe_inst.control_replay_block(block_name='DemoReplayBlock', start_stop=True)
|
|
244
|
+
wait(2)
|
|
245
|
+
canoe_inst.control_replay_block(block_name='DemoReplayBlock', start_stop=False)
|
|
246
|
+
wait(1)
|
|
247
|
+
canoe_inst.stop_measurement()
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### compile CAPL nodes and call capl function
|
|
251
|
+
|
|
252
|
+
```python
|
|
253
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
254
|
+
canoe_inst.compile_all_capl_nodes()
|
|
255
|
+
canoe_inst.start_measurement()
|
|
256
|
+
wait(1)
|
|
257
|
+
canoe_inst.call_capl_function('addition_function', 100, 200)
|
|
258
|
+
canoe_inst.call_capl_function('hello_world')
|
|
259
|
+
canoe_inst.stop_measurement()
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### execute test setup test module / test environment
|
|
263
|
+
|
|
264
|
+
```python
|
|
265
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
266
|
+
canoe_inst.start_measurement()
|
|
267
|
+
wait(1)
|
|
268
|
+
canoe_inst.execute_all_test_modules_in_test_env(demo_test_environment)
|
|
269
|
+
canoe_inst.execute_test_module('demo_test_node_002')
|
|
270
|
+
wait(1)
|
|
271
|
+
canoe_inst.stop_measurement()
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### get/set environment variable value
|
|
275
|
+
|
|
276
|
+
```python
|
|
277
|
+
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo_dev.cfg')
|
|
278
|
+
canoe_inst.start_measurement()
|
|
279
|
+
wait(1)
|
|
280
|
+
canoe_inst.set_environment_variable_value('int_var', 123.12)
|
|
281
|
+
canoe_inst.set_environment_variable_value('float_var', 111.123)
|
|
282
|
+
canoe_inst.set_environment_variable_value('string_var', 'this is string variable')
|
|
283
|
+
canoe_inst.set_environment_variable_value('data_var', (1, 2, 3, 4, 5, 6, 7))
|
|
284
|
+
var_value = canoe_inst.get_environment_variable_value('int_var')
|
|
285
|
+
var_value = canoe_inst.get_environment_variable_value('float_var')
|
|
286
|
+
var_value = canoe_inst.get_environment_variable_value('string_var')
|
|
287
|
+
var_value = canoe_inst.get_environment_variable_value('data_var')
|
|
288
|
+
wait(1)
|
|
289
|
+
canoe_inst.stop_measurement()
|
|
290
|
+
```
|
|
291
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
py_canoe/__init__.py,sha256=mQ22BKAhpGlVeyUmqjfvk9IPhdxgAnBTXdX2d92ABRk,111742
|
|
2
|
+
py_canoe/py_canoe_logger.py,sha256=nYdhgy6nLU6AGGwi0SxRa945uQHSyF1LU3amHWmSXQE,1306
|
|
3
|
+
py_canoe-3.0.2.dist-info/LICENSE,sha256=JCIp9hcSQAXxMXuV9QX7nEz2H52MbwyRq0GcQj3CPNE,1086
|
|
4
|
+
py_canoe-3.0.2.dist-info/METADATA,sha256=wg3lTRYsZ0RovyxawqHjHnwPM2Y6HA9JSqnYux0GETQ,9552
|
|
5
|
+
py_canoe-3.0.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
6
|
+
py_canoe-3.0.2.dist-info/RECORD,,
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: py_canoe
|
|
3
|
-
Version: 3.0.0
|
|
4
|
-
Summary: Python CANoe Package
|
|
5
|
-
Home-page: https://github.com/chaitu-ycr/py_canoe.git
|
|
6
|
-
License: LICENSE
|
|
7
|
-
Keywords: Vector,CANoe,py_canoe
|
|
8
|
-
Author: chaitu-ycr
|
|
9
|
-
Author-email: chaitu.ycr@gmail.com
|
|
10
|
-
Requires-Python: >=3.9,<4.0
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
-
Classifier: License :: Other/Proprietary License
|
|
13
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
-
Classifier: Topic :: Software Development :: Embedded Systems
|
|
21
|
-
Requires-Dist: pywin32 (>=306,<307)
|
|
22
|
-
Project-URL: Documentation, https://chaitu-ycr.github.io/py_canoe/
|
|
23
|
-
Project-URL: Repository, https://github.com/chaitu-ycr/py_canoe.git
|
|
24
|
-
Description-Content-Type: text/markdown
|
|
25
|
-
|
|
26
|
-
# About [py_canoe](https://github.com/chaitu-ycr/py_canoe)
|
|
27
|
-
|
|
28
|
-
Python 🐍 Package for controlling Vector CANoe 🛶 Tool
|
|
29
|
-
|
|
30
|
-
fork [this repo](https://github.com/chaitu-ycr/py_canoe/fork) and create pull request to contribute back to this project.
|
|
31
|
-
|
|
32
|
-
for ideas/discussions please create new discussion [here](https://github.com/chaitu-ycr/py_canoe/discussions)
|
|
33
|
-
|
|
34
|
-
create issue or request feature [here](https://github.com/chaitu-ycr/py_canoe/issues/new/choose)
|
|
35
|
-
|
|
36
|
-
## GitHub Releases 👉 [link](https://github.com/chaitu-ycr/py_canoe/releases)
|
|
37
|
-
|
|
38
|
-
## PyPi Package 👉 [link](https://pypi.org/project/py_canoe/)
|
|
39
|
-
|
|
40
|
-
## Prerequisites [link](https://chaitu-ycr.github.io/py_canoe/002_prerequisites/)
|
|
41
|
-
|
|
42
|
-
## Python environment setup instructions [link](https://chaitu-ycr.github.io/py_canoe/003_environment_setup/)
|
|
43
|
-
|
|
44
|
-
## Install [py_canoe](https://pypi.org/project/py_canoe/) package
|
|
45
|
-
|
|
46
|
-
```bat
|
|
47
|
-
pip install py_canoe --upgrade
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Documentation Links
|
|
51
|
-
|
|
52
|
-
### example use cases 👉 [link](https://chaitu-ycr.github.io/py_canoe/004_usage/)
|
|
53
|
-
|
|
54
|
-
### package reference doc 👉 [link](https://chaitu-ycr.github.io/py_canoe/999_reference/)
|
|
55
|
-
|
|
56
|
-
## Sample Example
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
# Import CANoe module
|
|
60
|
-
from py_canoe import CANoe
|
|
61
|
-
|
|
62
|
-
# create CANoe object
|
|
63
|
-
canoe_inst = CANoe()
|
|
64
|
-
|
|
65
|
-
# open CANoe configuration. Replace canoe_cfg with yours.
|
|
66
|
-
canoe_inst.open(canoe_cfg=r'tests\demo_cfg\demo.cfg')
|
|
67
|
-
|
|
68
|
-
# print installed CANoe application version
|
|
69
|
-
canoe_inst.get_canoe_version_info()
|
|
70
|
-
|
|
71
|
-
# Start CANoe measurement
|
|
72
|
-
canoe_inst.start_measurement()
|
|
73
|
-
|
|
74
|
-
# get signal value. Replace arguments with your message and signal data.
|
|
75
|
-
sig_val = canoe_inst.get_signal_value('CAN', 1, 'LightState', 'FlashLight')
|
|
76
|
-
print(sig_val)
|
|
77
|
-
|
|
78
|
-
# Stop CANoe Measurement
|
|
79
|
-
canoe_inst.stop_measurement()
|
|
80
|
-
|
|
81
|
-
# Quit / Close CANoe configuration
|
|
82
|
-
canoe_inst.quit()
|
|
83
|
-
```
|
|
84
|
-
|
py_canoe-3.0.0.dist-info/RECORD
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
py_canoe/__init__.py,sha256=qPO6VWSKoP0Vc-1ehUVrPHtCTSp_EQFq7MpHGH3muaA,109429
|
|
2
|
-
py_canoe/py_canoe_logger.py,sha256=nYdhgy6nLU6AGGwi0SxRa945uQHSyF1LU3amHWmSXQE,1306
|
|
3
|
-
py_canoe-3.0.0.dist-info/LICENSE,sha256=JCIp9hcSQAXxMXuV9QX7nEz2H52MbwyRq0GcQj3CPNE,1086
|
|
4
|
-
py_canoe-3.0.0.dist-info/METADATA,sha256=wZQ7nwkSjC1SPqu8ULZR94-vwlI439qYEf4ME3HPLXk,2754
|
|
5
|
-
py_canoe-3.0.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
6
|
-
py_canoe-3.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|