Closed ragavsathish closed 9 years ago
Yeah, that sounds good. The enumeration should probably go in it's own class (maybe "HekaDeviceType") or be avoided all together using a string instead.
If we're expanding it to support the ITC1600, we might as well include the other available options (ITC16, USB16, ITC18, USB18, ITC00, ITC1600).
function obj = HekaDaqController(deviceType, deviceNumber)
import symphonyui.builtin.daqs.HekaDeviceType;
if nargin < 1
deviceType = HekaDeviceType.USB18;
end
if nargin < 2
deviceNumber = 0;
end
NET.addAssembly(which('HekaDAQInterface.dll'));
NET.addAssembly(which('HekaNativeInterop.dll'));
switch deviceType
case HekaDeviceType.ITC16
ctype = Heka.NativeInterop.ITCMM.ITC16_ID;
case HekaDeviceType.ITC18
ctype = Heka.NativeInterop.ITCMM.ITC18_ID;
case HekaDeviceType.ITC1600
ctype = Heka.NativeInterop.ITCMM.ITC1600_ID;
case HekaDeviceType.ITC00
ctype = Heka.NativeInterop.ITCMM.ITC00_ID;
case HekaDeviceType.USB16
ctype = Heka.NativeInterop.ITCMM.USB16_ID;
case HekaDeviceType.USB18
ctype = Heka.NativeInterop.ITCMM.USB18_ID;
otherwise
error('Unknown device type');
end
cobj = Heka.HekaDAQController(double(ctype), deviceNumber);
obj@symphonyui.core.DaqController(cobj);'
...
Closed with 8dd7ebcedcb523e1aa7b75e71427b4612d37e41b
Current
HekaDaqController.m
can create only one kind of daq.But I need to create
cobj
based on board (ITC1600_ID or USB18_ID). Is it advisable to modifyHekaDaqController
constructor to take an argument and createcobj
based on it ?Kindly clarify