Jump to content
The simFlight Network Forums

Load some fuel on plane and fuel level question


Recommended Posts

Hi! 

 

This is my first post here so bare with me :) I have 7 years programming background so you can "TechTalk" to me as im familiar with data types and stuff.

 

So at first i wanted to know why 

PS.FuelLevelUSGallons.ToString("f1")

Returns integer value 52.00 even if there is 52.69 in tanks. Is there other function to have this value as more accurate ?

 

Second, how i add fuel to tanks ? 

 

Thank you in advance !

Link to comment
Share on other sites

Okey, i made it ! First question answer is : 

Math.Round(((PS.FuelCapacityUSGallons + 1) / 100) * PS.FuelPercentage, 2) & " gallons (" & PS.FuelPercentage.ToString("f2") & "%)" 

and second answer is : 

        If (Form1.LeftTank = True) Then
            Form1.PS.GetFuelTank(FSUIPC.FSFuelTanks.Left_Main).LevelUSGallons = Form1.LeftTankCapacity
        End If

        If (Form1.RightTank = True) Then
            Form1.PS.GetFuelTank(FSUIPC.FSFuelTanks.Right_Main).LevelUSGallons = Form1.RightTankCapacity
        End If
Link to comment
Share on other sites

Hi,

 

 

So at first i wanted to know why 

PS.FuelLevelUSGallons.ToString("f1")

Returns integer value 52.00 even if there is 52.69 in tanks. Is there other function to have this value as more accurate ?

 

I've tried it here and the accuracy of PS.FuelLevelUSGallons is correct to many decimal places. It could be that version 2.4 (which you are probably using) has a bug in it. I've attached version 3 (beta) if you want to try that.

 

 

I see you've worked out how to add fuel. You've probably also worked out you need to call PS.WriteChanges() after you've made all your adjustments to send the data to FSUIPC. I only mention it because it's not in the code you posted.

 

 

Paul

FSUIPCClient3.0_BETA.zip

Link to comment
Share on other sites

Yeah i figured out this by my own afterall ! Yeah 2.4 p3d

    Sub setFuelLevels()
        If (Form1.LeftTank = True) Then
            Form1.PS.GetFuelTank(FSUIPC.FSFuelTanks.Left_Main).LevelUSGallons = Form1.LeftTankCapacity
        End If

        If (Form1.RightTank = True) Then
            Form1.PS.GetFuelTank(FSUIPC.FSFuelTanks.Right_Main).LevelUSGallons = Form1.RightTankCapacity
        End If

        Form1.PS.WriteChanges()
        Threading.Thread.Sleep(2000)
        Form1.PS.RefreshData()
    End Sub

I got another question, i hope its okey if i ask in this topic.. so , do you know these green arrow kind markers in FSX tutorials/missions ?  those markers guides player as they fly and you can see distance / heading at the compass.
Is there any change i could create one by myself while i fly ? (or can i move existing marker ?) It should be possible because there is function inside engine which creates them. I tried to check every topic and documentation but didnt find the lead.. 

 

Thank you in advance :)

Link to comment
Share on other sites

Should be ! :) Check this information, im talking about POI objects and there is addons which creates them

There is some controls aswell in documentation:
POINT_OF_INTEREST_CYCLE_NEXT 66694

POINT_OF_INTEREST_CYCLE_PREVIOUS 66693
POINT_OF_INTEREST_TOGGLE_POINTER 66692 
Dont know tho how to use controls..

11brucj.jpg

Edited by Roope Järvenpää
Link to comment
Share on other sites

There is some controls aswell in documentation:

POINT_OF_INTEREST_CYCLE_NEXT 66694

POINT_OF_INTEREST_CYCLE_PREVIOUS 66693
POINT_OF_INTEREST_TOGGLE_POINTER 66692

 

 
I assume these cycle through the points already defined in a mission; so you would need to know all the points when you create the mission.
 
You can send these controls via offset 0x3110. Declare this offset as an <int>, then set the value to the number of the control.
 
Paul
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.