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