55 vector<shared_int>
data(32, 0);
58 this->
init(0, 0, data);
66 std::size_t size = data.size();
70 for (
auto &x : this->
data_)
86 for (
int i = 0; i < 32; i++)
88 this->
data_[i] = data[i];
94 bool rslt = this->
fun_ == rhs.
fun_ &&
103 LOG_COMM(
"Executing SetIO command load");
105 if (!buffer->
load(this->fun_))
111 if (!buffer->
load(this->address_))
113 LOG_ERROR(
"Failed to load SetIO address");
117 if (!buffer->
load(this->data_size_))
119 LOG_ERROR(
"Failed to load SetIO data size");
123 for (
auto x : this->
data_)
125 if (!buffer->
load(x))
132 LOG_COMM(
"SetIO data successfully loaded");
138 LOG_COMM(
"Executing SetIO command unload");
140 for (
auto &x : this->
data_)
144 LOG_ERROR(
"Failed to unload SetIO data");
149 if (!buffer->
unload(this->data_size_))
151 LOG_ERROR(
"Failed to unload SetIO data size");
155 if (!buffer->
unload(this->address_))
157 LOG_ERROR(
"Failed to unload SetIO address");
161 if (!buffer->
unload(this->fun_))
167 LOG_COMM(
"SetIO data successfully unloaded");
industrial::shared_types::shared_int * getData()
Returns the value of the IO element.
void init()
Initializes a empty write single io command.
void setDataSize(industrial::shared_types::shared_int data_size)
Sets value.
#define LOG_COMM(format,...)
bool load(industrial::shared_types::shared_bool value)
#define LOG_ERROR(format,...)
industrial::shared_types::shared_int address_
Address of IO element.
void setAddress(industrial::shared_types::shared_int address)
Sets address.
industrial::shared_types::shared_int getAddress()
Returns the address of the IO element.
SetIO(void)
Default constructor.
bool load(industrial::byte_array::ByteArray *buffer)
void setFun(industrial::shared_types::shared_int fun)
Sets value.
void copyFrom(SetIO &src)
Copies the passed in value.
industrial::shared_types::shared_int getFun()
Returns the value of the IO element.
industrial::shared_types::shared_int fun_
Value of IO element.
bool unload(industrial::byte_array::ByteArray *buffer)
industrial::shared_types::shared_int getDataSize()
Returns the value of the IO element.
Class encapsulated write single io data. FSRobo-R specific interface to set IO element on the control...
bool operator==(SetIO &rhs)
== operator implementation
bool unload(industrial::shared_types::shared_bool &value)
industrial::shared_types::shared_int data_[32]