EZC3D
Channel.cpp
Go to the documentation of this file.
1 #define EZC3D_API_EXPORTS
2 
10 #include "Channel.h"
11 
13 {
14 
15 }
16 
18  _data(channel._data)
19 {
20 
21 }
22 
24 {
25  std::cout << "Analog = " << data() << std::endl;
26 }
27 
28 void ezc3d::DataNS::AnalogsNS::Channel::write(std::fstream &f) const
29 {
30  f.write(reinterpret_cast<const char*>(&_data), ezc3d::DATA_TYPE::FLOAT);
31 }
32 
34 {
35  return _data;
36 }
37 
39 {
40  _data = v;
41 }
42 
44 {
45  if (static_cast<double>(data()) == 0.0)
46  return true;
47  else
48  return false;
49 }
float data() const
Get the value of the analog data.
Definition: Channel.cpp:33
Channel()
Create an empty analogous data channel.
Definition: Channel.cpp:12
void print() const
Print the channel.
Definition: Channel.cpp:23
bool isempty() const
Return if the channel is empty.
Definition: Channel.cpp:43
void write(std::fstream &f) const
Write the channel to an opened file.
Definition: Channel.cpp:28
Channel of an analogous data.
Definition: Channel.h:16
Declaration of Channel class.