Skip to content

Commit

Permalink
Removed redundant code as Real, Double, and Float are all transformed…
Browse files Browse the repository at this point in the history
… to Double in OPC UA
  • Loading branch information
thomasfruehwirth committed Dec 2, 2020
1 parent 1ccf727 commit 6b68a43
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions QvtoTransformationRules/transforms/ClassDiagram/Classes.qvto
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,7 @@ mapping UML::Property::property2UAVariable(inout parent : OPCUA::UANode) : OPCUA
value := object OPCUA::ValueType1{};
value.oclAsType(EObject).eSet(feature, self.defaultValue.oclAsType(UML::LiteralString).value);
};
} else if (self.type.toString().find("Real") > 0) {
dataType := getIdOrAlias("Double");
if(self.defaultValue <> null) {
var feature := TYPES::DocumentRoot.oclAsType(EClass).getEStructuralFeature("double");
value := object OPCUA::ValueType1{};
value.oclAsType(EObject).eSet(feature, self.defaultValue.oclAsType(UML::LiteralReal).value);
};
} else if (self.type.toString().find("Double") > 0) {
dataType := getIdOrAlias("Double");
if(self.defaultValue <> null) {
var feature := TYPES::DocumentRoot.oclAsType(EClass).getEStructuralFeature("double");
value := object OPCUA::ValueType1{};
value.oclAsType(EObject).eSet(feature, self.defaultValue.oclAsType(UML::LiteralReal).value);
};
} else if (self.type.toString().find("Float") > 0) {
} else if (self.type.toString().find("Real") > 0 or self.type.toString().find("Double") > 0 or self.type.toString().find("Float") > 0) {
dataType := getIdOrAlias("Double");
if(self.defaultValue <> null) {
var feature := TYPES::DocumentRoot.oclAsType(EClass).getEStructuralFeature("double");
Expand Down

0 comments on commit 6b68a43

Please sign in to comment.