blob: 0294cd0c8046b426483ca4f9f5b9cff70b803df5 [file] [log] [blame]
Constantin Ziesche02817f12020-08-04 21:40:43 +02001
2#include <BaSyx/submodel/map_v2/dataspecification/DataSpecificationPhysicalUnit.h>
3
4namespace basyx {
5namespace submodel {
6namespace map {
7
8constexpr char DataSpecificationPhysicalUnitPath::UnitName[];
9constexpr char DataSpecificationPhysicalUnitPath::UnitSymbol[];
10constexpr char DataSpecificationPhysicalUnitPath::Definition[];
11constexpr char DataSpecificationPhysicalUnitPath::SiNotation[];
12constexpr char DataSpecificationPhysicalUnitPath::SiName[];
13constexpr char DataSpecificationPhysicalUnitPath::DinNotation[];
14constexpr char DataSpecificationPhysicalUnitPath::EceName[];
15constexpr char DataSpecificationPhysicalUnitPath::EceCode[];
16constexpr char DataSpecificationPhysicalUnitPath::NistName[];
17constexpr char DataSpecificationPhysicalUnitPath::SourceOfDefinition[];
18constexpr char DataSpecificationPhysicalUnitPath::ConversionFactor[];
19constexpr char DataSpecificationPhysicalUnitPath::RegistrationAuthorityId[];
20constexpr char DataSpecificationPhysicalUnitPath::Supplier[];
21
22map::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
33const std::string &DataSpecificationPhysicalUnit::getUnitName() const
34{
35 return this->map.getProperty(DataSpecificationPhysicalUnitPath::UnitName).GetStringContent();
36}
37
38void DataSpecificationPhysicalUnit::setUnitName(const std::string &unitName)
39{
40 this->map.insertKey(DataSpecificationPhysicalUnitPath::UnitName, unitName);
41}
42
43const std::string &DataSpecificationPhysicalUnit::getUnitSymbol() const
44{
45 return this->map.getProperty(DataSpecificationPhysicalUnitPath::UnitSymbol).GetStringContent();
46}
47
48void DataSpecificationPhysicalUnit::setUnitSymbol(const std::string &unitSymbol)
49{
50 this->map.insertKey(DataSpecificationPhysicalUnitPath::UnitSymbol, unitSymbol);
51}
52
53LangStringSet & DataSpecificationPhysicalUnit::getDefinition()
54{
55 return this->definition;
56}
57
58void DataSpecificationPhysicalUnit::setDefinition(const api::ILangStringSet &definition)
59{
60 this->definition = LangStringSet(definition);
61 this->map.insertKey(DataSpecificationPhysicalUnitPath::Definition, this->definition.getMap());
62}
63
64const 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
72void DataSpecificationPhysicalUnit::setSiNotation(const std::string &siNotation)
73{
74 this->map.insertKey(DataSpecificationPhysicalUnitPath::SiNotation, siNotation);
75}
76
77const 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
85void DataSpecificationPhysicalUnit::setSiName(const std::string &siName)
86{
87 this->map.insertKey(DataSpecificationPhysicalUnitPath::SiName, siName);
88}
89
90const 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
98void DataSpecificationPhysicalUnit::setDinNotation(const std::string &dinNotation)
99{
100 this->map.insertKey(DataSpecificationPhysicalUnitPath::DinNotation, dinNotation);
101}
102
103const 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
111void DataSpecificationPhysicalUnit::setEceName(const std::string &eceName)
112{
113 this->map.insertKey(DataSpecificationPhysicalUnitPath::EceName, eceName);
114}
115
116const 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
124void DataSpecificationPhysicalUnit::setEceCode(const std::string &eceCode)
125{
126 this->map.insertKey(DataSpecificationPhysicalUnitPath::EceCode, eceCode);
127}
128
129const 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
137void DataSpecificationPhysicalUnit::setNistName(const std::string &nistName)
138{
139 this->map.insertKey(DataSpecificationPhysicalUnitPath::NistName, nistName);
140}
141
142const 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
150void DataSpecificationPhysicalUnit::setSourceOfDefinition(const std::string &sourceOfDefinition)
151{
152 this->map.insertKey(DataSpecificationPhysicalUnitPath::SourceOfDefinition, sourceOfDefinition);
153}
154
155const 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
163void DataSpecificationPhysicalUnit::setConversionFactor(const std::string &conversionFactor)
164{
165 this->map.insertKey(DataSpecificationPhysicalUnitPath::ConversionFactor, conversionFactor);
166}
167
168const 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
176void DataSpecificationPhysicalUnit::setRegistrationAuthorityId(const std::string &registrationAuthorityId)
177{
178 this->map.insertKey(DataSpecificationPhysicalUnitPath::RegistrationAuthorityId, registrationAuthorityId);
179}
180
181const 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
189void DataSpecificationPhysicalUnit::setSupplier(const std::string &supplier)
190{
191 this->map.insertKey(DataSpecificationPhysicalUnitPath::Supplier, supplier);
192}
193
194}
195}
196}