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
bool isValid(std::vector< std::string > &errorMessages)
Check if the SlaveIdentifierConfig is complete and valid.
ConfigTag
The ConfigTag is used when setting a config value.
Definition Config.h:62