• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. richard.mortimer

    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
    • Profile
    • Following 0
    • Followers 0
    • Topics 13
    • Posts 70
    • Best 2
    • Controversial 0
    • Groups 0

    richard.mortimer

    @richard.mortimer

    2
    Reputation
    526
    Profile views
    70
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    richard.mortimer Unfollow Follow

    Best posts made by richard.mortimer

    • RE: Styling amCharts

      Thanks for the suggestions, I ultimately went a different route with this, and bound a slider to the variable that was previously at the top of the page (which was 30 in the first instance) and allowed the user to select how many days worth of data they wanted to see:

      0_1555463825065_014_days.png 0_1555463829221_070_days.png 0_1555463838062_112_days.png 0_1555463848343_500_days.png

      The text box is also editable, so they can manually type a number in, if they wish (the '500' example at the end). I did use some of the styles suggested to modify the axes to a different grey to lessen it's impact upon the page, but it also meant that the X-axes date was relevant again, so the requirement to remove it changed (let's just call it 'agile development :). The slider modifies about 10 graphs across the page and works quite fast.

      Cheers

      Richard

      posted in Dashboard Designer & Custom AngularJS Pages
      richard.mortimerR
      richard.mortimer
    • Thanks and Goodbye ...

      My contract comes to an end this week, so I (potentially) won't be working in the Mango space after that - just wanted to say "thanks" to all that helped me through my journey. Wishing you all the best ...

      Richard

      posted in Mango feedback
      richard.mortimerR
      richard.mortimer

    Latest posts made by richard.mortimer

    • RE: Thanks and Goodbye ...

      I understand your sentiment @phildunlap - my old boss (and then bandmate) used to say something along the lines of "standing on the shoulders of giants you can see for miles" - and I wanted to express that I'm grateful for those who have loaned me their shoulders to stand on, because it doesn't always happen ...

      Cheers

      Richard

      posted in Mango feedback
      richard.mortimerR
      richard.mortimer
    • Thanks and Goodbye ...

      My contract comes to an end this week, so I (potentially) won't be working in the Mango space after that - just wanted to say "thanks" to all that helped me through my journey. Wishing you all the best ...

      Richard

      posted in Mango feedback
      richard.mortimerR
      richard.mortimer
    • RE: Pagination for a page

      @richard-mortimer said in Pagination for a page:

      @craigweb said in Pagination for a page:

      Hi Richard

      I believe, you do not need your query string function as there is already a component for this. You will need to register you page with the URL of ?page

       <ma-state-params on-change="PageStart = $stateParams.page; stateParams = $stateParams" update- 
       params="updateParams"></ma-state-params>
      

      Here is a help document that explains how to use it with a watchlist:
      https://help.infiniteautomation.com/linking-to-dynamic-pages

      Thanks for that, the PageStart variable is read in as what it should be, but seems to be overwritten when I'm reading in the Settings parameters (no matter where I put it on the page), so even when this is at the bottom of the page:

      <ma-state-params on-change="Settings.PageStart = $stateParams.page; stateParams = $stateParams" update-params="updateParams"></ma-state-params>
      

      And this is at the top:

      <ma-json-store xid="PageConfigXID" value="Settings"></ma-json-store><!-- page configuration data -->
      

      The value goes from 2 to 0 with this URL: http://mango2:8080/ui/richard-overview-angular?page=2

      Any idea how to make the value stick ... ?

      Scratch that - I've used two repeats - if the PageStart value doesn't exists - it displays the page as normal, but if it does exist, it does sends it to the second repeat and uses that value for the calculation of where to start the page. Kinda goes against the DRY prinicipal, but works effectively ....

      So, in the first instance:

      <div ng-if="!PageStart" class="table" ng-repeat="site in sites.sites | limitTo: Settings.PageSize : Settings.PageStart">
      

      And in the second:

      <div ng-if="PageStart" class="table" ng-repeat="site in sites.sites | limitTo: Settings.PageSize : (( PageStart - 1 ) * Settings.PageSize)">
      

      Cheers

      Richard

      posted in Scripting general Discussion
      richard.mortimerR
      richard.mortimer
    • RE: Pagination for a page

      @craigweb said in Pagination for a page:

      Hi Richard

      I believe, you do not need your query string function as there is already a component for this. You will need to register you page with the URL of ?page

       <ma-state-params on-change="PageStart = $stateParams.page; stateParams = $stateParams" update- 
       params="updateParams"></ma-state-params>
      

      Here is a help document that explains how to use it with a watchlist:
      https://help.infiniteautomation.com/linking-to-dynamic-pages

      Thanks for that, the PageStart variable is read in as what it should be, but seems to be overwritten when I'm reading in the Settings parameters (no matter where I put it on the page), so even when this is at the bottom of the page:

      <ma-state-params on-change="Settings.PageStart = $stateParams.page; stateParams = $stateParams" update-params="updateParams"></ma-state-params>
      

      And this is at the top:

      <ma-json-store xid="PageConfigXID" value="Settings"></ma-json-store><!-- page configuration data -->
      

      The value goes from 2 to 0 with this URL: http://mango2:8080/ui/richard-overview-angular?page=2

      Any idea how to make the value stick ... ?

      Cheers

      Richard

      posted in Scripting general Discussion
      richard.mortimerR
      richard.mortimer
    • RE: Pagination for a page

      A new requirement was added for the pagination; basically it needs to be callable by a query string added to the end of the URL called; so for example it wants to be http://mango_display_page?page=1 to show page 1; I've already got my JSON store sending through the start page as zero (called Settings.PageStart), which is assigned by <ma-json-store xid="PageConfigXID" value="Settings"></ma-json-store> - can I overwrite this value?

      I can grab the value and place it into a JavaScript function like this:

      var QS = function () {
        var query_string = {};
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
          var pair = vars*.split("=");
          if (typeof query_string[pair[0]] === "undefined") {
            query_string[pair[0]] = pair[1];
          } else if (typeof query_string[pair[0]] === "string") {
            var arr = [ query_string[pair[0]], pair[1] ];
            query_string[pair[0]] = arr;
          } else {
            query_string[pair[0]].push(pair[1]);
          }
        } 
          return query_string;
      } ();
      
      alert("x");
      //alert("x= " + Settings);
      //alert(QS.site);
      alert(QS.page);
      </script>
      

      How would I assign that to the AngularJS variable?

      Thanks

      Richard

      posted in Scripting general Discussion
      richard.mortimerR
      richard.mortimer
    • RE: Disable an amChart series upon load

      @richard-mortimer said in Disable an amChart series upon load:

      I was asked to remove one of the series plot from the graph

      I was asked to add them back, so glad I asked the question, now it's fixed!!

      Cheers

      Richard

      posted in Scripting general Discussion
      richard.mortimerR
      richard.mortimer
    • RE: Slider Problem

      I'm no expert on this, but when I've had difficulties with sliders, I've bound via the ng-model and added the gettersetter options thus:

      ng-model="Settings.TrendSet" ng-model-options="{getterSetter:true}"
      

      Hope that helps!

      Richard

      posted in User help
      richard.mortimerR
      richard.mortimer
    • RE: maJsonStore (JSON store)

      @mattfox said in maJsonStore (JSON store):

      @richard-mortimer I believe when you did | number:1 and | number:0 was more than sufficient. alternatively just use point.value.toFixed(1) and point.value.toFixed() repectively

      Thanks - the colon in the | number:1 was interfering with the ternary operator and getting it confused; so, while I could pipe it through, I couldn't modify the final number based on which direction it took - the point.value.toFixed(1) did the correct thing for me ...

      Cheers

      Richard

      posted in Scripting general Discussion
      richard.mortimerR
      richard.mortimer
    • RE: maJsonStore (JSON store)

      @craigweb said in maJsonStore (JSON store):

      <span ng-repeat="point in points">
          <ma-get-point-value point-xid="{{ point.xid }}" point="output"></ma-get-point-value>
          <div>{{output.value >1000? output.value/1000:output.value}}{{output.value >1000?'kW':'W'}}</div>
      </div>
      

      Sorry, I missed this reply - you are correct it's inside a larger loop, which iterates through each device - I'm going to try the ternary operator and see how that goes ...

      Any idea how to put the number filter in there? The kW was to one decimal place, and the W was to 0 ...

      Cheers

      Richard

      posted in Scripting general Discussion
      richard.mortimerR
      richard.mortimer
    • RE: maJsonStore (JSON store)

      @jared-wiltshire said in maJsonStore (JSON store):

      Two things -

      • Use track by in your ng-repeat expression so that Angular can correlate which points correspond to each span element when the points change.
      • Just pass the point to the <ma-get-point-value> component instead of retrieving it by XID again

      Thanks for that - I've made the changes and will keep an eye on it; unfortunately it only seems to happen at random times which makes it one of those "fun" bugs to iron out ... but I'm pretty confident that if you're pretty confident, it will probably be the right solution! :)

      Cheers!!

      Richard

      posted in Scripting general Discussion
      richard.mortimerR
      richard.mortimer