Kuba5 Posted January 3, 2013 Report Posted January 3, 2013 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
Paul Henty Posted January 3, 2013 Report Posted January 3, 2013 ... 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
Kuba5 Posted January 3, 2013 Author Report Posted January 3, 2013 (edited) I really misunderstood this function. :mrgreen: It works now! :) Thank you very much. Edited January 3, 2013 by Kuba5
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now