eamello Posted April 2, 2012 Report Posted April 2, 2012 Hi there, I've been working on my own version of acars and the development is going well. I've managed to learn from the code samples from many places and this forum was my reference couple of times. I know FS reads flaps as specific intervals, i.e. 0, 2047, ... 16383 when reading the offset 0x3BFA or 0xBDC. Depending how many flaps the aircraft has, the interval will be read accordingly. Does anyone have any logic in translating these values into Flap 1 (0), Flap 2 (8191), Flap 3 (16383), which already expects any aircraft, even the Wilco one, which has a different flap interval from other aircrafts? It can be in any language. I don’t want to reinvent the wheel here. Thanks.
Pete Dowson Posted April 2, 2012 Report Posted April 2, 2012 I know FS reads flaps as specific intervals, i.e. 0, 2047, ... 16383 when reading the offset 0x3BFA or 0xBDC. Depending how many flaps the aircraft has, the interval will be read accordingly. Does anyone have any logic in translating these values into Flap 1 (0), Flap 2 (8191), Flap 3 (16383), which already expects any aircraft, even the Wilco one, which has a different flap interval from other aircrafts? What version of FS are you aiming this at? If for FSX you can get the index number from offset 0BFC. (0 = full up). Pete
Graham Pollitt Posted April 2, 2012 Report Posted April 2, 2012 As aircraft have differing flap angles for each interval you will have to determine which flap angles to use for the current flap interval Here are snippets of code, not complete here just for example, in vb.net from my aircraft class for reading the flap angles (formatting doesnt look like it does in VStudio) I have a config file for each aircraft that I fly with flap data stored like this (taken from my 737-700 file) First number is raw value, 2nd is flap angle and 3rd is max airspeed for that flap extended //Flaps<NumberOfFlapAngles> 8<FlapsData>2048 1 2504096 2 2506144 5 2508192 10 21010239 15 20012287 25 19014335 30 17516383 40 162<EndFlapsData><DefaultFlaps> 5 30[/CODE]hence the following code copies the values read from the above section of the config file into the required arrays[CODE] 'read first line of flap data' line = parser.ReadFields() 'loop until end of flaps data section' While line(0) <> "<EndFlapsData>" objAircraft.FlapDetails(arrayindex) = line(0) objAircraft.FlapDetails(arrayindex + 1) = line(1) objAircraft.FlapDetails(arrayindex + 2) = line(2) 'read first line of flap data' line = parser.ReadFields() arrayindex += 3 End While[/CODE]The following code shows how to get the currently selected flap angle, max speed based on the raw value read from FS. This sub is called whenever I want to check for the flap values which I then do by reading the values stored within FlapAngleSet, FlapAngleMaximumSpeed[CODE] Public Sub getFlaps() Me.readFlapsOffset() Dim b As Short = 0 Dim c As Short = 1 'used as loop counter and also for flap array position so not zero based' Me.RawFlapsNumber = Me.fsRawFlapsNumber.Value While c <= Me.NumberOfFlapAngles 'only loop for the number of flaps ie 3' If Me.RawFlapsNumber = 0 Then 'if no flaps set then set angle to 0 for up and set max airspeed to max speed of aircraft' Me.FlapAngleSet = 0 Me.FlapAngleMaximumSpeed = Me.MaxStructuralAirspeed Me.FlapArrayPosition = 0 Exit While ElseIf Me.RawFlapsNumber = Me.FlapDetails(B) Then 'if raw value matches that for selected flap then get' 'the flap angle ie 20 and the max flap down speed for that angle' Me.FlapAngleSet = Me.FlapDetails(b + 1) Me.FlapAngleMaximumSpeed = Me.FlapDetails(b + 2) Me.FlapArrayPosition = c Exit While End If 'if not found then loop until read all the flap settings for that aircraft' 'ie 5 flaps settings, loop 5 times' b = b + 3 'move to next flap settings in array' c += 1 End While End Sub Public Sub readFlapsOffset() FSUIPCConnection.Process("flaps") End Sub[/CODE]These are only snippets from my aircraft class but should give you an idea of how to customise your ACARS app for flaps. This works fine for me.
eamello Posted April 3, 2012 Author Report Posted April 3, 2012 What version of FS are you aiming this at? If for FSX you can get the index number from offset 0BFC. (0 = full up). Pete Hi Pete, First thanks for replying, I noticed you have been helping FS developers for a long time! Well, the VA I've been developing has pilots that fly with FS2004 (most of them) and few FSX. It will have to expect any aircraft (FS default, freeware and payware) based on the fleet of the VA (B350, EMB120, ATR72, E-170, E-195, 737-800, A319, A320, 757, 767-300, 747-400, MD-11, 777-300 and 727-200). Thanks for the offset suggestion. I can also get the info when flaps are full, reading offset 0BDC = 16383. I think I will have to build some logic like gjpollitt wrote above. Having all flap details stored in a config file, retrieving them in a loop and them parse it according to the FS offset read. There is a multiline textbox on my acars where it displays all the events during the flight. All I want is display to the user (pilot), the flap change and its speed, like: [10h45 - Flap 2 at 210 kts] Thanks
eamello Posted April 3, 2012 Author Report Posted April 3, 2012 As aircraft have differing flap angles for each interval you will have to determine which flap angles to use for the current flap interval Here are snippets of code, not complete here just for example, in vb.net from my aircraft class for reading the flap angles (formatting doesnt look like it does in VStudio) I have a config file for each aircraft that I fly with flap data stored like this (taken from my 737-700 file) First number is raw value, 2nd is flap angle and 3rd is max airspeed for that flap extended Thanks gjpollitt. Let me grasp your suggestion and then I'll post it here how I am getting on. It looks like the way to go. Your code will help me for sure.
Luke Kolin Posted April 4, 2012 Report Posted April 4, 2012 I think I will have to build some logic like gjpollitt wrote above. Having all flap details stored in a config file, retrieving them in a loop and them parse it according to the FS offset read. Why? There are offsets that list flap positions in degrees (multiplied by 512) that I use which work for the vast majority of aircraft. The config file doesn't seem very extendible. Cheers! Luke
Graham Pollitt Posted April 4, 2012 Report Posted April 4, 2012 Why? There are offsets that list flap positions in degrees (multiplied by 512) that I use which work for the vast majority of aircraft. The config file doesn't seem very extendible. Cheers! Luke I use config files for the aircraft as I need to read the maximum speed for that flap setting. That info isn't available within FS
eamello Posted April 16, 2012 Author Report Posted April 16, 2012 Thanks guys. Why Am I not getting notification by e-mail when someone replies on this post? I am following this topic and also checked my notification settings and they are all ok. Emerson
eamello Posted May 15, 2012 Author Report Posted May 15, 2012 Just to let you know, the development was successful and my own acars is now being tested by few members of the VA. It was very interesting development and my first FS application. I used .NET framework windows forms. Thanks for all help. Emerson
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