• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Implementing project tracking sheet

    Scheduled Pinned Locked Moved User help
    18 Posts 3 Posters 4.2k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      psysak @Jared Wiltshire
      last edited by

      @jared-wiltshire Thanks! I figured out how to store things in an individual store as an array and then display it in a table, this is pretty good progress for me :)

      Thing I got stuck on is how to add a new array element, row, to the JSON store from a web page. I used a bit of the demo code but got stuck at trying to figure out how to add a new row. Was trying to see if I could mess with the array index and then essentially have it that when I hit save it would add a new index at array.length+1. A little beyond my js ability at this point though.

      1 Reply Last reply Reply Quote 0
      • Jared WiltshireJ Offline
        Jared Wiltshire
        last edited by

        @psysak

        <md-button ng-click="jsonStoreData.rows.push({myProperty: 'someValue'})">Add row</md-button>
        

        https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 0
        • P Offline
          psysak
          last edited by

          Out of curiosity @Jared-Wiltshire is there a decent resource you know of that could help me understand a bunch of this better? What particular things should I be looking into learning to become somewhat proficient at putting together dashboards which push and pull data between the mango back end? Is everything more or less built on Angular?
          Also, is there a resource available from you guys which maybe maps out the structure of mango and how things interact? I like this product but I find it difficult to understand all the components and how they interact without some kind of map. Something like that could also at least point me in a direction on what I need to understand better.

          Admittedly a lot of my confusion comes from not knowing js and not being familiar with a lot of the backend web based stuff but it would be really really useful for you guys to have something which can nudge people in the right direction without having to bug you all the time :)

          Thanks for all the help and all the work.

          1 Reply Last reply Reply Quote 0
          • Jared WiltshireJ Offline
            Jared Wiltshire
            last edited by

            @psysak The help pages are the best resource - https://help.infiniteautomation.com/introduction-to-html5-web-apps/

            The videos should be helpful too. Also look at the examples built into Mango, it looks like you already found these however.

            @psysak said in Implementing project tracking sheet:

            Also, is there a resource available from you guys which maybe maps out the structure of mango and how things interact?

            Basic infrastructure:
            Mango backend -> REST API / WebSockets -> HTMl5 / AngularJS frontend

            For developing a dashboard you don't really need to know much about the backend, REST API or WebSockets. That is abstracted through the use of AngularJS services and components.

            The big picture things you need to know about the backend are

            • Data sources connect to devices and read individual pieces of data into data points
            • Data points generally store long term time series data (i.e. trends)
            • The JSON data store can be used to store tabular data and configuration information for your dashboards
            • If you need to store user inputted data from your dashboard into a time series you can use a virtual data source / data points

            The front end -

            • <ma-point-value> retrieves and displays the current data point value using WebSockets to get live updates
            • <ma-point-values> retrieves historical point values for a given time range for use on charts/tables (via REST)
            • <ma-json-store> retrieves the contents of a JSON store via REST and keeps it up to date via WebSockets

            And then obviously the plethora of components used to display this information on the dashboards. Check the examples / dashboard designer / API documentation for more information on these.

            @psysak said in Implementing project tracking sheet:

            it would be really really useful for you guys to have something which can nudge people in the right direction without having to bug you all the time :)

            Hopefully the help site and examples satisfies this somewhat. We are happy to answer specific questions in the forum.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • P Offline
              psysak
              last edited by

              You guys are awesome, thank you :)

              You know what I find very useful, and maybe someone else would too, just seeing somewhere all the objects which are available to me from the dashboard designer. For example, I took your last post, figured out how I could console log from the ng-click and printed the myItem object which allowed me to see what I can do to it. Based on what you told me and when I found there I was able to piece together how to add the rows into my json store. Is it possible to to see an interactive breakdown of all the objects by any chance?

              Jared WiltshireJ 1 Reply Last reply Reply Quote 0
              • Jared WiltshireJ Offline
                Jared Wiltshire @psysak
                last edited by

                @psysak said in Implementing project tracking sheet:

                You know what I find very useful, and maybe someone else would too, just seeing somewhere all the objects which are available to me from the dashboard designer.

                The dashboard designer does have a pretty complete list of available components on the left, some of them do not have very good descriptions though I know.

                I don't know if you have seen this also, you can also browse the component API docs through the menu if you enable the menu item.
                0_1544212327566_aff12bdc-2cd0-4e29-ad57-e158ab763145-image.png

                The "Element specific" attributes should also give you some idea of what attributes are available for each element/component.

                0_1544212416091_e67a3602-5d57-475d-ba97-b57916ab448c-image.png

                @psysak said in Implementing project tracking sheet:

                figured out how I could console log from the ng-click and printed the myItem object which allowed me to see what I can do to it

                Another good way of doing this is adding a <pre> tag to inspect a variable on your page.

                <pre ng-bind="$ctrl.varName | json"></pre>
                

                Developer at Radix IoT

                1 Reply Last reply Reply Quote 0
                • P Offline
                  psysak
                  last edited by

                  "

                  @jared-wiltshire said in Implementing project tracking sheet:

                  The dashboard designer does have a pretty complete list of available components on the left, some of them do not have very good descriptions though I know.

                  I don't know if you have seen this also, you can also browse the component API docs through the menu if you enable the menu item.

                  I was aware of this yes and I do like that documentation but for example for the jsonStore the info provided is about $save, $delete, $revert. Which I suppose these are the specific things you guys have added? What I found really useful though, and I suspect it is as a result of my lack of knowledge on the js side, was this in the console
                  0_1544215706792_5c955049-1bba-4c10-874b-7ea03d0d8ab4-image.png
                  And from that I can understand what you meant by the push and how to get at that function.

                  I think access to some kind of scheme like that for all the available objects would be awesome, but in the absence of it I think the logging should help me a lot.

                  Another good way of doing this is adding a <pre> tag to inspect a variable on your page.

                  <pre ng-bind="$ctrl.varName | json"></pre>
                  

                  This I have to try :)

                  1 Reply Last reply Reply Quote 0
                  • Jared WiltshireJ Offline
                    Jared Wiltshire
                    last edited by

                    So I guess the relevant documentation for the $save methods etc are listed here, notice the link to the AngularJS $resource documentation.

                    0_1544217924401_b11ccbaa-bf9f-411c-8a28-a0194284c723-image.png

                    And yeah one definite advantage of logging something to the console like you did is that Chrome debugger will show you the methods/functions on the prototype of an object.

                    push() is a JavaScript built in Array method which has been around since the start of time, you will notice I previously linked to the MDN documentation for this function. MDN is an extremely useful resource for JavaScript. We have no intentions on trying to replicate it in our documentation :)
                    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference

                    Developer at Radix IoT

                    P 1 Reply Last reply Reply Quote 0
                    • P Offline
                      psysak @Jared Wiltshire
                      last edited by

                      @jared-wiltshire Ohh man, that's really great thank you! Hours of fun in those doc pages :)

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        psysak
                        last edited by

                        Quick question, I think I saw this alluded to at one point, if I make a table like this in the json store can I run reports against? Like an excel report.

                        1 Reply Last reply Reply Quote 0
                        • phildunlapP Offline
                          phildunlap
                          last edited by

                          Not yet. It would take something like a script shuffling it into a data point to make it available to an excel report, currently.

                          P 1 Reply Last reply Reply Quote 0
                          • P Offline
                            psysak @phildunlap
                            last edited by

                            @phildunlap said in Implementing project tracking sheet:

                            Not yet. It would take something like a script shuffling it into a data point to make it available to an excel report, currently.

                            Would it be better, and feasible, to implement the same thing using alpha points?

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post