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

Begin with Location tree.

parent cfc44531
No related branches found
No related tags found
2 merge requests!4Dev,!2Learner url load
Pipeline #3555 passed
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