Jump to content
The simFlight Network Forums

Graham Pollitt

Members
  • Posts

    148
  • Joined

  • Last visited

Posts posted by Graham Pollitt

  1. 1 hour ago, Pete Dowson said:

    Have you asked me about this beofre, at all?

    No but then I had never tried it until today just before I replied to this thread to see if I could see the issue that Adam was referring to.

    It doesn't affect me anyway as I don't assign using that method so is irrelevant to me whether it's an issue with FS, FSUIPC, Windows, Razer driver etc. The way I assign to the Razer works and that's all I'm bothered with,

  2. Adam,

    You need to assign a key on the main keyboard to a function either within FS or FSUIPC and then assign that same key to a button on the keypad via the Razer software.

    I use mine in both FSX and P3D and have never had any problems setting up this way.

    I understand what you mean by FSUIPC not detecting the button press but if you setup as above then that is not an issue.

  3.  

    I still do not understand how to be a database, how to extract from them ICAO codes and how to measure the distance between the two airports ((((

     

     

    Run makerwys.exe, copy the r5.csv file to your project folder or path directly to the file in the FS directory.

     

    Code a parser reader to find the two airports that you want from the r5.csv file and to obtain the lat/lon co-ordinates of those two airports

     

    Read here for the formulae you'll need for the distance between two lat/lon points. You'll have to decide which point you want to use for each airport

     

    http://williams.best.vwh.net/avform.htm

  4. 3) Refer to the "Timer1_Tick" Section. You need the Timer Tick. Within this Timer Tick you declare for example:

        The Timer tick is reading data every 200 ms for example.

        Me.Timer1.Interval = 200

        Me.Timer1.Enabled = True

        ecc.....

    .

     

    No you wouldn't set the interval nor enable the timer within the 'tick' routine as it would never start

     

    Set the interval in the form load section or at design time if the interval does not need to be changed and start the timer when the app is started

  5.  I did reinstall Level D 767, but not FSUIPC and when I did 3 test take offs, it seemed to work ,but on a planned flight, the V/S stopped working again on descent and on another, it did not work on take off.

     

    Did you have FSUIPIC reinstalled again when V/S stopped working? Above you don't mention reinstalling it.

     

    If you didn't its not a problem with FSUIPC

     

    If you did have you checked buttons and axis assignments in case there has been a control assigned that shouldn't be and is overriding the AP?

  6. No you just copy the data below the header

     

    eg in my ini file I have the below

     

    [buttons]
    ButtonRepeat=20,10
    1=RB,0,C65607,0
    2=RB,1,C65615,0
    3=PA,4,C66079,0
    4=PA,5,C66080,0
    7=PA,10,K97,8
    8=PA,11,K123,8
    9=PA,7,C65752,0

     

    [buttons.PMDG 737]
    0=PA,9,K88,9
    1=PB,4,K86,10
    2=PB,5,K86,11
    3=PB,6,K66,10
    4=PB,7,K66,11
    5=PA,0,K88,10
    6=PA,8,K90,10
    8=RB,11,C65602,0
    9=UB,11,C65604,0
    11=PA,1,K67,10

     

    so to make the 737 buttons apply as generic I copy that section into the generic buttons section like this.

     

    [buttons]
    0=PA,9,K88,9
    1=PB,4,K86,10
    2=PB,5,K86,11
    3=PB,6,K66,10
    4=PB,7,K66,11
    5=PA,0,K88,10
    6=PA,8,K90,10
    8=RB,11,C65602,0
    9=UB,11,C65604,0
    11=PA,1,K67,10

     

    To make the 737 buttons apply to another specific aircraft only you could copy that same section into the header for the new aircraft like this

     

    [buttons.PMDG Jetstream 41]

    0=PA,9,K88,9
    1=PB,4,K86,10
    2=PB,5,K86,11
    3=PB,6,K66,10
    4=PB,7,K66,11
    5=PA,0,K88,10
    6=PA,8,K90,10
    8=RB,11,C65602,0
    9=UB,11,C65604,0
    11=PA,1,K67,10

     

    There may be an easier way to do this but I am happy editing files etc so thats the way I would do it. Only takes a few seconds anyway.

  7. Thanks Pete, I've used the 333C offset and works fine.

     

    Code below for anyone interested (vb.net) though you'll need to modify for own use

        Private Shared fsWideFSRunning As Offset(Of UShort) = New FSUIPC.Offset(Of UShort)("widefs", &H333C)
        Public Shared WideFSRunning As Boolean 
    
        Public Shared Sub getfsWideFSRunning()
    
            FSUIPCConnection.Process("widefs")
            WideFSRunning = fsWideFSRunning.Value
    
        End Sub
    

    then check like this - I have this code at the start of my timer section

            SimulatorEvents.getfsWideFSRunning()
    
            If SimulatorEvents.WideFSRunning = False Then
                Me.Timer_Seconds.Enabled = False 'pause polling'
                Dim msg = MessageBox.Show("The connection to Flight Sim has been lost, retry connection?", "WideFS connection lost", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                If msg = DialogResult.Yes Then
                    Me.Timer_Seconds.Enabled = True
                    Exit Sub 'exit sub and retry on next poll count'
                Else
                    Dim msg2 = MessageBox.Show("Abandon retry?", "Restart Application?", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                    If msg2 = DialogResult.Yes Then
                        'stop main timer and reset app'
                        Me.Timer_Seconds.Enabled = False
                        frmMain.ClearData()
                        Exit Sub
                    Else 'no'
                        Me.Timer_Seconds.Enabled = True
                        Exit Sub 'exit sub and retry on next poll count'
                    End If
                End If
            End If
    
  8. Hi,

     

    I am unable to detect a crash and my app continues to run normally on the client pc when the fsx server disconnects and I am connecting via WideClient. Obviously I don't get any new data just the same data from the last read each time my timer ticks.

    Even when WideClient eventually times out and gives the 'waiting for a connection' message my app still continues to read the offsets as though the connection is still there.

    Any ideas how to trap this please? I've had a quick read of the WideClient manual but can't seem to locate a relevent parameter.

     

    thanks

    Graham

  9. Erik,

     

    Don't know what language you are programming in but here is what I wrote for my app in vb.net.

    You can modify this into whatever language you are using. The maths is there but you will need to change the objects/vars to match your app

        Sub GetTotalDistanceFlown()
    
            'calculate total distance flown so far'
            Static firstrun As Boolean = True
    
            If firstrun = True Then
                'remember position for next run otherwise distance starts with lat/lon of 0 and gives 6000nm at KSEA!'
                PreviousLat = ApplicationObjects.objAircraft.CurrentLatitude
                PreviousLon = ApplicationObjects.objAircraft.CurrentLongitude
                firstrun = False
            Else
                'convert longitude into radians'
                CurrentLat = Calculations.Deg2Rad(ApplicationObjects.objAircraft.CurrentLatitude)
                CurrentLon = Calculations.Deg2Rad(ApplicationObjects.objAircraft.CurrentLongitude)
    
                'as total distance is in nm convert to rad before calculating new distance'
                ReportGlobal.TotalDistanceFlownNM = Calculations.nm2Rad(ReportGlobal.TotalDistanceFlownNM)
                ReportGlobal.TotalDistanceFlownNM = ReportGlobal.TotalDistanceFlownNM + (2 * Math.Asin(Math.Sqrt((Math.Sin((PreviousLat - CurrentLat) / 2)) ^ 2 + Math.Cos(PreviousLat) * Math.Cos(CurrentLat) * (Math.Sin((PreviousLon - CurrentLon) / 2) ^ 2))))
                ReportGlobal.TotalDistanceFlownNM = Calculations.Rad2nm(ReportGlobal.TotalDistanceFlownNM)
                ReportGlobal.TotalDistanceFlownNM = Math.Round(ReportGlobal.TotalDistanceFlownNM, 4)
                '4 decimal places for accuracy on chart x axis'
    
                PreviousLat = ApplicationObjects.objAircraft.CurrentLatitude
                PreviousLon = ApplicationObjects.objAircraft.CurrentLongitude
            End If
    
        End Sub
    
    

    required function for above

        Shared Function Rad2nm(ByVal Rad)
            'This function converts radians to nm'
            Rad2nm = Rad * ((180 * 60) / Math.PI)
            Return Rad2nm
        End Function
    
        Shared Function nm2Rad(ByVal nm)
            'This function converts radians to nm'
            nm2Rad = nm * Math.PI / (180 * 60)
            Return nm2Rad
        End Function
    
  10. That offset is a bit array and yes you can read/write to it

     

    'In FS2000 and later, FSUIPC extends this by having a bit for each engine, 1=Eng1, 2=Eng2, 4=Eng3, 8=Eng4'

    Private fsEngineFail As Offset(Of BitArray) = New FSUIPC.Offset(Of BitArray)("engines", &HB6B, 1)
    
    Public Engine1fail As Boolean
    Public Engine2fail As Boolean
    Public Engine3fail As Boolean
    Public Engine4fail As Boolean
    
    'then have something like'
    
            FSUIPCConnection.Process("engines")
    
            If fsEngineFail .Value(0) = 1 Then
                Me.Engine1fail= true
            Else
                Me.Engine1fail=false
            End If
    
            If fsEngineFail .Value(1) = 1 Then
                Me.Engine2fail = true
            Else
                Me.Engine2fail =false
            End If
    
            If fsEngineFail .Value(2) = 1 Then
                Me.Engine3fail = true
            Else
                Me.Engine3fail =false
            End If
    
            If fsEngineFail .Value(3) = 1 Then
                Me.Engine4fail = true
            Else
                Me.Engine4fail =false
            End If
    

    To set a bit do something like

    fsEngineFail .Value(2) = 1
    
    'then write it '
    
    FSUIPCConnection.Process("engines")
    
    
    'this should set engine 3 bit to 1 to show engine fail'

    Thats from memory. It tests whether each bit for each engine is set or not and sets the bool var accordingly. In VB.net at least.

    May not be 100% correct but should give you an idea.

     

    EDIT

     

    you may have to change the above lines to (not home at mo to look how I did this)

    If fsEngineFail .Value(0) < 0 Then
    'true'
    else
    'false'
    
    'etc.'
    
  11. Rob,

    I assigned a button on my throttle quadrant via the buttons and switches tab.

    Select for FS control - Checked

    Control sent when button pressed - Throttle decreased

    Control to repeat while held - Checked

    Control sent when button released - Throttle cut

    Works fine for me in the NGX. Adds reverse to both engines whilst button down and sends throttles to idle when released. Never failed me yet.

    If you want seperate reverser controls for each engine assigned to 2 buttons then select Throttle 1 and Throttle 2 instead of Throttle.

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