Jump to content
The simFlight Network Forums

Dabull

Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by Dabull

  1. I think I tried that before. Sitting at MGCT airport (latitude: 14.6946573257446 Longitude: -91.8814315795899).

    When I read 6010/6018 as lat/lon type versus float I get this:

    name: "latitude"address: 0x6010type: "float"size: 8 },
          { name: "writelatitude"address: 0x6010type: "lat"size: 8 },
          { name: "longitude"address: 0x6018type: "float"size: 8 },
          { name: "writelongitude"address: 0x6018type: "lon"size: 8 },

     

    Lat/Lon Float: 14.696005552849051,-91.87789736218718
    Lat/Lon Write : 9688.75418157663,-89.522262409018

     

    Float is correct. The lat/lon type isn;t returning correct values.

  2. Can someone please verify if this is the correct reverse computation to write back heading (0x0580) and altitude (0x6020) to the sim? I think altitude is pretty much easy.  I am not convinced of the heading though.

    I extracted it as follows:

    heading = Math.round(response.data.heading * 360 / (65536*65536))
    altitude = Math.round(response.data.altitude * 3.28084)

    And I plan to write back as follows:

    var newheading = (plannedrecord.heading / 360) * (65536/65536)
    var newaltitude = plannedrecord.altitude / 3.28084
  3. Interestingly when I read back the payload after sending specific amounts I can see the stations have been loaded correctly at least data wise in MSFS:

     

    payloadStations: [
        {
          index: 0,
          name: 'TT:MENU.PAYLOAD.',
          weight: 170,
          position: [Object]
        },
        {
          index: 1,
          name: 'TT:MENU.PAYLOAD.',
          weight: 170,
          position: [Object]
        }
      ],

     

    But when you look in the UI it doesn't show up.

    image.png.0a2dfafe3cb128ca7daf7df501641e70.png

    This is the same result whether I use 'payload.autoload' or 'payload.write', using different aircraft. So it may be an MSFS issue.

     

  4. I am not sure why the passenger load is not working. The fuel part loads fine. Here is my code. I have been testing on stock DA40NG in MSFS. Cargo variable is 0. So I am trying to load 510 which is equivalent to 3 passengers at 170lbs/pax. But the stations all remain zero. 

     

    Also does the payload include the pilot station?

     

    var fuelload = Math.round(plannedrecord.maxFuel * .75)
        var passengers
        if (plannedrecord.passengers === 0){
            passengers = 0
        }
        else {
            passengers = plannedrecord.passengers * 170
        }
     
        var payload = (510 + plannedrecord.cargo)
        console.log (payload)
        
        var request = {
            command: 'payload.autoload',
            volumeUnit: 'gal',
            weightUnit: 'Lbs',
            length: 'm',
            method: 'set',
            totalFuelWeight: fuelload,
            totalPayloadWeight: payload
        }
     
        // send to the server as a JSON string
        if (wsstatus !== 'null' || wsstatus !== 'error'){
            ws.send(JSON.stringify(request));
        }
  5. Honestly most of the values don't make sense:

    I sent this:

    offsets: [
                { name: 'aircraftName'address: 0x3D00type: 'string'size: 256 },
                { name: 'altitude'address: 0x0570type: 'uint'size: 8 },
                { name: 'heading'address: 0x0580type: 'uint'size: 4 },
                {name: 'groundSpeed'address: 0x6030type: 'uint'size: 8},
                {name: 'latitude'address: 0x6010type: 'int'size: 8},
                {name: 'longitude'address: 0x6018type: 'int'size: 8},
                {name: 'verticalSpeed'address: 0x030Ctype: 'int'size: 4},
                {name: 'onGround'address: 0x0366type: 'int'size: 2}
            ]

     

    and I get this:

     

    {
      aircraftName: 'Cessna CJ4 Citation WT',
      altitude: 61267640065450,
      heading: 1445037629,
      groundSpeed: 4641275633426061000,
      latitude: -4606115315203747000,
      longitude: -4588245414674943500,
      verticalSpeed: 8,
      onGround: 0
    }

    I have no clue what a floating point double is. How do I convert these values to something meaningful.

  6. Yes. I am on the latest version of of WebSocketServer. I am running JS code in VS Code.

     

    Here is the code:

     

    const WebSocket = require('ws');
    var ws = new WebSocket('ws://localhost:2048/fsuipc/'"fsuipc");
     
    // Handle the onopen event
    ws.onopen = function () {
        console.log("Connection Open");
        var request = {
            command: 'offsets.declare',
            name: 'myOffsets',
            offsets: [
                { name: 'altitude'address: 0x0570type: 'int'size: 8 },
                { name: 'avionicsMaster'address: 0x2E80type: 'uint'size: 4 },
                { name: 'heading'address: 0x0580type: 'uint'size: 4 },
                { name: 'aircraftName'address: 0x3D00type: 'string'size: 256 },
            ]
        }
        ws.send(JSON.stringify(request));
        
        ws.close()
    };
     
    // Handle the onclose event
    ws.onclose = function () {
        console.log("Connection Closed");
        // clear the WebSocket so we can try again
        ws = null;
    };
     
    // Handle the onerror event
    ws.onerror = function (err) {
        console.error("WebSocket Error: ",err.message);
    };
     
    ws.onmessage = function (msg) {
        // parse the JCON string to a Javascript object
        var response = JSON.parse(msg.data);
     
        // If the response indicated success then we can proceed to process it 
        if (response.success) {
            // handle the response according to the command. 
            // could also use the name, or both.
            switch (response.command) {
                case "about.read":
                    console.log(response.data)
                    break;
                default:
                    // Unhandled command
                    console.log("Unknown command: " + response.command);
                    break;
            }
        }
        else {
            // The request failed. Handle the errors here.
            // In this example we just display errors to the webpage
            var error = 'Error for ' + response.name + ' (' + response.command + '): ';
            error += response.errorCode + " - " + response.errorMessage;
            console.log(error);
        }
    };
  7. Please help. I just registered FSUIPC4 and now FSX crashes on load. I tried the Loader.DLL solution. FSX loads now, but I do not see the AddOn menu for FSUIPC anymore. Does that mean it is loaded?

    Install Log:

    Installer for FSUIPC4.DLL version 4.967


    Looking in registry for FSX install path:
         HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Flight Simulator\10.0
         Parameter"SetupPath"
    ... >>>  OK! FOUND FSX!  <<< ...
         SetupPath=C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\

    Looking in registry for FSX-SE install path:
         HKEY_LOCAL_MACHINE\SOFTWARE\DovetailGames\FSX
         Parameter"Install_Path"
    Not there, so looking in:
         HKEY_CURRENT_USER\SOFTWARE\DovetailGames\FSX
         Parameter"AppPath"
    Not there, so looking in:
         HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Flight Simulator - Steam Edition\10.0
         Parameter"SetupPath"
    Not there, so looking in:
         HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft Games\Flight Simulator - Steam Edition\10.0
         Parameter"AppPath"
    ... NOT found! ...

    Looking in registry for Prepar3D v1 install path:
         HKEY_LOCAL_MACHINE\SOFTWARE\LockheedMartin\Prepar3D
         Parameter"SetupPath"
    Not there, so looking in:
         HKEY_CURRENT_USER\SOFTWARE\LockheedMartin\Prepar3D
         Parameter"AppPath"
    ... NOT found! ...

    Looking in registry for Prepar3D v2 install path:
         HKEY_LOCAL_MACHINE\SOFTWARE\Lockheed Martin\Prepar3D v2
         Parameter"SetupPath"
    Not there, so looking in:
         HKEY_CURRENT_USER\SOFTWARE\Lockheed Martin\Prepar3D v2
         Parameter"AppPath"
    ... NOT found! ...

    Looking in registry for Prepar3D v3 install path:
         HKEY_LOCAL_MACHINE\SOFTWARE\Lockheed Martin\Prepar3D v3
         Parameter"SetupPath"
    Not there, so looking in:
         HKEY_CURRENT_USER\SOFTWARE\Lockheed Martin\Prepar3D v3
         Parameter"AppPath"
    ... NOT found! ...
    ===========================================================

    INSTALLATION FOR FSX:
    SetupPath="C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\"
    Checking version of the FSX EXE:
    ... Version 10.0.61472.0  (Need at least 10.0.60905.0)
    Checking compatibility with installed SimConnect:
        Found SimConnect build 60905 (Original)
        Found SimConnect build 61242 (SP1 May07)
        Found SimConnect build 61259 (Acc/SP2 Oct07)
    Checking if there's already a version of FSUIPC4 installed in:
           C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.DLL
    ... Version 4.967 found.
    FSX Modules folder already exists.
    Okay -- installed FSUIPC4 into "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.DLL"
    Looking for the current user's Application Data path: 
    ... found as "C:\Users\XXX\AppData\Roaming"
    Now finding \Microsoft\FSX\FSX.CFG for all users, including this one
    Looking in "C:\Users\All Users\AppData\Roaming"
     ... No FSX.CFG there
    Looking in "C:\Users\Default\AppData\Roaming"
     ... No FSX.CFG there
    Looking in "C:\Users\Default User\AppData\Roaming"
     ... No FSX.CFG there
    Looking in "C:\Users\Default.migrated\AppData\Roaming"
     ... No FSX.CFG there
    Looking in "C:\Users\XXX\AppData\Roaming"
     ... No FSX.CFG there
    Looking in "C:\Users\XXX\AppData\Roaming"
     ... No FSX.CFG there
    Looking in "C:\Users\XXX\AppData\Roaming"
    Found FSX.CFG in "C:\Users\XXX\AppData\Roaming\Microsoft\FSX\FSX.CFG"
    Now checking DLL.XML ...
    ... There is a previous DLL.XML, checking for FSUIPC4 section.
    ... FSUIPC4 section already exists but will be replaced.
         (with FSUIPC4_Loader entry)
    ... FSUIPC4 section of DLL.XML written okay
    Now checking for a SimConnect.XML file ...
    ... No SimConnect.XML file found. This is okay.
    Looking in "C:\Users\Public\AppData\Roaming"
     ... No FSX.CFG there
    "Modules\FSUIPC Documents" folder already exists.
    Now installing additional files into the "Modules\FSUIPC Documents" folder:
       Installed "FSUIPC4 User Guide.pdf" okay
       Installed "FSUIPC4 for Advanced Users.pdf" okay
       Installed "FSUIPC4 History.pdf" okay
       Installed "The 2016 List of FSX and P3D Controls.pdf" okay
       Installed "FSUIPC Lua Library.pdf" okay
       Installed "FSUIPC Lua Plug-Ins.pdf" okay
       Installed "Lua License.pdf" okay
       Installed "Lua Plugins for VRInsight Devices.pdf" okay
       Installed "LuaFileSystem.pdf" okay
       Installed "Example LUA plugins.zip" okay
       Installed "ASN WX Radar facilities in FSUIPC4.pdf" okay
       Installed "Offset Mapping for PMDG 737NGX.pdf" okay
       Installed "Offset Mapping for PMDG 777X.pdf" okay
       Installed "Offset Mapping for PMDG 747QOTSII.pdf" okay
       Installed "FSUIPC4 Offsets Status.pdf" okay
       Installed "Profiles in Separate Files.pdf" okay
       Installed "FSUIPC4_Loader.dll" okay
    ===========================================================

    All installer tasks completed.
    Registration dialog exit: selected  FSUIPC CHECK
    Checking FSUIPC registration ...
    Registration check for FSUIPC4 was successful! (result code 00)

    *************** End of Install Log ***************
     

    FSUIPC Log Modules Folder:

    ********* FSUIPC4, Version 4.967 (1st June 2017) by Pete Dowson *********
    Windows 10 Home 64 Bit reported as Build 10586, Release ID: 1511 (OS 6.0)
    fsx.exe version = 10.0.61472.0
    Reading options from "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.ini"
    Running inside FSX on Windows Vista
    Module base=5FFE0000
    User Name=""
    User Addr=""
    FSUIPC4 Key is provided
    WIDEFS7 not user registered, or expired
           31 System time = 07/06/2017 14:47:07
           31 FLT path = "C:\Users\XXX\Documents\Flight Simulator X Files\"
           31 ------ Module Version Check ------
           31        acontain.dll: 10.0.61472.0
           31             api.dll: 10.0.61472.0
           31        controls.dll: 10.0.61472.0
           31      fs-traffic.dll: 10.0.61472.0
           31             G3D.dll: 10.0.61472.0
           31        language.dll: 10.0.61472.0
           31            sim1.dll: 10.0.61472.0
           31        visualfx.dll: 10.0.61472.0
           62         weather.dll: 10.0.61472.0
           62          window.dll: 10.0.61472.0
           62 ----------------------------------
          125 Trying to connect to SimConnect Acc/SP2 Oct07 ...
          187 FS path = "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\"
          609 ---------------------- Joystick Device Scan -----------------------
          609 Product= UMDF Virtual hidmini device Product string
          609    Manufacturer= UMDF Virtual hidmini device Manufacturer string
          609    Serial Number= UMDF Virtual hidmini device Serial Number string
          609    Vendor=BEEF, Product=FEED (Version 1.1)
          625 -------------------------------------------------------------------
     

     

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