• 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

    How-to get a preset into a <ma-point-statistics> object as "to" and "from"

    Scheduled Pinned Locked Moved Dashboard Designer & Custom AngularJS Pages
    6 Posts 3 Posters 1.3k Views 3 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
      Phillip Weeks
      last edited by

      I was wondering why the stats object cannot accept presets such as MONTH_SO_FAR and how should one get a preset like this into the <ma-point-statistics object easily?

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

        @phillip-weeks said in How-to get a preset into a <ma-point-statistics> object as "to" and "from":

        how should one get a preset like this into the <ma-point-statistics object easily

        Use the date bar (dateBar.from and dateBar.to) or add a <ma-date-range-picker> to your project.

        Developer at Radix IoT

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

          Yes thanks I added a ma-date-range-picker to get it for several stats objects ...
          can we add as many of these as required to obtain different ranges on different watchlists withing the dashboard using buttons so clicking last moth-to-date or last-week or last year-to-date would re-query the appropriate watchlist using the to/from of these range picker directives that were set up with the matching presets. So to="to1" from="from1" and to ="to2" from="from2" etc.
          Is this correct?

          P 1 Reply Last reply Reply Quote 0
          • P Offline
            Phillip Weeks @Phillip Weeks
            last edited by Phillip Weeks

            On a related issue can you provide an example of how to assign a new variable a point value. As in this example Please and thank-you in advance.

            <ma-point-value id="SETPOINTID" point="designer.points | filter:{name:'SETPOINT'}:true | maFirst" label="Target" ng-show="Temppanelshow" ng-init="newvariable=point.value"

            </ma-point-value>

            Or how to use <div ng-show based on ma-point-value evaluating true or false?

            1 Reply Last reply Reply Quote 0
            • ThomasEinastoT Offline
              ThomasEinasto
              last edited by ThomasEinasto

              Hi Phillip,

              To your question about the multiple date-time-pickers: Yes you can in my opinion.

              You can program different objects(watchlists) to behave accordingly to the programmed variables(from1 / from 2 / from(x) | to1 / to2 / to(x) ) like you guessed.

              Each Watchlist will work accordingly to their pointed from/to variables.

              On to your second question I would suggest that a good place to look at is MangoV3 dashboard module examples to get the basic things about the dashboard module works.

              I assume that you are filtering points from the point list which you have created in the datapoints list. Am I on the right idea?

              I would suggest to make things more easier and to use a little bit more code by using Mango specific tags to make things easier for you to program the page and etc as too much filtering on a single tag may lead to problems which might lead into some unwanted results.

              I would agree that this is much more comfortable as you can bulk the points in the list but I am on the thought that you should bring out specific points out seperately if they have one purpose. Someone from Mango will be more educated to talk about this as I have not used this feature(filtering/datapoint listing) so much and this is just my opinon.

              If so then you can use more simple methods on how to accomplish the same principles on hiding / showing the elements on the page.

              To use <div> tag with ng-show on <ma-point-value> here are examples by using <ma-get-point-value> tag with point-xid (which I think is more easier and understandable) and some more.

              <!--  First bring the point to the dashboard -->
              <ma-get-point-value point-xid="your wanted point XID" point="myPoint"></ma-get-point-value>
              
              <!--  Tag used to represent the point in ng-show will be 'myPoint.value' -->
              
              <!--  Now create the div -->
              
              <!--  This is the most understandable how ng-show works. If value equals false then div is shown else not. -->
              <div id="createddiv" ng-show="myPoint.value === false">
              
              <!-- To show point value -->
              The point value equals {{myPoint.value}} .
              
              <!-- To show the object of myPoint (Everything related to myPoint) -->
              The point object equals {{myPoint}} .
              </div>
              
              <!--  And vice-versa -->
              <div id="createddiv" ng-show="myPoint.value === true">
              
              <!-- To show point value -->
              The point value equals {{myPoint.value}} .
              
              <!-- To show the object of myPoint (Everything related to myPoint) -->
              The point object equals {{myPoint}} .
              </div>
              
              <!--  You can also shorten the ng-show by just leaving the value, this means that if value equals true then the div is shown. This is how AngularJS documentation shows how to use ng-show. -->
              <div id="createddiv" ng-show="myPoint.value">
              
              <!-- To show point value -->
              The point value equals {{myPoint.value}} .
              
              <!-- To show the object of myPoint (Everything related to myPoint) -->
              The point object equals {{myPoint | json}} .
              </div>
              
              <!--  You can also shorten the ng-show by just leaving the value and putting ! infront of the variable, this means that if value equals false then the div is shown. This is how AngularJS documentation shows how to use ng-show. -->
              
              <div id="createddiv" ng-show="!myPoint.value">
              
              <!-- To show point value -->
              The point value equals {{myPoint.value}} .
              
              <!-- To show the object of myPoint (Everything related to myPoint) -->
              The point object equals {{myPoint | json}} .
              </div>
              
              
              <!-- You can also create page specific variable which work inside the dashboard to not use binary values within Mango. This variable will be user controlled in their browser. -->
              
              <!-- First lets use the Material Design switch object embedded into Mango. (You can add ng-init="divenabler=true" into the tag to initialize the point with true.) -->
              
               <md-switch ng-model="divenabler" ng-init="divenabler=true" ng-model-options="{getterSetter:true}">
                      Is div enabled? : {{ divenabler }}
                  </md-switch>
              
              <!-- You can also play with the text -->
              
              <p ng-show="divenabler"> Div is Visible</p>
              <p ng-show="!divenabler"> Div is Hidden</p>
              
              <!--  Now create a similar div but use the previously modeled point in md-switch to show/hide the div -->
              
              <div id="createddiv"  ng-show="divenabler">
              <!-- To show point value from <ma-get-point-value> tag -->
              The point value equals {{myPoint.value}} .
              <!-- To show the object of myPoint (Everything related to myPoint) -->
              The point object equals {{myPoint | json}} .
              </div>
              
              
              <!-- You can also initialize a point with a value which controls ng-show -->
              <div id="createddiv" ng-init="divenablerinit = true" ng-show="divenablerinit">
              <!-- To show point value from <ma-get-point-value> tag -->
              The point value equals {{myPoint.value}} .
              <!-- To show the object of myPoint (Everything related to myPoint) -->
              The point object equals {{myPoint | json}} .
              </div>
              
              

              I hope this helps. I strongly suggest you on looking into the example pages in the dashboard module as all written is stated there also and explained more throughly.

              Thomas

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

                Thanks Thomas for those suggestions.
                I need to understand how to create the ng-model for the point that I get from this set...

                point="designer.points | filter:{name:'SETPOINT'}:true | maFirst"

                How can I get this point into ng-model="pointvariable" ??
                I do not wish to requery just pick from the current watchlist designer.points data.

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