Jump to content
The simFlight Network Forums

Manuel Lence

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Manuel Lence

  1. On 9/12/2022 at 6:54 AM, Paul Henty said:

    Hi,

    I don't have any plans to add an automatic update. 

    In version 1.0.0 of the WebSocketServer I added a property to the 'about.read' response called 'newServerVersionAvailable'.

    Your web socket client program (or website) can check this. If it's 'true' it means that the WebSocketServer you are connected to is out of date. You can then warn the user and give instructions on updating.

    Will that fit your needs?

    Paul 

    Hi Paul, yes that would be very helpful. Thanks again for your time on this project!

    Greetings, Manu.

  2. On 5/21/2022 at 7:04 PM, Paul Henty said:

    Hi Manuel,

    I don't know if I understand what you are asking for correctly.

    The server program will notify about new versions on the 'about' tab.

    Do you want a way for your client application (web page) to know if the server program needs to be updated (new version available)?

    Paul

    Hi Paul, sorry for the delay in responding. My question is if there is any possibility of automatic updates. In case of being very complicated if you could add a kind of API in the web page with which you could verify the current version of the socket with that of the client, and in case there is a new version it is notified that it exists and redirected to the website to download it. Thanks for your time.

  3. Hi Paul, thanks for answering.

    The ws.close () is only executed with the finish button. I'm sure of that because if I send a single command it still works.

    I show you the part of the code:

            ws.onmessage = function (msg) {
        
                var response = JSON.parse(msg.data);
        
                if (response.success) {
                    if(response.name == 'myOffsets')
                    {
                        showOffsetValues(response);
                    }
                    else if(response.name == 'myPayload')
                    {
                        showPayloadValues(response);
                    }
                }
            };

    And this is where I declare the offset I need and send to the websocket:

        this.iniciar = function () {
            var data = {
                command: 'offsets.declare',
                name: 'myOffsets',
                offsets: [{...CODE...}
                ]
            }
            ws.send(JSON.stringify(data));
     
            var request = {
                command: 'offsets.read',
                name: 'myOffsets',
                interval: 1000
            }
            ws.send(JSON.stringify(request));
     
            var PayloadSend = {
                command: 'payload.read',
                name: 'myPayload',
                weightUnit: 'Kg',
                volumeUnit: 'l'
            }
            ws.send(JSON.stringify(PayloadSend));
    }

    Thanks for your time.

  4. Hi, my name is Manuel. First of all I want to congratulate you for the incredible work you are doing.
    I am doing an ACARS for a virtual airline. Everything in JS.
    My question is the following:
    Is there a way to send two commands at the same time?
    I explain. I am already using the command: offset.declare and as explained by Paul's website, I send all the offset I need to track. But I would like to also be able to send the command payload.read since it gives all the information ready to read without the need to do calculations and conversions.
    I already tried sending the two commands separately and joining them on the switch as explained in the documentation on the web. The problem is that when reading the payload it disconnects from the websocket and I need to keep tracking the rest of the parameters.
    I hope you can help me with this if possible.
    Thank you very much again and sorry if my English is bad I am using google translator.
×
×
  • 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.