Added support for VIEW command to Java client.

This commit is contained in:
Jason Watkins
2015-05-08 13:57:16 -07:00
parent 039c92b2f1
commit 255877eee3
3 changed files with 101 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package gov.nasa.xpc.test;
import gov.nasa.xpc.ViewType;
import gov.nasa.xpc.WaypointOp;
import gov.nasa.xpc.XPlaneConnect;
@@ -677,4 +678,24 @@ public class XPlaneConnectTest
fail();
}
}
@Test
public void testSendView() throws IOException
{
String dref = "sim/graphics/view/view_type";
float fwd = 1000;
float chase = 1017;
try(XPlaneConnect xpc = new XPlaneConnect())
{
xpc.sendVIEW(ViewType.Forwards);
float result = xpc.getDREF(dref)[0];
assertEquals(fwd, result, 1e-4);
xpc.sendVIEW(ViewType.Chase);
result = xpc.getDREF(dref)[0];
assertEquals(chase, result, 1e-4);
}
}
}