SlaveIdentifierConfig.cpp
Go to the documentation of this file.
2 
4 {
5  std::uint32_t
7  {
8  return vendorID;
9  }
10 
11  std::uint32_t
13  {
14  return productCode;
15  }
16 
17  std::uint32_t
19  {
20  return serialNumber;
21  }
22 
23  std::string
25  {
26  return name;
27  }
28 
29  bool
30  SlaveIdentifierConfig::isValid(std::vector<std::string>& errorMessages)
31  {
32  bool isValid = true;
33 
34  if (vendorTag == ConfigTag::Invalid)
35  {
36  isValid = false;
37  errorMessages.push_back("Identifier is missing a VendorID node");
38  }
39  if (productTag == ConfigTag::Invalid)
40  {
41  isValid = false;
42  errorMessages.push_back("Identifier is missing a ProductID node");
43  }
44  if (serialTag == ConfigTag::Invalid)
45  {
46  isValid = false;
47  errorMessages.push_back("Identifier is missing a Serial node");
48  }
49  return isValid;
50  }
51 
52  void
53  SlaveIdentifierConfig::setVendorID(std::uint32_t vendorID, ConfigTag tag)
54  {
55  set(vendorID, tag, this->vendorID, this->vendorTag);
56  }
57 
58  void
59  SlaveIdentifierConfig::setProductCode(std::uint32_t productCode, ConfigTag tag)
60  {
61  set(productCode, tag, this->productCode, this->productTag);
62  }
63 
64  void
65  SlaveIdentifierConfig::setSerialNumber(std::uint32_t serial, ConfigTag tag)
66  {
67  set(serial, tag, this->serialNumber, this->serialTag);
68  }
69 
70  void
71  SlaveIdentifierConfig::setName(std::string name, ConfigTag tag)
72  {
73  set(name, tag, this->name, this->nameTag);
74  }
75 } // namespace armarx::control::hardware_config
armarx::control::hardware_config::SlaveIdentifierConfig::getProductCode
std::uint32_t getProductCode()
Definition: SlaveIdentifierConfig.cpp:12
armarx::control::hardware_config::SlaveIdentifierConfig::getVendorID
std::uint32_t getVendorID()
Definition: SlaveIdentifierConfig.cpp:6
armarx::control::hardware_config
Definition: Config.cpp:3
armarx::control::hardware_config::SlaveIdentifierConfig::getSerialNumber
std::uint32_t getSerialNumber()
Definition: SlaveIdentifierConfig.cpp:18
armarx::VariantType::Invalid
const VariantTypeId Invalid
Definition: Variant.h:914
armarx::control::hardware_config::ConfigTag
ConfigTag
The ConfigTag is used when setting a config value.
Definition: Config.h:61
armarx::control::hardware_config::SlaveIdentifierConfig::isValid
bool isValid(std::vector< std::string > &errorMessages)
Check if the SlaveIdentifierConfig is complete and valid.
Definition: SlaveIdentifierConfig.cpp:30
SlaveIdentifierConfig.h
armarx::control::hardware_config::SlaveIdentifierConfig::getName
std::string getName()
Definition: SlaveIdentifierConfig.cpp:24