execute_program.cpp
Go to the documentation of this file.
1 /*********************************************************************
2 * FSRobo-R Package BSDL
3 * ---------
4 * Copyright (C) 2019 FUJISOFT. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation and/or
12 * other materials provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors
14 * may be used to endorse or promote products derived from this software without
15 * specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *********************************************************************/
28 
32 #include <vector>
33 #include <iostream>
34 
36 using std::vector;
37 
38 namespace fsrobo_r_driver
39 {
40 namespace simple_message
41 {
42 namespace execute_program
43 {
44 
46 { this->init(); } ExecuteProgram::~ExecuteProgram(void) { } void ExecuteProgram::init() { this->name_.init();
47  this->param_.init();
48 }
49 
51 {
52  this->setName(name);
53  this->setParam(param);
54 }
55 
57 {
58  src.getName(this->name_);
59  src.getParam(this->param_);
60 }
61 
63 {
64  bool rslt = this->name_ == rhs.name_ && this->param_ == rhs.param_;
65 
66  return rslt;
67 }
68 
70 {
71  LOG_COMM("Executing ExecuteProgram command load");
72 
73  if (!this->name_.load(buffer))
74  {
75  LOG_ERROR("Failed to load ExecuteProgram name");
76  return false;
77  }
78 
79  if (!this->param_.load(buffer))
80  {
81  LOG_ERROR("Failed to load ExecuteProgram param");
82  return false;
83  }
84 
85 
86  LOG_COMM("ExecuteProgram data successfully loaded");
87  return true;
88 }
89 
91 {
92  LOG_COMM("Executing ExecuteProgram command unload");
93 
94  if (!this->param_.unload(buffer))
95  {
96  LOG_ERROR("Failed to unload ExecuteProgram param");
97  return false;
98  }
99 
100  if (!this->name_.unload(buffer))
101  {
102  LOG_ERROR("Failed to unload ExecuteProgram name");
103  return false;
104  }
105 
106  LOG_COMM("ExecuteProgram data successfully unloaded");
107  return true;
108 }
109 
110 }
111 }
112 }
void init()
Initializes a empty execute program command.
void copyFrom(ExecuteProgram &src)
Copies the passed in value.
bool unload(industrial::byte_array::ByteArray *buffer)
bool operator==(ExecuteProgram &rhs)
== operator implementation
#define LOG_COMM(format,...)
#define LOG_ERROR(format,...)
void init()
Initializes a empty motion control reply.
bool load(industrial::byte_array::ByteArray *buffer)
Class encapsulated set io reply data. These messages are sent by the FSRobo-R controller in response ...
Definition: simple_string.h:61
bool load(industrial::byte_array::ByteArray *buffer)
void getName(SimpleString &dest)
Returns a copy of the name data.
Class encapsulated write single io data. FSRobo-R specific interface to set IO element on the control...
bool unload(industrial::byte_array::ByteArray *buffer)
void getParam(SimpleString &dest)
Returns a copy of the name data.


fsrobo_r_driver
Author(s): F-ROSROBO
autogenerated on Sun Feb 9 2020 03:58:29