Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Google Charts using Web Socket data from Server every 5 seconds - Video

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Google Charts using Web Socket data from Server every 5 seconds - Video

    Working on a project with live reporting - thought this may encourage others to give Web Sockets a go.

    Play Video

    Cheers, Pete
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)

  • #2
    Re: Google Charts using Web Socket data from Server every 5 seconds - Video

    Looks great Pete

    Comment


    • #3
      Re: Google Charts using Web Socket data from Server every 5 seconds - Video

      WOW- again what a really cool use of Alpha Software! I would love to know how you did that, I just thought it was for messaging?
      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

      Comment


      • #4
        Re: Google Charts using Web Socket data from Server every 5 seconds - Video

        Really cool!!!

        Comment


        • #5
          Re: Google Charts using Web Socket data from Server every 5 seconds - Video

          I guess what I am seeing is that whatever the UX contains is broadcasting? In other words, your doing a 5 second refresh and it is refreshing, but also because it is using the web-socket system it is also updating the same UX in all listening UX's?
          Like I said, I just thought it was for messaging. I wonder what other uses could be enabled for this scenario...and feel free to correct me as I am interested in learning and possibly implementing this as a feature for my users to see real time data from the office to the field and vice-versa.
          Thanks again Pete for your contribution here, stuff like this keeps me dreaming!
          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

          Comment


          • #6
            Re: Google Charts using Web Socket data from Server every 5 seconds - Video

            No refresh or timing intervals involved - the sever is pushing it out - the, what I call the Listener Page (with the gauges on it), is just sitting there doing nothing until a message arrives and the SocketOnMessageRecieved shows it.
            Insanity: doing the same thing over and over again and expecting different results.
            Albert Einstein, (attributed)
            US (German-born) physicist (1879 - 1955)

            Comment


            • #7
              Re: Google Charts using Web Socket data from Server every 5 seconds - Video

              To be clear the Alpha Server doesn't know what is happening on the Listener Page as the page isn't calling it for anything. It's just listening to the port for a message (or data) it is entitled to listen to or do something with.
              Insanity: doing the same thing over and over again and expecting different results.
              Albert Einstein, (attributed)
              US (German-born) physicist (1879 - 1955)

              Comment


              • #8
                Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                I did not mean the data is being refreshed to the client end or the other end of the web-socket listening port, what I meant was the gauges, how are they getting their fresh info? You said that "as they get changed by the call" in other words the original UX that is creating the data must be getting it from somewhere to serve it up.
                NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                Comment


                • #9
                  Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                  There is no original UX, it is constrained random data (for the demo) being generated by an xbasic script server side. on arrival the message changes the values of the Listener UX (via the WebSocket) so the on change in the ux fires the relevant javascript function to refresh each gauge.
                  Insanity: doing the same thing over and over again and expecting different results.
                  Albert Einstein, (attributed)
                  US (German-born) physicist (1879 - 1955)

                  Comment


                  • #10
                    Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                    Attached is an example of using Google Gauges with Alpha WebSockets.

                    Make sure your Project Properties has WebSockets enabled... just leave the default settings in place.
                    Using just LivePreview in a Browser, fire up the UX in Chrome, and again in Firefox... so that both browsers are showing the UX.
                    The Google JS Charts library is set in the UX properties.

                    Each time you client a button... Users, Clients, or Orders... in either browser... both UXs will update. This demonstrates that any time something happens in a system... a User gets added, or Clients are added, or Orders are changed, you can fire off a WebSocket message sending through data to any UX with WebSockets enabled. The buttons fire off Ajax Callbacks that just create a random number.. but the data can come from anywhere... e.g. sql selects etc. The UX can also 'subscribe' to a channel so that only that UX will receive that channel's message.

                    As well, you could fire off a client-side api call to some service, get back data, and then send a WebSocket Client-side message.

                    The "message" is just a JSON string... it can be anything. All running WebSocket enabled UXs get the message... and the webSocketOnMessage event 'decodes' the message.

                    http://youtu.be/bIEBbz8bPK0?hd=1

                    Ya gotta love Alpha for enabling this... and Google for providing stunning visuals.
                    Attached Files
                    Last edited by Davidk; 08-04-2016, 08:54 PM.

                    Comment


                    • #11
                      Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                      ... - what a good idea. by the way some nice code there..
                      Last edited by peteconway; 08-04-2016, 08:24 PM.
                      Insanity: doing the same thing over and over again and expecting different results.
                      Albert Einstein, (attributed)
                      US (German-born) physicist (1879 - 1955)

                      Comment


                      • #12
                        Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                        yeah I am super stoked about this!
                        NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                        Comment


                        • #13
                          Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                          Thanks, very interesting - more interesting is this:
                          Code:
                          it is constrained random data (for the demo) being generated by an xbasic script server side
                          While i understand that it's random data, how can I research or learn to create an xbasic script that will "poll" a certain field in a database table for changes? I have never heard of that, obviously you can click a button and get fresh info from a table - how do I create a script to fetch the info automatically say every 5 seconds and finally does THAT tax the alpha server? It would be great to in the end create an app that is simply a listener/dashboard of events!

                          I am wondering about this going back to your example of the data appearing to refresh on it's own - updating the listener. Now in your case Pete you said it was random data - same case in Davids - and yes I get that it's sample data for the sake of the demonstration.

                          My thoughts are to create a div in the menu of a tabbed UI where users would see something similar to a scrolling shout box that would show the field reports text as they are submitted.
                          Maybe one day an automatically updating cost of labor, or a rolling total of billable items charged, total of estimates submitted, invoices paid, etc.

                          SO many ideas!

                          David and Pete - thanks for sharing your ideas and work! What a treat to come home tonight to have a look at this again, and YES it is really cool that Alpha added in web-sockets like this!
                          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                          Comment


                          • #14
                            Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                            Just so you are clear - as the WebSockets resides in the WebProjects Properties - all of your compents can send (share) or recieve information accross the nominated web server port. Also Xbasic scripts would not be polling xbasic on anything - the xbasic script runs in response to an end-point call from another event or even another service like Redis, once the call happens you send out what ever messages required based on the call recieved.
                            Insanity: doing the same thing over and over again and expecting different results.
                            Albert Einstein, (attributed)
                            US (German-born) physicist (1879 - 1955)

                            Comment


                            • #15
                              Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                              Also Xbasic scripts would not be polling xbasic on anything - the xbasic script runs in response to an end-point call from another event or even another service
                              Right so my thoughts are how do I poll my own data to update the page? I think that's what I was asking, lol. If I do - I am pretty sure THAT would put a burden on the server. NOW, perhaps I could update a page on an update instead of on short intervals, which would be more efficient.
                              Any thoughts on how I can learn to "update" the UX's data with the web-socket during an insert from another UX? I really have no clue what you would do, now if it were in the same running UX you could simply use an OnChange event, but another UX in another tab in a tabbedUI????

                              Cheers~
                              NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                              Comment

                              Working...
                              X