28 #ifndef FAKEANALOGDEVICE_HPP 29 #define FAKEANALOGDEVICE_HPP 50 FakeAnalogDevice(
unsigned int channels=32,
unsigned int bin_range=4096,
double lowest = -5.0,
double highest = +5.0)
54 mchannels( new int[channels] ),
55 mbin_range( bin_range),
74 virtual int read(
unsigned int chan,
double& value )
76 if (chan < nbofchans) {
77 value = mchannels[chan] / resolution(chan) + mlowest;
83 virtual int write(
unsigned int chan,
double value ) {
84 if (chan < nbofchans) {
85 mchannels[chan] = (
unsigned int)((value - mlowest) * resolution(chan));
91 virtual int rawRead(
unsigned int chan,
int & value )
93 if (chan < nbofchans) {
94 value = mchannels[chan];
100 virtual int rawWrite(
unsigned int chan,
int value ) {
101 if (chan < nbofchans)
102 mchannels[chan] = value;
112 virtual double lowest(
unsigned int )
const 124 return mbin_range/(mhighest-mlowest);
virtual double lowest(unsigned int) const
virtual int read(unsigned int chan, double &value)
virtual unsigned int nbOfChannels() const
virtual double resolution(unsigned int) const
virtual int rawRead(unsigned int chan, int &value)
FakeAnalogDevice(unsigned int channels=32, unsigned int bin_range=4096, double lowest=-5.0, double highest=+5.0)
virtual void rangeSet(unsigned int, unsigned int)
virtual double highest(unsigned int) const
virtual int write(unsigned int chan, double value)
virtual int rawWrite(unsigned int chan, int value)
virtual void arefSet(unsigned int, unsigned int)
virtual unsigned int rawRange() const
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.