Merge branch 'example-improvements' into develop

Resolves #36
This commit is contained in:
Jason Watkins
2015-05-01 14:28:49 -07:00
3 changed files with 13 additions and 2 deletions

View File

@@ -23,6 +23,13 @@ int main()
// Open Socket
const char* IP = "127.0.0.1"; //IP Address of computer running X-Plane
XPCSocket sock = openUDP(IP);
float tVal[1];
int tSize;
if (getDREF(sock, "sim/test/test_float", tVal, &tSize) < 0)
{
printf("Error establishing connecting. Unable to read data from X-Plane.");
return EXIT_FAILURE;
}
// Set Location/Orientation (sendPOSI)
// Set Up Position Array

View File

@@ -21,8 +21,8 @@ public class Main
System.out.println("Setting up simulation...");
try(XPlaneConnect xpc = new XPlaneConnect())
{
System.out.println("Setting inbound port");
xpc.setCONN(49055);
// Ensure connection established.
xpc.getDREF("sim/test/test_float");
System.out.println("Setting player aircraft position");
float[] posi = new float[] {37.524F, -122.06899F, 2500, 0, 0, 0, 1};

View File

@@ -11,6 +11,10 @@ import XPlaneConnect.*
disp('xplaneconnect Example Script-');
disp('Setting up Simulation');
Socket = openUDP(49005);
%% Ensure connected
getDREFs('sim/test/test_float')
%% Set position of the player aircraft
disp('Setting position');
pauseSim(1);