Skip to content
Snippets Groups Projects
Commit 66441f7e authored by René Schöne's avatar René Schöne
Browse files

Remove Link nonterminal, merged into Channel.

- Fixed openhab importer test
parent 8e98b9ea
No related branches found
No related tags found
No related merge requests found
...@@ -116,10 +116,6 @@ aspect Navigation { ...@@ -116,10 +116,6 @@ aspect Navigation {
return java.util.Optional.empty(); return java.util.Optional.empty();
} }
//--- containingChannel ---
inh Channel Link.containingChannel();
eq Channel.getLink().containingChannel() = this;
//--- containingThing --- //--- containingThing ---
inh Thing Channel.containingThing(); inh Thing Channel.containingThing();
eq Thing.getChannel().containingThing() = this; eq Thing.getChannel().containingThing() = this;
......
...@@ -160,7 +160,7 @@ aspect Printing { ...@@ -160,7 +160,7 @@ aspect Printing {
return new MemberPrinter("Channel") return new MemberPrinter("Channel")
.addRequired("id", getID()) .addRequired("id", getID())
.addRequired("type", getType(), ChannelType::getID) .addRequired("type", getType(), ChannelType::getID)
.addIds("links", getNumLink(), getLinkList(), Link::getItem) .addIds("links", getLinkedItems())
.build(); .build();
} }
......
...@@ -16,10 +16,9 @@ abstract ChannelCategory ; ...@@ -16,10 +16,9 @@ abstract ChannelCategory ;
DefaultChannelCategory : ChannelCategory ::= <Value:DefaultChannelCategoryValue> ; DefaultChannelCategory : ChannelCategory ::= <Value:DefaultChannelCategoryValue> ;
SimpleChannelCategory : ChannelCategory ::= <Value:String> ; SimpleChannelCategory : ChannelCategory ::= <Value:String> ;
Channel : ModelElement ::= Link* ; Channel : ModelElement ::= ;
rel Channel.Type -> ChannelType ; rel Channel.Type -> ChannelType ;
rel Channel.LinkedItem* <-> Item.Channel? ;
Link ::= <Item:Item> ;
Parameter : DescribableModelElement ::= <Type:ParameterValueType> [DefaultValue:ParameterDefaultValue] <Context:String> <Required:boolean> ; Parameter : DescribableModelElement ::= <Type:ParameterValueType> [DefaultValue:ParameterDefaultValue] <Context:String> <Required:boolean> ;
ParameterDefaultValue ::= <Value:String> ; ParameterDefaultValue ::= <Value:String> ;
......
...@@ -311,10 +311,8 @@ public class OpenHab2Importer { ...@@ -311,10 +311,8 @@ public class OpenHab2Importer {
private void update(Root model, LinkData[] linkList) { private void update(Root model, LinkData[] linkList) {
for (LinkData linkData : linkList) { for (LinkData linkData : linkList) {
Link link = new Link();
ifPresent(model.resolveChannel(linkData.channelUID), "Channel", linkData, ifPresent(model.resolveChannel(linkData.channelUID), "Channel", linkData,
channel -> channel.addLink(link)); channel -> ifPresent(model.resolveItem(linkData.itemName), "Item", linkData, channel::addLinkedItem));
ifPresent(model.resolveItem(linkData.itemName), "Item", linkData, link::setItem);
} }
} }
......
...@@ -73,7 +73,7 @@ public class EraserParserHelper { ...@@ -73,7 +73,7 @@ public class EraserParserHelper {
this.root.getMqttRoot().ensureCorrectPrefixes(); this.root.getMqttRoot().ensureCorrectPrefixes();
resolveList(channelMap, missingChannelListMap, Thing::addChannel); resolveList(channelMap, missingChannelListMap, Thing::addChannel);
resolveList(itemMap, missingItemLinkListMap, (channel, item) -> channel.addLink(new Link(item))); resolveList(itemMap, missingItemLinkListMap, Channel::addLinkedItem);
resolveList(groupMap, missingSubGroupListMap, Group::addGroup); resolveList(groupMap, missingSubGroupListMap, Group::addGroup);
resolveList(itemMap, missingItemListMap, this::addItemToGroup); resolveList(itemMap, missingItemListMap, this::addItemToGroup);
resolveList(channelTypeMap, missingChannelTypeListMap, ThingType::addChannelType); resolveList(channelTypeMap, missingChannelTypeListMap, ThingType::addChannelType);
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
{ {
"channelUID": "openlicht:polar-m600:342dfc32:rotation-y", "channelUID": "openlicht:polar-m600:342dfc32:rotation-y",
"configuration": {}, "configuration": {},
"itemName": "watch_acceleration_y" "itemName": "watch_rotation_y"
}, },
{ {
"channelUID": "openlicht:polar-m600:342dfc32:rotation-z", "channelUID": "openlicht:polar-m600:342dfc32:rotation-z",
......
...@@ -77,7 +77,7 @@ Channel: id="openlicht:polar-m600:342dfc32:activity" type="openlicht:activity-ty ...@@ -77,7 +77,7 @@ Channel: id="openlicht:polar-m600:342dfc32:activity" type="openlicht:activity-ty
Channel: id="openlicht:polar-m600:342dfc32:brightness" type="openlicht:brightness-type" links=["polar_brightness"] ; Channel: id="openlicht:polar-m600:342dfc32:brightness" type="openlicht:brightness-type" links=["polar_brightness"] ;
Channel: id="openlicht:polar-m600:342dfc32:heart-rate" type="openlicht:heart-rate-type" ; Channel: id="openlicht:polar-m600:342dfc32:heart-rate" type="openlicht:heart-rate-type" ;
Channel: id="openlicht:polar-m600:342dfc32:rotation-x" type="openlicht:rotation-type" links=["watch_rotation_x"] ; Channel: id="openlicht:polar-m600:342dfc32:rotation-x" type="openlicht:rotation-type" links=["watch_rotation_x"] ;
Channel: id="openlicht:polar-m600:342dfc32:rotation-y" type="openlicht:rotation-type" links=["watch_acceleration_y"] ; Channel: id="openlicht:polar-m600:342dfc32:rotation-y" type="openlicht:rotation-type" links=["watch_rotation_y"] ;
Channel: id="openlicht:polar-m600:342dfc32:rotation-z" type="openlicht:rotation-type" links=["watch_rotation_z"] ; Channel: id="openlicht:polar-m600:342dfc32:rotation-z" type="openlicht:rotation-type" links=["watch_rotation_z"] ;
Channel: id="openlicht:polar-m600:342dfc32:steps" type="openlicht:steps-type" ; Channel: id="openlicht:polar-m600:342dfc32:steps" type="openlicht:steps-type" ;
Channel: id="openlicht:samsung-s6:2ca84896:brightness" type="openlicht:brightness-type" links=["samsung_brightness"] ; Channel: id="openlicht:samsung-s6:2ca84896:brightness" type="openlicht:brightness-type" links=["samsung_brightness"] ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment