Jump to content
The simFlight Network Forums

Flight Status


Recommended Posts

I´m using VB .NET and the Offset E080 to give me the flight status.

There appears to be no question in your post. However:

Offset E080 is the start of a 96 item array of structures, each one of which may or may not contain current details of an AI aircraft on the Ground. Just getting the flight status of the first entry may or may not tell you anything, depending on whether the slot is used or not. And having the status of one odd AI traffic aircraft on the ground seems a little pointless?

I don't know VB.Net, but is a "BitArray" literally an array of bits? If so, getting the 38th bit isn't related to the structure at all. The offsets withing each of the 96 structures in in bytes -- byte 37 in each of the 96 entries will contain the status of that particular aircraft if, indeed, that slot is actually in use at that time.

Also, doesn't VB count from 1? In other words, isn't [37] a reference to the 37th entry, not, if it were bytes, the byte at offset 37 from the start (the first being 0)?

Finally, I have some recollect than the VB expression "&HE080 will actually give the hex value FFFFE080, which you certainly do not want. I think you have to postpend another & to stop the sign extension -- but please check in your VB manual first as I'm not 100% on that.

Pete

Link to comment
Share on other sites

I´m using VB .NET and the Offset E080 to give me the flight status.

If you want TCAS data you should use the facilities built into my DLL. This will be much easier than trying to get it yourself, especially using VB.NET.

See the section starting on page 22 of the UserGuide.pdf called "AI Traffic".

Paul

  • Upvote 1
Link to comment
Share on other sites

Thanks Paul, I´m trying do this like the Aircraft Type. It is correct?

No, it not works. I tryed with this:


Dim TCASData As Offset(Of String) = New FSUIPC.Offset(Of String)(&HE080, 37)
[/CODE]

and:

[CODE]
Me.FlownBoxNm.Text = TCASData.Value
[/CODE]

Why?? Can you put the code correct or say me the error?

Link to comment
Share on other sites


Dim TCASData As Offset(Of String) = New FSUIPC.Offset(Of String)(&HE080, 37)
Me.FlownBoxNm.Text = TCASData.Value
[/CODE]

Getting AI Traffic information is not as simple as declaring an offset. As I said, you should use the AI Traffic facilities provided by my DLL. You don't need to declare any offsets, the DLL does all the hard work for you.

To give you an idea of how difficult it is, the DLL contains about 900 lines of code to handle the AI Traffic. I'm sure you don't want to replicate all that, and I don't want to explain it all.

Just read from page 22 in the UserGuide.pdf and see how it's done and use what I've given you. All the correct code can be seen there (there is no point in my pasting it in here). I'm not sure you've even looked.

Paul

  • Upvote 1
Link to comment
Share on other sites

Getting AI Traffic information is not as simple as declaring an offset. As I said, you should use the AI Traffic facilities provided by my DLL. You don't need to declare any offsets, the DLL does all the hard work for you.

To give you an idea of how difficult it is, the DLL contains about 900 lines of code to handle the AI Traffic. I'm sure you don't want to replicate all that, and I don't want to explain it all.

Just read from page 22 in the UserGuide.pdf and see how it's done and use what I've given you. All the correct code can be seen there (there is no point in my pasting it in here). I'm not sure you've even looked.

Paul

I read it.

I need to put the it:


Private Sub readAI()
FSUIPCConnection.AITrafficServices.RefreshAITrafficInformation()
this.listBox1.Items.Clear()
For Each Plane As AIPlaneInfo In FSUIPCConnection.AITrafficServices.AllTraffic
Me.listBox1.Items.Add(Plane.ATCIdentifier & " (" & Plane.State.ToString() & ")")
End Sub
[/CODE]

I need to put in the timer. It is correct? Where I need to put the name of TextBox that it will be contains the state? I need to change listBox1 to the Text Box that it will be contains the state?

Link to comment
Share on other sites

I need to put in the timer. It is correct?

You could put this in the timer, it depends on how often you want this information. If your main timer is running 5 times per second then you might consider creating a new timer to get the AI Traffic less frequently.

Where I need to put the name of TextBox that it will be contains the state? I need to change listBox1 to the Text Box that it will be contains the state?

There will not be one state, there will a state for each AI Plane created by Flight Sim.

Now I'm not sure you want traffic information at all. In your first post your code is trying to read the TCAS (AI Traffic) information. That's what I thought you wanted, but your other questions don't match up.

Can you please explain again what information you want because I think we're talking about different things.

Paul

Link to comment
Share on other sites

OK, that wasn't clear.

I don't think your aircraft appears in the AI Traffic tables in FSUIPC. I can't check at the moment, Pete do you know?

Paul

Read the first message of Paul. But If it don´t work, How FSAcars, FSFK... Can Put the Flight Status? (Boarding, Taxing, Departing...)

Link to comment
Share on other sites

I only want the state of my aircraft (Departing, Landing, EnRoute...)

The AI traffic tables only contain data for AI traffic.

There is no "state" information for your own aircraft, only its position, speed, altitude, etc. YOU, the pilot, are supposed to know whether you are departing or landing or taxiniing or whatever. How could you not know?

If you want a program to tell you what you are doing it would be a matter of guessing from the various values describng the aircraft's current actions, like whether you are moving, whether you are on the ground, whether you are descending or climbing, and so on. But honestly I don't see the point?

How FSAcars, FSFK... Can Put the Flight Status? (Boarding, Taxing, Departing...)

For AI Traffic they read it from FSUIPC or direct from SimConnect. For the user aircraft they take note of what you are doing. The can't actually know you are 'boarding'. That's just a guess based on the fact that you are parked with the doors open. Taxiing is just moving at slow speeds on the ground, or even stopped but not at a gate. Taking off is moving faster on a runway. Departing is climbing away from the airport. Et cetera.

Regards

Pete

  • Upvote 1
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.