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

Begin with Location tree.

parent 66441f7e
No related branches found
No related tags found
No related merge requests found
aspect Location {
syn Optional<Location> Item.myLocation() {
if (this.hasLocation()) {
return Optional.of(this.getLocation());
} else {
return JavaUtils.ifPresentOrElseReturn(linkedThing(),
thing -> thing.hasLocation() ? Optional.of(thing.getLocation()) : Optional.empty(), () -> Optional.empty());
}
}
}
Location ::= <Label:String> SubLocation:Location ;
rel Location.Thing* <-> Thing.Location? ;
rel Location.Item* <-> Item.Location? ;
......@@ -124,6 +124,16 @@ aspect Navigation {
inh NeuralNetworkRoot OutputLayer.containingNeuralNetwork();
eq NeuralNetworkRoot.getOutputLayer().containingNeuralNetwork() = this;
//--- linkedThing ---
syn Optional<Thing> Item.linkedThing() {
if (!this.hasChannel()) {
return Optional.empty();
}
Channel channel = this.getChannel();
Thing thing = channel.containingThing();
return Optional.of(thing);
}
//--- getRoot ---
inh Root ASTNode.getRoot();
eq Root.getChannelCategory().getRoot() = this;
......
// ---------------- Main ------------------------------
Root ::= Thing* Group* ThingType* ChannelType* ChannelCategory* ItemCategory* User* MqttRoot InfluxRoot
MachineLearningRoot Rule* ;
MachineLearningRoot Rule* Location* ;
// ---------------- Users ------------------------------
User : LabelledModelElement ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment