|
@@ -1,6 +1,7 @@
|
|
package at.acdp.urweb.web;
|
|
package at.acdp.urweb.web;
|
|
|
|
|
|
import at.acdp.urweb.Main;
|
|
import at.acdp.urweb.Main;
|
|
|
|
+import at.acdp.urweb.fhpp.Status;
|
|
import com.nmote.xr.XRMethod;
|
|
import com.nmote.xr.XRMethod;
|
|
|
|
|
|
import java.util.concurrent.ExecutionException;
|
|
import java.util.concurrent.ExecutionException;
|
|
@@ -17,11 +18,31 @@ public class XRServer {
|
|
return "ref";
|
|
return "ref";
|
|
}
|
|
}
|
|
|
|
|
|
- @XRMethod(value = "pos", help = "pos")
|
|
|
|
- public static void pos(String pos) {
|
|
|
|
- //Main.fhm.prepare();
|
|
|
|
- Main.fhm.direktAuftrag(Integer.parseInt(pos),0);
|
|
|
|
- Main.fhm.direktAuftrag(Integer.parseInt(pos),1);
|
|
|
|
|
|
+ @XRMethod(value = "rel", help = "rel")
|
|
|
|
+ public static void rel(String pos) {
|
|
|
|
+ System.out.println("rel: "+pos);
|
|
|
|
+ waitMC(true);
|
|
|
|
+ Main.fhm.direktAuftrag(Integer.parseInt(pos),0,true);
|
|
|
|
+ Main.fhm.direktAuftrag(Integer.parseInt(pos),1,true);
|
|
|
|
+ waitMC(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @XRMethod(value = "abs", help = "abs")
|
|
|
|
+ public static void abs(String pos) {
|
|
|
|
+ System.out.println("abs: "+pos);
|
|
|
|
+ waitMC(true);
|
|
|
|
+ Main.fhm.direktAuftrag(Integer.parseInt(pos),0, false);
|
|
|
|
+ Main.fhm.direktAuftrag(Integer.parseInt(pos),1, false);
|
|
|
|
+ waitMC(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static void waitMC(boolean what) {
|
|
|
|
+ while(true) {
|
|
|
|
+ Status s=Main.fhm.readStatus().join();
|
|
|
|
+ System.out.println(s.mc);
|
|
|
|
+ if(s.mc==what) break;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@XRMethod(value = "status", help = "Returns status")
|
|
@XRMethod(value = "status", help = "Returns status")
|