Skip to content

Commit aad8699

Browse files
committed
Fixed issue following errcheck move
1 parent a35871e commit aad8699

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

spectro.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,13 @@ def __del__(self):
168168
logger_ASH.debug("Closing communications...")
169169

170170
self._done()
171-
171+
172172
def _init(self, mode):
173173
"""
174174
Inits avaspec and defines argtypes used by avaspec.AVS_Init as advised
175175
by ctypes manual.
176176
"""
177177

178-
# if avaspec.AVS_Init.argtypes is None:
179-
# logger_ASH.debug("Defining AVS_Init function information...")
180-
#
181-
# avaspec.AVS_Init.argtypes = [ctypes.c_short]
182-
# avaspec.AVS_Init.restype = ctypes.c_int
183-
# avaspec.AVS_Init.errcheck = self._check_error
184-
185178
logger_ASH.debug("Calling AVS_Init.")
186179
return avaspec.AVS_Init(mode)
187180

@@ -190,13 +183,6 @@ def _done(self):
190183
Same as self._init.
191184
"""
192185

193-
# if avaspec.AVS_Done.argtypes is None:
194-
# logger_ASH.debug("Defining AVS_Done function information...")
195-
#
196-
# avaspec.AVS_Done.argtypes = []
197-
# avaspec.AVS_Done.restype = ctypes.c_int
198-
# avaspec.AVS_Done.errcheck = self._check_error
199-
200186
logger_ASH.debug("Calling AVS_Done.")
201187
return avaspec.AVS_Done()
202188

@@ -224,15 +210,12 @@ def _getDeviceList(self):
224210
print(ReqSize)
225211
AvsDevList = (avaspec.AvsIdentityType * nrDev)()
226212

227-
avaspec.AVS_GetList.errcheck = self._check_error # Init errcheck
228-
229213
# Get the list, further information in AvaSpec DLL manual.
230214
nrDev = avaspec.AVS_GetList(ReqSize,
231215
ReqSize,
232216
AvsDevList)
233217

234218
# Init data types about AVS_Activate.
235-
avaspec.AVS_Activate.errcheck = self._check_error
236219
avaspec.AVS_Activate.restype = ctypes.c_uint
237220

238221
devDict = dict([])
@@ -360,8 +343,6 @@ def prepareMeasure(self, device, intTime=10, triggerred=False,
360343
Meas.m_Control_m_LaserWaveLength = 0.0
361344
Meas.m_Control_m_StoreToRam = 0
362345

363-
# avaspec_AVS_PrepareMeasure.errcheck = self._check_error
364-
365346
avaspec.AVS_PrepareMeasure(device, Meas)
366347

367348
def startMeasure(self, device, nmsr):
@@ -385,7 +366,6 @@ def startMeasure(self, device, nmsr):
385366
calback_event.wait(0)
386367
)
387368
)
388-
# avaspec.AVS_MeasureCallback.errcheck = self._check_error
389369
avaspec.AVS_MeasureCallback(device, calback_event.c_callback, nmsr)
390370

391371
def waitMeasurmentReady(self, device):
@@ -513,9 +493,6 @@ def getParameters(self, device):
513493
Device_Config = avaspec.DeviceConfigType()
514494
ReqSize = ctypes.c_uint(ctypes.sizeof(Device_Config))
515495

516-
# Prepare function errcheck
517-
avaspec.AVS_GetParameter.errcheck = self._check_error
518-
519496
# Get config
520497
avaspec.AVS_GetParameter(
521498
device,

0 commit comments

Comments
 (0)