Skip to content
Snippets Groups Projects
Commit f837e8e7 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Also added getSensors to demo for SMErobot

parent 9d9e1a0a
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,15 @@ public class Statistics extends Parser {
public static void main(String args[]) {
Start ast = parse(args);
// PrettyPrint all OWL instances found in input
System.out.println();
System.out.println("Manipulation and handling devices");
ast.getManipulationDevices(System.out);
System.out.println();
System.out.println("Sensors");
ast.getSensors(System.out);
System.out.println();
}
......
......@@ -7,16 +7,32 @@ aspect Statistics {
getChild(i).getManipulationDevices(pStream);
}
}
public void Thing.getManipulationDevices(PrintStream pStream) {
for (int i=0; i<getNumElement(); i++) {
getElement(i).getManipulationDevices(pStream);
}
}
public void ManipulationAndHandling.getManipulationDevices(PrintStream pStream) {
pStream.println(getOwlIdentifier().getIDENTIFIER()+
pStream.println(" "+getOwlIdentifier().getIDENTIFIER()+
" : "+getAttribute(0).getValue().getSTRING_LITERAL());
super.getManipulationDevices(pStream);
}
public void ASTNode.getSensors(PrintStream pStream) {
for (int i=0; i<getNumChild(); i++) {
getChild(i).getSensors(pStream);
}
}
public void Thing.getSensors(PrintStream pStream) {
for (int i=0; i<getNumElement(); i++) {
getElement(i).getSensors(pStream);
}
}
public void Sensor.getSensors(PrintStream pStream) {
pStream.println(" "+getOwlIdentifier().getIDENTIFIER()+
" : "+getAttribute(0).getValue().getSTRING_LITERAL());
super.getSensors(pStream);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment