BioImager  4.9.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
microscope.cameras._SDK3.dllFunction Class Reference

Public Member Functions

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

Public Attributes

 f = getattr(_stdcall_libraries[lib], name)
 
 fargs = args
 
 fargnames = argnames
 
 name = name
 
list inp = [not isinstance(a, OUTPUT) for a in args]
 
list in_args = [a for a in args if not isinstance(a, OUTPUT)]
 
list out_args = [a for a in args if isinstance(a, OUTPUT)]
 
int buf_size_arg_pos = -1
 
str buf_size_arg_pos = name + "\n\nArguments:\n===========\n"
 

Detailed Description

Definition at line 168 of file _SDK3.py.

Constructor & Destructor Documentation

◆ __init__()

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__()

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 [1/2]

int microscope.cameras._SDK3.dllFunction.buf_size_arg_pos = -1

Definition at line 182 of file _SDK3.py.

◆ buf_size_arg_pos [2/2]

str microscope.cameras._SDK3.dllFunction.buf_size_arg_pos = name + "\n\nArguments:\n===========\n"

Definition at line 185 of file _SDK3.py.

◆ f

microscope.cameras._SDK3.dllFunction.f = getattr(_stdcall_libraries[lib], name)

Definition at line 170 of file _SDK3.py.

◆ fargnames

microscope.cameras._SDK3.dllFunction.fargnames = argnames

Definition at line 175 of file _SDK3.py.

◆ fargs

microscope.cameras._SDK3.dllFunction.fargs = args

Definition at line 174 of file _SDK3.py.

◆ in_args

microscope.cameras._SDK3.dllFunction.in_args = [a for a in args if not isinstance(a, OUTPUT)]

Definition at line 179 of file _SDK3.py.

◆ inp

microscope.cameras._SDK3.dllFunction.inp = [not isinstance(a, OUTPUT) for a in args]

Definition at line 178 of file _SDK3.py.

◆ name

microscope.cameras._SDK3.dllFunction.name = name

Definition at line 176 of file _SDK3.py.

◆ out_args

list microscope.cameras._SDK3.dllFunction.out_args = [a for a in args if isinstance(a, OUTPUT)]

Definition at line 180 of file _SDK3.py.


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