BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
microscope.cameras._SDK3.dllFunction Class Reference

Public Member Functions

def __init__ (self, name, args=[], argnames=[], lib="ATCORE")
 
def __call__ (self, *args)
 

Public Attributes

 f
 
 fargs
 
 fargnames
 
 name
 
 inp
 
 in_args
 
 out_args
 
 buf_size_arg_pos
 

Detailed Description

Definition at line 168 of file _SDK3.py.

Constructor & Destructor Documentation

◆ __init__()

def microscope.cameras._SDK3.dllFunction.__init__ (   self,
  name,
  args = [],
  argnames = [],
  lib = "ATCORE" 
)

Definition at line 169 of file _SDK3.py.

169 def __init__(self, name, args=[], argnames=[], lib="ATCORE"):
170 self.f = getattr(_stdcall_libraries[lib], name)
171 self.f.restype = c_int
172 self.f.argtypes = [stripMeta(a) for a in args]
173
174 self.fargs = args
175 self.fargnames = argnames
176 self.name = name
177
178 self.inp = [not isinstance(a, OUTPUT) for a in args]
179 self.in_args = [a for a in args if not isinstance(a, OUTPUT)]
180 self.out_args = [a for a in args if isinstance(a, OUTPUT)]
181
182 self.buf_size_arg_pos = -1
183 for i in range(len(self.in_args)):
184 if isinstance(self.in_args[i], _OUTSTRLEN):
185 self.buf_size_arg_pos = i
186
187 ds = name + "\n\nArguments:\n===========\n"
188 for i in range(len(args)):
189 an = ""
190 if i < len(argnames):
191 an = argnames[i]
192 ds += "\t%s\t%s\n" % (args[i], an)
193
194 self.f.__doc__ = ds
195

Member Function Documentation

◆ __call__()

def microscope.cameras._SDK3.dllFunction.__call__ (   self,
args 
)

Definition at line 196 of file _SDK3.py.

196 def __call__(self, *args):
197 ars = []
198 i = 0
199 ret = []
200
201 if len(args) < len(self.in_args):
202 raise TypeError("Not enough arguments passed to %s" % self.name)
203
204 if self.buf_size_arg_pos >= 0:
205 bs = args[self.buf_size_arg_pos]
206 else:
207 bs = 255
208
209 for j in range(len(self.inp)):
210 if self.inp[j]: # an input
211 ars.append(args[i])
212 i += 1
213 else: # an output
214 r, ar = self.fargs[j].getVar(bs)
215 ars.append(ar)
216 ret.append(r)
217 # print r, r._type_
218
219 # print ars
220 res = self.f(*ars)
221 # print res
222
223 if not res == AT_SUCCESS:
224 if res == AT_ERR_TIMEDOUT or res == AT_ERR_NODATA:
225 # handle timeouts as a special case, as we expect to get them
226 raise TimeoutError(self.name, res)
227 else:
228 raise CameraError(self.name, res)
229
230 if len(ret) == 0:
231 return None
232 if len(ret) == 1:
233 return ret[0]
234 else:
235 return ret
236
237

Member Data Documentation

◆ buf_size_arg_pos

microscope.cameras._SDK3.dllFunction.buf_size_arg_pos

Definition at line 182 of file _SDK3.py.

Referenced by microscope.cameras.atmcd.dllFunction.__call__().

◆ f

microscope.cameras._SDK3.dllFunction.f

Definition at line 170 of file _SDK3.py.

Referenced by microscope.cameras.atmcd.dllFunction.__call__().

◆ fargnames

microscope.cameras._SDK3.dllFunction.fargnames

Definition at line 175 of file _SDK3.py.

◆ fargs

microscope.cameras._SDK3.dllFunction.fargs

Definition at line 174 of file _SDK3.py.

Referenced by microscope.cameras.atmcd.dllFunction.__call__().

◆ in_args

microscope.cameras._SDK3.dllFunction.in_args

Definition at line 179 of file _SDK3.py.

◆ inp

microscope.cameras._SDK3.dllFunction.inp

Definition at line 178 of file _SDK3.py.

◆ name

microscope.cameras._SDK3.dllFunction.name

◆ out_args

microscope.cameras._SDK3.dllFunction.out_args

Definition at line 180 of file _SDK3.py.


The documentation for this class was generated from the following file: