Jump to content
The simFlight Network Forums

Cooper94

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Cooper94

  1. Ok I have researched more about how this all works but now I am getting another problem. I use the offset HB80 and this tells me how much fuel can be put into the left engine. But is there anyway to read what is in that engine say the capasicty is 2500 and its at 1500 how can I get that 1500?

    Thank you

  2. I do thank you all for your help and patients but that sadly did not work below is the code to my whole program.

    Imports FSUIPC
    Public Class Form1
        Private Const AppTitle As String = "PiREP  Reporting System"
        Const Message As String = "Error 1222"
        Dim airSpeed As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H2BC)
        Dim touch As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H30C)
        Dim down As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H366)
        Private altitude As Offset(Of Long) = New FSUIPC.Offset(Of Long)(&H570)
        Dim Fuel As Offset(Of Single) = New FSUIPC.Offset(Of Single)(&H90C)
    
    
    
        Private Sub OpenFSUIPC()
            Try
                FSUIPCConnection.Open()
                Me.Timer1.Interval = 200
                Me.Timer1.Enabled = True
            Catch ex As Exception
                MessageBox.Show(Message, AppTitle, MessageBoxButtons.OK, MessageBoxIcon.Error)
            End Try
        End Sub
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Button1.Enabled = False
            Button2.Enabled = False
            TextBox2.Enabled = False
            TextBox3.Enabled = False
            TextBox4.Enabled = False
            CheckBox1.Enabled = False
            ComboBox1.Enabled = False
            Label25.Enabled = False
            Label27.Enabled = False
            Timer2.Enabled = False
            TextBox3.CharacterCasing = CharacterCasing.Upper
            TextBox2.CharacterCasing = CharacterCasing.Upper
            OpenFSUIPC()
    
        End Sub
        Private Sub Form1_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
            FSUIPCConnection.Close()
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim Starttime As String = TimeOfDay
            Timer2.Enabled = True
            Label13.Text = Starttime
            TextBox2.Enabled = False
            TextBox3.Enabled = False
            TextBox4.Enabled = False
            ComboBox1.Enabled = False
            Button1.Enabled = False
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            FSUIPCConnection.Close()
        End Sub
    
        Private Sub InformationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InformationToolStripMenuItem.Click
            MsgBox("Version 1.0 Created By Nicholas Cooper")
        End Sub
    
        Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
            End
        End Sub
    
        Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
            End
        End Sub
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    
            Try
                FSUIPCConnection.Process()
                Dim deptime As String = TimeOfDay
                Dim airpeedKnots As Double = (airSpeed.Value / 128D)
                Me.Label15.Text = airpeedKnots.ToString("f1")
                Dim touchrate As Double = (touch.Value / 256.0) * 3.28084 * 60.0
                Dim altFeet As Double
                altFeet = altitude.Value / (65536.0 * 65536.0) * 3.28084
                altFeet = Math.Round(altFeet, 0)
                Label18.Text = altFeet
    
                Dim fuelleft As Single = (Fuel.Value)
                Label26.Text = fuelleft.ToString("f1")
    
                If airpeedKnots >= "60" Then
                    Label16.Text = "In-Flight"
                Else
                    Label16.Text = "On-Ground"
                End If
                If airpeedKnots <= "10" And Label23.Text = "3" Then
                    Label27.Enabled = True
                    Label25.Enabled = True
                    Label27.Text = touchrate.ToString("f1")
                End If
    
            Catch exFSUIPC As FSUIPCException
                If exFSUIPC.FSUIPCErrorCode = FSUIPCError.FSUIPC_ERR_SENDMSG Then
                    FSUIPCConnection.Close()
                    MessageBox.Show("The connection to Flight Sim has been lost.", AppTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
                    End
                End If
            Catch ex As Exception
            End Try
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Button1.Enabled = True
            Button2.Enabled = True
            TextBox2.Enabled = True
            TextBox3.Enabled = True
            TextBox4.Enabled = True
            CheckBox1.Enabled = True
            ComboBox1.Enabled = True
            Button3.Enabled = False
            Button4.Enabled = False
            TextBox7.Enabled = False
            TextBox8.Enabled = False
        End Sub
        Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
            Label20.Text = Val(Label20.Text) + Val(1)
            If Label20.Text = 360 Then
                Label23.Text = Val(Label23.Text) + Val(1)
                Label20.Text = Val(0)
            End If
            If Label23.Text = 10 Then
                Label21.Text = Val(Label21.Text) + Val(1)
                Label23.Text = Val(0)
            End If
            If Label20.Text = 1 Then
                Dim flthrs As String
                flthrs = Label21.Text + "." + Label19.Text
            End If
        End Sub
    
        Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
            If CheckBox1.Checked Then
                Label17.Text = "Yes"
            Else
                Label17.Text = "No"
            End If
        End Sub
    End Class
    

    I thank you all once again for all you help!

  3. Ok this is my code:

    Dim Fuel As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H90C)
    Dim fuelleft As Double = (Fuel.Value)
    Label26.Text = fuelleft.ToString("f1")
    

    The H90C is the offset 090C in the SDK manual, it recieves fuel from the left engine and how much is used from the start of the flight. I havnt got it to work but I hope this code will help you guys understand a little bit more as to what I am looking to do.

    Thank You

    P.S- I know VB very well just I have been trying to get fuel total for a long time and I couldnt get it so I seeked help. Thank you again.

  4. I am new to this and I didt really understand the SDK manual all that much. I am in the makeing of createing a acars system for a virtual airline which works 100% but I would like to add two features if possible. One I would like to let them know on landing what there landing rate was and also what there current altitude is. I have looked for the offsets and have tryed but all I get is random numbers for the altitude. If I try to landing rate I get a rate but most of the time it is 0.0 or -1.0. I know for a fact I cant get that with my nose down 100% and it still reads that. If you could so kidly help me that would be great!

    Thank You

    www.republicv.org

    CEO

×
×
  • 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.