Jump to content
The simFlight Network Forums

FSUIPC: Offset for manual braking?


Recommended Posts

Hello all,

I am trying to hack out the autobrake code for use in PMSystems, and I'm having a little trouble with the autobrake disarm.

I want to write it, such that if the autobrake is braking, and the speed is below 60 kts, the autobrake will disarm when the user manually brakes (ie: by pressing the '.' key)

Is there an offset which indicates manual braking?

I have found the 0BC4 and 0BC6 for the L and R Brakes; but these values just indicate the braking force, and do not distinguish between the autobrake and manual braking.

The docs refer to using the bytes 0C00 and 0C01 to simulate manual braking, but I cannot read from them (they stay 0, even when the '.' key is pressed) As far as I understand, these offsets are only used for setting manual braking (ie: simulating pressing '.') and not for reading the event.

Is there any way to determine whether or not the user has pressed the brakes, or am I missing something in 0C00 and 0C01?

Thanks,

-Chris

Link to comment
Share on other sites

Is there an offset which indicates manual braking?

No. The various means of braking (brake control, brake axis, parking brake, autobrake) all just increase and/or maintain brake pressure.

The docs refer to using the bytes 0C00 and 0C01 to simulate manual braking, but I cannot read from them (they stay 0, even when the '.' key is pressed) As far as I understand, these offsets are only used for setting manual braking (ie: simulating pressing '.') and not for reading the event.

Correct. They are actually implemented by FSUIPC, not FS, for compatibility with FS98 and before. The braking system changed in FS2000 and those offsets did nothing otherwise.

Is there any way to determine whether or not the user has pressed the brakes

Not really, not at present. I could set a flag someplace when I see a brake control or a brake axis increment. For the brake axis input I could actually make a copy someplace or the axis value, but that cannot be applied to the normal brake control (i.e. the one by default associated with the . keypress or F11/F12 separate left/right brakes).

Maybe just a simple one byte count -- increment it each time I see a brake control or an axis increase, decrement it once per second or so, say. I would need to experiment to find the best compromise. Obviosly the flag would have to remain non-zero long enough for programs to see it.

Regards,

Pete

Link to comment
Share on other sites

Thanks for the info Pete. I didn't think it was possible, but figured I'd make sure :)

I currently have it set to disarm at 60 kts, so no big deal, just something that would be nice to have

Additionally, I got to thinking, I may write a small C++ app that watches the KB/Joystick for a brake command and use that to set the disarm in FSUIPC...

so many things to play with, so little time :lol:

Thanks again for your help!

-Chris

Link to comment
Share on other sites

Additionally, I got to thinking, I may write a small C++ app that watches the KB/Joystick for a brake command and use that to set the disarm in FSUIPC...

Well, don't rush at that unnecessarily. I've put the idea of a flag in FSUIPC on my list. :wink:

When I get to do it I'll send you a test version.

Regards,

Pete

Link to comment
Share on other sites

Thanks for the info Pete. I didn't think it was possible, but figured I'd make sure :)

Okay. It was easy enough to do. I've added another one byte offset, as follows:

32F9 1 byte

Brakes being used flag. This non-zero if the user has pressed the brakes (left, right or both) recently. It stays non-zero for a second after the last brake control or significant axis increase seen. It does not stay set for continued constant brake pressure via the axis inputs. It operates also for increasing values written to offset 0C00 or 0C01.

Note: this is only fully implemented for FS2004+. It will work for buttons and axes in earlier versions, but not keyboard braking.

Try it -- test version 3.485 attached.

Regards,

Pete

FSUIPC3485test.zip

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.