Jump to content
The simFlight Network Forums

get the specific aircraft type ?


Recommended Posts

I am also working on the flight sim addon called fs charter and i have encountered a problem and am desperately seeking help. When i use the offset for getting aircraft type, it tells me that the aircraft is a cessna, or a boeing, but it fails to specify what type of boeing or cessna etc. I was wondering if anyone would be able to help me and possibly submit a small code (if possible) to find the specific kind of aircraft that the user is flying.

It Would be much appreciated... Thank you

Link to comment
Share on other sites

I am also working on the flight sim addon called fs charter and i have encountered a problem and am desperately seeking help. When i use the offset for getting aircraft type, it tells me that the aircraft is a cessna, or a boeing, but it fails to specify what type of boeing or cessna etc. I was wondering if anyone would be able to help me and possibly submit a small code (if possible) to find the specific kind of aircraft that the user is flying.

I am assuming you are talking about using FSUIPC offsets? Or are you reading gauge variables direct in FS? It would help if you gave the context of your question.

If FSUIPC, can you tell me what offset it is which tells you whether it is a Boeing or Cessna? I don't think I know that one. The main aircraft type offset, at 0609, tells you whether it is a prop or jet or helo or glider, and the offset 0AEC tells you how many engines it has.

There are offsets which give you the full "title" of the aircraft, from the Aircraft.CFG file, and other offsets giving other information from that file, such as the ATC type and so on, but all they do is reflect whatever it is that the user or aircraft designer enters into those fields in the CFG files.

Please clarify your question somewhat so I can help.

Regards

Pete

Link to comment
Share on other sites

Hello again...

I am looking for the fsuipc offset that will tell me the specific type of aircraft... meaning the entire title of the plane, until now i have used the code me.textbox5.text = aircraft_type.value, (visual basic.net), the value being whichever aircraft is being flown, the words aircraft_type were dimmed at the beginning wit the offset being 3160, which is said to have gotten the full atc aircraft type, but all i can get out of it is what "brand" of aircraft it is, not the specific kind eg. cessna 152.... boeing 474-400... some help with this would be once again..much appreciated

Link to comment
Share on other sites

I am looking for the fsuipc offset that will tell me the specific type of aircraft... meaning the entire title of the plane

The entire title of the plane, the one that identifies it uniquely in the whole list of installed aircraft, is available at offset 256.

There are also assorted ATC identifiers from the AIRCRAFT.CFG file in offsets 3130 to 3160.

These are the only identifying strings available. If you need others from the AIRCRAFT.CFG file (are there others, always?) you could read that file yourself. You can derive the path to it from the path to the AIR file, in offset 3C00, as both AIR and CFG files are normally in the same folder.

Regards

Pete

Link to comment
Share on other sites

  • 4 months later...

Offset 256? I cant find any reference to that offset in the docs

I am using the below at offset 3D00

Dim raircraftname As Offset(Of String) = New FSUIPC.Offset(Of String)("aircraft name", &H3D00, 256) 'aircraft name

With default cessna 172 I read the whole aircraft name including "" surrounding the name

With Flight1 cessna 172 I read all the name apart from the last " quote

In the aircraft.cfg for the default the name is title=Cessna Skyhawk 172SP and for flight1 it is title = Skyhawk 172R. If I copy and paste the title from flight1 to default it gives me the same result.

Any idea why this is please? All other aircraft names I have tried read "aircraft name" with the quotes.

thanks

Link to comment
Share on other sites

Offset 256? I cant find any reference to that offset in the docs

I am using the below at offset 3D00

Correct. Looks like a misprint I made (back in January!!). It's of size 256.

With default cessna 172 I read the whole aircraft name including "" surrounding the name

With Flight1 cessna 172 I read all the name apart from the last " quote

Well, it isn't a difference in FSUIPC. I don't add anything or take anything away. Which Flight simulator is this? FS2004 or FSX? If FSX, as sounds likely, it'll be a difference in how SimConnect supplies it. I can check. If it is supplying them with such variations I may need to scan for and remove " characters so that comparisons and aircraft-specific checks will work consistently.

In the aircraft.cfg for the default the name is title=Cessna Skyhawk 172SP and for flight1 it is title = Skyhawk 172R. If I copy and paste the title from flight1 to default it gives me the same result.

Sorry, same result for same aircraft, or does the result follow the title?

Any idea why this is please? All other aircraft names I have tried read "aircraft name" with the quotes.

Maybe it's your code? Or whatever FSUIPC interface wrapper it is you are using for your language (is that VB?).

I can try it here, but first I'd like to know which version of Flight Sim you are referring to. Just in case it is your code, could you Monitor 3D00 please, change various aircraft, and show me the resulting Log. To do this go to FSUIPC's Logging options, right-hand side, set offset 3D00, type ASCIIZ, and select "normal Log".

Please always consider using Logging for debugging purposes. You can actually log exactly what your program is reading or writing (IPC read and write logging) as well. That is what it is for. Also, you can check directly what 3D00 is containing by using FSInterrogate, as supplied for such purposes in the SDK.

Regards

Pete

Link to comment
Share on other sites

thanks for suggestions

I am using VB.net 2005 SP1 with Pauls (phenty) vb.net dll within FS2004

The results you requested are:

********* FSUIPC, Version 3.75 by Pete Dowson *********

Running on Windows Version 5.1 Build 2600 Service Pack 2

Verifying Certificate for "J:\Program Files\Microsoft Games\Flight Simulator 9\MODULES\FSUIPC.dll" now ...

SUCCESS! Signature verifies okay!

Running inside FS2004 (FS9.1 CONTROLS.DLL, FS9.1 WEATHER.DLL)

User Name="Graham Pollitt"

User Addr="gjpollitt@yahoo.co.uk"

FSUIPC Key is provided

WIDEFS not user registered, or expired

Module base=61000000

ClassOptions: UIPCMAIN=FF7F, FS98MAIN=FF7F, FS2KMAIN=FF5E

WeatherOptions(Orig)=400CB78F[400CB78F]

InitDelay: 0 seconds

WeatherReadInterval=4

LogOptions=00000001

DebugStatus=15

1750 System time = 11:37:19

1750 J:\Program Files\Microsoft Games\Flight Simulator 9\

1750 System time = 11:37:19, FS2004 time = 12:00:00 (00:00Z)

2578 FLIGHTS\OTHER\FLTSIM.flt

2594 AIRCRAFT\c172\Cessna172SP.air

2828 Aircraft="Cessna Skyhawk 172SP"

6875 J:\Documents and Settings\Graham\My Documents\Flight Simulator Files\UI generated flight.flt

7312 Monitor IPC:3D00 (AsciiZ) = [20]"Cessna Skyhawk 172SP"

8266 Advanced Weather Interface Enabled

22797 Traffic File #14 = "scenery\world\scenery\traffic030528"

33484 WeatherOptions set, now 400CB78F (timer=0)

52594 AIRCRAFT\Douglas_DC3\Douglas_DC3.air

52859 Aircraft="Douglas DC-3 Paint2"

55422 Monitor IPC:3D00 (AsciiZ) = [19]"Douglas DC-3 Paint2"

64812 AIRCRAFT\F1_Cessna_172\F1_Cessna_172.air

65062 Aircraft="Skyhawk 172R"

68359 Monitor IPC:3D00 (AsciiZ) = [12]"Skyhawk 172R"

"Skyhawk 172R" appears ok here so it may be something to do with the way it is read within Pauls dll.

Basically my code is this (though not listed like this in my app):

Dim temp as String

Dim raircraftname As Offset(Of String) = New FSUIPC.Offset(Of String)("aircraft name", &H3D00, 256) 'aircraft name

FSUIPCConnection.Process("aircraft name")

temp = raircraftname.Value

If cboAircraft.Text <> temp Then Exit Sub

this is to check the aircraft selected with my app matches the one loaded within FS2004. As mentioned I get the result of "Skyhawk 172R and not "Skyhawk 172R".

I will drop Paul a msg and see if it could be with vb.net dll

thanks again

Graham

Link to comment
Share on other sites

I am using VB.net 2005 SP1 with Pauls (phenty) vb.net dll within FS2004

The results you requested are:

Okay. The "" marks around the strings in this log are added by the logging. they are not actually part of the string data returned by FSUIPC. they are there in the log so you can see any leading or trailing spaces.

I will drop Paul a msg and see if it could be with vb.net dll

Okay. But it might be a good idea for your code to test for and strip off quotes at either end in any case. I doubt that they'd occur in real titles.

Regards

Pete

Link to comment
Share on other sites

So you can see what is happening the end quote " doesnt get read only with the Flight1 Cessna 172.

The text read from the combobox also has "" either side. I suppose I could delimit the string to remove the "" but thought there may be an obvious fix

I will see what Paul thinks in case it the dll

thanks again

Graham

post-11144-128689529673_thumb.jpg

post-11144-12868952968_thumb.jpg

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.