Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I am currently using the FS2004 FSUIPC SDK for Java to support a client's application. At some point in the future, the client may want to migrate to FSX. The FSX documentation that I have read leads me to believe that lagacy FSUIPC based applications will work with the FSUIPC for FSX. Is this true for the language SDKs as well?

Posted
I am currently using the FS2004 FSUIPC SDK for Java to support a client's application. At some point in the future, the client may want to migrate to FSX. The FSX documentation that I have read leads me to believe that lagacy FSUIPC based applications will work with the FSUIPC for FSX. Is this true for the language SDKs as well?

Yes, the interface is the same.

Regards

Pete

Posted

Using the Java SDK, I have an issue that I can't resolve. Everytime I run the provided test application, the phrase "Hello, world" appears in the FS2004 window. The letters are red and are overlayed on a green bar that stretches the width of the window. I can't find anywhere in the provided code that would cause this to happen. Any ideas?

Posted
Using the Java SDK, I have an issue that I can't resolve. Everytime I run the provided test application, the phrase "Hello, world" appears in the FS2004 window. The letters are red and are overlayed on a green bar that stretches the width of the window. I can't find anywhere in the provided code that would cause this to happen. Any ideas?

That's obtained by sending the string "Hello world" to FSUIPC offset 3380 and then writing a control value to offset 32FA. Please check the SDK documentation.

It sounds like the provided test application is designed to do exactly this, in other words the FS equivalent of the standard Hello World test used for introducing every language!

What did you expect it to do? Is there no source code in the example?

Pete

Posted

Pete,

The test application provided with the SDK connects to FS2004 and then prints out various attributes about the aircraft to stdout. I've done a search for the words "hello world" to and found nothing. I did the search on the test code as well as the Java SDK source both. I also searched on the two offsets you provided in your previous reply, they do not appear either. Is it possible that the "Hello, world" phrase is hidding in the .dll file that is part of the Java SDK? I have provided the code from the test application.

I have been able to make changes to this code, recompile and see the expected results, so I know that the "Hello, world" string is not in the .class file that I am executing.

import com.flightsim.fsuipc.*;

public class Test

{

static void TestADF()

{

System.out.println("Testing ADF");

FSADF adf = new FSADF();

System.out.println("freq " + adf.Freq());

System.out.println("freq as string " + adf.FreqAsString());

System.out.println("ID " +adf.Identity());

System.out.println("Name " + adf.Name());

}

static void TestNav1()

{

System.out.println("TestNav1");

FSNav1 nav = new FSNav1();

System.out.println("freq " + nav.Freq());

System.out.println("freq as string " + nav.FreqAsString());

System.out.println("ID " +nav.Identity());

System.out.println("Name " + nav.Name());

System.out.println("loc " +nav.LocaliserNeedle());

System.out.println("glide " + nav.GlideSlope());

}

static void TestAircraft()

{

System.out.println("TestAircraft");

FSAircraft air = new FSAircraft();

System.out.println("latitude " + air.Latitude());

System.out.println("longtitude " + air.Longitude());

System.out.println("VOR1 lat " + air.VOR1LocLatitude());

System.out.println("VOR1 long " + air.VOR1LocLongitude());

int hi = air.Heading();

System.out.println("heading " + hi);

double h = 360.0*hi/(65536.0*65536.0);

System.out.println("h " + h);

int mi = air.Magnetic();

System.out.println("magnetic " + mi);

double m = 360.0*mi/(65536.0*65536.0);

System.out.println("m " + m);

double p = air.Pitch();

System.out.println("pitch " + p);

double b = air.Bank();

System.out.println("bank " + b);

System.out.println("IAS " + air.IAS());

System.out.println("VS " + air.VerticalSpeed());

System.out.println("alt " + air.Altitude());

System.out.println("locerr " + air.LocaliserError());

System.out.println("loc " + air.Localiser());

System.out.println("engine " + air.NumberOfEngines());

System.out.println("engine type " +air.EngineType());

}

static void TestEngine1()

{

System.out.println("TestEngine1");

FSEngine1 eng = new FSEngine1();

System.out.println("comb " + eng.Combustion());

}

static void TestEngine2()

{

System.out.println("TestEngine2");

FSEngine2 eng = new FSEngine2();

System.out.println("comb " + eng.Combustion());

}

static void TestGear()

{

System.out.println("TestGear");

FSGear gear = new FSGear();

System.out.println("nose" + gear.NoseGearState());

System.out.println("left " + gear.LeftGearState());

System.out.println("right " + gear.RightGearState());

}

static void TestFlightSim()

{

System.out.println("\nTestFlightSim");

FSFlightSim sim = new FSFlightSim();

System.out.println("name " + sim.StartSituationName());

}

public static void main(String s[])

{

System.out.println("Running tests");

int ret = fsuipc_wrapper.Open(fsuipc_wrapper.SIM_ANY);

System.out.println("ret =" + ret);

if(ret == 0 )

{

System.out.println("Flight sim not found");

}

else

{

TestADF();

TestNav1();

TestAircraft();

TestEngine1();

TestEngine2();

TestGear();

TestFlightSim();

}

}

}

Posted

Well, the source code for the Java SDK does contain the "Hello, world" sting. The EngineType method in the FSAircraft class pokes the string into FS. I used the Windoze search to try an locate this string originally. For some reason the Windoze search tool was ignoring all .java files. As soon as I renamed the file from FSAircraft.java to FSAircraft.java.txt, the Windoze search tool found the string. Here is a thread on the subject.

http://forum.java.sun.com/thread.jspa?tID=3935013

THANKS BILL!!!!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.