Jump to content
The simFlight Network Forums

carlosuc99

Members
  • Posts

    21
  • Joined

  • Last visited

Posts posted by carlosuc99

  1. Hi,

    I want to see in a Text Box the flaps position (0, 2, 5...). I call the offset like this:


    Dim Flaps As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3BF8)
    [/CODE]

    And I write it in a text box like this:

    [CODE]
    Dim FlapsPosition As Double = Flaps.Value
    Me.FlightLogBox.Text = FlapsPosition.ToString("F1")
    [/CODE]

    But the value is incorrect.

  2. I have another problem now. I only get the position at the start and the current position. But, I take-off and I return to the same airport. I have a problem because the position at the start and the current are near and it only shows me that I flown, for example, only 0.23NM but It´s false.

    I think I can fix this problem resetting the position in the timer1, and plus it than the value of the FlownTextBox. I test a lot of forms to this but doesn´t work.

    Paul, Do you have an idea to do this?

  3. Ok, I read the User Guide. But, I have a problem. I want to calculate the distance flown from the start position (position when I connect with the simulator) to current position.

    I tryed it:


    Public Class MainForm

    'Some Code
    Dim StartPoint As FsLatLonPoint

    ' Initialise some of the variables we will need later
    Public Sub New()
    InitializeComponent()
    Dim StartLat As FsLatitude = New FsLatitude(Latitude.Value)
    Dim StartLon As FsLongitude = New FsLongitude(Longitude.Value)
    StartPoint = New FsLatLonPoint(StartLat, StartLon)
    End Sub
    [/CODE]

    And in the timer this:

    [CODE]
    Dim Lat As FsLatitude = New FsLatitude(Latitude.Value)
    Dim Lon As FsLongitude = New FsLongitude(Longitude.Value)
    Dim Lat2 As Double = (Latitude.Value * 90.0 / (10001750.0 * 65536.0 * 65536.0))
    Me.LatitudeBox.Text = Lat.ToString()
    Me.LongitudeBox.Text = Lon.ToString()
    'Distance Flown
    Dim CurrentPosition As FsLatLonPoint = New FsLatLonPoint(Lat, Lon)
    Dim distance As Double = 0
    Select Case (Me.FlownUnitsCombo.Text)
    Case "Nautical Miles"
    distance = CurrentPosition.DistanceFromInNauticalMiles(StartPoint)
    Case "Statute Miles"
    distance = CurrentPosition.DistanceFromInFeet(StartPoint) / 5280D
    Case "Kilometres"
    distance = StartPoint.DistanceFromInMetres(CurrentPosition) / 1000D
    End Select
    Me.FlownBox.Text = distance.ToString("N2")
    [/CODE]

    But, the result is my current postion to 0 postion. Because don´t read

    [CODE]Latitude.Value[/CODE]

    at the StartLatitude and

    [CODE]Longitude.Value[/CODE]

    at the StartLogintude. But, I replace that for the cordinates like EGLL in the VB EXAMPLE. Works but it shows me the distance to heatrow and not the distance flown, logical.

  4. 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?

  5. 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?

  6. Hi,

    I use VB.NET How Can I obtain the distance flown? For expample. I take-off from Heatrow and I land at Chicago O`Hare. I want to obtain the distance flown in the flight. But I want to see the always the distance flown, not only when I arrival. If I am in the middle of the Atlantic I want to see the distance flown too. I want to see the distance flown anywhere. I don´t found any offset to do this.

  7. Hi,

    Paul or anybody. Can you put an example table in VB .NET with the report of parking brakes? For any time that I put the parking brakes creates a line in the table with a colum: Like Name: Parking Brakes SET.

    If you can´t don´t worry. I know How can I creat a table but I don´t know how can I insert the action of FSUIPC and put a correct while. Because I don´t know the times it need to run.

    PD: I´m thinking do it with a rich textbox. I think is easier. How Can I put the dates here? With a while?

  8. I fin it:

    3366

    1

    This byte reflects the FS2004 ―Engine on Fire‖ flags. I‘m not sure if FS actually simulates such events, but it appears to have allocated Gauge-accessible variables to indicate them. This byte uses bits 2^0–2^3 as flags for fires in Engines 1 to 4, respectively.

    Ok-SimC

    Ok-SimC

    But, I don´t know How I can used in .NET? I don´t know If I need 1 to set fire in engine 1 or anything? Anybody can put an example?

  9. Commands? The FSUIPC interface is the same no matter whcich offsets you want to handle. If by "commands" you mean "offsets", then the list is provided in documents (one for FS9 and before, one for FSUIPC4 and FSx) within the FSUIPC SDK.

    I'm afraid I cannot help specifically with VB.NET, but you might do well looking in the Download Links subforum, in the thread FSUIPC Client DLL for .NET - Version 2.0.

    Regards

    Pete

    Ok, I find the offsets in the VB .NET document. It load the offsets like this:


    ' Register the Offsets we're interesing in for this application
    Dim airSpeed As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H2BC) ' Basic integer read example
    Dim avionics As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H2E80) ' Basic integer read and write example
    Dim fsLocalDateTime As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H238, 10) ' Example of reading an arbitary set of bytes.
    Dim aircraftType As Offset(Of String) = New FSUIPC.Offset(Of String)("AircraftInfo", &H3160, 24) ' Example of string and use of a group
    Dim lights As Offset(Of BitArray) = New FSUIPC.Offset(Of BitArray)(&HD0C, 2) ' Example of BitArray used to manage a bit field type offset.
    Dim compass As Offset(Of Double) = New FSUIPC.Offset(Of Double)(&H2CC) ' Example for disconnecting/reconnecting
    Dim pause As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H262, True) ' Example of a write only offset.
    Dim com2bcd As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H3118) ' Example of reading a frequency coded in Binary Coded Decimal
    Dim playerLatitude As Offset(Of Long) = New Offset(Of Long)(&H560) ' Offset for Lat/Lon features
    Dim playerLongitude As Offset(Of Long) = New Offset(Of Long)(&H568) ' Offset for Lat/Lon features
    Dim onGround As Offset(Of Short) = New Offset(Of Short)(&H366) ' Offset for Lat/Lon features
    Dim magVar As Offset(Of Short) = New Offset(Of Short)(&H2A0) ' Offset for Lat/Lon features
    Dim playerHeadingTrue As Offset(Of UInteger) = New Offset(Of UInteger)(&H580) ' Offset for moving the plane
    Dim playerAltitude As Offset(Of Long) = New Offset(Of Long)(&H570) ' Offset for moving the plane
    Dim slewMode As Offset(Of Short) = New Offset(Of Short)(&H5DC, True) ' Offset for moving the plane
    Dim sendControl As Offset(Of Integer) = New Offset(Of Integer)(&H3110, True) ' Offset for moving the plane
    [/CODE]

    But the code number isn´t all like the PDF. In some offsets the number it is without &H and in other &H is the same than 0. Why?

  10. There are a number of failures you can se up, through FSUIPC offsets, including engine fire and maybe preventing landing gear action. But it will depend also on which add-on aircraft you use, or a default.

    FS itself doesn't simulate cabin pressurisation, so de-pressurising it isn't possible. However, you could try to work out what the results would be and try to make those things happen. Same goes for a lot of things.

    Pete

    Thank you Pet for you answer. I´m you FAN I love you work.

    Ok, I need to do configurations for all aircrafts models I use to simulate fails?

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