I have just added the raw beginnings of a Java client library and
trivially-simple Swing GUI demo under scripts/java/demo/FGClient/.
Here's the Java code to connect to a FlightGear process and increase
the current altitude by 1000 feet:

  FGConnection fgfs = new FGConnection("localhost", 9000);
  double altitude = fgfs.getDouble("/position/altitude-ft");
  fgfs.setDouble("/position/altitude-ft", altitude + 1000);
  fgfs.close();

The demo application displays the current altitude, longitude, and
latitude in a small GUI window, and uses a separate thread to update
the values every second.  To use it, try these commands:

  fgfs --telnet=9000
  java FGFSDemo localhost 9000

I might develop this into a remote instructor's panel, a full
configuration GUI, a remote-control module for weather and other
environment parameters, or any combination of these.  Contributions
are welcome, of course.


All the best,


David

-- 
David Megginson, [EMAIL PROTECTED], http://www.megginson.com/

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to