Constantin Ziesche | 02817f1 | 2020-08-04 21:40:43 +0200 | [diff] [blame^] | 1 | |
| 2 | #include <BaSyx/submodel/map_v2/dataspecification/DataSpecificationPhysicalUnit.h> |
| 3 | |
| 4 | namespace basyx { |
| 5 | namespace submodel { |
| 6 | namespace map { |
| 7 | |
| 8 | constexpr char DataSpecificationPhysicalUnitPath::UnitName[]; |
| 9 | constexpr char DataSpecificationPhysicalUnitPath::UnitSymbol[]; |
| 10 | constexpr char DataSpecificationPhysicalUnitPath::Definition[]; |
| 11 | constexpr char DataSpecificationPhysicalUnitPath::SiNotation[]; |
| 12 | constexpr char DataSpecificationPhysicalUnitPath::SiName[]; |
| 13 | constexpr char DataSpecificationPhysicalUnitPath::DinNotation[]; |
| 14 | constexpr char DataSpecificationPhysicalUnitPath::EceName[]; |
| 15 | constexpr char DataSpecificationPhysicalUnitPath::EceCode[]; |
| 16 | constexpr char DataSpecificationPhysicalUnitPath::NistName[]; |
| 17 | constexpr char DataSpecificationPhysicalUnitPath::SourceOfDefinition[]; |
| 18 | constexpr char DataSpecificationPhysicalUnitPath::ConversionFactor[]; |
| 19 | constexpr char DataSpecificationPhysicalUnitPath::RegistrationAuthorityId[]; |
| 20 | constexpr char DataSpecificationPhysicalUnitPath::Supplier[]; |
| 21 | |
| 22 | map::DataSpecificationPhysicalUnit::DataSpecificationPhysicalUnit(const std::string &unitName, |
| 23 | const std::string &unitSymbol, |
| 24 | const api::ILangStringSet &definition) |
| 25 | : vab::ElementMap{} |
| 26 | { |
| 27 | this->map.insertKey(DataSpecificationPhysicalUnitPath::UnitName, unitName); |
| 28 | this->map.insertKey(DataSpecificationPhysicalUnitPath::UnitSymbol, unitSymbol); |
| 29 | this->definition = LangStringSet(definition); |
| 30 | this->map.insertKey(DataSpecificationPhysicalUnitPath::Definition, this->definition.getMap()); |
| 31 | } |
| 32 | |
| 33 | const std::string &DataSpecificationPhysicalUnit::getUnitName() const |
| 34 | { |
| 35 | return this->map.getProperty(DataSpecificationPhysicalUnitPath::UnitName).GetStringContent(); |
| 36 | } |
| 37 | |
| 38 | void DataSpecificationPhysicalUnit::setUnitName(const std::string &unitName) |
| 39 | { |
| 40 | this->map.insertKey(DataSpecificationPhysicalUnitPath::UnitName, unitName); |
| 41 | } |
| 42 | |
| 43 | const std::string &DataSpecificationPhysicalUnit::getUnitSymbol() const |
| 44 | { |
| 45 | return this->map.getProperty(DataSpecificationPhysicalUnitPath::UnitSymbol).GetStringContent(); |
| 46 | } |
| 47 | |
| 48 | void DataSpecificationPhysicalUnit::setUnitSymbol(const std::string &unitSymbol) |
| 49 | { |
| 50 | this->map.insertKey(DataSpecificationPhysicalUnitPath::UnitSymbol, unitSymbol); |
| 51 | } |
| 52 | |
| 53 | LangStringSet & DataSpecificationPhysicalUnit::getDefinition() |
| 54 | { |
| 55 | return this->definition; |
| 56 | } |
| 57 | |
| 58 | void DataSpecificationPhysicalUnit::setDefinition(const api::ILangStringSet &definition) |
| 59 | { |
| 60 | this->definition = LangStringSet(definition); |
| 61 | this->map.insertKey(DataSpecificationPhysicalUnitPath::Definition, this->definition.getMap()); |
| 62 | } |
| 63 | |
| 64 | const std::string * DataSpecificationPhysicalUnit::getSiNotation() const |
| 65 | { |
| 66 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::SiNotation) ) |
| 67 | return nullptr; |
| 68 | |
| 69 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::SiNotation).GetStringContent(); |
| 70 | } |
| 71 | |
| 72 | void DataSpecificationPhysicalUnit::setSiNotation(const std::string &siNotation) |
| 73 | { |
| 74 | this->map.insertKey(DataSpecificationPhysicalUnitPath::SiNotation, siNotation); |
| 75 | } |
| 76 | |
| 77 | const std::string * DataSpecificationPhysicalUnit::getSiName() const |
| 78 | { |
| 79 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::SiName) ) |
| 80 | return nullptr; |
| 81 | |
| 82 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::SiName).GetStringContent(); |
| 83 | } |
| 84 | |
| 85 | void DataSpecificationPhysicalUnit::setSiName(const std::string &siName) |
| 86 | { |
| 87 | this->map.insertKey(DataSpecificationPhysicalUnitPath::SiName, siName); |
| 88 | } |
| 89 | |
| 90 | const std::string * DataSpecificationPhysicalUnit::getDinNotation() const |
| 91 | { |
| 92 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::DinNotation) ) |
| 93 | return nullptr; |
| 94 | |
| 95 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::DinNotation).GetStringContent(); |
| 96 | } |
| 97 | |
| 98 | void DataSpecificationPhysicalUnit::setDinNotation(const std::string &dinNotation) |
| 99 | { |
| 100 | this->map.insertKey(DataSpecificationPhysicalUnitPath::DinNotation, dinNotation); |
| 101 | } |
| 102 | |
| 103 | const std::string * DataSpecificationPhysicalUnit::getEceName() const |
| 104 | { |
| 105 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::EceName) ) |
| 106 | return nullptr; |
| 107 | |
| 108 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::EceName).GetStringContent(); |
| 109 | } |
| 110 | |
| 111 | void DataSpecificationPhysicalUnit::setEceName(const std::string &eceName) |
| 112 | { |
| 113 | this->map.insertKey(DataSpecificationPhysicalUnitPath::EceName, eceName); |
| 114 | } |
| 115 | |
| 116 | const std::string * DataSpecificationPhysicalUnit::getEceCode() const |
| 117 | { |
| 118 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::EceCode) ) |
| 119 | return nullptr; |
| 120 | |
| 121 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::EceCode).GetStringContent(); |
| 122 | } |
| 123 | |
| 124 | void DataSpecificationPhysicalUnit::setEceCode(const std::string &eceCode) |
| 125 | { |
| 126 | this->map.insertKey(DataSpecificationPhysicalUnitPath::EceCode, eceCode); |
| 127 | } |
| 128 | |
| 129 | const std::string * DataSpecificationPhysicalUnit::getNistName() const |
| 130 | { |
| 131 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::NistName) ) |
| 132 | return nullptr; |
| 133 | |
| 134 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::NistName).GetStringContent(); |
| 135 | } |
| 136 | |
| 137 | void DataSpecificationPhysicalUnit::setNistName(const std::string &nistName) |
| 138 | { |
| 139 | this->map.insertKey(DataSpecificationPhysicalUnitPath::NistName, nistName); |
| 140 | } |
| 141 | |
| 142 | const std::string * DataSpecificationPhysicalUnit::getSourceOfDefinition() const |
| 143 | { |
| 144 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::SourceOfDefinition) ) |
| 145 | return nullptr; |
| 146 | |
| 147 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::SourceOfDefinition).GetStringContent(); |
| 148 | } |
| 149 | |
| 150 | void DataSpecificationPhysicalUnit::setSourceOfDefinition(const std::string &sourceOfDefinition) |
| 151 | { |
| 152 | this->map.insertKey(DataSpecificationPhysicalUnitPath::SourceOfDefinition, sourceOfDefinition); |
| 153 | } |
| 154 | |
| 155 | const std::string * DataSpecificationPhysicalUnit::getConversionFactor() const |
| 156 | { |
| 157 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::ConversionFactor) ) |
| 158 | return nullptr; |
| 159 | |
| 160 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::ConversionFactor).GetStringContent(); |
| 161 | } |
| 162 | |
| 163 | void DataSpecificationPhysicalUnit::setConversionFactor(const std::string &conversionFactor) |
| 164 | { |
| 165 | this->map.insertKey(DataSpecificationPhysicalUnitPath::ConversionFactor, conversionFactor); |
| 166 | } |
| 167 | |
| 168 | const std::string * DataSpecificationPhysicalUnit::getRegistrationAuthorityId() const |
| 169 | { |
| 170 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::RegistrationAuthorityId) ) |
| 171 | return nullptr; |
| 172 | |
| 173 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::RegistrationAuthorityId).GetStringContent(); |
| 174 | } |
| 175 | |
| 176 | void DataSpecificationPhysicalUnit::setRegistrationAuthorityId(const std::string ®istrationAuthorityId) |
| 177 | { |
| 178 | this->map.insertKey(DataSpecificationPhysicalUnitPath::RegistrationAuthorityId, registrationAuthorityId); |
| 179 | } |
| 180 | |
| 181 | const std::string * DataSpecificationPhysicalUnit::getSupplier() const |
| 182 | { |
| 183 | if ( not this->map.hasProperty(DataSpecificationPhysicalUnitPath::Supplier) ) |
| 184 | return nullptr; |
| 185 | |
| 186 | return &this->map.getProperty(DataSpecificationPhysicalUnitPath::Supplier).GetStringContent(); |
| 187 | } |
| 188 | |
| 189 | void DataSpecificationPhysicalUnit::setSupplier(const std::string &supplier) |
| 190 | { |
| 191 | this->map.insertKey(DataSpecificationPhysicalUnitPath::Supplier, supplier); |
| 192 | } |
| 193 | |
| 194 | } |
| 195 | } |
| 196 | } |