Groups > Borland > Delphi Object Oriented design > Re: Input signal type




Input signal type

Input signal type
Mon, 06 Aug 2007 23:32:26 +020
Hi,

Background: I have to deal with a large number of hardware devices -
data acquisition modules/boards - they all were designed for the
same purpose (i.e. to acquire data from external transducers), they
also have somewhat similar feature set, but each of them exposes a
different APIs. I have already created a base adapter class that
describes the behavior of a "generic" data acquisition module/device
and wrote concrete adapter classes, one per device. So far, so good.

These devices are usually capable of handling multiple input signal
types/ranges (e.g. ± 20mA, ± 5V, 4~20mA, etc.) - which ones and how
many of them are supported is device specific information. Now each
device introduces a certain number of analog input channels. Each
analog input channel has to be assigned one and only one input signal
type out of all available input signal types for given device.

The problem is that some devices allow selection of input signal type
on a per channel basis (i.e. you can have 2 or more channels with
different selected input signal types), whereas other devices allow
selection of input signal type only globally for all channels at once
(i.e. all channels must have the same selected input signal type).

My current design is that the base adapter class has an array property
named InputSignalTypes (it gets populated by a concrete adapter class)
and also SelectedInputSignalTypeIndex property that holds index of
selected input signal type for all channels in the device (lowest
common denominator).

I need to extend current design to be able to allow selection of input
signal type on a per channel basis, but only for devices that supports
this feature. Any suggestions are welcome.


-- 
Post Reply
Re: Input signal type
Tue, 07 Aug 2007 00:03:58 +020
> I need to extend current design to be able to allow selection of input
> signal type on a per channel basis, but only for devices that supports
> this feature. Any suggestions are welcome.

in a similar scenario I have an interface like ISignalTypeSelector
then you can implement this interface in the device or in the channel
when selecting the signal type you can check if Supports(obj,
ISignalTypeSelector, sts) then ..
Post Reply
about | contact