Skip to content

Commit

Permalink
codegen WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
zariiii9003 committed Oct 19, 2023
1 parent cf7dc17 commit a096baf
Show file tree
Hide file tree
Showing 2 changed files with 1,898 additions and 349 deletions.
44 changes: 43 additions & 1 deletion src/pycanape/cnp_api/cnp_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ class tAsap3Hdl(ctypes.Structure):


TAsap3Hdl = ctypes.POINTER(tAsap3Hdl)
TAsap3DiagHdl = ctypes.c_ulong
TModulHdl = ctypes.c_ushort
TRecorderID = ctypes.POINTER(ctypes.c_ulong)
TTime = ctypes.c_ulong
TScriptHdl = ctypes.c_ulong
TParamTemplateHdl = ctypes.POINTER(ctypes.c_ulong)
TParamItemHdl = ctypes.POINTER(ctypes.c_ulong)

EVENT_CALLBACK = ctypes.WINFUNCTYPE(None, TAsap3Hdl, ctypes.c_ulong)
EVENT_CALLBACK = ctypes.WINFUNCTYPE(ctypes.c_long, TAsap3Hdl, ctypes.c_ulong)


class TTaskInfo(ctypes.Structure):
Expand Down Expand Up @@ -390,3 +391,44 @@ class TPhysInterface(ctypes.Structure):
("m_CanapPhysInterfaceName", ctypes.c_char_p),
("m_CanapPhysDeviceName", ctypes.c_char_p),
]


class PValues(ctypes.Union):
_fields_ = [
("IVal", ctypes.c_int64),
("UIVal", ctypes.c_uint64),
("FVal", ctypes.c_float),
("DVal", ctypes.c_double),
]


class DiagNumericParameter(ctypes.Structure):
_pack_ = 1
_anonymous_ = ["_values"]
_fields = [
("DiagNumeric", enum_type),
("_values", PValues),
("Values", PValues),
]


class DiagJobResponse(ctypes.Structure):
_pack_ = 1
_fields = [
("job_responsestring", ctypes.c_char_p),
("job_responseValue", ctypes.c_double),
]


class DiagNotificationStruct(ctypes.Structure):
_pack_ = 1
_fields = [
("DiagHandle", TAsap3DiagHdl),
("DiagState", enum_type),
("PrivateData", ctypes.c_void_p),
]


FNCDIAGNOFIFICATION = ctypes.WINFUNCTYPE(
ctypes.c_long, ctypes.c_ulong, ctypes.POINTER(DiagNotificationStruct)
)
Loading

0 comments on commit a096baf

Please sign in to comment.