Jump to content
The simFlight Network Forums

C# touchdown rate


Recommended Posts

Hello, i need help with FSUIPC (C#). I want read touchdown rate (V/S) and write it to textbox. I tried this:

Offset:

private Offset<int> touchdown_rate = new Offset<int>(0x030C); // Offset pro zjištění t/d rate
private Offset<short> onGround = new Offset<short>(0x0366); // Offset pro nastavení zem/vzduch

In timer:

this.onGround.Value = 1;
double TouchdownRate = ((double)touchdown_rate.Value * 60D * 3.28084D / 256D);
this.txttouchdown.Text = TouchdownRate.ToString();

Button for check onGround:

private void button5_Click(object sender, EventArgs e)
{
this.onGround.Value = 1;
}

But in textbox is V/S in airborne... it´s always updating, but i want just record v/s at touchdown.. thank you very much.

P.S. Im beginner

post-41295-0-22801500-1357230651.jpg

Link to comment
Share on other sites

...

But in textbox is V/S in airborne... it´s always updating, but i want just record v/s at touchdown.. thank you very much.

You've slightly misunderstood about the OnGround flag. You don't set this yourself. It's updated by FS when the aircraft is on the ground.

The 030C is constantly updated while in the air. As soon as the plane touches down this value gets 'frozen'. So this value will be the last vertical speed as the wheels touched down. When the plane takes off again this offset gets updated again.

What you need to do is READ the OnGround flag until it's 1 (plane has touched down). Then you can read the 030C. This will now contain the Vertical Speed at touch down.

so something like this in your timer...

if (this.onGround.Value == 1)
{
double TouchdownRate = ((double)touchdown_rate.Value * 60D * 3.28084D / 256D);
this.txttouchdown.Text = TouchdownRate.ToString();
}
else
{
this.txttouchdown.Text = "Airborne";
}

Let me know if you need any more help.

Paul

Link to comment
Share on other sites

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.