mirror of
https://github.com/nqrduck/LimeDriverBindings.git
synced 2024-06-30 01:09:09 +00:00
Implemented default LimeCfg through initialize function
This commit is contained in:
parent
68f5b60e93
commit
85ecf5f39d
2
extern/limedriver
vendored
2
extern/limedriver
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 09e5057452a19aee5ae527e1faa79d61018214d6
|
||||
Subproject commit 3d1c7bdf2ce95fb69f5a89b195a0f6e18496f97f
|
|
@ -82,6 +82,8 @@ cdef extern from "limedriver.h":
|
|||
|
||||
string stamp_start
|
||||
string stamp_end
|
||||
|
||||
cdef LimeConfig_t initializeLimeConfig(int Npulses)
|
||||
|
||||
|
||||
cdef class PyLimeConfig:
|
||||
|
@ -716,3 +718,16 @@ cdef class PyLimeConfig:
|
|||
@stamp_end.setter
|
||||
def stamp_end(self, value):
|
||||
self._config.stamp_end = value.encode('utf-8')
|
||||
|
||||
@classmethod
|
||||
def initialize(cls, int Npulses):
|
||||
cdef LimeConfig_t config = initializeLimeConfig(Npulses)
|
||||
|
||||
cdef PyLimeConfig instance = cls.__new__(cls, Npulses)
|
||||
instance._config = <LimeConfig_t*>malloc(sizeof(LimeConfig_t))
|
||||
|
||||
if instance._config is NULL:
|
||||
raise MemoryError()
|
||||
memcpy(instance._config, &config, sizeof(LimeConfig_t))
|
||||
|
||||
return instance
|
||||
|
|
Loading…
Reference in a new issue