py_canoe.core.application.Application
Main interface to CANoe Application via COM automation.
Source code in src\py_canoe\core\application.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
capl
property
Returns the CAPL object (read-only, mirrors COM Application.CAPL).
channel_mapping_name
property
writable
Sets or returns the application name used to map application channels to real existing Vector network interface channels.
configuration
property
Returns the Configuration object (read-only, mirrors COM Application.Configuration).
The wrapper is cached because it holds test environment/module data that is fetched when a configuration is loaded and consumed by later calls.
environment
property
Returns the Environment object (read-only, mirrors COM Application.Environment).
full_name
property
Returns full path of the currently loaded CANoe configuration.
measurement
property
Returns the Measurement object (read-only, mirrors COM Application.Measurement).
The wrapper is cached because it registers a COM event sink that must stay alive and unique for the Application's lifetime.
name
property
Returns name of the currently loaded CANoe configuration.
networks
property
Returns the Networks object (read-only, mirrors COM Application.Networks).
The wrapper is cached because it holds diagnostic devices data that is fetched when a configuration is loaded and consumed by later calls.
path
property
Returns the directory path of the currently loaded CANoe configuration.
performance
property
Returns the Performance object (read-only, mirrors COM Application.Performance).
simulation
property
Returns the Simulation object (read-only, mirrors COM Application.Simulation).
system
property
Returns the System object (read-only, mirrors COM Application.System).
ui
property
Returns the UI object (read-only, mirrors COM Application.UI).
version
property
Returns the Version object (read-only, mirrors COM Application.Version).
visible
property
writable
Returns whether the CANoe application window is visible.
attach_to_active_application()
Attach to an already running CANoe application instance.
Source code in src\py_canoe\core\application.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
bus(bus_type=BusType.CAN)
Returns a Bus object for the given bus type.
This mirrors the COM Application.Bus([type]) property. The Bus wrapper is stateless (it only wraps the COM Bus object), so a fresh wrapper is created on each call.
| Parameters: |
|
|---|
Source code in src\py_canoe\core\application.py
103 104 105 106 107 108 109 110 111 112 113 | |
new(auto_save=False, prompt_user=False, timeout=5)
Create a new empty CANoe configuration.
Source code in src\py_canoe\core\application.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
new_configuration_from_yaml(configuration_path, path_to_yaml_folder, scenario_name='')
Creates a new configuration from an existing venvironment.yaml or venvironment-basic.yaml.
| Parameters: |
|
|---|
Source code in src\py_canoe\core\application.py
185 186 187 188 189 190 191 192 193 194 | |
open(canoe_cfg, visible=True, auto_save=True, prompt_user=False, timeout=5)
Open a CANoe configuration file (.cfg) in a new or existing CANoe instance.
Source code in src\py_canoe\core\application.py
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
open_config(canoe_cfg, auto_save=True, prompt_user=False, timeout=60)
Switch to a different CANoe configuration without restarting CANoe.
This method switches configurations in an already-running CANoe instance. Use this when CANoe is already running and you want to load a different .cfg file.
For starting CANoe with a configuration from scratch, use open() instead.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src\py_canoe\core\application.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | |
pump_messages()
Pump COM messages to prevent blocking.
This is a thin wrapper around pythoncom.PumpWaitingMessages(). Use this in custom wait loops to keep COM responsive.
Example
while not ready(): app.pump_messages() time.sleep(0.1)
Source code in src\py_canoe\core\application.py
426 427 428 429 430 431 432 433 434 435 436 437 | |
quit(timeout=5)
Quit the CANoe application gracefully.
Source code in src\py_canoe\core\application.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |