-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPythonCanoe.py
More file actions
42 lines (27 loc) · 1.09 KB
/
Copy pathPythonCanoe.py
File metadata and controls
42 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os.path
from win32com.client import DispatchEx
from CANoeCAPL import CAPL
from CANoeMeasurement import CanoeMeasurement
from CANoeTrace import CANoeTrace
canoe_app = None
class MeasurementInitHandler:
def OnInit(self):
global canoe_app
for func in canoe_app.capl.functions:
res = canoe_app.capl.canoe_capl.GetFunction(func)
canoe_app.capl.compiled_functions[func] = res
class CanoeApp:
def __init__(self, config_file_path: str):
self.canoe_instance = DispatchEx('CANoe.Application')
if not os.path.exists(config_file_path):
raise FileNotFoundError("Config file not found")
self.canoe_instance.Open(config_file_path)
# initializing modules
self.trace = CANoeTrace(self.canoe_instance)
self.capl = CAPL(self)
self.measurement = CanoeMeasurement(self.canoe_instance, self)
global canoe_app
canoe_app = self
self.canoe_instance.CAPL.Compile()
def get_config_open_status(self):
return self.canoe_instance.Configuration.OpenConfigurationResult.result