We are busy with a project for school. We have to make a Motion simulator together with Flightsimulator. We used FUIPC to get certain information which is very useful for the motion simulator. The Throttle level is where we get stuck. Of course also the possibilty to write a differnt throttle level is something we need. Anyway this is the code we have now but we get a Throttlle Level of Zero.
Hopefully someone can help us
Greetz Rob Loskamp:
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 TestEngine() {
FSEngine1 engine = new FSEngine1();
//FSEngine engine = new FSEngine();
for(int x=0;x<1000000;x++){
System.out.println("Throttlelever " + (engine.ThrottleLever()*100000000));
}
}
static void TestAircraft() {
System.out.println("TestAircraft");
FSAircraft air = new FSAircraft();
for(int x=0;x<10000;x++){
//System.out.println("Pitch-Degrees " + Math.round(air.Pitch()) + " Roll-Degrees " + Math.round(air.Bank()));
//System.out.println("Airspeed " + air.IAS());
System.out.println("enginetype " + air.Heading());
}
}
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();
//TestAircraft();
TestFlightSim();
TestEngine();
}
}
}